[go: up one dir, main page]

CN106656666A - Method and device for acquiring first screen time of web page - Google Patents

Method and device for acquiring first screen time of web page Download PDF

Info

Publication number
CN106656666A
CN106656666A CN201611148648.9A CN201611148648A CN106656666A CN 106656666 A CN106656666 A CN 106656666A CN 201611148648 A CN201611148648 A CN 201611148648A CN 106656666 A CN106656666 A CN 106656666A
Authority
CN
China
Prior art keywords
time
webpage
file
page element
screen
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201611148648.9A
Other languages
Chinese (zh)
Other versions
CN106656666B (en
Inventor
刘永生
王光全
杨艳松
刘畅
何晓峰
王泽林
谢梦楠
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China United Network Communications Group Co Ltd
Original Assignee
China United Network Communications Group Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China United Network Communications Group Co Ltd filed Critical China United Network Communications Group Co Ltd
Priority to CN201611148648.9A priority Critical patent/CN106656666B/en
Publication of CN106656666A publication Critical patent/CN106656666A/en
Application granted granted Critical
Publication of CN106656666B publication Critical patent/CN106656666B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters
    • H04L43/0876Network utilisation, e.g. volume of load or congestion level
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/08Monitoring or testing based on specific metrics, e.g. QoS, energy consumption or environmental parameters

Landscapes

  • Engineering & Computer Science (AREA)
  • Environmental & Geological Engineering (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

本发明公开了一种获取网页首屏时间的方法及装置,涉及互联网技术领域,能够解决用户不愿意配合安装探针则难以获取网页首屏时间的问题。本发明的获取网页首屏时间的方法包括:获取DPI系统中对应的流量记录;确定网页文件的请求时间和返回时间,确定为网页文件的加载时间;获取网页标识对应的至少一个首屏页面元素;确定首屏页面元素文件的请求时间和返回时间,确定为所述首屏页面元素文件的加载时间;将网页文件的返回时间和首屏页面元素文件的请求时间的差值确定为网页解析时间;根据网页文件的加载时间、首屏页面元素文件的加载时间和网页解析时间确定网页首屏时间。本发明适用于获取网页首屏时间的过程中。

The invention discloses a method and device for obtaining the time of the first screen of a webpage, relates to the technical field of the Internet, and can solve the problem that it is difficult to obtain the time of the first screen of a webpage if the user is unwilling to cooperate with the installation of a probe. The method for obtaining the first screen time of the webpage of the present invention includes: obtaining the corresponding traffic record in the DPI system; determining the request time and return time of the webpage file, which is determined as the loading time of the webpage file; obtaining at least one first screen page element corresponding to the webpage identifier Determine the request time and return time of the first screen page element file, and determine it as the loading time of the first screen page element file; determine the difference between the return time of the web page file and the request time of the first screen page element file as the web page analysis time ; Determine the first screen time of the web page according to the loading time of the web page file, the loading time of the element file of the first screen page, and the parsing time of the web page. The present invention is applicable to the process of obtaining the first screen time of the webpage.

Description

一种获取网页首屏时间的方法及装置A method and device for obtaining the first screen time of a webpage

技术领域technical field

本发明涉及互联网技术领域,尤其涉及一种获取网页首屏时间的方法及装置。The invention relates to the technical field of the Internet, in particular to a method and a device for obtaining the first screen time of a web page.

背景技术Background technique

网页首屏时间是用来评价网页业务质量的关键指标,网页首屏时间是指用户发起网页浏览操作到用户设备的屏幕完整呈现网页内容的时间。The time to first screen of a web page is a key indicator used to evaluate the quality of web page services. The time to first screen of a web page refers to the time from when a user initiates a web browsing operation to when the content of the web page is fully displayed on the screen of the user device.

目前获取网页首屏时间是采用探针拨测的方式,这需要在用户侧部署专门的软件或硬件设备作为探针,并挂在用户家庭网关或者安装在用户的电脑中。如果要采集大量的用户数据,则需要部署大量探针,那么则需要巨大的投资;此外,因为在拨测的时候是模拟用户的网页浏览操作,需要占用用户的流量,会影响用户的正常上网,而且发生的费用由用户来承担,这将导致用户不愿意配合进行探针部署,因此,大量获取用户的网页首屏时间在实际操作过程中会遇到很大的困难。At present, the method of obtaining the first screen time of a web page is to use a probe dial test, which requires the deployment of special software or hardware devices on the user side as probes, and hangs on the user's home gateway or installs it in the user's computer. If you want to collect a large amount of user data, you need to deploy a large number of probes, which requires a huge investment; in addition, because the user's web browsing operation is simulated during the dial-up test, the user's traffic needs to be occupied, which will affect the user's normal Internet access , and the costs incurred will be borne by the user, which will cause users to be unwilling to cooperate in the deployment of probes. Therefore, it will encounter great difficulties in the actual operation process to obtain a large number of users' webpage first screen time.

发明内容Contents of the invention

本发明实施例提供一种获取网页首屏时间的方法及装置,能够解决用户不愿意配合安装探针则难以获取网页首屏时间的问题。Embodiments of the present invention provide a method and device for obtaining the first screen time of a webpage, which can solve the problem that it is difficult to obtain the first screen time of a webpage if the user is unwilling to cooperate with installing a probe.

为达到上述目的,本发明实施例采用如下技术方案:In order to achieve the above object, the embodiment of the present invention adopts the following technical solutions:

第一方面,本发明提供一种获取网页首屏时间的方法,所述网页包括网页文件和页面元素文件,所述方法包括:In a first aspect, the present invention provides a method for obtaining the first screen time of a webpage, the webpage includes a webpage file and a page element file, and the method includes:

根据终端接入标识和网页标识获取深度报文检测DPI系统中对应的流量记录,所述流量记录包括所述终端接入标识对应的终端访问所述网页标识对应的网页时产生的数据包和每一个所述数据包对应的发送时间或者接收时间,所述数据包包括请求数据包和响应数据包;According to the terminal access identifier and the webpage identifier, obtain the corresponding traffic record in the deep packet detection DPI system, the traffic record includes the data packets and each data packet generated when the terminal corresponding to the terminal access identifier accesses the webpage corresponding to the webpage identifier A sending time or receiving time corresponding to the data packet, the data packet includes a request data packet and a response data packet;

根据所述流量记录确定所述网页标识对应的网页文件的请求时间和网页文件的返回时间,将所述网页文件的返回时间和所述网页文件的请求时间的差值确定为网页文件的加载时间;Determine the request time of the webpage file corresponding to the webpage identifier and the return time of the webpage file according to the traffic record, and determine the difference between the return time of the webpage file and the request time of the webpage file as the loading time of the webpage file ;

获取所述网页标识对应的至少一个首屏页面元素,每个所述首屏页面元素对应一个首屏页面元素文件;Obtaining at least one above-the-fold page element corresponding to the webpage identifier, and each of the above-the-fold page elements corresponds to a first-screen page element file;

根据所述流量记录确定所述首屏页面元素文件的请求时间和所述首屏页面元素文件的返回时间,将所述首屏页面元素文件的返回时间和所述首屏页面元素文件的请求时间的差值确定为所述首屏页面元素文件的加载时间;Determine the request time of the above-the-fold page element file and the return time of the first-screen page element file according to the traffic record, and set the return time of the first-screen page element file and the request time of the first-screen page element file The difference between is determined as the loading time of the above-the-fold page element file;

将所述网页文件的返回时间和所述首屏页面元素文件的请求时间的差值确定为网页解析时间;Determining the difference between the return time of the webpage file and the request time of the above-the-fold page element file as the webpage parsing time;

根据所述网页文件的加载时间、所述首屏页面元素文件的加载时间和所述网页解析时间确定所述网页的网页首屏时间。The above-the-fold time of the webpage is determined according to the loading time of the webpage file, the loading time of the above-the-fold page element file, and the parsing time of the webpage.

第二方面,本发明提供一种获取网页首屏时间的装置,所述网页包括网页文件和页面元素文件,所述装置包括:In a second aspect, the present invention provides a device for obtaining the first screen time of a web page, the web page includes a web page file and a page element file, and the device includes:

获取模块,用于根据终端接入标识和网页标识获取深度报文检测DPI系统中对应的流量记录,所述流量记录包括所述终端接入标识对应的终端访问所述网页标识对应的网页时产生的数据包和每一个所述数据包对应的发送时间或者接收时间,所述数据包包括请求数据包和响应数据包;An acquisition module, configured to acquire a corresponding traffic record in the deep message detection DPI system according to the terminal access identifier and the webpage identifier, where the traffic record includes that generated when the terminal corresponding to the terminal access identifier accesses the webpage corresponding to the webpage identifier The data packets and the sending time or receiving time corresponding to each of the data packets, the data packets include request data packets and response data packets;

确定模块,用于根据所述获取模块获取的所述流量记录确定所述网页标识对应的网页文件的请求时间和网页文件的返回时间,将所述网页文件的返回时间和所述网页文件的请求时间的差值确定为网页文件的加载时间;A determination module, configured to determine the request time of the webpage file corresponding to the webpage identifier and the return time of the webpage file according to the traffic records obtained by the acquisition module, and combine the return time of the webpage file and the request time of the webpage file The time difference is determined as the loading time of the webpage file;

所述获取模块,还用于获取所述网页标识对应的至少一个首屏页面元素,每个所述首屏页面元素对应一个首屏页面元素文件;The acquiring module is further configured to acquire at least one first-screen page element corresponding to the webpage identifier, and each of the first-screen page elements corresponds to one first-screen page element file;

所述确定模块,还用于根据所述获取模块获取的所述流量记录确定所述首屏页面元素文件的请求时间和所述首屏页面元素文件的返回时间,将所述首屏页面元素文件的返回时间和所述首屏页面元素文件的请求时间的差值确定为所述首屏页面元素文件的加载时间;The determining module is further configured to determine the request time of the above-the-fold page element file and the return time of the first-screen page element file according to the traffic records obtained by the obtaining module, and store the first-screen page element file The difference between the return time of the first screen page element file and the request time of the first screen page element file is determined as the loading time of the first screen page element file;

所述确定模块,还用于将所述网页文件的返回时间和所述首屏页面元素文件的请求时间的差值确定为网页解析时间;The determination module is also used to determine the difference between the return time of the webpage file and the request time of the first screen page element file as the webpage resolution time;

所述确定模块,还用于根据所述网页文件的加载时间、所述首屏页面元素文件的加载时间和所述网页解析时间确定所述网页的网页首屏时间。The determining module is further configured to determine the first screen time of the web page according to the loading time of the web page file, the loading time of the first screen page element file, and the webpage parsing time.

本发明实施例提供的一种获取网页首屏时间的方法及装置,通过根据在网络侧提取DPI系统中的流量记录,分别获取网页文件的加载时间、首屏页面元素文件的加载时间和网页解析时间,再根据网页文件的加载时间、首屏页面元素文件的加载时间和网页解析时间确定网页首屏时间。相比较于现有技术中的在用户侧部署专门的软件或硬件设备作为探针,并挂在用户家庭网关或者安装在用户的电脑中,本发明不需要再在用户侧部署探针,不需要占用用户的流量,可以直接根据网络侧DPI系统中的流量记录进行处理,方便地得到网页首屏时间,进而可以根据网页首屏时间评价互联网业务的质量,为运营商和互联网公司提供提升用户感知的依据。The embodiment of the present invention provides a method and device for obtaining the first screen time of a webpage. By extracting the traffic records in the DPI system on the network side, the loading time of the webpage file, the loading time of the element file of the first screen page, and the webpage analysis are respectively obtained. Time, and then determine the first screen time of the web page according to the loading time of the web page file, the loading time of the first screen page element file, and the webpage parsing time. Compared with the prior art that deploys special software or hardware devices on the user side as probes, and hangs them on the user’s home gateway or installs them in the user’s computer, the present invention does not need to deploy probes on the user side, and does not require The traffic occupied by the user can be processed directly according to the traffic records in the DPI system on the network side, and the first screen time of the web page can be obtained conveniently, and then the quality of the Internet service can be evaluated according to the first screen time of the web page, providing operators and Internet companies with the ability to improve user perception basis.

附图说明Description of drawings

为了更清楚地说明本发明实施例中的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the accompanying drawings that need to be used in the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For Those of ordinary skill in the art can also obtain other drawings based on these drawings without making creative efforts.

图1为本发明实施例提供的一种获取网页首屏时间的方法流程图;FIG. 1 is a flow chart of a method for obtaining the first screen time of a webpage provided by an embodiment of the present invention;

图2为本发明实施例提供的另一种获取网页首屏时间的方法流程图;FIG. 2 is a flow chart of another method for obtaining the first screen time of a webpage provided by an embodiment of the present invention;

图3为本发明实施例提供的一种获取网页首屏时间的装置结构图;FIG. 3 is a structural diagram of a device for obtaining the first screen time of a web page provided by an embodiment of the present invention;

图4为本发明实施例提供的一种获取网页首屏时间的终端的结构示意图。FIG. 4 is a schematic structural diagram of a terminal for obtaining the first screen time of a webpage provided by an embodiment of the present invention.

具体实施方式detailed description

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some, not all, embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.

随着数据业务的发展和精细化运营,运营商通常要对流经网络的数据报文进行DPI(Deep Packet Inspection,深度报文检测)。DPI技术是一种基于应用层的流量检测和控制技术,当IP(Internet Protocol,网络之间互连的协议)数据包、TCP(TransmissionControl Protocol,传输控制协议)或UDP(User Datagram Protocol,用户数据报协议)数据流通过基于DPI技术的带宽管理系统时,该系统通过深入读取IP包载荷的内容来对OSI(Open System Interconnection,开放式系统互联)七层协议中的应用层信息进行重组,从而得到整个应用程序的内容,然后按照系统定义的管理策略对流量进行整形操作,从而形成符合管理策略的一系列流量记录。而本发明实施例正是基于DPI系统得到的流量记录进行进一步的分析和处理。With the development of data services and refined operations, operators usually need to perform DPI (Deep Packet Inspection, deep packet inspection) on data packets flowing through the network. DPI technology is a flow detection and control technology based on the application layer. When IP (Internet Protocol, the protocol for interconnection between networks) packets, TCP (Transmission Control When the data stream passes through the bandwidth management system based on DPI technology, the system reorganizes the application layer information in the OSI (Open System Interconnection, Open System Interconnection) seven-layer protocol by deeply reading the content of the IP packet load. In this way, the content of the entire application is obtained, and then the traffic is shaped according to the management policy defined by the system, so as to form a series of traffic records conforming to the management policy. However, the embodiment of the present invention performs further analysis and processing based on the flow records obtained by the DPI system.

本发明实施例提供一种获取网页首屏时间的方法,如图1所示,包括:An embodiment of the present invention provides a method for obtaining the first screen time of a webpage, as shown in Figure 1, including:

101、根据终端接入标识和网页标识获取DPI系统中对应的流量记录。101. Acquire corresponding traffic records in the DPI system according to the terminal access identifier and the webpage identifier.

其中,所述流量记录包括所述终端接入标识对应的终端访问所述网页标识对应的网页时产生的数据包和每一个所述数据包对应的发送时间或者接收时间;终端接入标识可以是终端IP地址,网页标识可以是网页的地址。Wherein, the flow record includes the data packets generated when the terminal corresponding to the terminal access identifier accesses the webpage corresponding to the webpage identifier and the sending time or receiving time corresponding to each data packet; the terminal access identifier may be The terminal IP address, and the webpage identifier may be an address of a webpage.

作为一种具体实施例,对DPI系统中的流量记录进行监测,识别每条流量记录的源IP地址、源端口号、目的IP地址、目的端口号等信息,将源IP地址和目的IP地址与AAA(Authentication、Authorization、Accounting,验证、授权和记账)服务器中的终端接入标识进行关联,从而识别出终端接入标识对应的流量记录。再从终端接入标识对应的流量记录中获取与网页标识对应的数据流量记录。As a specific embodiment, the traffic records in the DPI system are monitored, and information such as the source IP address, source port number, destination IP address, and destination port number of each traffic record are identified, and the source IP address and the destination IP address are compared with the The terminal access identifiers in the AAA (Authentication, Authorization, and Accounting) server are associated to identify the traffic records corresponding to the terminal access identifiers. Then obtain the data flow record corresponding to the web page identifier from the flow record corresponding to the terminal access identifier.

此外,为了能快速查找到流量记录中所需要的数据包,可对数据包预先进行分类,如果数据包中终端接入标识是源IP,表明这些数据包是由终端发出的,则数据包为上行数据包;如果数据包中终端接入标识是目的IP地址,表明这些数据包是发往终端的,则数据包为下行数据包。In addition, in order to quickly find the data packets needed in the flow records, the data packets can be classified in advance. If the terminal access identifier in the data packets is the source IP, it indicates that these data packets are sent by the terminal, and the data packets are Uplink data packet; if the terminal access identifier in the data packet is the destination IP address, indicating that these data packets are sent to the terminal, the data packet is a downlink data packet.

然后过滤出HTTP(HyperText Transfer Protocol,超文本传输协议)的数据包,过滤方法如下:Then filter out the data packets of HTTP (HyperText Transfer Protocol, hypertext transfer protocol), the filtering method is as follows:

1)选择TCP数据包,因为HTTP数据包是通过TCP协议承载的。1) Select the TCP data packet, because the HTTP data packet is carried by the TCP protocol.

2)对TCP报文的负荷进行分析,使用ASCII(American Standard Code forInformation Interchange,美国信息交换标准代码)编码对负荷解析成文本,使用回车符和换行符(‘\r\n’)对文本进行切分成行。对每一行文本,使用空格符将文本切分成字段。2) Analyze the load of the TCP message, use the ASCII (American Standard Code for Information Interchange, American Standard Code for Information Interchange) code to parse the load into text, and use the carriage return and line feed ('\r\n') to parse the text Split into rows. For each line of text, use spaces to split the text into fields.

3)对于上行数据包,第一个字段匹配“GET”、或“POST”、或“DELETE”、或“HEAD”、或“OPTIONS”、或“PUT”、或“TRACE”,第三个字段匹配“HTTP/1.1”或“HTTP/1.0”,如果两个字段都匹配成功,则确定该数据包为HTTP的请求数据包。3) For the upstream data packet, the first field matches "GET", or "POST", or "DELETE", or "HEAD", or "OPTIONS", or "PUT", or "TRACE", the third field Match "HTTP/1.1" or "HTTP/1.0". If both fields match successfully, the packet is determined to be an HTTP request packet.

4)对于下行数据包,第一个字段匹配“HTTP/1.1”或“HTTP/1.0”,第二个字段匹配三位数字,例如“200”,如果两个字段都匹配成功,则确定该数据包为HTTP的响应数据包。4) For downlink data packets, the first field matches "HTTP/1.1" or "HTTP/1.0", and the second field matches three-digit numbers, such as "200". If both fields match successfully, the data is determined The packet is an HTTP response packet.

102、根据所述流量记录确定所述网页标识对应的网页文件请求时间和网页文件返回时间,将所述网页返回时间和所述网页请求时间的差值确定为网页加载时间。102. Determine the webpage file request time and webpage file return time corresponding to the webpage identifier according to the traffic records, and determine the difference between the webpage return time and the webpage request time as the webpage loading time.

一般情况下,一个网页包括一个网页文件和若干个页面元素文件。其中,网页文件中通常还包括需要二次访问的页面元素的超链接地址,该超链接地址对应于页面元素文件。要完整呈现首屏内容包括加载该网页文件以及加载该网页文件中包括的首屏页面元素的内容,而本步骤的网页文件的加载时间仅仅是指从请求该网页文件到该网页文件加载结束的时间,不包含加载首屏页面元素文件的时间。Generally, a web page includes a web page file and several page element files. Wherein, the web page file usually also includes a hyperlink address of a page element requiring secondary access, and the hyperlink address corresponds to the page element file. To fully present the above-the-fold content includes loading the webpage file and loading the content of the above-the-fold page elements included in the webpage file, and the loading time of the webpage file in this step only refers to the time from when the webpage file is requested to when the webpage file is loaded Time, excluding the time of loading the element file of the first screen page.

作为一种具体实施例,在步骤101中获取到的流量记录中,查找用于请求加载该网页文件的请求数据包,该请求数据包的发送时间即可确定为网页文件的请求时间。再查找与该请求数据包对应的全部响应报文,这些响应报文全部接收完毕的时间为网页文件加载完成时间,该时间可确定为网页文件的返回时间。As a specific embodiment, in the traffic record obtained in step 101, the request data packet for requesting to load the webpage file is searched, and the sending time of the request data packet can be determined as the request time of the webpage file. Then search for all the response messages corresponding to the request packet. The time when all these response messages are received is the time when the webpage file is loaded, and this time can be determined as the return time of the webpage file.

具体地,确定网页请求时间的方法包括:对获取的包含该网页标识的请求数据包的第一行以下,连续两个回车符和换行符(‘\r\n\r\n’)以上的文本进行分析,步骤如下:Specifically, the method for determining the webpage request time includes: following the first line of the obtained request packet containing the webpage identifier, two consecutive carriage returns and line feeds ('\r\n\r\n') To analyze the text, the steps are as follows:

1)使用回车符和换行符(‘\r\n’)对请求数据包的文本进行切分成行,使用空格对每行数据切分成字段。1) Use carriage return and line feed ('\r\n') to split the text of the request packet into lines, and use spaces to split each line of data into fields.

2)查找第一行以“GET”为第一个字段的行,将第二个字段的内容标记为“part1”。然后,在该数据包中查找以“Host:”为第一字段的行,将该行的第二字段的内容标记为“part2”,“part2”和“part1”的内容连接起来即为请求的网页地址(即网页标识),而该请求数据包对应的发送时间即为网页请求时间。2) Find the first line with "GET" as the first field, and mark the content of the second field as "part1". Then, look for the line with "Host:" as the first field in the data packet, mark the content of the second field of the line as "part2", and connect the contents of "part2" and "part1" to be the requested The address of the webpage (that is, the identifier of the webpage), and the sending time corresponding to the request data packet is the webpage request time.

确定网页请返回时间的方法具体包括:在与上述请求数据包同一个TCP会话中,获取该请求数据包对应的响应数据包,该响应数据包的数量至少为一个。对响应数据包的第一行以下,连续两个回车符和换行符(‘\r\n\r\n’)以上的文本进行分析,步骤如下:The method for determining the time to return the webpage specifically includes: obtaining a response data packet corresponding to the request data packet in the same TCP session as the above request data packet, and the number of the response data packets is at least one. To analyze the text below the first line of the response data packet and above two consecutive carriage returns and line feeds ('\r\n\r\n'), the steps are as follows:

1)使用回车符和换行符(‘\r\n’)对响应数据包的文本进行切分成行,使用空格对每行数据切分成字段。1) Use carriage return and line feed ('\r\n') to split the text of the response packet into lines, and use spaces to split each line of data into fields.

2)对第一个响应数据包进行分析(根据TCP的序列号字段来判断),查找以“Content-Length:”开始的行,该字段后面的数值即为网页的大小。2) Analyze the first response data packet (judged according to the serial number field of TCP), and find the line starting with "Content-Length:", the value behind this field is the size of the web page.

3)统计TCP会话中该请求数据包对应的响应数据包负荷的大小,当等于请求的网页的大小时,则表示该网页加载完毕,最后一个响应数据包对应的接收时间即为网页返回时间。3) count the size of the response packet load corresponding to the request packet in the TCP session, when equal to the size of the requested webpage, it means that the webpage has been loaded, and the corresponding receiving time of the last response packet is the webpage return time.

此外,如果第一个响应数据包没有以“Content-Length:”开始的行,则可查找响应数据包中包含“Connection:close”的行,该行信息表示该网页传输完毕。因此,该包含“Connection:close”的响应数据包对应的接收时间即为网页返回时间。In addition, if the first response data packet does not have a line starting with "Content-Length:", you can look for the line containing "Connection: close" in the response data packet, and this line of information indicates that the transmission of the web page is completed. Therefore, the receiving time corresponding to the response packet containing "Connection: close" is the webpage return time.

如果既没有以“Content-Length:”开始的行,又没有以“Connection:close”的行,则在该TCP会话中查找响应数据包的头部,根据数据包的头部的URL(Uniform ResoureLocator,统一资源定位符)的信息判断是否为网页响应的文件,当该头部信息显示为不是该网页响应文件时,该数据包的上一个响应数据包为请求网页的最后一个响应数据包。最后一个响应数据包对应的接收时间即为网页文件的返回时间。If there is neither a line starting with "Content-Length:" nor a line starting with "Connection: close", then look for the header of the response data packet in the TCP session, according to the URL of the header of the data packet (Uniform ResoureLocator , Uniform Resource Locator) information to judge whether it is a web page response file, when the header information is displayed as not being the web page response file, the last response data packet of the data packet is the last response data packet of the requested web page. The receiving time corresponding to the last response data packet is the return time of the web page file.

最后,网页返回时间减去网页请求时间即为网页加载时间。Finally, the page return time minus the page request time is the page load time.

103、获取所述网页标识对应的至少一个首屏页面元素。103. Acquire at least one above-the-fold page element corresponding to the webpage identifier.

具体地,网页中通常还会包含需要二次访问的页面元素,如图片元素、外联脚本元素、外联层叠样式表元素、框架元素等,而这些需要二次访问的页面元素分别对应页面元素服务器中的相应的页面元素文件,而首屏页面元素是指在终端的第一屏页面中显示的,需要二次访问的页面元素。Specifically, web pages usually also contain page elements that require secondary access, such as image elements, external script elements, external cascading style sheet elements, frame elements, etc., and these page elements that require secondary access correspond to page elements The corresponding page element file in the server, and the first screen page element refers to the page element that is displayed on the first screen page of the terminal and needs to be accessed twice.

作为一种具体实施例,由于需要二次访问的页面元素具有特定的格式,所以根据特定格式从请求数据包中识别出需二次访问的页面元素。例如:图片类型的页面元素对应的html(HyperText Markup Language,超级文本标记语言)格式为<img src=”image.jpg”/>,其中src表示所包含的图片文件;外联脚本元素的格式为<script scr=”behavior.js”></script>,其中src表示脚本文件;外联层叠样式表元素的格式为<linkrel=”stylesheet”,href=”style.css”/>,其中href表示层叠样式表文件;框架元素的格式为<iframe src=”frame.htm”></iframe>,其中src表示框架内的页面文件。As a specific embodiment, since the page elements requiring secondary access have a specific format, the page elements requiring secondary access are identified from the request data packet according to the specific format. For example: the html (HyperText Markup Language, Hypertext Markup Language) format corresponding to the image type page element is <img src="image.jpg"/>, where src represents the included image file; the format of the external script element is <script scr="behavior.js"></script>, where src means the script file; the format of the external cascading style sheet element is <linkrel="stylesheet", href="style.css"/>, where href means Cascading style sheet file; the format of the frame element is <iframe src="frame.htm"></iframe>, where src represents the page file within the frame.

由于终端屏幕的尺寸大小以及用户对页面缩放比例的设置不同,同一网页在终端的第一屏上显示的页面大小也会不同,显示出的首屏页面元素的个数也会不同,当对获取网页首屏时间要求精度较高时,需要针对具体情况精确获取首屏页面元素。Due to the different size of the terminal screen and the user's setting of the page zoom ratio, the page size displayed on the first screen of the terminal will be different for the same web page, and the number of page elements displayed on the first screen will also be different. When the first-screen time of a web page requires high precision, it is necessary to accurately obtain the first-screen page elements for specific situations.

用户也可以设置一个终端的常用屏幕尺寸,且页面缩放比例为常用值的页面中所能显示的首屏页面元素作为参考,当对获取网页首屏时间要求精度不高时,可直接采用参考中首屏页面元素。The user can also set the common screen size of a terminal, and the first screen page elements that can be displayed on the page with the usual page scaling ratio as a reference. When the accuracy of obtaining the first screen time of the web page is not high, you can directly use the reference Above the fold page elements.

最后,从网页文件中获取首屏页面元素的标识,用于查找首屏页面元素对应的首屏页面元素文件。Finally, the identification of the above-the-fold page element is obtained from the webpage file, and is used to find the above-the-fold page element file corresponding to the above-the-fold page element.

104、根据所述流量记录确定所述首屏页面元素文件的请求时间和所述首屏页面元素文件的返回时间,将所述首屏页面元素的文件的返回时间和所述首屏页面元素文件的请求时间的差值确定为所述首屏页面元素文件的加载时间。104. Determine the request time of the above-the-fold page element file and the return time of the first-screen page element file according to the traffic record, and set the return time of the first-screen page element file and the first-screen page element file The difference between the request times is determined as the loading time of the above-the-fold page element file.

其中,首屏页面元素文件的加载时间是指从开始请求第一个加载的首屏页面元素文件到最后一个加载的首屏页面元素文件结束的时间。Wherein, the loading time of the first-screen page element file refers to the time from the request for the first loaded first-screen page element file to the end of the last loaded first-screen page element file.

在步骤101中获取到的流量记录中,查找用于请求加载第一个首屏页面元素的标识对应的请求数据包,该请求数据包的发送时间即可确定为首屏页面元素文件的请求时间。In the traffic record obtained in step 101, search for the request data packet corresponding to the identifier for requesting to load the first screen element of the first screen page, and the sending time of the request data packet can be determined as the request time of the file of the first screen page element file.

查找用于加载最后一个首屏页面元素的请求数据包,再查找与该请求数据包对应的全部响应报文,这些响应报文全部接受完毕的时间可确定为首屏页面元素的返回时间。Search for the request packet used to load the last first-screen page element, and then search for all response packets corresponding to the request packet. The time when all these response packets are received can be determined as the return time of the first-screen page element.

具体的请求时间和返回时间的确定方法可参考步骤102,在此不重复赘述。For a specific method of determining the request time and return time, reference may be made to step 102, which will not be repeated here.

最后,首屏页面元素文件的返回时间减去首屏页面元素文件的请求时间即为首屏页面元素文件的加载时间。Finally, the return time of the element file of the first screen page minus the request time of the element file of the first screen page is the loading time of the element file of the first screen page.

105、将所述网页文件的返回时间和所述首屏页面元素文件的请求时间的差值确定为网页解析时间。105. Determine the difference between the return time of the webpage file and the request time of the above-the-fold page element file as the webpage parsing time.

具体地,网页加载的过程包括:终端请求加载网页文件,网页服务器响应请求,发送网页文件。终端接收网页文件,接收完毕后,终端开始对网页文件的内容进行解析,得到需要二次访问的首屏页面元素文件,然后再请求加载首屏页面元素文件。其中,网页解析时间是指从网页返回完毕到开始请求首屏页面元素文件之间的时间即为网页解析时间。Specifically, the webpage loading process includes: the terminal requests to load the webpage file, and the webpage server sends the webpage file in response to the request. The terminal receives the webpage file, and after receiving it, the terminal starts to analyze the content of the webpage file, obtains the first-screen page element file that needs to be accessed twice, and then requests to load the first-screen page element file. Wherein, the webpage parsing time refers to the time between the completion of returning the webpage and the start of requesting the first screen page element file, which is the webpage parsing time.

106、根据所述网页加载时间、所述首屏页面元素的加载时间和所述网页解析时间确定所述网页首屏时间。106. Determine the above-the-fold time of the webpage according to the webpage loading time, the loading time of the above-the-fold page elements, and the webpage parsing time.

作为一种具体实施例,将网页加载时间、首屏页面元素的加载时间和网页解析时间相加得到同一终端访问同一网页的网页首屏时间。As a specific embodiment, adding the webpage loading time, the loading time of the page elements on the first screen and the webpage parsing time can obtain the first screen time of the same webpage accessed by the same terminal.

本发明实施例提供的一种获取网页首屏时间的方法,通过根据在网络侧提取DPI系统中的流量记录,分别获取网页文件的加载时间、首屏页面元素文件的加载时间和网页解析时间,再根据网页文件的加载时间、首屏页面元素文件的加载时间和网页解析时间确定网页首屏时间。相比较于现有技术中的在用户侧部署专门的软件或硬件设备作为探针,并挂在用户家庭网关或者安装在用户的电脑中,本发明不需要再在用户侧部署探针,不需要占用用户的流量,可以直接根据网络侧DPI系统中的流量记录进行处理,方便地得到网页首屏时间,进而可以根据网页首屏时间评价互联网业务的质量,为运营商和互联网公司提供提升用户感知的依据。A method for obtaining the first screen time of a webpage provided by an embodiment of the present invention obtains the loading time of the webpage file, the loading time of the first screen page element file, and the webpage parsing time respectively by extracting the traffic records in the DPI system on the network side, The first screen time of the web page is then determined according to the loading time of the web page file, the loading time of the element file of the first screen page, and the parsing time of the web page. Compared with the prior art that deploys special software or hardware devices on the user side as probes, and hangs them on the user’s home gateway or installs them in the user’s computer, the present invention does not need to deploy probes on the user side, and does not require The traffic occupied by the user can be processed directly according to the traffic records in the DPI system on the network side, and the first screen time of the web page can be obtained conveniently, and then the quality of the Internet service can be evaluated according to the first screen time of the web page, providing operators and Internet companies with the ability to improve user perception basis.

进一步地,作为对图1所示方法的细化和扩展,本发明实施例还提供了一种获取网页首屏时间的方法,如图2所示,在步骤106之后,该方法还包括:Further, as a refinement and extension of the method shown in Figure 1, the embodiment of the present invention also provides a method for obtaining the time of the first screen of a webpage, as shown in Figure 2, after step 106, the method further includes:

107、当步骤106获取的网页首屏时间大于预设阈值时,确定所述终端访问所述网页的网页文件的平均加载时间、首屏页面元素文件的平均加载时间和网页的平均解析时间。107. When the above-the-fold time of the webpage acquired in step 106 is greater than the preset threshold, determine the average loading time of the webpage file, the average loading time of the above-the-fold page element file, and the average parsing time of the webpage when the terminal accesses the webpage.

其中,预设阈值可以确定为同一终端多次访问同一网址时网页首屏时间的平均值。预设阈值的选择也可根据用户对网页首屏时间的要求进行确定,具体确定标准在此不做限定。Wherein, the preset threshold may be determined as an average value of the first screen time of the webpage when the same terminal visits the same website for multiple times. The selection of the preset threshold can also be determined according to the user's requirement on the first screen time of the webpage, and the specific determination standard is not limited here.

作为一种具体的实施例,终端多次访问网页时,先确定每一次的网页文件的加载时间,然后对这些网页文件的加载时间求平均值,该平均值确定为网页文件的平均加载时间。As a specific embodiment, when the terminal accesses the webpage multiple times, it first determines the loading time of each webpage file, and then averages the loading times of these webpage files, and the average value is determined as the average loading time of the webpage file.

类似方法确定首屏页面元素文件的平均加载时间和网页的平均解析时间,在此不重复赘述。The average loading time of the element file of the first screen page and the average parsing time of the web page are determined in a similar manner, and details are not repeated here.

108、比较所述网页文件的加载时间与所述平均网页文件的加载时间、所述首屏页面元素文件的加载时间与所述首屏页面元素文件的平均加载时间以及所述网页解析时间和所述网页的平均解析时间。108. Comparing the loading time of the webpage file with the loading time of the average webpage file, the loading time of the above-the-fold page element file and the average loading time of the above-the-fold page element file, and the webpage parsing time and the The average parse time for the above pages.

作为一种具体实施例,计算步骤102中确定的网页文件的加载时间和平均网页文件的加载时间的差值,计算步骤104中确定的首屏页面元素文件的加载时间和首屏页面元素文件的平均加载时间的差值,计算步骤105中确定的网页解析时间和网页的平均解析时间的差值,并比较三个差值的相对大小。As a specific embodiment, the difference between the loading time of the webpage file determined in step 102 and the loading time of the average webpage file is calculated, and the loading time of the first screen page element file determined in step 104 and the time difference of the first screen page element file are calculated. For the difference of average loading time, calculate the difference between the parsing time of the webpage determined in step 105 and the average parsing time of the webpage, and compare the relative sizes of the three differences.

109、根据比较结果确定影响所述网页首屏时间的因素。109. Determine factors that affect the above-the-fold time of the webpage according to the comparison result.

作为一种具体实施例,当步骤106中确定的网页首屏时间大于预设阈值时,表明网页首屏时间过长,需要分析和确定影响网页首屏时间的因素。步骤108中确定的三个参数的差值(网页文件的加载时间与网页文件的平均加载时间的差值,首屏页面元素文件的加载时间和首屏页面元素文件的平均加载时间的差值,网页解析时间和网页的平均解析时间的差值)越大,表明对网页首屏时间的影响也越大。根据差值的相对大小,可以定位网页首屏时间的瓶颈因素。As a specific embodiment, when the time to the first screen of the web page determined in step 106 is greater than the preset threshold, it indicates that the time to the first screen of the web page is too long, and factors affecting the time to the first screen of the web page need to be analyzed and determined. The difference between the three parameters determined in step 108 (the difference between the loading time of the webpage file and the average loading time of the webpage file, the difference between the loading time of the first screen page element file and the average loading time of the first screen page element file, The greater the difference between the web page parsing time and the web page average parsing time), the greater the impact on the first screen time of the web page. According to the relative size of the difference, the bottleneck factor of the first screen time of the web page can be located.

本发明实施例提供的一种获取网页首屏时间的方法,通过根据在网络侧提取DPI系统中的流量记录,分别获取网页文件的平均加载时间、首屏页面元素文件的平均加载时间和网页的平均解析时间,进而确定网页首屏时间的瓶颈因素。相比较于现有技术中只是获取单一终端单次访问网页的一个网页首屏时间相比,本发明直接根据网络侧DPI系统中的流量记录,计算出实际计算得到的三个参数与这三个平均值的差值情况,定位影响网页首屏时间的因素以及影响程度,为运营商和互联网公司提供提升用户感知的依据。A method for obtaining the first screen time of a webpage provided by an embodiment of the present invention obtains the average loading time of webpage files, the average loading time of the first screen page element files, and the The average resolution time, and then determine the bottleneck factor of the first screen time of the web page. Compared with the prior art, which only obtains the first screen time of a single webpage accessed by a single terminal, the present invention directly calculates the three actual calculated parameters based on the traffic records in the DPI system on the network side. The difference between the average value and the factors that affect the first screen time of the webpage and the degree of influence are located, providing operators and Internet companies with a basis to improve user perception.

此外,为了更精确的获取影响网页首屏时间的瓶颈因素,以及为改进网页首屏时间提供依据,本发明实施例还提供了另一种获取三个参数的平均值的方法,如下:In addition, in order to more accurately obtain the bottleneck factors that affect the first screen time of the webpage, and provide a basis for improving the first screen time of the webpage, the embodiment of the present invention also provides another method for obtaining the average value of the three parameters, as follows:

另一种获取平均网页文件的加载时间的具体方法,如下:Another specific method for obtaining the loading time of the average web page file is as follows:

需要说明的是,同一终端在请求访问同一网页时,该网页的文件可能保存在多个不同位置的网址服务器上,由于受终端的地理位置和传输网络等因素的影响,每一次响应终端的请求的网址服务器也有可能不同,而不同的网址服务器响应时,对应的网页加载时间不同,故需要针对不同的网址服务器计算相应的网页加载时间。It should be noted that when the same terminal requests to access the same web page, the web page files may be stored on multiple URL servers in different locations. The URL servers of different URLs may also be different, and when different URL servers respond, the corresponding webpage loading time is different, so it is necessary to calculate the corresponding webpage loading time for different URL servers.

作为一种具体实施例,在步骤101获取的请求数据包中,首先,查找以“Host:”为第一字段的行,该行的第二字段即为网页服务器的IP地址或者为网页对应的域名,若为网页对应的域名则可通过该请求数据包的目的IP地址确定为网页服务器的IP地址。As a specific embodiment, in the request packet obtained in step 101, at first, search for the line with "Host:" as the first field, and the second field of the line is the IP address of the web server or the corresponding IP address of the web page. The domain name, if it is the domain name corresponding to the webpage, can be determined as the IP address of the webpage server through the destination IP address of the request data packet.

然后,针对同一终端访问同一网址时,同一个网页服务器响应时,确定每一次的网页请求时间和网页返回时间,进而确定每一次的网页加载时间。再对这些网页加载时间求平均数,即反映该网页服务器响应时对应的平均加载时间。Then, when the same terminal accesses the same website and the same webpage server responds, the webpage request time and webpage return time of each time are determined, and then the webpage loading time of each time is determined. The average loading time of these webpages is then calculated to reflect the corresponding average loading time when the webpage server responds.

最后,依照此方法分别获取不同网页服务器响应时对应的平均加载时间,并建立一个网页服务器的IP地址和其对应的平均网页加载时间的列表,通过该列表可以反映不同网页服务器响应同一终端访问同一网页的平均加载时间,其数值的大小可以反映不同网址服务器对网页首屏时间的不同影响情况,既可根据精确的确定影响网页首屏时间的瓶颈因素,精确到具体响应的网址服务器,又可以为改进瓶颈因素提供改进方向和依据。Finally, obtain the corresponding average loading time of different webpage servers according to this method, and create a list of IP addresses of webpage servers and their corresponding average webpage loading times. The average loading time of a web page, its numerical value can reflect the different influences of different URL servers on the first screen time of the web page, it can not only accurately determine the bottleneck factors that affect the first screen time of the web page, but also be accurate to the URL server that responds specifically. Provide improvement directions and basis for improving bottleneck factors.

另一种获取首屏页面元素文件的平均加载时间的具体方法,如下:Another specific method for obtaining the average loading time of the first screen page element file is as follows:

需要说明的是,同一终端在请求访问同一网页的同一首屏页面元素时,该首屏页面元素的文件可能保存在不同位置的页面元素服务器上,由于受终端的地理位置和传输网络等因素的影响,每一次响应终端的请求的页面元素服务器也有可能不同,而不同的页面元素服务器响应时,对应的页面元素对应的加载时间不同,故需要针对不同的页面元素服务器计算相应的页面元素的加载时间。It should be noted that when the same terminal requests to access the same first-screen page element of the same web page, the file of the first-screen page element may be stored on the page element server in a different location, due to factors such as the geographical location of the terminal and the transmission network. Influence, each page element server that responds to the request of the terminal may also be different, and when different page element servers respond, the corresponding loading time of the corresponding page element is different, so it is necessary to calculate the loading of the corresponding page element for different page element servers time.

作为一种具体实施例,在步骤101获取的请求数据包中,首先,查找以“Host:”为第一字段的行,该行的第二字段即为页面元素服务器的IP地址或者为页面元素对应的域名,若为页面元素对应的域名则可通过该请求数据包的目的IP地址确定为页面元素服务器的IP地址。As a specific embodiment, in the request data packet obtained in step 101, first, look for the line with "Host:" as the first field, and the second field of the line is the IP address of the page element server or the page element The corresponding domain name, if it is the domain name corresponding to the page element, can be determined as the IP address of the page element server through the destination IP address of the request data packet.

然后,针对同一终端访问同一网址时,同一个页面元素服务器响应时,确定每一次页面元素的请求时间和返回时间,进而确定每一次的页面元素的加载时间。再对这些页面元素服务器的加载时间求平均数,即反映该首屏页面元素服务器响应时对应的首屏页面元素的平均加载时间。Then, when the same terminal accesses the same URL and the same page element server responds, the request time and return time of each page element are determined, and then the loading time of each page element is determined. Then, the average loading time of these page element servers is calculated to reflect the average loading time of the corresponding first screen page elements when the first screen page element server responds.

最后,依照此方法分别获取不同首屏页面元素服务器响应时的平均加载时间,并建立一个首屏页面元素服务器的IP地址和其对应的首屏页面元素文件的平均加载时间的列表,通过该列表可以反映不同首屏页面元素服务器响应同一终端访问同一首屏页面元素的平均加载时间,其数值的大小可以反映不同首屏页面元素服务器对网页首屏时间的影响情况,既可根据精确的确定影响网页首屏时间的瓶颈因素,精确到具体响应的首屏页面元素服务器,又可以为改进瓶颈因素提供改进方向和依据。Finally, according to this method, obtain the average loading time of different first-screen page element servers respectively, and establish a list of the IP address of the first-screen page element server and the average loading time of the corresponding first-screen page element files, through the list It can reflect the average loading time of different above-the-fold page element servers responding to the same terminal accessing the same above-the-fold page element. The bottleneck factor of the first screen time of the webpage, and the server of the first screen page element that is accurate to the specific response, can also provide the improvement direction and basis for improving the bottleneck factor.

另一种获取网页的平均解析时间的具体方法,如下:Another specific method for obtaining the average parsing time of a web page is as follows:

网页的平均解析时间需要说明的是,同一终端在请求访问同一网页时,但由于终端的User-Agent字段对应的用户代理信息的不同,用户代理信息包括硬件类型、硬件配置和软件版本等,网页的解析时间也会有所不同。The average parsing time of a web page needs to be explained that when the same terminal requests to access the same web page, due to the difference in user agent information corresponding to the User-Agent field of the terminal, the user agent information includes hardware type, hardware configuration, and software version, etc. The parse time for will also vary.

作为一种具体实施例,首先,在步骤101获取的请求数据包中,查找以“User-Agent:”为第一字段的行,第二字段的内容的信息为User-Agent信息。As a specific embodiment, firstly, in the request data packet obtained in step 101, search for the line with "User-Agent:" as the first field, and the content information of the second field is User-Agent information.

然后,针对同一终端访问同一网址时,终端对应的User-Agent信息相同时,确定每一次访问的网页解析时间,再对网页解析时间求平均数,即反映该User-Agent信息对应的平均解析时间。Then, when the same terminal accesses the same URL and the corresponding User-Agent information of the terminal is the same, determine the webpage resolution time for each visit, and then calculate the average of the webpage resolution time, which reflects the average resolution time corresponding to the User-Agent information .

网页的平均解析时间网页的平均解析时间最后,依照此方法分别获取不同User-Agent对应网页的平均解析时间,并建立一个User-Agent信息对应的网页的平均解析时间的列表,通过该列表可以反映不同User-Agent解析同一网址文件的平均时间,其数值的大小可以反映不同User-Agent字段对网页首屏时间的影响情况,既可根据精确的确定影响网页首屏时间的瓶颈因素,精确到具体终端的User-Agent信息,又可以为改进瓶颈因素提供改进方向和依据。The average parsing time of the webpage The average parsing time of the webpage Finally, according to this method, the average parsing time of webpages corresponding to different User-Agents is respectively obtained, and a list of the average parsing time of webpages corresponding to User-Agent information is established, which can reflect The average time for different User-Agents to parse the same URL file. The size of the value can reflect the impact of different User-Agent fields on the first screen time of the webpage. It can accurately determine the bottleneck factors that affect the first screen time of the webpage, and it is accurate to the specific The User-Agent information of the terminal can also provide improvement directions and basis for improving bottleneck factors.

此外,基于这种获取三个参数的平均值的方法上,获取网页首屏时间的平均值也可采取如下方法:In addition, based on the method of obtaining the average value of the three parameters, the following method can also be used to obtain the average value of the first screen time of the webpage:

获取上述多个平均网页加载时间、多个平均首屏页面元素的加载时间和多个网页的平均解析时间中的最小值,根据公式计算得到最优网页首屏时间。网页的平均解析时间获取其中的最大值,根据公式计算得到最差网页首屏时间。Obtain the minimum value among the average loading time of multiple web pages, the average loading time of multiple above-the-fold page elements, and the average parsing time of multiple web pages above, according to the formula Calculate the optimal first screen time of the webpage. Get the maximum value of the average parsing time of the webpage, according to the formula Calculate the worst web page first screen time.

可以根据步骤106中确定的网页首屏时间在最优网页首屏时间和最差网页首屏时间之间的位置情况来评价网页质量的情况,也可根据最优网页首屏时间和最差网页首屏时间的平均值来确定平均网页首屏时间,该平均网页首屏时间可作为预设阈值,需要说明是这里仅仅给出了预设阈值的一种示例,具体预设阈值的设置在此不做限定。The situation of the web page quality can be evaluated according to the position of the first screen time of the web page determined in step 106 between the optimal web page first screen time and the worst web page first screen time, or according to the optimal web page first screen time and the worst web page first screen time. The average first screen time of the web page is used to determine the average web page first screen time. The average web page first screen time can be used as the preset threshold. It should be noted that this is only an example of the preset threshold. The specific preset threshold is set here No limit.

本发明实施例还提供一种获取网页首屏时间的装置30,如图3所示,所述网页包括网页文件和页面元素文件,所述装置包括:The embodiment of the present invention also provides a device 30 for obtaining the first screen time of a web page. As shown in FIG. 3 , the web page includes a web page file and a page element file, and the device includes:

获取模块31,用于根据终端接入标识和网页标识获取深度报文检测DPI系统中对应的流量记录,所述流量记录包括所述终端接入标识对应的终端访问所述网页标识对应的网页时产生的数据包和每一个所述数据包对应的发送时间或者接收时间,所述数据包包括请求数据包和响应数据包。An acquisition module 31, configured to acquire a corresponding traffic record in the deep packet detection DPI system according to the terminal access identifier and the webpage identifier, where the traffic record includes when the terminal corresponding to the terminal access identifier accesses the webpage corresponding to the webpage identifier The generated data packets and the sending time or receiving time corresponding to each of the data packets, the data packets include request data packets and response data packets.

确定模块32,用于根据所述获取模块31获取的所述流量记录确定所述网页标识对应的网页文件的请求时间和网页文件的返回时间,将所述网页文件的返回时间和所述网页文件的请求时间的差值确定为网页文件的加载时间。A determining module 32, configured to determine the request time of the webpage file corresponding to the webpage identifier and the return time of the webpage file according to the flow record obtained by the acquisition module 31, and combine the return time of the webpage file and the return time of the webpage file The difference in request time is determined as the loading time of the web page file.

所述获取模块31,还用于获取所述网页标识对应的至少一个首屏页面元素,每个所述首屏页面元素对应一个首屏页面元素文件。The acquiring module 31 is further configured to acquire at least one first-screen page element corresponding to the webpage identifier, and each of the first-screen page elements corresponds to one first-screen page element file.

所述确定模块32,还用于根据所述获取模块31获取的所述流量记录确定所述首屏页面元素文件的请求时间和所述首屏页面元素文件的返回时间,将所述首屏页面元素文件的返回时间和所述首屏页面元素文件的请求时间的差值确定为所述首屏页面元素文件的加载时间。The determination module 32 is further configured to determine the request time of the first screen page element file and the return time of the first screen page element file according to the traffic records obtained by the acquisition module 31, and convert the first screen page The difference between the return time of the element file and the request time of the element file of the first screen page is determined as the loading time of the element file of the first screen page.

所述确定模块32,还用于将所述网页文件的返回时间和所述首屏页面元素文件的请求时间的差值确定为网页解析时间。The determination module 32 is further configured to determine the difference between the return time of the webpage file and the request time of the first screen element file as the webpage parsing time.

所述确定模块32,还用于根据所述网页文件的加载时间、所述首屏页面元素文件的加载时间和所述网页解析时间确定所述网页的网页首屏时间。The determination module 32 is further configured to determine the time of the first screen of the web page according to the loading time of the web page file, the loading time of the element file of the first screen page, and the parsing time of the web page.

进一步地,所述确定模块32,还用于将包含所述网页标识且用于请求加载所述网页文件的请求数据包对应的发送时间确定为所述网页文件的请求时间;查找包含所述网页标识且用于请求加载所述网页文件的所述请求数据包对应的至少一个所述响应数据包;将所述至少一个所述响应数据包中最后接收的所述响应数据包对应的接收时间确定为网页文件的返回时间。Further, the determining module 32 is also configured to determine the sending time corresponding to the request packet containing the webpage identifier and used to request loading of the webpage file as the request time of the webpage file; Identify and be used to request at least one response data packet corresponding to the request data packet to load the webpage file; determine the receiving time corresponding to the last received response data packet in the at least one response data packet It is the return time of the webpage file.

所述确定模块32,还用于确定用于请求加载第一个所述首屏页面元素文件的所述请求数据包对应的发送时间为所述首屏页面元素文件的请求时间;查找用于请求加载最后一个所述首屏页面元素文件的所述请求数据包对应的至少一个所述响应数据包;将所述至少一个所述响应数据包中最后接收的所述响应数据包对应的接收时间确定为首屏页面元素文件的返回时间。The determining module 32 is also used to determine that the sending time corresponding to the request data packet for requesting to load the first first screen page element file is the request time of the first screen page element file; Loading at least one of the response data packets corresponding to the request data packet of the last above-the-fold page element file; determining the receiving time corresponding to the last received response data packet in the at least one of the response data packets It is the return time of the above-the-fold page element file.

所述确定模块32,还用于将所述网页文件的加载时间、所述首屏页面元素文件的加载时间和所述网页解析时间的和值确定为所述网页的网页首屏时间。The determining module 32 is further configured to determine the sum of the loading time of the webpage file, the loading time of the first screen page element file, and the webpage parsing time as the first screen time of the webpage.

所述确定模块32,还用于当所述网页首屏时间大于预设阈值时,确定所述终端访问所述网页的网页文件的平均加载时间、首屏页面元素文件的平均加载时间和网页的平均解析时间;比较所述网页文件的加载时间与所述网页文件的平均加载时间、所述首屏页面元素文件的加载时间与所述首屏页面元素文件的平均加载时间以及所述网页解析时间和所述网页的平均解析时间;根据比较结果确定影响所述网页首屏时间的因素。The determination module 32 is also used to determine the average loading time of the webpage files of the terminal accessing the webpage, the average loading time of the first screen page element files, and the Average parsing time; comparing the loading time of the webpage file with the average loading time of the webpage file, the loading time of the first-screen page element file and the average loading time of the first-screen page element file, and the webpage parsing time and the average parsing time of the webpage; and determine the factors that affect the above-the-fold time of the webpage according to the comparison result.

本发明实施例提供的一种获取网页首屏时间的装置,通过根据在网络侧提取DPI系统中的流量记录,分别获取网页文件的加载时间、首屏页面元素文件的加载时间和网页解析时间,再根据网页文件的加载时间、首屏页面元素文件的加载时间和网页解析时间确定网页首屏时间。相比较于现有技术中的在用户侧部署专门的软件或硬件设备作为探针,并挂在用户家庭网关或者安装在用户的电脑中,本发明不需要再在用户侧部署探针,不需要占用用户的流量,可以直接根据网络侧DPI系统中的流量记录进行处理,方便地得到网页首屏时间,进而可以根据网页首屏时间评价互联网业务的质量,为运营商和互联网公司提供提升用户感知的依据。A device for obtaining the first screen time of a web page provided by an embodiment of the present invention obtains the loading time of the web page file, the loading time of the first screen page element file, and the webpage parsing time respectively by extracting the traffic records in the DPI system on the network side, The first screen time of the web page is then determined according to the loading time of the web page file, the loading time of the element file of the first screen page, and the parsing time of the web page. Compared with the prior art that deploys special software or hardware devices on the user side as probes, and hangs them on the user’s home gateway or installs them in the user’s computer, the present invention does not need to deploy probes on the user side, and does not require The traffic occupied by the user can be processed directly according to the traffic records in the DPI system on the network side, and the first screen time of the web page can be obtained conveniently, and then the quality of the Internet service can be evaluated according to the first screen time of the web page, providing operators and Internet companies with the ability to improve user perception basis.

如图4所示,本发明实施例提供一种获取网页首屏时间的终端,包括:处理器401、存储器402、收发器403以及总线404,所述处理器401、存储器402和收发器403通过所述总线404互相通信。其中,所述存储器402用于存储多个指令以实现本发明提供的拨号方法,所述处理器401执行所述多个指令以实现根据终端接入标识和网页标识获取深度报文检测DPI系统中对应的流量记录,所述流量记录包括所述终端接入标识对应的终端访问所述网页标识对应的网页时产生的数据包和每一个所述数据包对应的发送时间或者接收时间,所述数据包包括请求数据包和响应数据包;根据所述流量记录确定所述网页标识对应的网页文件的请求时间和网页文件的返回时间,将所述网页文件的返回时间和所述网页文件的请求时间的差值确定为网页文件的加载时间;获取所述网页标识对应的至少一个首屏页面元素,每个所述首屏页面元素对应一个首屏页面元素文件;根据所述流量记录确定所述首屏页面元素文件的请求时间和所述首屏页面元素文件的返回时间,将所述首屏页面元素文件的返回时间和所述首屏页面元素文件的请求时间的差值确定为所述首屏页面元素文件的加载时间;将所述网页文件的返回时间和所述首屏页面元素文件的请求时间的差值确定为网页解析时间;根据所述网页文件的加载时间、所述首屏页面元素文件的加载时间和所述网页解析时间确定所述网页的网页首屏时间。As shown in FIG. 4 , an embodiment of the present invention provides a terminal for acquiring the first screen time of a web page, including: a processor 401, a memory 402, a transceiver 403, and a bus 404, and the processor 401, the memory 402, and the transceiver 403 pass The buses 404 communicate with each other. Wherein, the memory 402 is used to store a plurality of instructions to realize the dialing method provided by the present invention, and the processor 401 executes the plurality of instructions to realize the acquisition of the deep message detection DPI system according to the terminal access identifier and the webpage identifier. Corresponding flow records, the flow records include the data packets generated when the terminal corresponding to the terminal access identifier accesses the webpage corresponding to the webpage identifier and the sending time or receiving time corresponding to each data packet, the data The packet includes a request data packet and a response data packet; determine the request time of the webpage file corresponding to the webpage identifier and the return time of the webpage file according to the traffic record, and set the return time of the webpage file and the request time of the webpage file The difference is determined as the loading time of the webpage file; obtain at least one first-screen page element corresponding to the webpage identifier, each of the first-screen page elements corresponds to one first-screen page element file; determine the first-screen page element file according to the traffic record The request time of the screen page element file and the return time of the first screen page element file, the difference between the return time of the first screen page element file and the request time of the first screen page element file is determined as the first screen The loading time of the page element file; the difference between the return time of the web page file and the request time of the first screen page element file is determined as the web page resolution time; according to the loading time of the web page file, the first screen page element The loading time of the file and the parsing time of the webpage determine the above-the-fold time of the webpage.

进一步的,所述处理器401还用于将包含所述网页标识且用于请求加载所述网页文件的请求数据包对应的发送时间确定为所述网页文件的请求时间;查找包含所述网页标识且用于请求加载所述网页文件的所述请求数据包对应的至少一个所述响应数据包;将所述至少一个所述响应数据包中最后接收的所述响应数据包对应的接收时间确定为网页文件的返回时间。Further, the processor 401 is further configured to determine the sending time corresponding to the request packet containing the webpage identifier and used to request loading of the webpage file as the request time of the webpage file; and at least one response packet corresponding to the request packet for requesting loading of the webpage file; determining the receiving time corresponding to the last received response packet in the at least one response packet as The return time of the web page file.

进一步的,所述处理器401还用于确定用于请求加载第一个所述首屏页面元素文件的所述请求数据包对应的发送时间为所述首屏页面元素文件的请求时间;查找用于请求加载最后一个所述首屏页面元素文件的所述请求数据包对应的至少一个所述响应数据包;将所述至少一个所述响应数据包中最后接收的所述响应数据包对应的接收时间确定为首屏页面元素文件的返回时间。Further, the processor 401 is also configured to determine that the sending time corresponding to the request data packet for requesting to load the first first screen page element file is the request time of the first screen page element file; At least one of the response data packets corresponding to the request data packet requesting to load the last first screen page element file; The time is determined as the return time of the above-the-fold page element file.

进一步的,所述处理器401还用于将所述网页文件的加载时间、所述首屏页面元素文件的加载时间和所述网页解析时间的和值确定为所述网页的网页首屏时间。Further, the processor 401 is further configured to determine the sum of the loading time of the webpage file, the loading time of the above-the-fold page element file, and the webpage parsing time as the first-screen time of the webpage.

进一步的,所述处理器401还用于当所述网页首屏时间大于预设阈值时,确定所述终端访问所述网页的网页文件的平均加载时间、首屏页面元素文件的平均加载时间和网页的平均解析时间;比较所述网页文件的加载时间与所述网页文件的平均加载时间、所述首屏页面元素文件的加载时间与所述首屏页面元素文件的平均加载时间以及所述网页解析时间和所述网页的平均解析时间;根据比较结果确定影响所述网页首屏时间的因素。Further, the processor 401 is further configured to determine the average loading time of the webpage file of the terminal accessing the webpage, the average loading time of the first screen page element file and The average parsing time of the webpage; comparing the loading time of the webpage file with the average loading time of the webpage file, the loading time of the first screen page element file and the average loading time of the first screen page element file and the webpage Parsing time and the average parsing time of the webpage; determining the factors affecting the above-the-fold time of the webpage according to the comparison result.

其中,本发明实施例所述的处理器401可以是一个处理器,也可以是多个处理元件的统称。例如,该处理器401可以是中央处理器(Central Processing Unit,简称CPU),也可以是特定集成电路(Application Specific Integrated Circuit,简称ASIC),或者是被配置成实施本发明实施例的一个或多个集成电路,例如:一个或多个微处理器(digitalsignal processor,简称DSP),或,一个或者多个现场可编程门阵列(Field ProgrammableGate Array,简称FPGA)。Wherein, the processor 401 in this embodiment of the present invention may be one processor, or may be a general term for multiple processing elements. For example, the processor 401 may be a central processing unit (Central Processing Unit, referred to as CPU), or a specific integrated circuit (Application Specific Integrated Circuit, referred to as ASIC), or configured to implement one or more of the embodiments of the present invention. An integrated circuit, for example: one or more microprocessors (digitalsignal processor, DSP for short), or one or more field programmable gate arrays (Field Programmable Gate Array, FPGA for short).

存储器402可以是一个存储装置,也可以是多个存储元件的统称,且用于存储可执行程序代码等。且存储器402可以包括随机存储器(RAM),也可以包括非易失性存储器(non-volatile memory),例如磁盘存储器,闪存(Flash)等。The memory 402 may be a storage device, or a general term for multiple storage elements, and is used to store executable program codes and the like. And the memory 402 may include random access memory (RAM), and may also include non-volatile memory (non-volatile memory), such as disk memory, flash memory (Flash), and the like.

总线404可以是工业标准体系结构(Industry Standard Architecture,ISA)总线、外部设备互连(Peripheral Component,PCI)总线或扩展工业标准体系结构(ExtendedIndustry Standard Architecture,EISA)总线等。该总线404可以分为地址总线、数据总线、控制总线等。为便于表示,图4中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。The bus 404 may be an Industry Standard Architecture (Industry Standard Architecture, ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (Extended Industry Standard Architecture, EISA) bus, etc. The bus 404 can be divided into address bus, data bus, control bus and so on. For ease of representation, only one thick line is used in FIG. 4 , but it does not mean that there is only one bus or one type of bus.

本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于装置实施例而言,由于其基本相似于方法实施例,所以描述得比较简单,相关之处参见方法实施例的部分说明即可。Each embodiment in this specification is described in a progressive manner, the same and similar parts of each embodiment can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, as for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and for relevant parts, please refer to part of the description of the method embodiment.

本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于计算机可读取存储介质中,该程序在执行时,可包括如上述各方法的实施例的流程。其中,所述的存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)或随机存储记忆体(Random AccessMemory,RAM)等。Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be implemented through computer programs to instruct related hardware, and the programs can be stored in computer-readable storage media. During execution, it may include the processes of the embodiments of the above-mentioned methods. Wherein, the storage medium may be a magnetic disk, an optical disk, a read-only memory (Read-Only Memory, ROM) or a random access memory (Random Access Memory, RAM) and the like.

以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到的变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应该以权利要求的保护范围为准。The above is only a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Anyone skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present invention. All should be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be determined by the protection scope of the claims.

Claims (10)

1.一种获取网页首屏时间的方法,其特征在于,所述网页包括网页文件和页面元素文件,所述方法包括:1. A method for obtaining the first screen time of a webpage, characterized in that, the webpage comprises a webpage file and a page element file, and the method comprises: 根据终端接入标识和网页标识获取深度报文检测DPI系统中对应的流量记录,所述流量记录包括所述终端接入标识对应的终端访问所述网页标识对应的网页时产生的数据包和每一个所述数据包对应的发送时间或者接收时间,所述数据包包括请求数据包和响应数据包;According to the terminal access identifier and the webpage identifier, obtain the corresponding traffic record in the deep packet detection DPI system, the traffic record includes the data packets and each data packet generated when the terminal corresponding to the terminal access identifier accesses the webpage corresponding to the webpage identifier A sending time or receiving time corresponding to the data packet, the data packet includes a request data packet and a response data packet; 根据所述流量记录确定所述网页标识对应的网页文件的请求时间和网页文件的返回时间,将所述网页文件的返回时间和所述网页文件的请求时间的差值确定为网页文件的加载时间;Determine the request time of the webpage file corresponding to the webpage identifier and the return time of the webpage file according to the traffic record, and determine the difference between the return time of the webpage file and the request time of the webpage file as the loading time of the webpage file ; 获取所述网页标识对应的至少一个首屏页面元素,每个所述首屏页面元素对应一个首屏页面元素文件;Obtaining at least one above-the-fold page element corresponding to the webpage identifier, and each of the above-the-fold page elements corresponds to a first-screen page element file; 根据所述流量记录确定所述首屏页面元素文件的请求时间和所述首屏页面元素文件的返回时间,将所述首屏页面元素文件的返回时间和所述首屏页面元素文件的请求时间的差值确定为所述首屏页面元素文件的加载时间;Determine the request time of the above-the-fold page element file and the return time of the first-screen page element file according to the traffic record, and set the return time of the first-screen page element file and the request time of the first-screen page element file The difference between is determined as the loading time of the above-the-fold page element file; 将所述网页文件的返回时间和所述首屏页面元素文件的请求时间的差值确定为网页解析时间;Determining the difference between the return time of the webpage file and the request time of the above-the-fold page element file as the webpage parsing time; 根据所述网页文件的加载时间、所述首屏页面元素文件的加载时间和所述网页解析时间确定所述网页的网页首屏时间。The above-the-fold time of the webpage is determined according to the loading time of the webpage file, the loading time of the above-the-fold page element file, and the parsing time of the webpage. 2.根据权利要求1所述的方法,其特征在于,所述根据所述流量记录确定所述网页标识对应的网页文件的请求时间和网页文件的返回时间包括:2. The method according to claim 1, wherein said determining the request time of the webpage file corresponding to the webpage identifier and the return time of the webpage file according to the traffic record comprises: 将包含所述网页标识且用于请求加载所述网页文件的请求数据包对应的发送时间确定为所述网页文件的请求时间;Determining the sending time corresponding to the request packet containing the webpage identifier and used to request loading of the webpage file as the request time of the webpage file; 查找包含所述网页标识且用于请求加载所述网页文件的所述请求数据包对应的至少一个所述响应数据包;Find at least one response packet corresponding to the request packet containing the webpage identifier and used to request loading of the webpage file; 将所述至少一个所述响应数据包中最后接收的所述响应数据包对应的接收时间确定为网页文件的返回时间。Determining the receiving time corresponding to the last received response data packet in the at least one response data packet as the return time of the webpage file. 3.根据权利要求2所述的方法,其特征在于,所述根据所述流量记录确定所述首屏页面元素文件的请求时间和所述首屏页面元素文件的返回时间包括:3. The method according to claim 2, wherein the determining the request time of the first screen page element file and the return time of the first screen page element file according to the traffic record comprises: 确定用于请求加载第一个所述首屏页面元素文件的所述请求数据包对应的发送时间为所述首屏页面元素文件的请求时间;Determining that the sending time corresponding to the request data packet for requesting to load the first above-the-fold page element file is the request time of the above-the-fold page element file; 查找用于请求加载最后一个所述首屏页面元素文件的所述请求数据包对应的至少一个所述响应数据包;Find at least one response packet corresponding to the request packet for requesting to load the last above-the-fold page element file; 将所述至少一个所述响应数据包中最后接收的所述响应数据包对应的接收时间确定为首屏页面元素文件的返回时间。Determining the receiving time corresponding to the last received response data packet in the at least one response data packet as the return time of the first screen page element file. 4.根据权利要求1所述的方法,其特征在于,所述根据所述网页文件的加载时间、所述首屏页面元素文件的加载时间和所述网页解析时间确定所述网页的网页首屏时间包括:4. The method according to claim 1, wherein the first screen of the webpage is determined according to the loading time of the webpage file, the loading time of the element file of the first screen page and the analysis time of the webpage Time includes: 将所述网页文件的加载时间、所述首屏页面元素文件的加载时间和所述网页解析时间的和值确定为所述网页的网页首屏时间。The sum of the loading time of the webpage file, the loading time of the first screen page element file and the webpage parsing time is determined as the first screen time of the webpage. 5.根据权利要求1所述的方法,其特征在于,还包括:5. The method according to claim 1, further comprising: 当所述网页首屏时间大于预设阈值时,确定所述终端访问所述网页的网页文件的平均加载时间、首屏页面元素文件的平均加载时间和网页的平均解析时间;When the above-the-fold time of the webpage is greater than the preset threshold, determine the average loading time of the webpage file of the terminal accessing the webpage, the average loading time of the first-screen page element file and the average parsing time of the webpage; 比较所述网页文件的加载时间与所述网页文件的平均加载时间、所述首屏页面元素文件的加载时间与所述首屏页面元素文件的平均加载时间以及所述网页解析时间和所述网页的平均解析时间;Comparing the loading time of the webpage file with the average loading time of the webpage file, the loading time of the first screen page element file and the average loading time of the first screen page element file, and the webpage parsing time and the webpage The average resolution time of ; 根据比较结果确定影响所述网页首屏时间的因素。Factors affecting the above-the-fold time of the webpage are determined according to the comparison result. 6.一种获取网页首屏时间的装置,其特征在于,所述网页包括网页文件和页面元素文件,所述装置包括:6. A device for obtaining the first screen time of a webpage, wherein the webpage includes a webpage file and a page element file, and the device includes: 获取模块,用于根据终端接入标识和网页标识获取深度报文检测DPI系统中对应的流量记录,所述流量记录包括所述终端接入标识对应的终端访问所述网页标识对应的网页时产生的数据包和每一个所述数据包对应的发送时间或者接收时间,所述数据包包括请求数据包和响应数据包;An acquisition module, configured to acquire a corresponding traffic record in the deep message detection DPI system according to the terminal access identifier and the webpage identifier, where the traffic record includes that generated when the terminal corresponding to the terminal access identifier accesses the webpage corresponding to the webpage identifier The data packets and the sending time or receiving time corresponding to each of the data packets, the data packets include request data packets and response data packets; 确定模块,用于根据所述获取模块获取的所述流量记录确定所述网页标识对应的网页文件的请求时间和网页文件的返回时间,将所述网页文件的返回时间和所述网页文件的请求时间的差值确定为网页文件的加载时间;A determination module, configured to determine the request time of the webpage file corresponding to the webpage identifier and the return time of the webpage file according to the traffic records obtained by the acquisition module, and combine the return time of the webpage file and the request time of the webpage file The time difference is determined as the loading time of the webpage file; 所述获取模块,还用于获取所述网页标识对应的至少一个首屏页面元素,每个所述首屏页面元素对应一个首屏页面元素文件;The acquiring module is further configured to acquire at least one first-screen page element corresponding to the webpage identifier, and each of the first-screen page elements corresponds to one first-screen page element file; 所述确定模块,还用于根据所述获取模块获取的所述流量记录确定所述首屏页面元素文件的请求时间和所述首屏页面元素文件的返回时间,将所述首屏页面元素文件的返回时间和所述首屏页面元素文件的请求时间的差值确定为所述首屏页面元素文件的加载时间;The determining module is further configured to determine the request time of the above-the-fold page element file and the return time of the first-screen page element file according to the traffic records obtained by the obtaining module, and store the first-screen page element file The difference between the return time of the first screen page element file and the request time of the first screen page element file is determined as the loading time of the first screen page element file; 所述确定模块,还用于将所述网页文件的返回时间和所述首屏页面元素文件的请求时间的差值确定为网页解析时间;The determination module is also used to determine the difference between the return time of the webpage file and the request time of the first screen page element file as the webpage resolution time; 所述确定模块,还用于根据所述网页文件的加载时间、所述首屏页面元素文件的加载时间和所述网页解析时间确定所述网页的网页首屏时间。The determining module is further configured to determine the first screen time of the web page according to the loading time of the web page file, the loading time of the first screen page element file, and the webpage parsing time. 7.根据权利要求6所述的装置,其特征在于,所述确定模块,还用于将包含所述网页标识且用于请求加载所述网页文件的请求数据包对应的发送时间确定为所述网页文件的请求时间;7. The device according to claim 6, wherein the determining module is further configured to determine the sending time corresponding to the request packet containing the webpage identifier and used to request loading of the webpage file as the The request time of the web page file; 查找包含所述网页标识且用于请求加载所述网页文件的所述请求数据包对应的至少一个所述响应数据包;Find at least one response packet corresponding to the request packet containing the webpage identifier and used to request loading of the webpage file; 将所述至少一个所述响应数据包中最后接收的所述响应数据包对应的接收时间确定为网页文件的返回时间。Determining the receiving time corresponding to the last received response data packet in the at least one response data packet as the return time of the webpage file. 8.根据权利要求7所述的装置,其特征在于,所述确定模块,还用于确定用于请求加载第一个所述首屏页面元素文件的所述请求数据包对应的发送时间为所述首屏页面元素文件的请求时间;8. The device according to claim 7, wherein the determining module is further configured to determine that the sending time corresponding to the request data packet for requesting to load the first first screen page element file is the Describe the request time for the first screen page element file; 查找用于请求加载最后一个所述首屏页面元素文件的所述请求数据包对应的至少一个所述响应数据包;Find at least one response packet corresponding to the request packet for requesting to load the last above-the-fold page element file; 将所述至少一个所述响应数据包中最后接收的所述响应数据包对应的接收时间确定为首屏页面元素文件的返回时间。Determining the receiving time corresponding to the last received response data packet in the at least one response data packet as the return time of the first screen page element file. 9.根据权利要求6所述的装置,其特征在于,所述确定模块,还用于将所述网页文件的加载时间、所述首屏页面元素文件的加载时间和所述网页解析时间的和值确定为所述网页的网页首屏时间。9. The device according to claim 6, wherein the determining module is further configured to combine the loading time of the webpage file, the loading time of the first screen page element file, and the sum of the webpage parsing time The value is determined as the time above the fold of the web page in question. 10.根据权利要求6所述的装置,其特征在于,所述确定模块,还用于当所述网页首屏时间大于预设阈值时,确定所述终端访问所述网页的网页文件的平均加载时间、首屏页面元素文件的平均加载时间和网页的平均解析时间;10. The device according to claim 6, wherein the determination module is further configured to determine the average loading of the webpage files of the webpage accessed by the terminal when the first screen time of the webpage is greater than a preset threshold time, the average loading time of the above-the-fold page element files, and the average parsing time of the web page; 比较所述网页文件的加载时间与所述网页文件的平均加载时间、所述首屏页面元素文件的加载时间与所述首屏页面元素文件的平均加载时间以及所述网页解析时间和所述网页的平均解析时间;Comparing the loading time of the webpage file with the average loading time of the webpage file, the loading time of the first screen page element file and the average loading time of the first screen page element file, and the webpage parsing time and the webpage The average resolution time of ; 根据比较结果确定影响所述网页首屏时间的因素。Factors affecting the above-the-fold time of the webpage are determined according to the comparison result.
CN201611148648.9A 2016-12-13 2016-12-13 Method and device for acquiring first screen time of webpage Active CN106656666B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611148648.9A CN106656666B (en) 2016-12-13 2016-12-13 Method and device for acquiring first screen time of webpage

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611148648.9A CN106656666B (en) 2016-12-13 2016-12-13 Method and device for acquiring first screen time of webpage

Publications (2)

Publication Number Publication Date
CN106656666A true CN106656666A (en) 2017-05-10
CN106656666B CN106656666B (en) 2020-05-22

Family

ID=58825073

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611148648.9A Active CN106656666B (en) 2016-12-13 2016-12-13 Method and device for acquiring first screen time of webpage

Country Status (1)

Country Link
CN (1) CN106656666B (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107992416A (en) * 2017-11-28 2018-05-04 中国联合网络通信集团有限公司 A kind of definite method and device of webpage time delay
CN108671547A (en) * 2018-04-24 2018-10-19 腾讯科技(深圳)有限公司 A kind of method, apparatus and storage medium of the initial screen time obtaining application
CN108984384A (en) * 2017-06-01 2018-12-11 中国电信股份有限公司 Webpage head screen time-delay measuring method, device and system
CN109039715A (en) * 2018-07-17 2018-12-18 中国联合网络通信集团有限公司 User's web page browsing experience evaluation method and system, network base station configuration method
CN109740093A (en) * 2018-12-26 2019-05-10 无线生活(北京)信息技术有限公司 The determination method and device of initial screen time
CN110717121A (en) * 2019-08-27 2020-01-21 北京奇艺世纪科技有限公司 Method and device for determining first screen time of page
CN110781427A (en) * 2019-10-30 2020-02-11 北京博睿宏远数据科技股份有限公司 A calculation method, device, device and storage medium for time above the fold
CN111124530A (en) * 2019-11-25 2020-05-08 北京博睿宏远数据科技股份有限公司 Browser first rendering time calculation method, device, browser and storage medium
CN112463254A (en) * 2020-12-09 2021-03-09 广州酷狗计算机科技有限公司 Method, device and equipment for acquiring webpage loading time and storage medium
CN112507261A (en) * 2020-12-18 2021-03-16 无线生活(杭州)信息科技有限公司 First screen time calculation method and device

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101382958A (en) * 2008-10-21 2009-03-11 深圳华为通信技术有限公司 Web page loading method and device
CN103324521A (en) * 2013-06-20 2013-09-25 张家港保税区润桐电子技术研发有限公司 Method for measuring initial screen time of webpage
CN103559222A (en) * 2013-10-18 2014-02-05 北京奇虎科技有限公司 Method and device for displaying page loading time in browsers
CN103678372A (en) * 2012-09-14 2014-03-26 北京百度网讯科技有限公司 Method and equipment for obtaining application performance of page
CN103812713A (en) * 2012-11-06 2014-05-21 腾讯科技(深圳)有限公司 Method and apparatus for testing webpage loading time
CN104412254A (en) * 2012-03-30 2015-03-11 茨特里克斯系统公司 Measuring web browsing quality of experience in real-time at an intermediate network node
CN104685831A (en) * 2012-09-28 2015-06-03 瑞典爱立信有限公司 Measuring web page rendering time
CN104850415A (en) * 2014-02-13 2015-08-19 腾讯科技(深圳)有限公司 Method and apparatus for loading pages
CN104899131A (en) * 2014-03-04 2015-09-09 腾讯科技(深圳)有限公司 Detection method and device of webpage loading in browser, and mobile terminal
CN105045620A (en) * 2015-07-07 2015-11-11 深信服网络科技(深圳)有限公司 Method for measuring webpage first screen loading time and detection equipment
CN105373617A (en) * 2015-11-27 2016-03-02 中国联合网络通信集团有限公司 Web page first screen determination method and apparatus
CN105677678A (en) * 2014-11-20 2016-06-15 腾讯科技(武汉)有限公司 Determination method for first screen positions of pages, webpage information display method and system
CN105765907A (en) * 2013-11-22 2016-07-13 微软技术许可有限责任公司 Performance monitoring to provide real or near real time remediation feedback

Patent Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101382958A (en) * 2008-10-21 2009-03-11 深圳华为通信技术有限公司 Web page loading method and device
US9167021B2 (en) * 2012-03-30 2015-10-20 Citrix Systems, Inc. Measuring web browsing quality of experience in real-time at an intermediate network node
CN104412254A (en) * 2012-03-30 2015-03-11 茨特里克斯系统公司 Measuring web browsing quality of experience in real-time at an intermediate network node
CN103678372A (en) * 2012-09-14 2014-03-26 北京百度网讯科技有限公司 Method and equipment for obtaining application performance of page
CN104685831A (en) * 2012-09-28 2015-06-03 瑞典爱立信有限公司 Measuring web page rendering time
CN103812713A (en) * 2012-11-06 2014-05-21 腾讯科技(深圳)有限公司 Method and apparatus for testing webpage loading time
CN103324521A (en) * 2013-06-20 2013-09-25 张家港保税区润桐电子技术研发有限公司 Method for measuring initial screen time of webpage
CN103559222A (en) * 2013-10-18 2014-02-05 北京奇虎科技有限公司 Method and device for displaying page loading time in browsers
CN105765907A (en) * 2013-11-22 2016-07-13 微软技术许可有限责任公司 Performance monitoring to provide real or near real time remediation feedback
CN104850415A (en) * 2014-02-13 2015-08-19 腾讯科技(深圳)有限公司 Method and apparatus for loading pages
CN104899131A (en) * 2014-03-04 2015-09-09 腾讯科技(深圳)有限公司 Detection method and device of webpage loading in browser, and mobile terminal
CN105677678A (en) * 2014-11-20 2016-06-15 腾讯科技(武汉)有限公司 Determination method for first screen positions of pages, webpage information display method and system
CN105045620A (en) * 2015-07-07 2015-11-11 深信服网络科技(深圳)有限公司 Method for measuring webpage first screen loading time and detection equipment
CN105373617A (en) * 2015-11-27 2016-03-02 中国联合网络通信集团有限公司 Web page first screen determination method and apparatus

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
XIAO SOPHIA WANG等: "Demystifying Page Load Performance with WProf", 《10TH USENIX SYMPOSIUM ON NETWORKED SYSTEMS DESIGN AND IMPLEMENTATION》 *
王成等: "Web前端性能优化方案与实践", 《计算机应用与软件》 *

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108984384A (en) * 2017-06-01 2018-12-11 中国电信股份有限公司 Webpage head screen time-delay measuring method, device and system
CN107992416A (en) * 2017-11-28 2018-05-04 中国联合网络通信集团有限公司 A kind of definite method and device of webpage time delay
CN108671547A (en) * 2018-04-24 2018-10-19 腾讯科技(深圳)有限公司 A kind of method, apparatus and storage medium of the initial screen time obtaining application
CN109039715A (en) * 2018-07-17 2018-12-18 中国联合网络通信集团有限公司 User's web page browsing experience evaluation method and system, network base station configuration method
CN109740093A (en) * 2018-12-26 2019-05-10 无线生活(北京)信息技术有限公司 The determination method and device of initial screen time
CN110717121A (en) * 2019-08-27 2020-01-21 北京奇艺世纪科技有限公司 Method and device for determining first screen time of page
CN110717121B (en) * 2019-08-27 2022-07-12 北京奇艺世纪科技有限公司 Method and device for determining first screen time of page
CN110781427A (en) * 2019-10-30 2020-02-11 北京博睿宏远数据科技股份有限公司 A calculation method, device, device and storage medium for time above the fold
CN111124530A (en) * 2019-11-25 2020-05-08 北京博睿宏远数据科技股份有限公司 Browser first rendering time calculation method, device, browser and storage medium
CN112463254A (en) * 2020-12-09 2021-03-09 广州酷狗计算机科技有限公司 Method, device and equipment for acquiring webpage loading time and storage medium
CN112463254B (en) * 2020-12-09 2025-01-14 广州酷狗计算机科技有限公司 Method, device, equipment and storage medium for obtaining web page loading time
CN112507261A (en) * 2020-12-18 2021-03-16 无线生活(杭州)信息科技有限公司 First screen time calculation method and device

Also Published As

Publication number Publication date
CN106656666B (en) 2020-05-22

Similar Documents

Publication Publication Date Title
CN106656666B (en) Method and device for acquiring first screen time of webpage
CN110324311B (en) Vulnerability detection method and device, computer equipment and storage medium
CN107624233B (en) VPN transmission tunnel scheduling method and device and VPN client server
US10999384B2 (en) Method and system for identifying website visitors
CN102752288B (en) Network access behavior identification method and device
CN103257989B (en) Web page download time is analyzed
CN107341395B (en) Method for intercepting reptiles
CN104994133B (en) A kind of mobile Web web page access user experience perception evaluating method based on network KPI
CN103269479B (en) A kind of call bill processing method, device and system
CN109688280A (en) Request processing method, request processing equipment, browser and storage medium
CN102884764A (en) Message receiving method, deep packet inspection device, and system
CN106412975B (en) A testing method and device for content billing vulnerability
CN106899549B (en) Network security detection method and device
CN105635073B (en) Access control method, device and network access device
KR20160030308A (en) Service quality index calculation method and calculation apparatus, and communications system
CN102523296B (en) Method, device and system for optimizing wireless webpage browsing resources
CN107992416B (en) Method and device for determining webpage time delay
CN104023046A (en) Mobile terminal recognition method and device
CN113055420B (en) HTTPS service identification method, device and computing equipment
CN110784364B (en) Data monitoring method and device, storage medium and terminal
CN113453076B (en) User video service quality evaluation method, device, computing device and storage medium
CN112398796B (en) Information processing method, device, equipment and computer readable storage medium
CN102694802B (en) Network access information recording method and device
CN102918527B (en) Investigation method and system for web application hosting
CN110457900A (en) A website monitoring method, device, equipment and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant