CN106230662B - Network flux statistical method and device - Google Patents

Network flux statistical method and device Download PDF

Info

Publication number
CN106230662B
CN106230662B CN201610622084.1A CN201610622084A CN106230662B CN 106230662 B CN106230662 B CN 106230662B CN 201610622084 A CN201610622084 A CN 201610622084A CN 106230662 B CN106230662 B CN 106230662B
Authority
CN
China
Prior art keywords
application program
flow
user identity
network
identity information
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.)
Active
Application number
CN201610622084.1A
Other languages
Chinese (zh)
Other versions
CN106230662A (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.)
Beijing Xiaomi Mobile Software Co Ltd
Original Assignee
Beijing Xiaomi Mobile Software 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 Beijing Xiaomi Mobile Software Co Ltd filed Critical Beijing Xiaomi Mobile Software Co Ltd
Priority to CN201610622084.1A priority Critical patent/CN106230662B/en
Publication of CN106230662A publication Critical patent/CN106230662A/en
Application granted granted Critical
Publication of CN106230662B publication Critical patent/CN106230662B/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

Abstract

The disclosure is directed to a kind of network flux statistical method and devices, wherein method includes: to obtain all socket filec descriptors that second application program creates during accessing network when the first application program accesses network by the second application program;Obtain the corresponding first User Identity information of first application program;Use all socket filec descriptors described in the first User Identity information flag;According to all socket filec descriptors after label, first application program used flow during accessing network is determined.Pass through the technical solution, so that it may the first application program used flow during accessing network is determined, to avoid all flows accessed in network development process all counting on the second application program under one's name, so that traffic statistics are finer and accurate.

Description

Network flux statistical method and device
Technical field
This disclosure relates to traffic statistics technical field more particularly to a kind of network flux statistical method and device.
Background technique
It will appear many single application APPs in android system and provide network service for other applications Situation, such as system downloading program, the channel PUSH etc..The network flow generated in this case can all count on network flow On the APP really occurred.Cause such APP that can accumulate many flows in this way, and the respective stream of requestor can not be accurately distinguished Measure Expenditure Levels.
In order to solve the above-mentioned technical problem, existing technical solution is to generate the APP of network request by recording request APP Information, differentiation record the flow that each APP is consumed by oneself.It is provided to modules inquiry, the stream that oneself is generated Amount is consumed to which APP.
This mode is not official's support pattern of android system, the flow inquiry mode that android system provides without The subdivided data that flow undertakes APP record is merged into initial data by method, and when third-party application is inquired or flow undertakes APP consumes all flows.
Summary of the invention
The embodiment of the present disclosure provides a kind of network flux statistical method and device, including following technical solution:
According to the first aspect of the embodiments of the present disclosure, a kind of network flux statistical method is provided, comprising:
When the first application program accesses network by the second application program, second application program is obtained in access net All socket filec descriptors created during network;
Obtain the corresponding first User Identity information of first application program;
Use all socket filec descriptors described in the first User Identity information flag;
According to all socket filec descriptors after label, determine first application program in the process of access network Used in flow.
In one embodiment, the method also includes:
The determining flow is saved in the statistical information data file of operating system support;
When receiving first flow querying command, the flow is obtained from the statistical information data file.
In one embodiment, the method also includes:
Receive first application program within a preset period of time used in flow total amount querying command;
According to the querying command, from being saved in acquisition preset time period in the statistical information data file about institute State all flow informations of the first application program;
All flow informations are counted, to obtain the flow total amount.
In one embodiment, described to obtain the corresponding first User Identity information of first application program, packet It includes:
The first User Identity information is obtained from the corresponding process of first application program.
In one embodiment, described to use all socket files described in the first User Identity information flag Descriptor, comprising:
The corresponding second user identity letter of the second application program is obtained from all socket filec descriptors Breath;
Use the second user in all socket filec descriptors described in the first User Identity information substitution Identification information.
According to the second aspect of an embodiment of the present disclosure, a kind of network flow statistic device is provided, comprising:
First obtains module, for obtaining described the when the first application program accesses network by the second application program All socket filec descriptors that two application programs create during accessing network;
Second obtains module, obtains the corresponding first User Identity information of first application program;
Mark module, for being described using all socket files described in the first User Identity information flag Symbol;
Determining module, for determining that first application program exists according to all socket filec descriptors after label Used flow during access network.
In one embodiment, described device further include:
Memory module, for the flow determined to be saved in the statistical information data file of operating system support;
Third obtains module, for when receiving first flow querying command, from the statistical information data file Obtain the flow.
In one embodiment, described device further include:
Receiving module, for receive first application program within a preset period of time used in flow total amount inquiry Order;
4th obtains module, when presetting for being obtained from the statistical information data file according to the querying command Between all flow informations about first application program for saving in section;
Statistical module, for being counted to all flow informations, to obtain the flow total amount.
In one embodiment, the second acquisition module is used for:
The first User Identity information is obtained from the corresponding process of first application program.
In one embodiment, the mark module includes:
Acquisition submodule, for obtaining the second application program corresponding second from all socket filec descriptors User Identity information;
Submodule is substituted, for describing using all socket files described in the first User Identity information substitution Second user identification information in symbol.
According to the third aspect of an embodiment of the present disclosure, a kind of network flow statistic device is provided, comprising:
Processor;
Memory for storage processor executable instruction;
Wherein, the processor is configured to:
When the first application program accesses network by the second application program, second application program is obtained in access net All socket filec descriptors created during network;
Obtain the corresponding first User Identity information of first application program;
Use all socket filec descriptors described in the first User Identity information flag;
According to all socket filec descriptors after label, determine first application program in the process of access network Used in flow.
The technical scheme provided by this disclosed embodiment can include the following benefits:
Above-mentioned technical proposal, when the first application program accesses network by the second application program, that is, what is requested access to answers When undertaking application program access network by network with program, the corresponding first user identity mark of the first application program can be used All socket filec descriptors that information flag creates in access network development process are known, in this manner it is possible to determine the first application Program used flow during accessing network, to avoid all counting on all flows accessed in network development process Second application program under one's name so that traffic statistics are finer and accurate.
It should be understood that above general description and following detailed description be only it is exemplary and explanatory, not The disclosure can be limited.
Detailed description of the invention
The drawings herein are incorporated into the specification and forms part of this specification, and shows the implementation for meeting the disclosure Example, and together with specification for explaining the principles of this disclosure.
Fig. 1 is a kind of flow chart of network flux statistical method shown according to an exemplary embodiment.
Fig. 2 is the flow chart of another network flux statistical method shown according to an exemplary embodiment.
Fig. 3 is the flow chart of another network flux statistical method shown according to an exemplary embodiment.
Fig. 4 is the flow chart of another network flux statistical method shown according to an exemplary embodiment.
Fig. 5 is the flow chart of step S103 in a kind of network flux statistical method shown according to an exemplary embodiment.
Fig. 6 is a kind of block diagram of network flow statistic device shown according to an exemplary embodiment.
Fig. 7 is the block diagram of another network flow statistic device shown according to an exemplary embodiment.
Fig. 8 is the block diagram of another network flow statistic device shown according to an exemplary embodiment.
Fig. 9 is the block diagram of mark module in a kind of network flow statistic device shown according to an exemplary embodiment.
Figure 10 is a kind of block diagram for network flow statistic device shown according to an exemplary embodiment.
Specific embodiment
Example embodiments are described in detail here, and the example is illustrated in the accompanying drawings.Following description is related to When attached drawing, unless otherwise indicated, the same numbers in different drawings indicate the same or similar elements.Following exemplary embodiment Described in embodiment do not represent all implementations consistent with this disclosure.On the contrary, they be only with it is such as appended The example of the consistent device and method of some aspects be described in detail in claims, the disclosure.
One is owned by Android operation system each application APP or shares one with other applications A User Identity UID.Android operation system records flow so that UID is mark.In APP operational process, APP Process can carry oneself UID information.All processes require one socket FD of creation when generating network request, And network is accessed by socket system call request kernel.In the related technology, system kernel will record request network into The UID of journey, then network flow caused by the socket FD this process creation all counts on this UID.At this point, If the first application program accesses network by the second application program, the flow generated in network development process is accessed all and can count on the Two application programs are under one's name.Pass through third party application and can not find out what the first application program generated in access network development process Flow.
In order to solve the above-mentioned technical problem, the embodiment of the present disclosure provides a kind of network flux statistical method, and this method can For in terminal device, such as mobile phone, computer, digital broadcasting terminal, messaging device, game console, plate set It is standby, Medical Devices, body-building equipment, personal digital assistant etc..
Fig. 1 is a kind of flow chart of network flux statistical method shown according to an exemplary embodiment.
As shown in Figure 1, the network flux statistical method includes step S101-S104:
In step s101, it when the first application program accesses network by the second application program, obtains second and applies journey All socket filec descriptors that sequence creates during accessing network;
When the first application program accesses network by the second application program, in the second application program operational process, the The process of two application programs can carry the User Identity information of oneself, and all processes require to create when generating network Socket filec descriptor, and network is accessed by socket system call request kernel, i.e., all socket file descriptions Symbol should be identified using the corresponding second user identification information of the second application program.
In step s 102, the corresponding first User Identity information of the first application program is obtained;
In step s 103, using all socket filec descriptors of the first User Identity information flag;
The corresponding first User Identity information of the first application program is obtained, and uses the first User Identity information All socket filec descriptors that the first application program of label creates during accessing network by the second application program, In this way, the flow generated in the process can count on corresponding first application program of the first User Identity information Under one's name, to realize the reasonable flow distribution of operating system bottom, to avoid to access all flows in network development process all The second application program is counted under one's name, so that traffic statistics are finer and accurate.
In step S104, according to all socket filec descriptors after label, determine that the first application program is accessing Used flow during network.
It is available in access network when determining the first application program used flow during accessing network During, the label of all generations has the target socket filec descriptor of User Identity information, and then basis These targets socket filec descriptor counts the first application program flow used in access network development process.
In this embodiment, when the first application program accesses network by the second application program, that is, what is requested access to answers When undertaking application program access network by network with program, the corresponding first user identity mark of the first application program can be used All socket filec descriptors that information flag creates in access network development process are known, in this manner it is possible to determine the first application Program used flow during accessing network, to avoid all counting on all flows accessed in network development process Second application program under one's name so that traffic statistics are finer and accurate.
For example, when certain shopping application program accesses network by browser application, in shopping application routine access net During network, all processes can all create socket filec descriptor when generating network, and when carrying out traffic statistics, It is to be counted according to the User Identity information identified on these socket filec descriptors, in the present embodiment, obtains The User Identity information of shopping application program is taken, and is accessed using the User Identity information flag of shopping application program The socket filec descriptor created in network development process, in this way, when carrying out traffic statistics, so that it may count shopping application program Used flow, without all flows generated during this are all counted on browser under one's name, so that flow Statistics is finer and accurate.
Fig. 2 is the flow chart of another network flux statistical method shown according to an exemplary embodiment.
As shown in Fig. 2, in one embodiment, the above method further includes step S201-S202:
In step s 201, determining flow is saved in the statistical information data file of operating system support;
In step S202, when receiving first flow querying command, flow is obtained from statistical information data file.
In this embodiment, the flow of the first determining application program is saved in the statistical information number of operating system support According in file, in this way, third party application can be segmented when inquiry after data on flows so that traffic statistics are more It is fine and accurate.
Fig. 3 is the flow chart of another network flux statistical method shown according to an exemplary embodiment.
As shown in figure 3, in one embodiment, the above method further includes step S301-S303:
In step S301, receive the first application program within a preset period of time used in flow total amount inquiry life It enables;
User can inquire the first application program used stream within a preset period of time with input flow rate total amount querying command Total amount is measured, as inquired the flow total amount that the first application program uses in a week.
In step s 302, according to querying command, from what is saved in acquisition preset time period in statistical information data file All flow informations about the first application program;
When receiving querying command, flow can be counted according to time conditions, as counted in preset time period, All flows used in first application program.Wherein, when user or manufacturer can arbitrarily be arranged default according to individual demand Between section, to meet the different flow statistical demand of different different users.
In step S303, all flow informations are counted, to obtain flow total amount.
In this embodiment, when the first application program accesses network by the second application program, i.e. request applications When undertaking application program access network by network, request applications used flow in the process can be counted, i.e., Traffic statistics can be finely divided, so that user be facilitated to know flow caused by request applications, promote making for user With experience.
Fig. 4 is the flow chart of another network flux statistical method shown according to an exemplary embodiment.
As shown in figure 4, in one embodiment, above-mentioned steps S102 includes step S401:
In step S401, the first User Identity information is obtained from the corresponding process of the first application program.
It in this embodiment, can include the first User Identity information in the corresponding process of the first application program, because This, can obtain the first User Identity information in these processes, in this manner it is ensured that the first User Identity information Accuracy.
Fig. 5 is the flow chart of step S103 in a kind of network flux statistical method shown according to an exemplary embodiment.
As shown in figure 5, in one embodiment, above-mentioned steps S103 includes step S501-S502:
In step S501, the corresponding second user body of the second application program is obtained from all socket filec descriptors Part identification information;
When the first application program accesses network by the second application program, in the second application program operational process, the The process of two application programs can carry the User Identity information of oneself, and all processes require to create when generating network Socket filec descriptor, and network is accessed by socket system call request kernel, i.e., all socket file descriptions Symbol should be identified using the corresponding second user identification information of the second application program.Therefore, it is necessary to elder generation from The corresponding second user identification information of the second application program is obtained in all socket filec descriptors.
In step S502, second in all socket filec descriptors of the first User Identity information substitution is used User Identity information.
After getting the second user identification information in all socket filec descriptors, with the first user identity Mark substitution second user identity, in this way, just all containing the first user identity mark in these socket filec descriptors Know information, when carrying out traffic statistics, the first application program can be counted under one's name.
Wherein, in order to guarantee the safety and effectivenesses of traffic statistics, it can be set and calling above-mentioned the first user identity of acquisition Identification information and with its substitute second user identification information when, need operating system permission, only operating system can gather around There is this permission, so that other applications be avoided to modify the User Identity information in socket filec descriptor without authorization.
Following is embodiment of the present disclosure, can be used for executing embodiments of the present disclosure.
Fig. 6 is a kind of block diagram of network flow statistic device shown according to an exemplary embodiment, which can lead to Cross being implemented in combination with as some or all of of terminal device of software, hardware or both.As shown in fig. 6, the network flow Statistic device includes:
First obtains module 61, is configured as obtaining when the first application program accesses network by the second application program All socket filec descriptors that second application program creates during accessing network;
Second obtains module 62, is configured as obtaining the corresponding first User Identity letter of first application program Breath;
Mark module 63 is configured with all socket files described in the first User Identity information flag Descriptor;
Determining module 64 is configured as determining first application according to all socket filec descriptors after label Program used flow during accessing network.
It is available in access network when determining the first application program used flow during accessing network During, the label of all generations has the target socket filec descriptor of User Identity information, and then basis These targets socket filec descriptor counts the first application program flow used in access network development process.
In this embodiment, when the first application program accesses network by the second application program, that is, what is requested access to answers When undertaking application program access network by network with program, the corresponding first user identity mark of the first application program can be used All socket filec descriptors that information flag creates in access network development process are known, in this manner it is possible to determine the first application Program used flow during accessing network, to avoid all counting on all flows accessed in network development process Second application program under one's name so that traffic statistics are finer and accurate.
For example, when certain shopping application program accesses network by browser application, in shopping application routine access net During network, all processes can all create socket filec descriptor when generating network, and when carrying out traffic statistics, It is to be counted according to the User Identity information identified on these socket filec descriptors, in the present embodiment, obtains The User Identity information of shopping application program is taken, and is accessed using the User Identity information flag of shopping application program The socket filec descriptor created in network development process, in this way, when carrying out traffic statistics, so that it may count shopping application program Used flow, without all flows generated during this are all counted on browser under one's name, so that flow Statistics is finer and accurate.
Fig. 7 is the block diagram of another network flow statistic device shown according to an exemplary embodiment.
As shown in fig. 7, in one embodiment, above-mentioned apparatus further include:
Memory module 71, the flow for being configured as to determine are saved in the statistical information data text of operating system support In part;
Third obtains module 72, is configured as when receiving first flow querying command, from the statistical information data The flow is obtained in file.
In this embodiment, the flow of the first determining application program is saved in the statistical information number of operating system support According in file, in this way, third party application can be segmented when inquiry after data on flows so that traffic statistics are more It is fine and accurate.
Fig. 8 is the block diagram of another network flow statistic device shown according to an exemplary embodiment.
As shown in figure 8, in one embodiment, above-mentioned apparatus further include:
Receiving module 81 is configured as receiving first application program used flow total amount within a preset period of time Querying command;
4th obtains module 82, is configured as being obtained from the statistical information data file according to the querying command All flow informations about first application program saved in preset time period;
Statistical module 83 is configured as counting all flow informations, to obtain the flow total amount.
In this embodiment, when the first application program accesses network by the second application program, i.e. request applications When undertaking application program access network by network, request applications used flow in the process can be counted, i.e., Traffic statistics can be finely divided, so that user be facilitated to know flow caused by request applications, promote making for user With experience.
In one embodiment, the second acquisition module 62 is used for:
The first User Identity information is obtained from the corresponding process of first application program.
It in this embodiment, can include the first User Identity information in the corresponding process of the first application program, because This, can obtain the first User Identity information in these processes, in this manner it is ensured that the first User Identity information Accuracy.
Fig. 9 is the block diagram of mark module in a kind of network flow statistic device shown according to an exemplary embodiment.
As shown in figure 9, in one embodiment, the mark module 63 includes:
Acquisition submodule 91 is configured as obtaining the second application program correspondence from all socket filec descriptors Second user identification information;
When the first application program accesses network by the second application program, in the second application program operational process, the The process of two application programs can carry the User Identity information of oneself, and all processes require to create when generating network Socket filec descriptor, and network is accessed by socket system call request kernel, i.e., all socket file descriptions Symbol should be identified using the corresponding second user identification information of the second application program.Therefore, it is necessary to elder generation from The corresponding second user identification information of the second application program is obtained in all socket filec descriptors.
Submodule 92 is substituted, all socket texts described in the first User Identity information substitution are configured with Second user identification information in part descriptor.
After getting the second user identification information in all socket filec descriptors, with the first user identity Mark substitution second user identity, in this way, just all containing the first user identity mark in these socket filec descriptors Know information, when carrying out traffic statistics, the first application program can be counted under one's name.
According to the third aspect of an embodiment of the present disclosure, a kind of network flow statistic device is provided, comprising:
Processor;
Memory for storage processor executable instruction;
Wherein, processor is configured as:
When the first application program accesses network by the second application program, second application program is obtained in access net All socket filec descriptors created during network;
Obtain the corresponding first User Identity information of first application program;
Use all socket filec descriptors described in the first User Identity information flag;
According to all socket filec descriptors after label, determine first application program in the process of access network Used in flow.
Above-mentioned processor is also configured to:
The determining flow is saved in the statistical information data file of operating system support;
When receiving first flow querying command, the flow is obtained from the statistical information data file.
Above-mentioned processor is also configured to:
Receive first application program within a preset period of time used in flow total amount querying command;
According to the querying command, from being saved in acquisition preset time period in the statistical information data file about institute State all flow informations of the first application program;
All flow informations are counted, to obtain the flow total amount.
Above-mentioned processor is also configured to:
It is described to obtain the corresponding first User Identity information of first application program, comprising:
The first User Identity information is obtained from the corresponding process of first application program.
Above-mentioned processor is also configured to:
It is described to use all socket filec descriptors described in the first User Identity information flag, comprising:
The corresponding second user identity letter of the second application program is obtained from all socket filec descriptors Breath;
Use the second user in all socket filec descriptors described in the first User Identity information substitution Identification information.
Figure 10 is a kind of block diagram for network flow statistic device shown according to an exemplary embodiment, and the device is suitable For terminal device.For example, device 1000 can be mobile phone, computer, digital broadcasting terminal, messaging device, trip Play console, tablet device, Medical Devices, body-building equipment, personal digital assistant etc..
Device 1000 may include following one or more components: processing component 1002, memory 1004, power supply module 1006, multimedia component 1008, audio component 1010, the interface 1012 of input/output (I/O), sensor module 1014, and Communication component 1016.
The integrated operation of the usual control device 1000 of processing component 1002, such as with display, telephone call, data communication, Camera operation and record operate associated operation.Processing component 1002 may include one or more processors 1020 to execute Instruction, to perform all or part of the steps of the methods described above.In addition, processing component 1002 may include one or more moulds Block, convenient for the interaction between processing component 1002 and other assemblies.For example, processing component 1002 may include multi-media module, To facilitate the interaction between multimedia component 1008 and processing component 1002.
Memory 1004 is configured as storing various types of data to support the operation in device 1000.These data Example includes the instruction of any application or method for operating on device 1000, contact data, telephone book data, Message, picture, video etc..Memory 1004 can by any kind of volatibility or non-volatile memory device or they Combination is realized, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), it is erasable can Program read-only memory (EPROM), programmable read only memory (PROM), read-only memory (ROM), magnetic memory, flash memory Reservoir, disk or CD.
Power supply module 1006 provides electric power for the various assemblies of device 1000.Power supply module 1006 may include power management System, one or more power supplys and other with for device 1000 generate, manage, and distribute the associated component of electric power.
Multimedia component 1008 includes the screen of one output interface of offer between described device 1000 and user.? In some embodiments, screen may include liquid crystal display (LCD) and touch panel (TP).If screen includes touch panel, Screen may be implemented as touch screen, to receive input signal from the user.Touch panel includes that one or more touch passes Sensor is to sense the gesture on touch, slide, and touch panel.The touch sensor can not only sense touch or sliding is dynamic The boundary of work, but also detect duration and pressure associated with the touch or slide operation.In some embodiments, more Media component 1008 includes a front camera and/or rear camera.When device 1000 is in operation mode, as shot mould When formula or video mode, front camera and/or rear camera can receive external multi-medium data.Each preposition camera shooting Head and rear camera can be a fixed optical lens system or have focusing and optical zoom capabilities.
Audio component 1010 is configured as output and/or input audio signal.For example, audio component 1010 includes a wheat Gram wind (MIC), when device 1000 is in operation mode, when such as call mode, recording mode, and voice recognition mode, microphone quilt It is configured to receive external audio signal.The received audio signal can be further stored in memory 1004 or via communication Component 1016 is sent.In some embodiments, audio component 1010 further includes a loudspeaker, is used for output audio signal.
I/O interface 1012 provides interface, above-mentioned peripheral interface module between processing component 1002 and peripheral interface module It can be keyboard, click wheel, button etc..These buttons may include, but are not limited to: home button, volume button, start button and Locking press button.
Sensor module 1014 includes one or more sensors, and the state for providing various aspects for device 1000 is commented Estimate.For example, sensor module 1014 can detecte the state that opens/closes of device 1000, the relative positioning of component, such as institute The display and keypad that component is device 1000 are stated, sensor module 1014 can be with detection device 1000 or device 1,000 1 The position change of a component, the existence or non-existence that user contacts with device 1000,1000 orientation of device or acceleration/deceleration and dress Set 1000 temperature change.Sensor module 1014 may include proximity sensor, be configured in not any physics It is detected the presence of nearby objects when contact.Sensor module 1014 can also include optical sensor, as CMOS or ccd image are sensed Device, for being used in imaging applications.In some embodiments, which can also include acceleration sensing Device, gyro sensor, Magnetic Sensor, pressure sensor or temperature sensor.
Communication component 1016 is configured to facilitate the communication of wired or wireless way between device 1000 and other equipment.Dress The wireless network based on communication standard, such as WiFi can be accessed by setting 1000,2G or 3G or their combination.It is exemplary at one In embodiment, communication component 1016 receives broadcast singal or broadcast correlation from external broadcasting management system via broadcast channel Information.In one exemplary embodiment, the communication component 1016 further includes near-field communication (NFC) module, to promote short distance Communication.For example, radio frequency identification (RFID) technology, Infrared Data Association (IrDA) technology, ultra wide band can be based in NFC module (UWB) technology, bluetooth (BT) technology and other technologies are realized.
In the exemplary embodiment, device 1000 can be by one or more application specific integrated circuit (ASIC), number Signal processor (DSP), digital signal processing appts (DSPD), programmable logic device (PLD), field programmable gate array (FPGA), controller, microcontroller, microprocessor or other electronic building bricks are realized, for executing the above method.
In the exemplary embodiment, a kind of non-transitorycomputer readable storage medium including instruction, example are additionally provided It such as include the memory 1004 of instruction, above-metioned instruction can be executed by the processor 1020 of device 1000 to complete the above method.Example Such as, the non-transitorycomputer readable storage medium can be ROM, random access memory (RAM), CD-ROM, tape, soft Disk and optical data storage devices etc..
A kind of non-transitorycomputer readable storage medium, when the instruction in the storage medium is by the processing of device 1000 When device executes, so that device 1000 is able to carry out above-mentioned network flux statistical method, which comprises
When the first application program accesses network by the second application program, second application program is obtained in access net All socket filec descriptors created during network;
Obtain the corresponding first User Identity information of first application program;
Use all socket filec descriptors described in the first User Identity information flag;
According to all socket filec descriptors after label, determine first application program in the process of access network Used in flow.
In one embodiment, the method also includes:
The determining flow is saved in the statistical information data file of operating system support;
When receiving first flow querying command, the flow is obtained from the statistical information data file.
In one embodiment, the method also includes:
Receive first application program within a preset period of time used in flow total amount querying command;
According to the querying command, from being saved in acquisition preset time period in the statistical information data file about institute State all flow informations of the first application program;
All flow informations are counted, to obtain the flow total amount.
In one embodiment, described to obtain the corresponding first User Identity information of first application program, packet It includes:
The first User Identity information is obtained from the corresponding process of first application program.
In one embodiment, described to use all socket files described in the first User Identity information flag Descriptor, comprising:
The corresponding second user identity letter of the second application program is obtained from all socket filec descriptors Breath;
Use the second user in all socket filec descriptors described in the first User Identity information substitution Identification information.
Those skilled in the art will readily occur to its of the disclosure after considering specification and practicing disclosure disclosed herein Its embodiment.This application is intended to cover any variations, uses, or adaptations of the disclosure, these modifications, purposes or Person's adaptive change follows the general principles of this disclosure and including the undocumented common knowledge in the art of the disclosure Or conventional techniques.The description and examples are only to be considered as illustrative, and the true scope and spirit of the disclosure are by following Claim is pointed out.
It should be understood that the present disclosure is not limited to the precise structures that have been described above and shown in the drawings, and And various modifications and changes may be made without departing from the scope thereof.The scope of the present disclosure is only limited by the accompanying claims.

Claims (9)

1. a kind of network flux statistical method characterized by comprising
When the first application program accesses network by the second application program, second application program is obtained in access network All socket filec descriptors created in the process;
Obtain the corresponding first User Identity information of first application program;
Use all socket filec descriptors described in the first User Identity information flag;
According to all socket filec descriptors after label, determine first application program in access network during institute The flow used;
It is described to use all socket filec descriptors described in the first User Identity information flag, comprising:
The corresponding second user identification information of the second application program is obtained from all socket filec descriptors;
Use the second user identity in all socket filec descriptors described in the first User Identity information substitution Identification information.
2. the method according to claim 1, wherein the method also includes:
The determining flow is saved in the statistical information data file of operating system support;
When receiving first flow querying command, the flow is obtained from the statistical information data file.
3. according to the method described in claim 2, it is characterized in that, the method also includes:
Receive first application program within a preset period of time used in flow total amount querying command;
According to the querying command, from obtained in the statistical information data file saved in preset time period about described the All flow informations of one application program;
All flow informations are counted, the flow total amount is obtained.
4. the method according to claim 1, wherein first application program corresponding first that obtains is used Family identification information, comprising:
The first User Identity information is obtained from the corresponding process of first application program.
5. a kind of network flow statistic device characterized by comprising
First obtains module, for obtaining described second and answering when the first application program accesses network by the second application program All socket filec descriptors created during accessing network with program;
Second obtains module, obtains the corresponding first User Identity information of first application program;
Mark module, for using all socket filec descriptors described in the first User Identity information flag;
Determining module, for determining that first application program is being accessed according to all socket filec descriptors after label Used flow during network;
The mark module includes:
Acquisition submodule, for obtaining the corresponding second user of the second application program from all socket filec descriptors Identification information;
Submodule is substituted, for using in all socket filec descriptors described in the first User Identity information substitution Second user identification information.
6. device according to claim 5, which is characterized in that described device further include:
Memory module, for the flow determined to be saved in the statistical information data file of operating system support;
Third obtains module, for being obtained from the statistical information data file when receiving first flow querying command The flow.
7. device according to claim 6, which is characterized in that described device further include:
Receiving module, for receive first application program within a preset period of time used in flow total amount inquiry life It enables;
4th obtains module, for obtaining preset time period from the statistical information data file according to the querying command All flow informations about first application program of interior preservation;
Statistical module, for being counted to all flow informations, to obtain the flow total amount.
8. device according to claim 5, which is characterized in that the second acquisition module is used for:
The first User Identity information is obtained from the corresponding process of first application program.
9. a kind of network flow statistic device characterized by comprising
Processor;
Memory for storage processor executable instruction;
Wherein, the processor is configured to:
When the first application program accesses network by the second application program, second application program is obtained in access network All socket filec descriptors created in the process;
Obtain the corresponding first User Identity information of first application program;
Use all socket filec descriptors described in the first User Identity information flag;
According to all socket filec descriptors after label, determine first application program in access network during institute The flow used;
It is described to use all socket filec descriptors described in the first User Identity information flag, comprising:
The corresponding second user identification information of the second application program is obtained from all socket filec descriptors;
Use the second user identity in all socket filec descriptors described in the first User Identity information substitution Identification information.
CN201610622084.1A 2016-08-01 2016-08-01 Network flux statistical method and device Active CN106230662B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610622084.1A CN106230662B (en) 2016-08-01 2016-08-01 Network flux statistical method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610622084.1A CN106230662B (en) 2016-08-01 2016-08-01 Network flux statistical method and device

Publications (2)

Publication Number Publication Date
CN106230662A CN106230662A (en) 2016-12-14
CN106230662B true CN106230662B (en) 2019-04-23

Family

ID=57535840

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610622084.1A Active CN106230662B (en) 2016-08-01 2016-08-01 Network flux statistical method and device

Country Status (1)

Country Link
CN (1) CN106230662B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106603345B (en) * 2017-02-04 2019-07-09 Oppo广东移动通信有限公司 Monitor method, apparatus and terminal that application program uses flow
CN107743080B (en) * 2017-09-30 2019-10-25 Oppo广东移动通信有限公司 Flow statistical method and device, computer equipment, computer readable storage medium
CN110096363B (en) * 2019-04-29 2021-11-30 亚信科技(成都)有限公司 Method and device for associating network event with process
CN113268518B (en) * 2020-02-17 2024-03-29 百度在线网络技术(北京)有限公司 Flow statistics method and device and distributed flow statistics system
CN112260889B (en) * 2020-09-28 2022-03-11 中孚安全技术有限公司 Linux-based process flow monitoring method, system and equipment
CN112732356A (en) * 2021-01-11 2021-04-30 江西中瑞防雷技术有限公司 Data monitoring management system of intelligent platform system

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101873640A (en) * 2010-05-27 2010-10-27 华为终端有限公司 Flow processing method, device and mobile terminal
CN102223307A (en) * 2011-06-29 2011-10-19 中兴通讯股份有限公司 Method for processing socket, method for grouped data transmission and device
CN102711139A (en) * 2012-04-24 2012-10-03 华为终端有限公司 Data flow counting method and terminal
US8291068B2 (en) * 2009-01-14 2012-10-16 Hewlett-Packard Development Company, L.P. Automatic protocol detection
CN104661322A (en) * 2013-11-20 2015-05-27 中兴通讯股份有限公司 Application internet access processing method and device as well as terminal
CN105491081A (en) * 2014-09-16 2016-04-13 网宿科技股份有限公司 Method for forwarding of internal flow of application in mobile intelligent terminal

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8291068B2 (en) * 2009-01-14 2012-10-16 Hewlett-Packard Development Company, L.P. Automatic protocol detection
CN101873640A (en) * 2010-05-27 2010-10-27 华为终端有限公司 Flow processing method, device and mobile terminal
CN102223307A (en) * 2011-06-29 2011-10-19 中兴通讯股份有限公司 Method for processing socket, method for grouped data transmission and device
CN102711139A (en) * 2012-04-24 2012-10-03 华为终端有限公司 Data flow counting method and terminal
CN104661322A (en) * 2013-11-20 2015-05-27 中兴通讯股份有限公司 Application internet access processing method and device as well as terminal
CN105491081A (en) * 2014-09-16 2016-04-13 网宿科技股份有限公司 Method for forwarding of internal flow of application in mobile intelligent terminal

Also Published As

Publication number Publication date
CN106230662A (en) 2016-12-14

Similar Documents

Publication Publication Date Title
CN106230662B (en) Network flux statistical method and device
CN105306824B (en) Acquisition parameters adjusting method and device
CN105187863B (en) Play the method and device of advertisement
CN106547663B (en) Key management method and device
CN106528709A (en) Social information recommendation method and apparatus
CN104063655A (en) Child mode processing method and device
CN106648063B (en) Gesture recognition method and device
CN106254646A (en) Network flux statistical method and device
CN107608561A (en) Touch-screen control method and device
CN109117874A (en) Operation behavior prediction technique and device
US9924334B1 (en) Message pushing method, terminal equipment and computer-readable storage medium
CN109189185A (en) terminal temperature adjusting method and device
CN106792173A (en) Video broadcasting method and device
CN104980662A (en) Method for adjusting imaging style in shooting process, device thereof and imaging device
CN104219714B (en) The flow control methods and device of mobile router
CN104464674B (en) Liquid crystal display method of adjustment and device
CN106203650A (en) Call a taxi and ask sending method and device
CN109451811A (en) Unmanned plane management method and device, electronic equipment and computer readable storage medium
CN104881342B (en) terminal test method and device
CN105261209B (en) The volume of the flow of passengers determines method and device
CN105487758B (en) Application software pop-up control method, device and terminal device
CN105657658A (en) Gathering event processing method and apparatuses
CN105957011B (en) Image processing method and device
CN109451810A (en) Unmanned aerial vehicle (UAV) control method and device, unmanned plane and equipment of the core network
CN107040547A (en) Method, device and the terminal device of administrator password

Legal Events

Date Code Title Description
C06 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