Summary of the invention
The embodiment of the invention provides a kind of flow statistical method, system and acting server, is used on the statistics terminal each and moves and use the flow that expends and timely reminding user, makes things convenient for the user to carry out terminal applies and manages, and makes the user obtain better experience.
One aspect of the present invention has proposed a kind of flow statistical method, may further comprise the steps: the access request that the acting server receiving terminal sends, and this access request comprises the letter of attorment relevant information; Acting server is according to the visit data of the terminal of letter of attorment monitoring access; Acting server is according to the flow of the terminal of the visit data statistics access of monitoring.Adopt this technical scheme, can add up respectively that the flow of each software expends on the terminal, promote the user and experience.
In the technique scheme, preferably, the access request that described acting server receiving terminal sends, this access request comprise and also comprise step before the step of letter of attorment relevant information: the Information generation letter of attorment that acting server provides according to terminal also is sent to described terminal with the reference address of described letter of attorment.Adopt this technical scheme, acting server generates corresponding letter of attorment for each terminal, effectively the network access request of office terminal and carry out traffic statistics.
In the technique scheme, preferred, described letter of attorment have can the described terminal of unique identification agent address and port.In this technical scheme, acting server is when assignment agent address and port, for each terminal distribution unique agent address and port, the network request of each terminal can be finished by this port, the all-network request that counts at this port so, just can think the network request that this terminal is sent, like this so that network flow statistic is more convenient.
In the technique scheme, preferred, acting server further comprises according to the step of the flow of the terminal of the visit data statistics access of monitoring: acting server is determined the software of transmission visit data according to the characteristic value in the visit data; Acting server carries out traffic statistics for the software of determining.In this technical scheme, by the characteristic value acquisition network access request of phase-split network request and the corresponding relation between the application software, just can add up the flow of each software, promote the user and experience.
In the technique scheme, preferred, also comprise after the step of described acting server according to the flow of the terminal of the visit data statistics access of monitoring: described acting server sends to described terminal with described traffic statistics data.In this technical scheme, terminal can access the traffic statistics data of each software on the terminal that acting server counts on, and makes things convenient for the better network application software of management oneself of user.
Another aspect of the present invention also provides a kind of flow statistic device, comprises receiver module, monitoring module and statistical module, wherein, described receiver module is used for the access request that the acting server receiving terminal sends, and this access request comprises the letter of attorment relevant information; Described monitoring module is used for acting server according to the visit data of the terminal of letter of attorment monitoring access; Described statistical module is used for acting server according to the flow of the terminal of the visit data statistics access of monitoring.
In the technique scheme, preferred, also comprise the letter of attorment generation module, be used for Information generation letter of attorment that acting server provides according to terminal and the reference address of described letter of attorment is sent to described terminal.
In the technique scheme, preferred, described letter of attorment have can the described terminal of unique identification agent address and port.
In the technique scheme, preferred, described access module is further used for, and acting server is determined the software of transmission visit data according to the characteristic value in the visit data; Acting server carries out traffic statistics for the software of determining.
In the technique scheme, preferred, also comprise sending module, be used for acting server described traffic statistics data are sent to described terminal.
Another aspect of the present invention has proposed a kind of acting server, is used for the terminal traffic statistics, comprises flow statistic device arbitrary in the technique scheme.
Other features and advantages of the present invention will be set forth in the following description, and, partly from specification, become apparent, perhaps understand by implementing the present invention.Purpose of the present invention and other advantages can realize and obtain by specifically noted structure in the specification of writing, claims and accompanying drawing.
Below by drawings and Examples, technical scheme of the present invention is described in further detail.
Embodiment
Below in conjunction with accompanying drawing the preferred embodiments of the present invention are described, should be appreciated that preferred embodiment described herein only is used for description and interpretation the present invention, is not intended to limit the present invention.
As shown in Figure 1, the flow chart for flow statistical method of the present invention may further comprise the steps:
The access request that step 101, acting server receiving terminal send, this access request comprises the letter of attorment relevant information;
The visit data of step 102, the acting server terminal that monitoring accesses according to letter of attorment;
Step 103, acting server are added up the flow of the terminal of access according to the visit data of monitoring.
Adopt this technical scheme, can add up respectively that the flow of each software expends on the terminal, promote the user and experience.
As shown in Figure 2, the detail flowchart for flow statistical method of the present invention may further comprise the steps:
Step 201, terminal are to acting server apply for agency certificate;
Each terminal needed the apply for agency certificate before carrying out access to netwoks by acting server for the first time, obtain can use after the letter of attorment always.
Step 202, acting server also return to terminal to the reference address of letter of attorment according to the letter of attorment of this terminal of Information generation that terminal provides;
This letter of attorment comprise can this user of unique identification agent address and port, network agent certificate is installed in this address of terminal access, this letter of attorment is installed after, the network request that terminal is sent is all finished with agent way by acting server.Acting server is when assignment agent address and port, for each terminal distribution unique agent address and port, the network request of each terminal can be finished by this port, the all-network request that counts at this port so, just can think the network request that this terminal is sent, like this so that network flow statistic is more convenient.
Step 203, the network application server that acting server is extremely corresponding with the network access request data retransmission of described terminal transmission according to the port of described letter of attorment;
Step 204, acting server determine to send the software of network access request according to the characteristic value of described network access request data;
Step 205, acting server receive and transmit the response data of described network application server;
Step 206, acting server obtain the traffic statistics data of described software according to described network access request data and response data.
In real work, acting server can be read the User-Agent value in the HTTP request header after receiving user HTTP request, and this User-Agent value can be distinguished HTTP request source.The value of User-Agent was in for example HTTP asked in the packet daily record on the acting server: QQ/2.0.0.1808 CFNetwork/548.1.4 Darwin/11.0.0.Based on the method, acting server can be analyzed the network packet of various application software, and the User-Agent of logging software network request counts User-Agent corresponding to various softwares.And the corresponding relation of software and User-Agent is recorded in the data processing module on the acting server.For example, the network request daily record User-Agent of the qq of Tengxun software is QQ/2.0.0.1808 CFNetwork/548.1.4 Darwin/11.0.0 on the iphone terminal, and wherein 2.0.0 is the version number of QQ.The User-Agent of a software normally fixes, therefore, we can determine that the User-Agent of the upper mobile phone QQ of iphone is QQ/x.x.x....., wherein x.x.x is version number, ... expression cell phone system version identifier, and can determine that thus the network packet with this signature identification all is that this QQ software produces, in like manner, acting server can identify by same method the network traffics that all main flow softwares produce on the market.
Those skilled in the art can understand; it is above-mentioned that to come software corresponding to network data package by the User-Agent value only be a kind of concrete solution; adopt the analysis of other data segments also can obtain this result; therefore; foregoing description can not be as restriction technical characterictic of the present invention, and any technical scheme of utilizing the packet characteristic value to carry out this kind analysis all should fall within protection scope of the present invention.
In this technical scheme, by the characteristic value acquisition network access request of phase-split network request and the corresponding relation between the application software, just can add up the flow of each software, promote the user and experience.
As a kind of preferred technical scheme, acting server obtains according to network access request data and response data can also comprising step after the step of traffic statistics data of described terminal: acting server sends to described terminal with the traffic statistics data.In this technical scheme, terminal can access the traffic statistics data of each software on the terminal that acting server counts on, and makes things convenient for the better network application software of management oneself of user.
As shown in Figure 3, be the embodiment of flow statistic device of the present invention, comprisereceiver module 301,monitoring module 302 and statistical module 303.Receiver module 301 is used for the access request that the acting server receiving terminal sends, and this access request comprises the letter of attorment relevant information;Monitoring module 302 is used for acting server according to the visit data of the terminal of letter of attorment monitoring access;Statistical module 303 is used for acting server according to the flow of the terminal of the visit data statistics access of monitoring.
In this device, can also comprise the letter of attorment generation module, the Information generation letter of attorment that provides according to terminal also is sent to terminal with the reference address of letter of attorment; Acting server obtains the traffic statistics data of described each software of terminal according to the network access data of the terminal of installation agent certificate.
In addition, can also data compression device be set at acting server, be used for the response data of network application server is carried out necessary compression, in order to be terminal saving flow.
The below specifies the operation principle of this system as an example of the iOS system example.
When the embedded softwares such as the third party software on the terminal or Safari, Appstore sent the HTTP network request by the iOS system, because letter of attorment has been installed, the iOS system can access proxies.Behind the network request of receiving the iOS system, acting server can forward the request to network application server, and after the request of receiving forwarding, network application server can return response data to acting server.After receiving the response data of network application server, acting server is carrying out again this response data being returned to the iOS system after the necessary data compression, and the iOS system returns to data the software that sends HTTP.
In above-mentioned network interaction process, solicited message, response message and the data compression information of flow statistic device meeting detail record HTTP network interaction.Because each user's proxy server address and port are different, network request data of a corresponding user only of a port on the acting server so, whole HTTP network interaction log recordings is the whole HTTP network interaction record of this user on this port.
Receivingsystem 301 can regularly be added up the whole log recordings on all of the port, and these log recordings have comprised whole HTTP network interaction daily record of all users and the compressed information of each HTTP network interaction.As described in front installation agent certificate process and software flow Statistics, flow statistic device is distinguished the user according to port, then counts whole log recordings of each user.According to the time of HTTP network interaction daily record, can count whole HTTP network interaction daily record in each each month of user.Owing to can distinguish according to the User-Agent in the daily record of HTTP network interaction network request source, flow statistic device can count the HTTP network traffics that expend in of that month each network request source of each user and the uninterrupted of compression.
Supervising device 302 obtains the User-Agent of all main flow cell phone softwares on the market according to aforesaid test mode, and sets up a dbase, the icon picture that software is corresponding and User-Agent mappingtable.Supervising device 302 can read each user HTTP network total amount that each User-Agent expends every month and the uninterrupted of compression fromstatistic device 303, then according to dbase and User-Agent mapping table,supervising device 302 can obtain cell phone software title corresponding to User-Agent and cell phone software icon picture, thereby analyzes the flow of each user's flow that each cell phone software expends in every month and compression.
Client can be to the statistic device data on flows information in 303 these specific months of mobile phone of request, after receiving the data on flows information that data processing module returns, client can show HTTP network traffics that each software expends and the uninterrupted of saving to the user.
Those skilled in the art should understand that embodiments of the invention can be provided as method, system or computer program.Therefore, the present invention can adopt complete hardware implementation example, complete implement software example or in conjunction with the form of the embodiment of software and hardware aspect.And the present invention can adopt the form of the computer program of implementing in one or more computer-usable storage medium (including but not limited to magnetic disc store and optical memory etc.) that wherein include computer usable program code.
The present invention is that reference is described according to flow chart and/or the block diagram of method, equipment (system) and the computer program of the embodiment of the invention.Should understand can be by the flow process in each flow process in computer program instructions realization flow figure and/or the block diagram and/or square frame and flow chart and/or the block diagram and/or the combination of square frame.Can provide these computer program instructions to the processor of all-purpose computer, special-purpose computer, Embedded Processor or other programmable data processing device producing a machine, so that the instruction of carrying out by the processor of computer or other programmable data processing device produces the device of the function that is used for being implemented in flow process of flow chart or a plurality of flow process and/or square frame of block diagram or a plurality of square frame appointments.
These computer program instructions also can be stored in energy vectoring computer or the computer-readable memory of other programmable data processing device with ad hoc fashion work, so that the instruction that is stored in this computer-readable memory produces the manufacture that comprises command device, this command device is implemented in the function of appointment in flow process of flow chart or a plurality of flow process and/or square frame of block diagram or a plurality of square frame.
These computer program instructions also can be loaded on computer or other programmable data processing device, so that carry out the sequence of operations step producing computer implemented processing at computer or other programmable devices, thereby be provided for being implemented in the step of the function of appointment in flow process of flow chart or a plurality of flow process and/or square frame of block diagram or a plurality of square frame in the instruction that computer or other programmable devices are carried out.
Obviously, those skilled in the art can carry out various changes and modification to the present invention and not break away from the spirit and scope of the present invention.Like this, if of the present invention these are revised and modification belongs within the scope of claim of the present invention and equivalent technologies thereof, then the present invention also is intended to comprise these changes and modification interior.