CN106330548B - Flow statistical method, device and system - Google Patents

Flow statistical method, device and system Download PDF

Info

Publication number
CN106330548B
CN106330548B CN201610753692.6A CN201610753692A CN106330548B CN 106330548 B CN106330548 B CN 106330548B CN 201610753692 A CN201610753692 A CN 201610753692A CN 106330548 B CN106330548 B CN 106330548B
Authority
CN
China
Prior art keywords
request
response data
file
push information
offline
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.)
Expired - Fee Related
Application number
CN201610753692.6A
Other languages
Chinese (zh)
Other versions
CN106330548A (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.)
Alibaba China Co Ltd
Original Assignee
Youku Network Technology Beijing 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 Youku Network Technology Beijing Co Ltd filed Critical Youku Network Technology Beijing Co Ltd
Priority to CN201610753692.6A priority Critical patent/CN106330548B/en
Publication of CN106330548A publication Critical patent/CN106330548A/en
Application granted granted Critical
Publication of CN106330548B publication Critical patent/CN106330548B/en
Expired - Fee Related 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
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0876Aspects of the degree of configuration automation
    • H04L41/0886Fully automatic configuration
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/55Push-based network services

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Automation & Control Theory (AREA)
  • Environmental & Geological Engineering (AREA)
  • Information Transfer Between Computers (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Computer And Data Communications (AREA)

Abstract

The embodiment of the invention provides a flow statistical method, a device and a system, wherein the method obtains a push information request sent by a target equipment client, and the push information request comprises the following steps: the address of the target server and the request type; acquiring response data returned by the target server according to the push information request; and counting the flow according to the push information request and the response data. By the method and the device, the operation complexity of the pushed information flow test can be reduced, and the method can be used in combination with the automatic test.

Description

Flow statistical method, device and system
Technical Field
The present invention relates to data statistics technologies in the field of network communications, and in particular, to a traffic statistics method, apparatus, and system.
Background
With the development of networks, traffic consumption generated by pushing information by a client becomes one of objects concerned by users, and thus a traffic statistical method for counting traffic consumption generated by pushing information by a client is urgently needed.
Currently, there are three types of push information consumed by a client to generate traffic: the information is pushed before the off-line, the information is pushed when the off-line is suspended, and the information is pushed when the off-line is started. The method for counting the size of the flow consumed by the push information in the prior art comprises the following steps: the method comprises the steps of manually grabbing related requests and responses sent by a client by a third-party packet grabbing tool (such as packet grabbing tools charles, fixdler and wireshark) to manually grab information pushing requests and returned data, and then manually calculating the consumed flow, so that the consumed flow is counted. The existing traffic statistical method has high operation complexity, and the operation of manually capturing data packets by a third-party packet capturing tool to calculate the consumed traffic cannot be combined with the automatic test.
Disclosure of Invention
In order to solve the above technical problems, embodiments of the present invention are intended to provide a flow statistical method, a device and a system, so as to solve the problems that the existing flow statistical method has high operation complexity and cannot be used in combination with an automated test.
The technical scheme of the invention is realized as follows:
the embodiment of the invention provides a traffic statistical method, which comprises the following steps:
the method comprises the steps of obtaining a push information request sent by a target equipment client, wherein the push information request comprises: the address of the target server and the request type;
acquiring response data returned by the target server according to the push information request;
and counting the flow according to the push information request and the response data.
In the foregoing solution, the obtaining a push information request sent by a target device client includes:
acquiring an IP address of the terminal equipment and binding the target equipment;
and starting a monitoring program, and monitoring the push information request sent by the client on the target equipment.
In the foregoing solution, the obtaining, according to the push information request, response data returned by the target server includes:
acquiring the IP address of the target server according to the push information request;
connecting the target server and sending the push information request to the target server;
and acquiring response data returned by the target server aiming at different request types according to the request type of the information pushing request.
In the foregoing solution, the obtaining, according to the request type of the information pushing request, response data returned by the target server for different request types includes:
judging whether the request type is an offline pre-information pushing request or not, and if the request type is the offline pre-information pushing request, calculating a first request data length of the offline pre-information pushing request; continuously acquiring response data returned by the target server until the push information request before offline is not acquired any more, and counting all the acquired response data to obtain first response data; creating a first file, and inputting a first preset field of the off-line pre-push information into the first file;
if not, judging whether the request type is an offline push information pause request or not, and if so, calculating a second request data length of the offline push information pause request; continuously acquiring response data returned by the target server until the offline pause push information request is not acquired any more, and counting all the acquired response data to obtain second response data; creating a second file, and inputting a first preset field of the offline pause pushing information into the second file;
otherwise, when the request type is not an off-line pre-push information request and an off-line pause push information request, judging whether the request type is an off-line startup diagram push information request, and if the request type is the off-line startup diagram push information request, calculating a third request data length of the off-line startup diagram push information request; continuously acquiring response data returned by the target server until the offline startup diagram pushing information request is not acquired any more, and counting all the acquired response data to obtain third response data; and inputting a first preset field of the off-line startup picture pushing information into the second file.
In the above scheme, the method further comprises:
when the request type is a non-offline information pushing request, judging whether a first preset field recorded in the first file contains an HTTP (hyper text transport protocol) address of the information pushing request, and if the first preset field contains the HTTP address, acquiring and analyzing response data returned by the target server;
when the response data is a first preset threshold value, creating a third file;
and when the response data is a second preset threshold value, creating a fourth file, and inputting a second preset field of the information pushing request into the fourth file.
In the above scheme, the method further comprises:
and when the request type is a non-offline information pushing request and the first preset field recorded in the first file does not contain the HTTP address, judging whether the first preset field of the third file contains the HTTP address or not, and if so, recording the second preset field of the information pushing request into the fourth file.
In the above scheme, the method further comprises:
when the request type is a non-offline information pushing request, and a first preset field recorded in the first file does not contain the HTTP address and a first preset field of the third file does not contain the HTTP address, judging whether a first preset field recorded in the second file contains the HTTP address or not, and if the first preset field contains the HTTP address, acquiring and analyzing response data returned by the target server;
and when the response data is the second preset threshold, creating a fifth file, and inputting a second preset field of the push information request into the fifth file.
In the foregoing solution, the counting the traffic according to the push information request and the response data includes:
respectively counting the lengths of the first return data, the second return data and the third return data;
respectively counting the data sizes of the fourth file and the fifth file;
and calculating the sum of the first request data length, the second request data length, the third request data length, the first return data length, the second return data length, the third return data length, the data size of the fourth file and the data size of the fifth file to obtain the flow size.
The embodiment of the invention also provides a flow statistic device, which comprises:
an obtaining module, configured to obtain a push information request sent by a target device client, where the push information request includes: the address of the target server and the request type;
the acquisition module is further used for acquiring response data returned by the target server according to the push information request;
and the counting module is used for counting the flow according to the push information request and the response data.
In the foregoing scheme, the obtaining module is specifically configured to:
acquiring an IP address of the terminal equipment and binding the target equipment;
and starting a monitoring program, and monitoring the push information request sent by the client on the target equipment.
In the foregoing scheme, the obtaining module is specifically configured to:
acquiring the IP address of the target server according to the push information request;
connecting the target server and sending the push information request to the target server;
and acquiring response data returned by the target server aiming at different request types according to the request type of the information pushing request.
In the foregoing scheme, the obtaining module is specifically configured to:
judging whether the request type is an offline pre-information pushing request or not, and if the request type is the offline pre-information pushing request, calculating a first request data length of the offline pre-information pushing request; continuously acquiring response data returned by the target server until the push information request before offline is not acquired any more, and counting all the acquired response data to obtain first response data; creating a first file, and inputting a first preset field of the off-line pre-push information into the first file;
if not, judging whether the request type is an offline push information pause request or not, and if so, calculating a second request data length of the offline push information pause request; continuously acquiring response data returned by the target server until the offline pause push information request is not acquired any more, and counting all the acquired response data to obtain second response data; creating a second file, and inputting a first preset field of the offline pause pushing information into the second file;
otherwise, when the request type is not an off-line pre-push information request and an off-line pause push information request, judging whether the request type is an off-line startup diagram push information request, and if the request type is the off-line startup diagram push information request, calculating a third request data length of the off-line startup diagram push information request; continuously acquiring response data returned by the target server until the offline startup diagram pushing information request is not acquired any more, and counting all the acquired response data to obtain third response data; and inputting a first preset field of the off-line startup picture pushing information into the second file.
In the foregoing solution, the obtaining module is further configured to:
when the request type is a non-offline information pushing request, judging whether a first preset field recorded in the first file contains an HTTP (hyper text transport protocol) address of the information pushing request, and if the first preset field contains the HTTP address, acquiring and analyzing response data returned by the target server;
when the response data is a first preset threshold value, creating a third file;
and when the response data is a second preset threshold value, creating a fourth file, and inputting a second preset field of the information pushing request into the fourth file.
In the foregoing solution, the obtaining module is further configured to:
and when the request type is a non-offline information pushing request and the first preset field recorded in the first file does not contain the HTTP address, judging whether the first preset field of the third file contains the HTTP address or not, and if so, recording the second preset field of the information pushing request into the fourth file.
In the foregoing solution, the obtaining module is further configured to:
when the request type is a non-offline information pushing request, and a first preset field recorded in the first file does not contain the HTTP address and a first preset field of the third file does not contain the HTTP address, judging whether a first preset field recorded in the second file contains the HTTP address or not, and if the first preset field contains the HTTP address, acquiring and analyzing response data returned by the target server;
and when the response data is the second preset threshold, creating a fifth file, and inputting a second preset field of the push information request into the fifth file.
In the above scheme, the statistical module is configured to:
respectively counting the lengths of the first return data, the second return data and the third return data;
respectively counting the data sizes of the fourth file and the fifth file;
and calculating the sum of the first request data length, the second request data length, the third request data length, the first return data length, the second return data length, the third return data length, the data size of the fourth file and the data size of the fifth file to obtain the flow size.
The embodiment also provides a traffic statistic system, which includes a client, a server and the traffic statistic apparatus, where the client is configured to send a push information request to the server, and the server is configured to return response data according to the push information request.
The embodiment of the invention provides a traffic statistical method, a device and a system, wherein the method is used for counting the traffic according to a push information request and response data sent by a target equipment client and returned by a target server. The method can automatically count the flow consumed when the client sends various information pushing requests, does not need to manually grab the information requests and response data, greatly reduces the operation complexity of the information pushing flow test, and can be used in combination with the automatic test.
Drawings
Fig. 1 is a schematic flow chart of a first embodiment of a traffic statistical method according to the present invention;
fig. 2 is a schematic flow chart of a second embodiment of the traffic statistic method provided in the present invention;
fig. 3 is a schematic flow chart of a third embodiment of the traffic statistic method provided in the present invention;
fig. 4 is a schematic flow chart of a fourth embodiment of the traffic statistic method provided in the present invention;
fig. 5 is a schematic structural diagram of a first embodiment of a flow rate statistic device provided in the present invention.
Detailed Description
The technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.
The traffic statistical method provided by the embodiment of the invention is suitable for the traffic statistics of the push information in the playing process of the player at the client, for example, the traffic statistics of scenes such as the push information before playing offline, the push information when offline is suspended, the push information of an offline startup diagram and the like at the client.
Fig. 1 is a schematic flow diagram of a first embodiment of a traffic statistic method provided in the present invention, and as shown in fig. 1, an execution subject of this embodiment is a traffic statistic module disposed on a client, or the traffic statistic module may also be disposed on a server, and the method includes:
step 101: acquiring a push information request sent by a target equipment client;
wherein the push information request comprises: the address of the target server and the type of request.
It should be noted that the target device client refers to a player client on the terminal device that needs to be counted, and the target device client is used for sending a push information request; the terminal equipment can be, for example, a personal computer, a mobile phone, an IPad, and the like, and the player includes but is not limited to a youku player, a storm video, and the like; the target server is used for receiving the push information request and carrying out data processing response. The flow statistic module intercepts a push information request sent by a client, wherein the push information request comprises an address of a target server, a request type and other datagram text segments for transmitting request messages, and the like, so that the target server receives the push information request and returns response data.
Step 102: and acquiring response data returned by the target server according to the push information request.
In this step, after intercepting the push information request, the traffic statistics module analyzes and processes the intercepted request information, sends the intercepted request to the target server, and finally respectively obtains response data based on different request types returned by the server according to the request types. Specifically, after catching the information push request, firstly, an object (such as a flag) is created as an identifier, the value is 0, then a loop is established, and data is returned after continuously waiting for the request. If data is returned, the value of flag is set to 1 and all data returned during looping is saved, and if no data is returned, looping is skipped. Thus, all response data returned by the request can be calculated. It should be noted that, in this process, the traffic statistics module also counts data lengths of push information requests of different request types.
Step 103: and counting the flow according to the push information request and the response data.
In this step, the total traffic of the push information request of this time can be obtained according to the previously counted data lengths of the push information requests of different types and the response data length returned by the server.
According to the traffic statistical method, the traffic is counted according to the push information request and the response data by acquiring the push information request sent by the target device client and the response data returned by the target server. The method can automatically count the flow consumed when the client sends various information pushing requests, does not need to manually grab the information requests and response data, greatly reduces the operation complexity of the information pushing flow test, and can be used in combination with the automatic test.
Fig. 2 is a schematic flow chart of a second embodiment of the traffic statistic method provided in the present invention, and as shown in fig. 2, on the basis of the first embodiment, the step 101 of obtaining a push information request sent by a target device client includes:
step 1011: and acquiring the IP address of the terminal equipment and binding the target equipment.
Step 1012: and starting a monitoring program, and monitoring a push information request sent by a client on the target equipment.
The embodiment can bind the target equipment through the IP address of each terminal, thereby effectively monitoring the push information request of the client of the target equipment.
Fig. 3 is a schematic flow chart of a third embodiment of the traffic flow statistical method provided in the present invention, and as shown in fig. 3, on the basis of the first embodiment, step 102 includes:
step 1021: and acquiring the IP address of the target server according to the push information request.
Step 1022: and connecting the target server and sending the push information request to the target server.
Step 1023: and acquiring response data returned by the target server aiming at different request types according to the request type of the information pushing request.
In the embodiment, a flow statistic module intercepts any request sent by a client, analyzes and processes the intercepted request information, and acquires the IP address of a target server; and establishing a socket to be connected to the target server, sending the intercepted request to the target server, and respectively acquiring response data returned by the target server according to different request types.
Further, on the basis of the third embodiment, the step 1023 includes:
judging whether the request type is an offline pre-information pushing request or not, and if the request type is the offline pre-information pushing request, calculating a first request data length of the offline pre-information pushing request; continuously acquiring response data returned by the target server until the push information request before offline is not acquired any more, and counting all the acquired response data to obtain first response data; creating a first file, and inputting a first preset field of the off-line pre-push information into the first file;
if not, judging whether the request type is an offline push information pause request or not, and if so, calculating a second request data length of the offline push information pause request; continuously acquiring response data returned by the target server until the offline pause push information request is not acquired any more, and counting all the acquired response data to obtain second response data; creating a second file, and inputting a first preset field of the offline pause pushing information into the second file;
otherwise, when the request type is not an off-line pre-push information request and an off-line pause push information request, judging whether the request type is an off-line startup diagram push information request, and if the request type is the off-line startup diagram push information request, calculating a third request data length of the off-line startup diagram push information request; continuously acquiring response data returned by the target server until the offline startup diagram pushing information request is not acquired any more, and counting all the acquired response data to obtain third response data; and inputting a first preset field of the off-line startup picture pushing information into the second file.
Further, the method further comprises:
when the request type is a non-offline information pushing request, judging whether a first preset field recorded in the first file contains a hypertext transfer protocol (HTTP) address of the information pushing request, and if the first preset field contains the HTTP address, acquiring and analyzing response data returned by the target server;
when the response data is a first preset threshold value, creating a third file;
and when the response data is a second preset threshold value, creating a fourth file, and inputting a second preset field of the information pushing request into the fourth file.
Further, the method further comprises:
and when the request type is a non-offline information pushing request and the first preset field recorded in the first file does not contain the HTTP address, judging whether the first preset field of the third file contains the HTTP address or not, and if so, recording the second preset field of the information pushing request into the fourth file.
Further, the method further comprises:
when the request type is a non-offline information pushing request, and a first preset field recorded in the first file does not contain the HTTP address and a first preset field of the third file does not contain the HTTP address, judging whether a first preset field recorded in the second file contains the HTTP address or not, and if the first preset field contains the HTTP address, acquiring and analyzing response data returned by the target server;
and when the response data is the second preset threshold, creating a fifth file, and inputting a second preset field of the push information request into the fifth file.
Further, on the basis of the above embodiment, step 103 includes:
respectively counting the lengths of the first return data, the second return data and the third return data;
respectively counting the data sizes of the fourth file and the fifth file;
and calculating the sum of the first request data length, the second request data length, the third request data length, the first return data length, the second return data length, the third return data length, the data size of the fourth file and the data size of the fifth file to obtain the flow size.
Fig. 4 is a schematic flow chart of a fourth embodiment of the traffic statistic method provided in the present invention, as shown in fig. 4, the method includes the following steps:
(1) any request sent by a client is intercepted, the intercepted request information is analyzed and processed, and the ip address of a target server is obtained
(2) Creating socket to connect to target server, sending intercepted request to target server
(3) And (3) judging whether the request is a request for pushing information before off-line while executing the step (2), and if so, calculating the data length of the request for pushing information before off-line. If not, judging whether the request is the request of offline pause push information, and if so, calculating the data length of the request of offline pause push information. If not, judging whether the request is the request of pushing the information by the off-line startup graph, and if so, calculating the data length of the request of pushing the information by the off-line startup graph.
(4) And (3) after catching the information pushing request before offline, firstly, establishing an object (such as a flag) as an identifier with a value of 0, then establishing a cycle, and continuously waiting for the information pushing request and then returning data. The value of flag is set to 1 if data is returned and all data returned on a loop is given to the global variable self.
(5) And (4) after the execution of the step (4) is finished and the loop is skipped, if the value of flag is 1, calculating the number of the returned offline push information, creating RSvideo _ txt and monitorlist _ txt under the root directory of the flow measurement test tool, traversing the RS field value in each offline push information data, and writing the value into RSvideo _ txt. Traversing SUS, SU and SUE field values in each piece of before-offline push information data, and recording the values of the three fields into monitorelist.
(6) Calculating the size of a global variable self after the data is returned by the information pushing request before the offline.
(7) And (3) if the request is judged to be a non-offline information pushing request when the step (3) is executed, judging whether the field value of the RS stored in RSvideo _ txt contains the http address of the request, if so, analyzing the returned data of the request, if the response of the returned data is 302, finding the field value of the location, creating a video _ txt file, and writing the value into the video _ txt file. If the returned data response is 200, creating RSvideo off low.txt, finding a content-length field, and writing the value of the field into RSvideo off low.txt.
(8) And (3) if the request is judged to be neither an offline push information request nor contained in the rsvideo content.
(9) And (3) after the offline information pushing pause request is caught, firstly, establishing an object (such as a flag) as an identifier, wherein the value is 0, then establishing a loop, and continuously waiting for the information pushing request and then returning data. Pause is given to the value of flag if data is returned and all data returned during the loop is given to the global variable self.
(10) And (9) after the execution of the step (9) is finished and the loop is skipped, if the value of the flag is 1, calculating the number of the returned offline pause push information, creating RSpiclistat.txt under the root directory of the flow test tool, traversing the RS field value in each offline pause push information data, writing the value into RSpiclistat.txt, traversing the SUS field value in each offline pause push information data, and recording the field value into monitorelist.txt.
(11) Calculating the size of a global variable self.
(12) And (3) if the request is judged to be a non-offline information pushing request when the step (3) is executed, judging whether the HTTP address of the request is contained in the RS field value stored in the RSpiclistat.
(13) And (3) after the offline startup graph push information request is captured, firstly, creating an object (such as a flag) as an identifier, wherein the value is 0, then establishing a cycle, and continuously waiting for the push information request and then returning data. Set the value of flag to 1 if data is returned and assign all data returned in the loop to the global variable self.
(14) And (13) after the execution of the step (13) is finished and the loop is skipped, if the value of the flag is 1, calculating the number of the off-line startup graph push information returned this time, traversing the RS field value in each off-line startup graph push information data, writing the value into RSpiclistat.
(15) Calculating the size of a global variable self.
Fig. 5 is a schematic structural diagram of a first embodiment of a flow rate statistic device provided in the present invention, and as shown in fig. 5, the device includes:
an obtaining module 11, configured to obtain a push information request sent by a target device client, where the push information request includes: the address of the target server and the request type;
the obtaining module 11 is further configured to obtain response data returned by the target server according to the push information request;
and the counting module 12 is configured to count a traffic according to the push information request and the response data.
Further, the obtaining module 11 is specifically configured to:
acquiring a network protocol IP address of the terminal equipment and binding the target equipment;
and starting a monitoring program, and monitoring the push information request sent by the client on the target equipment.
Further, the obtaining module 11 is specifically configured to:
acquiring the IP address of the target server according to the push information request;
connecting the target server and sending the push information request to the target server;
and acquiring response data returned by the target server aiming at different request types according to the request type of the information pushing request.
Further, the obtaining module 11 is specifically configured to:
judging whether the request type is an offline pre-information pushing request or not, and if the request type is the offline pre-information pushing request, calculating a first request data length of the offline pre-information pushing request; continuously acquiring response data returned by the target server until the push information request before offline is not acquired any more, and counting all the acquired response data to obtain first response data; creating a first file, and inputting a first preset field of the off-line pre-push information into the first file;
if not, judging whether the request type is an offline push information pause request or not, and if so, calculating a second request data length of the offline push information pause request; continuously acquiring response data returned by the target server until the offline pause push information request is not acquired any more, and counting all the acquired response data to obtain second response data; creating a second file, and inputting a first preset field of the offline pause pushing information into the second file;
otherwise, when the request type is not an off-line pre-push information request and an off-line pause push information request, judging whether the request type is an off-line startup diagram push information request, and if the request type is the off-line startup diagram push information request, calculating a third request data length of the off-line startup diagram push information request; continuously acquiring response data returned by the target server until the offline startup diagram pushing information request is not acquired any more, and counting all the acquired response data to obtain third response data; and inputting a first preset field of the off-line startup picture pushing information into the second file.
Further, the obtaining module 11 is further configured to:
when the request type is a non-offline information pushing request, judging whether a first preset field recorded in the first file contains a hypertext transfer protocol (HTTP) address of the information pushing request, and if the first preset field contains the HTTP address, acquiring and analyzing response data returned by the target server;
when the response data is a first preset threshold value, creating a third file;
and when the response data is a second preset threshold value, creating a fourth file, and inputting a second preset field of the information pushing request into the fourth file.
Further, the obtaining module 11 is further configured to:
and when the request type is a non-offline information pushing request and the first preset field recorded in the first file does not contain the HTTP address, judging whether the first preset field of the third file contains the HTTP address or not, and if so, recording the second preset field of the information pushing request into the fourth file.
Further, the obtaining module 11 is further configured to:
when the request type is a non-offline information pushing request, and a first preset field recorded in the first file does not contain the HTTP address and a first preset field of the third file does not contain the HTTP address, judging whether a first preset field recorded in the second file contains the HTTP address or not, and if the first preset field contains the HTTP address, acquiring and analyzing response data returned by the target server;
and when the response data is the second preset threshold, creating a fifth file, and inputting a second preset field of the push information request into the fifth file.
Further, the statistic module 12 is configured to:
respectively counting the lengths of the first return data, the second return data and the third return data;
respectively counting the data sizes of the fourth file and the fifth file;
and calculating the sum of the first request data length, the second request data length, the third request data length, the first return data length, the second return data length, the third return data length, the data size of the fourth file and the data size of the fifth file to obtain the flow size.
The embodiment of the invention also provides a flow statistic system, which comprises a client, a server and the flow statistic device, wherein the client is used for sending a push information request to the server, and the server is used for returning response data according to the push information request.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of a hardware embodiment, a software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above description is only a preferred embodiment of the present invention, and is not intended to limit the scope of the present invention.

Claims (17)

1. A method of traffic statistics, the method comprising:
the method comprises the steps of obtaining a push information request sent by a target equipment client, wherein the push information request comprises: the method comprises the steps of obtaining an address of a target server and a request type, wherein the request type comprises one or more of off-line pre-push information, off-line pause push information and off-line startup graph push information;
acquiring response data returned by the target server according to the push information request;
counting the flow according to the push information request and the response data;
wherein, acquiring the response data returned by the target server according to the push information request comprises:
and acquiring response data returned by the target server aiming at different request types according to the request type of the information pushing request.
2. The method of claim 1, wherein the obtaining the push information request sent by the target device client comprises:
acquiring a network protocol IP address of the terminal equipment and binding the target equipment;
and starting a monitoring program, and monitoring the push information request sent by the client on the target equipment.
3. The method of claim 1, wherein the obtaining response data returned by the target server according to the push information request further comprises:
acquiring the IP address of the target server according to the push information request;
and connecting the target server and sending the push information request to the target server.
4. The method according to claim 1, wherein the obtaining response data returned by the target server for different request types according to the request type of the push information request comprises:
judging whether the request type is an offline pre-information pushing request or not, and if the request type is the offline pre-information pushing request, calculating a first request data length of the offline pre-information pushing request; continuously acquiring response data returned by the target server until the push information request before offline is not acquired any more, and counting all the acquired response data to obtain first response data; creating a first file, and inputting a first preset field of the off-line pre-push information into the first file;
if not, judging whether the request type is an offline push information pause request or not, and if so, calculating a second request data length of the offline push information pause request; continuously acquiring response data returned by the target server until the offline pause push information request is not acquired any more, and counting all the acquired response data to obtain second response data; creating a second file, and inputting a first preset field of the offline pause pushing information into the second file;
otherwise, when the request type is not an off-line pre-push information request and an off-line pause push information request, judging whether the request type is an off-line startup diagram push information request, and if the request type is the off-line startup diagram push information request, calculating a third request data length of the off-line startup diagram push information request; continuously acquiring response data returned by the target server until the offline startup diagram pushing information request is not acquired any more, and counting all the acquired response data to obtain third response data; and inputting a first preset field of the off-line startup picture pushing information into the second file.
5. The method of claim 4, further comprising:
when the request type is a non-offline information pushing request, judging whether a first preset field recorded in the first file contains a hypertext transfer protocol (HTTP) address of the information pushing request, and if the first preset field contains the HTTP address, acquiring and analyzing response data returned by the target server;
when the response data is a first preset threshold value, creating a third file;
and when the response data is a second preset threshold value, creating a fourth file, and inputting a second preset field of the information pushing request into the fourth file.
6. The method of claim 5, further comprising:
and when the request type is a non-offline information pushing request and the first preset field recorded in the first file does not contain the HTTP address, judging whether the first preset field of the third file contains the HTTP address or not, and if so, recording the second preset field of the information pushing request into the fourth file.
7. The method of claim 6, further comprising:
when the request type is a non-offline information pushing request, and a first preset field recorded in the first file does not contain the HTTP address and a first preset field of the third file does not contain the HTTP address, judging whether a first preset field recorded in the second file contains the HTTP address or not, and if the first preset field contains the HTTP address, acquiring and analyzing response data returned by the target server;
and when the response data is the second preset threshold, creating a fifth file, and inputting a second preset field of the push information request into the fifth file.
8. The method of claim 7, wherein the counting traffic sizes according to the push information request and the response data comprises:
respectively counting the lengths of the first response data, the second response data and the third response data;
respectively counting the data sizes of the fourth file and the fifth file;
and calculating the sum of the first request data length, the second request data length, the third request data length, the first response data length, the second response data length, the third response data length, the data size of the fourth file and the data size of the fifth file to obtain the flow size.
9. A flow statistic device, said device comprising:
an obtaining module, configured to obtain a push information request sent by a target device client, where the push information request includes: the method comprises the steps of obtaining an address of a target server and a request type, wherein the request type comprises one or more of off-line pre-push information, off-line pause push information and off-line startup graph push information;
the acquisition module is further used for acquiring response data returned by the target server according to the push information request;
the statistic module is used for counting the flow according to the push information request and the response data;
the obtaining module is specifically configured to obtain, according to the request type of the push information request, response data returned by the target server for different request types.
10. The apparatus of claim 9, wherein the obtaining module is specifically configured to:
acquiring a network protocol IP address of the terminal equipment and binding the target equipment;
and starting a monitoring program, and monitoring the push information request sent by the client on the target equipment.
11. The apparatus of claim 9, wherein the obtaining module is further specifically configured to:
acquiring the IP address of the target server according to the push information request;
and connecting the target server and sending the push information request to the target server.
12. The apparatus of claim 9, wherein the obtaining module is specifically configured to:
judging whether the request type is an offline pre-information pushing request or not, and if the request type is the offline pre-information pushing request, calculating a first request data length of the offline pre-information pushing request; continuously acquiring response data returned by the target server until the push information request before offline is not acquired any more, and counting all the acquired response data to obtain first response data; creating a first file, and inputting a first preset field of the off-line pre-push information into the first file;
if not, judging whether the request type is an offline push information pause request or not, and if so, calculating a second request data length of the offline push information pause request; continuously acquiring response data returned by the target server until the offline pause push information request is not acquired any more, and counting all the acquired response data to obtain second response data; creating a second file, and inputting a first preset field of the offline pause pushing information into the second file;
otherwise, when the request type is not an off-line pre-push information request and an off-line pause push information request, judging whether the request type is an off-line startup diagram push information request, and if the request type is the off-line startup diagram push information request, calculating a third request data length of the off-line startup diagram push information request; continuously acquiring response data returned by the target server until the offline startup diagram pushing information request is not acquired any more, and counting all the acquired response data to obtain third response data; and inputting a first preset field of the off-line startup picture pushing information into the second file.
13. The apparatus of claim 12, wherein the obtaining module is further configured to:
when the request type is a non-offline information pushing request, judging whether a first preset field recorded in the first file contains a hypertext transfer protocol (HTTP) address of the information pushing request, and if the first preset field contains the HTTP address, acquiring and analyzing response data returned by the target server;
when the response data is a first preset threshold value, creating a third file;
and when the response data is a second preset threshold value, creating a fourth file, and inputting a second preset field of the information pushing request into the fourth file.
14. The apparatus of claim 13, wherein the obtaining module is further configured to:
and when the request type is a non-offline information pushing request and the first preset field recorded in the first file does not contain the HTTP address, judging whether the first preset field of the third file contains the HTTP address or not, and if so, recording the second preset field of the information pushing request into the fourth file.
15. The apparatus of claim 14, wherein the obtaining module is further configured to:
when the request type is a non-offline information pushing request, and a first preset field recorded in the first file does not contain the HTTP address and a first preset field of the third file does not contain the HTTP address, judging whether a first preset field recorded in the second file contains the HTTP address or not, and if the first preset field contains the HTTP address, acquiring and analyzing response data returned by the target server;
and when the response data is the second preset threshold, creating a fifth file, and inputting a second preset field of the push information request into the fifth file.
16. The apparatus of claim 15, wherein the statistics module is configured to:
respectively counting the lengths of the first response data, the second response data and the third response data;
respectively counting the data sizes of the fourth file and the fifth file;
and calculating the sum of the first request data length, the second request data length, the third request data length, the first response data length, the second response data length, the third response data length, the data size of the fourth file and the data size of the fifth file to obtain the flow size.
17. A traffic statistic system, comprising a client, a server and the traffic statistic device of any one of claims 9-16, wherein the client is configured to send a push information request to the server, and the server is configured to return response data according to the push information request.
CN201610753692.6A 2016-08-29 2016-08-29 Flow statistical method, device and system Expired - Fee Related CN106330548B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610753692.6A CN106330548B (en) 2016-08-29 2016-08-29 Flow statistical method, device and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610753692.6A CN106330548B (en) 2016-08-29 2016-08-29 Flow statistical method, device and system

Publications (2)

Publication Number Publication Date
CN106330548A CN106330548A (en) 2017-01-11
CN106330548B true CN106330548B (en) 2019-12-31

Family

ID=57789992

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610753692.6A Expired - Fee Related CN106330548B (en) 2016-08-29 2016-08-29 Flow statistical method, device and system

Country Status (1)

Country Link
CN (1) CN106330548B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108512711B (en) * 2017-02-24 2021-07-13 阿里巴巴(中国)有限公司 Method, device and equipment for obtaining instantaneous interface access statistic

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105281981A (en) * 2015-11-04 2016-01-27 北京百度网讯科技有限公司 Data traffic monitoring method and device for network service
CN105577462A (en) * 2014-10-10 2016-05-11 阿里巴巴集团控股有限公司 Mobile device flow statistical method and device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105577462A (en) * 2014-10-10 2016-05-11 阿里巴巴集团控股有限公司 Mobile device flow statistical method and device
CN105281981A (en) * 2015-11-04 2016-01-27 北京百度网讯科技有限公司 Data traffic monitoring method and device for network service

Also Published As

Publication number Publication date
CN106330548A (en) 2017-01-11

Similar Documents

Publication Publication Date Title
EP3386150A1 (en) Terminal failure processing method, device and system
US9774642B2 (en) Method and device for pushing multimedia resource and display terminal
CN110351198B (en) Flow regulation method, data transmission system, storage medium and equipment
US20100095370A1 (en) Selective packet capturing method and apparatus using kernel probe
CN108900374B (en) Data processing method and device applied to DPI equipment
US9276819B2 (en) Network traffic monitoring
CN105357475A (en) Video playing method and device
CN106791957B (en) Video live broadcast processing method and device
WO2014121630A1 (en) Method and device for transferring file
CN104735473A (en) Video stream playing detection method and device
CN108229159B (en) Malicious code detection method and system
CN106844532B (en) Application program acquisition method and device and terminal equipment
WO2015154549A1 (en) Data processing method and device
CN111049781A (en) Detection method, device, equipment and storage medium for rebound network attack
CN107493486B (en) Method, system and terminal equipment for video playing termination
CN105338564A (en) Client adaption method, server and system, and client
CN106330548B (en) Flow statistical method, device and system
CN109194706B (en) Network resource dial testing method and terminal
CN108833961B (en) Method, server and system for acquiring flight record data
CN109120468B (en) Method, device and storage medium for obtaining end-to-end network delay
CN107239473A (en) A kind of exhibiting pictures system of selection and device
EP3264851A1 (en) Data transmission method and device for data service
WO2014062103A1 (en) Method, network device, computer program and computer program product for determining a set of power state parameters
CN109120541B (en) Method, device, terminal equipment and storage medium for limiting network speed
CN113596325B (en) Method and device for capturing images, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Address after: 100080 A 5 C, block A, China International Steel Plaza, 8 Haidian Avenue, Haidian District, Beijing.

Applicant after: Youku network technology (Beijing) Co., Ltd.

Address before: 100080 A 5 C, block A, China International Steel Plaza, 8 Haidian Avenue, Haidian District, Beijing.

Applicant before: 1Verge Inc.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20200507

Address after: 310052 room 508, floor 5, building 4, No. 699, Wangshang Road, Changhe street, Binjiang District, Hangzhou City, Zhejiang Province

Patentee after: Alibaba (China) Co.,Ltd.

Address before: 100080 Beijing Haidian District city Haidian street A Sinosteel International Plaza No. 8 block 5 layer A, C

Patentee before: Youku network technology (Beijing) Co., Ltd

TR01 Transfer of patent right
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20191231

Termination date: 20200829

CF01 Termination of patent right due to non-payment of annual fee