CN107276853B - Flow processing method, electronic device and computer system - Google Patents

Flow processing method, electronic device and computer system Download PDF

Info

Publication number
CN107276853B
CN107276853B CN201710616504.XA CN201710616504A CN107276853B CN 107276853 B CN107276853 B CN 107276853B CN 201710616504 A CN201710616504 A CN 201710616504A CN 107276853 B CN107276853 B CN 107276853B
Authority
CN
China
Prior art keywords
traffic
network
flow
electronic equipment
module
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
CN201710616504.XA
Other languages
Chinese (zh)
Other versions
CN107276853A (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.)
Lenovo Beijing Ltd
Original Assignee
Lenovo Beijing 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 Lenovo Beijing Ltd filed Critical Lenovo Beijing Ltd
Priority to CN201710616504.XA priority Critical patent/CN107276853B/en
Publication of CN107276853A publication Critical patent/CN107276853A/en
Application granted granted Critical
Publication of CN107276853B publication Critical patent/CN107276853B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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/16Threshold monitoring

Abstract

The present disclosure provides a traffic processing method, including: monitoring whether the electronic equipment meets a flow acquisition condition; if the electronic equipment meets the flow acquisition condition, triggering a flow acquisition process, wherein the flow acquisition process is used for acquiring the newly added network flow of the electronic equipment when running, and the newly added network flow is the network flow used by the electronic equipment in the interval of updating the network flow twice; and after the flow acquisition process is triggered, operating the flow acquisition process to acquire the newly added network flow of the electronic equipment. The present disclosure also provides an electronic device and a computer system.

Description

Flow processing method, electronic device and computer system
Technical Field
The disclosure relates to a traffic processing method, an electronic device and a computer system.
Background
At present, the network traffic of the electronic device generally needs to be accessed periodically by the processor, and the traffic acquisition mode needs to wait until the scheduled time is reached.
Disclosure of Invention
One aspect of the present disclosure provides a traffic processing method, including: monitoring whether the electronic equipment meets a flow acquisition condition; if the electronic equipment meets the flow acquisition condition, triggering a flow acquisition process, wherein the flow acquisition process is used for acquiring newly added network flow of the electronic equipment when running, and the newly added network flow is network flow used by the electronic equipment in the interval of updating the network flow twice; and after the flow acquisition process is triggered, operating the flow acquisition process to acquire the newly added network flow of the electronic equipment.
Optionally, the monitoring whether the electronic device satisfies the traffic acquiring condition includes: monitoring whether the network flow increment of the electronic equipment reaches a first threshold value; and the flow value corresponding to the newly-added network flow is equal to the first threshold value.
Optionally, monitoring the network traffic increment of the electronic device includes: counting network flow increment through a flow recording module; the energy consumption consumed when the traffic recording module counts the network traffic increment is lower than that consumed when the traffic acquiring process running on the processor acquires the network traffic increment in a polling mode.
Optionally, the electronic device supports a first network and a second network, and the traffic recording module includes a first recording module and a second recording module, where: if the electronic equipment has network traffic generated in the first network, triggering the first recording module to carry out statistics on the network traffic increment of the first network; and if the electronic equipment generates network traffic in the second network, triggering the second recording module to count the network traffic increment of the whole network, wherein the whole network at least comprises the first network and the second network.
Optionally, the method further includes: after acquiring the newly added network traffic of the electronic device, updating the acquired newly added network traffic into a traffic database, wherein the traffic database is used for storing the network traffic used by the electronic device cumulatively within a preset time period.
Optionally, the flow rate obtaining condition includes at least one of: the electronic equipment starts a flow inquiry or flow updating or flow acquisition process according to a user instruction; the processor of the electronic equipment enters a second state from a first state, wherein the power consumption of the processor of the electronic equipment in the first state is lower than that in the second state; and the network traffic increment of the electronic equipment does not reach a first threshold value, but the time length for generating the network traffic increment reaches a second threshold value.
Another aspect of the present disclosure also provides an electronic device including: the first monitoring module is used for monitoring whether the electronic equipment meets a flow acquisition condition; the first triggering module is used for triggering a traffic acquiring process when the electronic equipment is monitored to meet the traffic acquiring condition, wherein the traffic acquiring process is used for acquiring newly added network traffic of the electronic equipment when running, and the newly added network traffic is network traffic which is used by the electronic equipment in a gap of updating network traffic twice; and the processing module is used for running the flow acquisition process after the flow acquisition process is triggered so as to acquire the newly added network flow of the electronic equipment.
Optionally, the first monitoring module is further configured to: monitoring whether the network flow increment of the electronic equipment reaches a first threshold value; and the flow value corresponding to the newly-added network flow is equal to the first threshold value.
Optionally, the electronic device further includes: the second monitoring module is used for monitoring the network traffic increment of the electronic equipment and counting the network traffic increment through the traffic recording module; the energy consumption consumed when the traffic recording module counts the network traffic increment is lower than that consumed when the traffic acquiring process running on the processor acquires the network traffic increment in a polling mode.
Another aspect of the present disclosure also provides a computer system including: one or more processors; and one or more storage devices for storing one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement any of the traffic processing methods described above.
Drawings
For a more complete understanding of the present disclosure and the advantages thereof, reference is now made to the following descriptions taken in conjunction with the accompanying drawings, in which:
fig. 1 schematically illustrates an exemplary system architecture to which a traffic handling method may be applied, according to an embodiment of the present disclosure;
FIG. 2 schematically illustrates a flow chart of a traffic handling method according to an embodiment of the present disclosure;
fig. 3 schematically illustrates a schematic diagram of a traffic logging module disposed in a linux kernel according to an embodiment of the present disclosure;
FIG. 4 schematically illustrates a schematic diagram of a flow logging module counting flow, according to an embodiment of the disclosure;
FIG. 5 schematically illustrates a flow chart of a traffic handling method according to another embodiment of the present disclosure;
fig. 6 schematically shows a flow of traffic processing according to another embodiment of the present disclosure.
FIG. 7 schematically shows a block diagram of an electronic device according to an embodiment of the present disclosure;
FIG. 8 schematically shows a block diagram of an electronic device according to another embodiment of the present disclosure; and
fig. 9 schematically illustrates a block diagram of a computer system for implementing a traffic processing method according to an embodiment of the present disclosure.
Detailed Description
Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It should be understood that the description is illustrative only and is not intended to limit the scope of the present disclosure. Moreover, in the following description, descriptions of well-known structures and techniques are omitted so as to not unnecessarily obscure the concepts of the present disclosure.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The words "a", "an" and "the" and the like as used herein are also intended to include the meanings of "a plurality" and "the" unless the context clearly dictates otherwise. Furthermore, the terms "comprises," "comprising," and the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art unless otherwise defined. It is noted that the terms used herein should be interpreted as having a meaning that is consistent with the context of this specification and should not be interpreted in an idealized or overly formal sense.
Some block diagrams and/or flow diagrams are shown in the figures. It will be understood that some blocks of the block diagrams and/or flowchart illustrations, or combinations thereof, 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, or other programmable data processing apparatus, such that the instructions, which execute via the processor, create means for implementing the functions/acts specified in the block diagrams and/or flowchart block or blocks.
Accordingly, the techniques of this disclosure may be implemented in hardware and/or software (including firmware, microcode, etc.). In addition, the techniques of this disclosure may take the form of a computer program product on a computer-readable medium having instructions stored thereon for use by or in connection with an instruction execution system. In the context of this disclosure, a computer-readable medium may be any medium that can contain, store, communicate, propagate, or transport the instructions. For example, the computer readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, device, or propagation medium. Specific examples of the computer readable medium include: magnetic storage devices, such as magnetic tape or Hard Disk Drives (HDDs); optical storage devices, such as compact disks (CD-ROMs); a memory, such as a Random Access Memory (RAM) or a flash memory; and/or wired/wireless communication links.
The embodiment of the disclosure provides a traffic processing method and electronic equipment. The flow processing method comprises the steps of monitoring whether the electronic equipment meets a flow obtaining condition or not, triggering a flow obtaining process if the electronic equipment meets the flow obtaining condition, wherein the flow obtaining process is used for obtaining the newly added network flow of the electronic equipment when running, the newly added network flow is the network flow used by the electronic equipment in the interval of updating the network flow twice, and after the flow obtaining process is triggered, running the flow obtaining process to obtain the newly added network flow of the electronic equipment.
Fig. 1 schematically shows an exemplary system architecture to which a traffic processing method may be applied according to an embodiment of the present disclosure.
As shown in fig. 1, the system architecture 100 according to this embodiment may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may have installed thereon various communication client applications, such as shopping-like applications, web browser applications, search-like applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only).
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 105 may be a server providing various services, such as a background management server (for example only) providing support for websites browsed by users using the terminal devices 101, 102, 103. The background management server may analyze and perform other processing on the received data such as the user request, and feed back a processing result (e.g., a webpage, information, or data obtained or generated according to the user request) to the terminal device.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
It should be noted that the traffic processing method provided by the embodiment of the present disclosure may be generally executed by the server 105. Accordingly, the traffic handling system provided by the embodiments of the present disclosure may be generally disposed in the server 105. The traffic processing method provided by the embodiment of the present disclosure may also be executed by a server or a server cluster that is different from the server 105 and is capable of communicating with the terminal devices 101, 102, 103 and/or the server 105. Accordingly, the traffic processing system provided by the embodiment of the present disclosure may also be disposed in a server or a server cluster different from the server 105 and capable of communicating with the terminal devices 101, 102, 103 and/or the server 105.
Fig. 2 schematically shows a flow chart of a traffic handling method according to an embodiment of the present disclosure.
As shown in fig. 2, the method includes operations S201 to S203.
In operation S201, whether the electronic device satisfies a traffic acquisition condition is monitored.
In operation S202, if it is monitored that the electronic device satisfies the traffic acquisition condition, a traffic acquisition process is triggered. The traffic obtaining process is used for obtaining a new network traffic of the electronic device during operation, and the new network traffic is a network traffic which is cumulatively used by the electronic device in a gap between two times of updating the network traffic.
In operation S203, after the traffic acquiring process is triggered, the traffic acquiring process is executed to acquire a newly added network traffic of the electronic device.
In the disclosed embodiment, the electronic device may include various types, which are not limited herein, for example, it may include a smart phone, a tablet computer, a personal computer, and the like. The traffic acquiring condition may also include various conditions, which are not limited herein, and for example, it may include that the network traffic increment reaches a certain amount, when a user requests to query/update/acquire information related to the network traffic, and so on. Correspondingly, the manner for monitoring whether the electronic device satisfies the traffic obtaining condition may also include various manners, which are not limited herein, for example, it may include monitoring whether the network traffic increment of the electronic device reaches a certain amount, and so on.
In implementation, if the monitoring finds that the electronic equipment meets the traffic acquisition condition, a traffic acquisition process is triggered to acquire the newly added network traffic. The traffic acquiring process may exist in the form of a service, which is not limited herein, and may be, for example, traffic monitoring classes (TrafficStats).
Specifically, since all information in the Linux system exists in the form of files, information related to the traffic of the application (also referred to as traffic information) is also stored in the files. For a system before android2.2, traffic flow information is stored in a proc/net/dev (or proc/self/net/dev) file, so that the traffic flow information can be obtained by reading a related file through a traffic acquisition process and then analyzing the related file. For the systems of android2.2 and later, a traffic monitoring class (TrafficStats) can be used as a traffic acquisition process of the disclosure, and traffic information can be acquired by polling a proc/net/dev (or proc/self/net/dev) file through TrafficStats.
It should be noted that the traffic acquisition process runs on the CPU, and therefore needs to occupy CPU resources. However, in the process of monitoring whether the electronic device satisfies the traffic acquisition condition, there is a fact that network traffic is acquired, but the acquisition is acquired only when the traffic acquisition condition is satisfied, and therefore CPU resources are not occupied all the time.
In the embodiment of the present disclosure, the newly added network traffic is network traffic that is used by the electronic device in an accumulated manner in a gap between two times of updating the network traffic, for example, the newly added network traffic is network traffic that is used by an application program of the electronic device in an accumulated manner between the current traffic update and an adjacent previous traffic update.
By adopting the embodiment of the disclosure, the network flow is acquired by adopting the triggering mode meeting the flow acquisition condition, and the technical effects of efficiently acquiring the network flow increment and saving CPU resources can be achieved.
The method shown in fig. 2 is further described with reference to fig. 3-6 in conjunction with specific embodiments.
According to an embodiment of the present disclosure, the monitoring whether the electronic device satisfies the traffic acquiring condition may include multiple types, which are not limited herein, and as an alternative embodiment, the monitoring may include: and monitoring whether the network traffic increment of the electronic equipment reaches a first threshold value, wherein the traffic value corresponding to the newly-added network traffic is equal to the first threshold value.
In the embodiment of the present disclosure, the first threshold may be flexibly set according to specific situations, for example, may be preset to 10K, 20K, and so on.
Through the embodiment of the disclosure, when the network traffic used by the electronic device reaches the first threshold, the network traffic increment is acquired once, and compared with the acquisition of the traffic at intervals, the acquisition mode of the latter has the defects, for example, if the user does not use the traffic for a long time, the traffic acquisition process is triggered to run when the time is up, and the idle work is done for a long time, so that the efficiency is low, and the CPU resource is consumed.
According to an embodiment of the present disclosure, the network traffic increment of the monitoring electronic device may include multiple types, which are not limited herein, for example, the network traffic increment may be counted by the traffic recording module. The energy consumption consumed when the traffic recording module counts the network traffic increment is lower than that consumed when the traffic acquiring process running on the processor acquires the network traffic increment in a polling mode. The traffic acquiring process here may be specially designed traffic monitoring software.
In the embodiment of the present disclosure, the flow recording module may include various forms, which are not limited herein, for example, it may be in a hardware form, or may be in a form of a hardware structure (such as an FPGA) implemented by software programming, or may also be in a software form (such as a service), and so on.
For example, in the embodiment of the present disclosure, the Traffic recording module may be Traffic _ increase _ triger, and as shown in fig. 3, Traffic _ increase _ triger may be disposed in a Network Driver layer, which is located in linux kernel space and used for transmitting Network data. In the Network Driver, when the linux kernel runs, the Traffic _ increment _ triger automatically runs and counts flow data. Although Traffic _ increment _ triger also occupies CPU resources when counting Traffic data, since the Traffic counting scheme is counted under the condition that the Traffic acquiring condition is satisfied, the total power consumption consumed by the polling Traffic monitoring scheme is less than that consumed by the linux kernel space operating over time.
In addition, as shown in fig. 3, the linux kernel further includes the following modules: applications: application, System libraries: system function library, System Call Interface: system call interface, VFS: virtual File Systems, File Systems: file system, Volume Manager: convolution manager, Block Device Interface: block device interface, Sockets: socket layer, Virtual Memory: virtual memory, Scheduler: the process scheduler, Socket/TCP/UDP/IP/Ethernet, is four network protocols.
According to the embodiment of the disclosure, when the network flow used by the electronic device does not reach a certain amount (such as a first threshold), the flow recording module is used for recording, and when the recorded amount of the flow recording module reaches a certain amount (such as a first threshold), the flow acquiring process is started to acquire the network flow increment, so that the CPU resource is not occupied all the time, and the purposes of saving the CPU resource and reducing the power consumption are achieved.
According to the embodiment of the disclosure, the electronic device may support at least a first network and a second network, and correspondingly, the traffic recording module may include a first recording module and a second recording module. If the electronic equipment generates network traffic in the first network, triggering a first recording module to count the network traffic increment of the first network; and if the electronic equipment has network traffic in the second network, triggering a second recording module to carry out statistics on network traffic increment of the whole network. Wherein the full network comprises at least a first network and a second network.
In the embodiment of the present disclosure, neither the first network nor the second network is limited, for example, the first network may be a mobile phone network, and the second network may be a wlan network (wifi network). Network traffic increments of different networks may be recorded using different traffic recording modules to distinguish.
For example, in the embodiment of the present disclosure, a wlan network traffic and a mobile network traffic may be monitored, specifically, as shown in fig. 4:
(1) a Mobile Traffic incremental counter Incase _ Mobile _ Traffic can be built in a Network Driver to serve as a first recording module, and when Incase _ Mobile _ Traffic is greater than 10K, a Mobile Traffic Update Event is triggered.
(2) A Wlan Traffic increment counter, Increa _ Wlan _ Traffic, can be built in a Network Driver as a second recording module, and when Increa _ Wlan _ Traffic > 10K, a local area Network Traffic Update Event is triggered.
Through the embodiment of the disclosure, the traffic of the electronic device used in different networks can be recorded through different traffic recording modules, so as to achieve the purpose of recording in a distinguishing manner and providing more accurate traffic use details for users.
Fig. 5 schematically shows a flow chart of a traffic handling method according to another embodiment of the present disclosure.
As shown in fig. 5, in the embodiment of the present disclosure, the traffic processing method may further include operation S501 in addition to operations S201 to S203 described above with reference to fig. 2. The description of operations S201 to S203 is omitted here for the sake of brevity of description. Wherein:
in operation S501, after acquiring a new network traffic of the electronic device, the acquired new network traffic is updated to the traffic database. The traffic database is used for storing network traffic used by the electronic equipment in an accumulated mode within a preset time period.
In the embodiment of the present disclosure, after acquiring a newly added network traffic of an electronic device, a traffic update event may be triggered, and the acquired newly added network traffic is updated into a traffic database, as shown in fig. 6. The Mobile phone network comprises a first network (Mobile phone network), a second network (Mobile phone network), a third network and a fourth network, wherein the flow of the first network (Mobile phone network) is equal to the number of bytes of data received in the Mobile phone network and the number of bytes of data sent in the Mobile phone network, namely Mobile Total Traffic in Traffic states. The flow of the second network (wifi network) — the number of bytes of data received in the wifi network + the number of bytes of data sent in the wifi network-the first network flow, i.e., Wlan Traffic ═ Traffic.
In order to facilitate the statistics of the network traffic increment, the traffic recording module can be cleared while the traffic database is updated every time. For example, clear Increase _ Mobile _ traffic, and/or clear Increase _ Wlan _ traffic.
As shown in fig. 6, when a traffic increment trigger (i.e., a traffic recording module, which at least includes a first recording module and a second recording module) is triggered, a traffic change event source is generated, and this event will continue to trigger an event listener (i.e., a traffic acquiring process), and then a corresponding event handler is invoked, thereby completing a traffic monitoring update operation (i.e., updating a newly added network traffic into a traffic database).
Specifically, the Mobile Traffic Update Event may trigger the Traffic monitoring module to Update the Mobile Traffic data. The Traffic monitoring module calls Traffic status, getMobileRxBytes () + Traffic status, getMobileTxBytes () -Mobile Total Traffic, to trigger the Traffic monitoring module to Update the Wlan Traffic data. The Traffic monitoring module calls Traffic status, getTotalRxBytes () + Traffic status, getTotalTxBytes () -Mobile Total Traffic ═ Wlan Traffic, and calculates to obtain Wlan Traffic data.
Through the embodiment of the disclosure, after the newly added network traffic of the electronic device is obtained each time, the newly added network traffic can be uniformly stored in the traffic database for the user to inquire and know the traffic use condition of the user.
According to an embodiment of the present disclosure, the traffic obtaining condition may include multiple conditions, which are not limited herein, and besides whether the network traffic increment of the monitoring electronic device reaches the first threshold or not, as an optional embodiment, the traffic obtaining condition may further include at least one of the following: the electronic equipment starts a flow query or flow update or flow acquisition process according to a user instruction; the method comprises the steps that a processor of the electronic device enters a second state from a first state, wherein the power consumption of the processor of the electronic device in the first state is lower than that of the processor of the electronic device in the second state; and the network traffic increment of the electronic device has not reached the first threshold, but the length of time to generate the network traffic increment has reached the second threshold.
In the embodiment of the present disclosure, on one hand, if the network traffic increment does not reach the first threshold, but the time length for generating the network traffic increment reaches the second threshold, the traffic acquisition process may also be triggered; on the other hand, if the network traffic increment does not reach the first threshold value and the time length for generating the network traffic increment does not reach the second threshold value, but an operation instruction of the user for the electronic device is received, the traffic acquisition process is triggered, wherein the operation instruction can be used for instructing to perform at least one of the following operations: and starting a flow query or flow update or flow acquisition process.
Through the embodiment of the disclosure, the defect of poor user experience caused by untimely flow updating can be avoided by setting various flow acquisition triggering conditions.
Fig. 7 schematically shows a block diagram of an electronic device according to an embodiment of the disclosure.
As shown in fig. 7, the electronic device 700 includes a first monitoring module 710, a first triggering module 720, and a processing module 730. The electronic device 700 may perform the methods described above with reference to fig. 2-6. Wherein:
the first monitoring module 710 is used for monitoring whether the electronic device 700 satisfies a traffic acquisition condition.
The first triggering module 720 is configured to trigger a traffic acquisition process when it is monitored that the electronic device 700 satisfies a traffic acquisition condition. The traffic obtaining process is configured to obtain an additional network traffic of the electronic device 700 during operation, where the additional network traffic is a network traffic that is cumulatively used by the electronic device 700 in a gap between two times of updating the network traffic.
The processing module 730 is configured to run a traffic acquisition process after the traffic acquisition process is triggered, so as to acquire a new network traffic of the electronic device 700.
In the disclosed embodiment, the electronic device may include various types, which are not limited herein, for example, it may include a smart phone, a tablet computer, a personal computer, and the like. The traffic acquiring condition may also include various conditions, which are not limited herein, and for example, it may include that the network traffic increment reaches a certain amount, when a user requests to query/update/acquire information related to the network traffic, and so on. Correspondingly, the manner for monitoring whether the electronic device satisfies the traffic obtaining condition may also include various manners, which are not limited herein, for example, it may include monitoring whether the network traffic increment of the electronic device reaches a certain amount, and so on.
In implementation, if the monitoring finds that the electronic equipment meets the traffic acquisition condition, a traffic acquisition process is triggered to acquire the newly added network traffic. The traffic acquiring process may exist in the form of a service, which is not limited herein, and may be, for example, traffic monitoring classes (TrafficStats). It should be noted that the traffic acquisition process runs on the CPU, and therefore needs to occupy CPU resources. However, in the process of monitoring whether the electronic device meets the traffic acquisition condition, the fact that the network traffic is acquired also exists, but the acquisition does not occupy the CPU resource.
In the embodiment of the present disclosure, the newly added network traffic is network traffic that is used by the electronic device in an accumulated manner in a gap between two times of updating the network traffic, for example, the newly added network traffic is network traffic that is used by an application program of the electronic device in an accumulated manner between the current traffic update and an adjacent previous traffic update.
By adopting the embodiment of the disclosure, the network flow is acquired by adopting the triggering mode meeting the flow acquisition condition, and the technical effects of efficiently acquiring the network flow increment and saving CPU resources can be achieved.
According to an embodiment of the present disclosure, the first monitoring module may be further configured to monitor whether a network traffic increment of the electronic device reaches a first threshold. And the flow value corresponding to the newly added network flow is equal to the first threshold value.
Through the embodiment of the disclosure, when the network traffic used by the electronic device reaches the first threshold, the network traffic increment is acquired once, and compared with the acquisition of the traffic at intervals, the acquisition mode of the latter has the defects, for example, if the user does not use the traffic for a long time, the traffic acquisition process is triggered to run when the time is up, and the idle work is done for a long time, so that the efficiency is low, and the CPU resource is consumed.
Fig. 8 schematically shows a block diagram of an electronic device according to another embodiment of the present disclosure. As shown in fig. 5, the electronic device 700 may include a second monitoring module 810 in addition to the modules described above with reference to fig. 7, in accordance with an embodiment of the present disclosure. For the sake of brevity of description, a description of the modules described with reference to fig. 7 is omitted here. Wherein:
the second monitoring module 810 is configured to monitor the network traffic increment of the electronic device 700, and count the network traffic increment through the traffic recording module. The energy consumption consumed when the traffic recording module counts the network traffic increment is lower than that consumed when the traffic acquiring process running on the processor acquires the network traffic increment in a polling mode.
According to the embodiment of the disclosure, when the network flow used by the electronic device does not reach a certain amount (such as a first threshold), the flow recording module is used for recording, and when the recorded amount of the flow recording module reaches a certain amount (such as a first threshold), the flow acquiring process is started to acquire the network flow increment, so that the CPU resource is not occupied all the time, and the purposes of saving the CPU resource and reducing the power consumption are achieved.
It is understood that the first monitoring module 710, the first triggering module 720, the processing module 730, the second monitoring module 810, and the like may be combined and implemented in one module, or any one of them may be split into a plurality of modules. Alternatively, at least part of the functionality of one or more of these modules may be combined with at least part of the functionality of the other modules and implemented in one module. According to an embodiment of the present invention, at least one of the first monitoring module 710, the first triggering module 720, the processing module 730, and the second monitoring module 810 may be implemented at least in part as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or may be implemented in hardware or firmware in any other reasonable manner of integrating or packaging a circuit, or in a suitable combination of three implementations of software, hardware, and firmware. Alternatively, at least one of the first monitoring module 710, the first triggering module 720, the processing module 730 and the second monitoring module 810 may be at least partially implemented as a computer program module, which, when executed by a computer, may perform the functions of the respective module.
The present disclosure also provides a computer system comprising: one or more processors; and one or more storage devices for storing one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the traffic processing method of any of the above embodiments.
Fig. 9 schematically illustrates a block diagram of a computer system for implementing a traffic processing method according to an embodiment of the present disclosure.
As shown in fig. 9, computer system 900 includes a processor 910, a memory 920. The computer system 900 may perform the methods described above with reference to fig. 2-6.
The processor 910 may include, for example, a general purpose microprocessor, an instruction set processor and/or associated chipset, and/or a special purpose microprocessor (e.g., an Application Specific Integrated Circuit (ASIC)), among others. The processor 910 may also include onboard memory for caching purposes. Processor 910 may be a single processing unit or a plurality of processing units for performing the different actions of the method flows according to embodiments of the present disclosure described with reference to fig. 2-6.
The memory 920 may be, for example, any medium that can contain, store, communicate, propagate, or transport the instructions. For example, a readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, device, or propagation medium. Specific examples of the readable storage medium include: magnetic storage devices, such as magnetic tape or Hard Disk Drives (HDDs); optical storage devices, such as compact disks (CD-ROMs); a memory, such as a Random Access Memory (RAM) or a flash memory; and/or wired/wireless communication links.
Memory 920 may include a computer program 921, which computer program 921 may include code/computer-executable instructions that, when executed by processor 910, cause processor 910 to perform a method flow, such as described above in connection with fig. 2-6, and any variations thereof.
The computer program 921 may be configured with, for example, computer program code comprising computer program modules. For example, in an example embodiment, code in computer program 921 may include one or more program modules, including 921A, modules 921B, … …, for example. It should be noted that the division and number of modules are not fixed, and those skilled in the art may use suitable program modules or program module combinations according to actual situations, which when executed by the processor 910, enable the processor 910 to execute the method flows described above with reference to fig. 2 to 6, for example, and any variations thereof.
According to an embodiment of the present invention, at least one of the first monitoring module 710, the first triggering module 720, the processing module 730, and the second monitoring module 810 may be implemented as a computer program module described with reference to fig. 9, which, when executed by the processor 910, may implement the respective operations described above.
Those skilled in the art will appreciate that various combinations and/or combinations of features recited in the various embodiments and/or claims of the present disclosure can be made, even if such combinations or combinations are not expressly recited in the present disclosure. In particular, various combinations and/or combinations of the features recited in the various embodiments and/or claims of the present disclosure may be made without departing from the spirit or teaching of the present disclosure. All such combinations and/or associations are within the scope of the present disclosure.
While the disclosure has been shown and described with reference to certain exemplary embodiments thereof, it will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the disclosure as defined by the appended claims and their equivalents. Accordingly, the scope of the present disclosure should not be limited to the above-described embodiments, but should be defined not only by the appended claims, but also by equivalents thereof.

Claims (8)

1. A traffic processing method, comprising:
monitoring whether the electronic equipment meets a flow acquisition condition or not through a monitoring module;
if the electronic equipment meets the flow acquisition condition through monitoring by the monitoring module, triggering a flow acquisition process running on a processor through a triggering module, wherein the flow acquisition process is used for acquiring newly added network flow of the electronic equipment when running, and the newly added network flow is network flow used by the electronic equipment in the interval of updating the network flow twice; and
after the flow acquisition process is triggered, the flow acquisition process is operated by a processor to acquire the newly added network flow of the electronic equipment,
wherein, whether monitoring the electronic equipment through the monitoring module satisfies the flow acquisition condition includes through the monitoring module:
monitoring whether the network traffic increment of the electronic equipment reaches a first threshold value;
and the flow value corresponding to the newly added network flow is equal to the first threshold value.
2. The method of claim 1, wherein monitoring, by a monitoring module, a network traffic delta of the electronic device comprises:
counting network flow increment through a flow recording module;
the energy consumption consumed when the traffic recording module counts the network traffic increment is lower than that consumed when the traffic acquiring process running on the processor acquires the network traffic increment in a polling mode.
3. The method of claim 2, wherein the electronic device supports a first network and a second network, the traffic logging module comprises a first logging module and a second logging module, wherein:
if the electronic equipment has network traffic generated in the first network, triggering the first recording module to count the network traffic increment of the first network through the triggering module;
if the electronic equipment has network traffic generated in the second network, the triggering module triggers the second recording module to count network traffic increment of the whole network, wherein the whole network at least comprises the first network and the second network.
4. The method of claim 1, wherein the method further comprises:
after the newly added network traffic of the electronic equipment is acquired, updating the acquired newly added network traffic into a traffic database through a processor, wherein the traffic database is used for storing the network traffic used by the electronic equipment in an accumulated manner within a preset time period.
5. The method of claim 1, wherein the traffic acquisition condition further comprises at least one of:
the electronic equipment starts a flow query or flow update or flow acquisition process according to a user instruction;
the processor of the electronic device enters a second state from a first state, wherein the power consumption of the processor of the electronic device in the first state is lower than the power consumption of the processor of the electronic device in the second state; and
the network traffic increment of the electronic device has not reached a first threshold, but the length of time the network traffic increment was generated has reached a second threshold.
6. An electronic device, comprising:
the first monitoring module is used for monitoring whether the electronic equipment meets a flow acquisition condition;
the first triggering module is used for triggering the processing module to operate a flow acquisition process when the electronic equipment is monitored to meet the flow acquisition condition, wherein the flow acquisition process is used for acquiring newly added network flow of the electronic equipment during operation, and the newly added network flow is network flow used by the electronic equipment in a gap of updating network flow twice; and
the processing module is configured to run the traffic acquisition process to acquire a newly added network traffic of the electronic device after the traffic acquisition process is triggered,
wherein the first monitoring module is further configured to:
monitoring whether the network traffic increment of the electronic equipment reaches a first threshold value;
and the flow value corresponding to the newly added network flow is equal to the first threshold value.
7. The electronic device of claim 6, wherein the electronic device further comprises: a second monitoring module for monitoring network traffic increments of the electronic device,
the second monitoring module counts network traffic increment through a traffic recording module;
the energy consumption consumed when the traffic recording module counts the network traffic increment is lower than that consumed when the traffic acquiring process running on the processor acquires the network traffic increment in a polling mode.
8. A computer system, comprising:
one or more processors; and
one or more storage devices for storing one or more programs,
wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the traffic processing method of any of claims 1 to 5.
CN201710616504.XA 2017-07-25 2017-07-25 Flow processing method, electronic device and computer system Active CN107276853B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710616504.XA CN107276853B (en) 2017-07-25 2017-07-25 Flow processing method, electronic device and computer system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710616504.XA CN107276853B (en) 2017-07-25 2017-07-25 Flow processing method, electronic device and computer system

Publications (2)

Publication Number Publication Date
CN107276853A CN107276853A (en) 2017-10-20
CN107276853B true CN107276853B (en) 2020-11-20

Family

ID=60079141

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710616504.XA Active CN107276853B (en) 2017-07-25 2017-07-25 Flow processing method, electronic device and computer system

Country Status (1)

Country Link
CN (1) CN107276853B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110351275B (en) * 2019-07-11 2022-08-19 北京长亭未来科技有限公司 Host port flow monitoring method, system, device and storage equipment
CN112039721B (en) * 2020-08-04 2022-03-18 紫光云(南京)数字技术有限公司 Method and system for monitoring flow of elastic public network IP under public cloud platform

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104009892A (en) * 2014-06-12 2014-08-27 北京奇虎科技有限公司 Monitoring method and device for traffic of mobile terminal and client side
CN104410962A (en) * 2014-11-10 2015-03-11 华为软件技术有限公司 A terminal user network traffic monitoring method and device
CN104717368A (en) * 2015-04-08 2015-06-17 宇龙计算机通信科技(深圳)有限公司 Flow-data updating method, flow-data updating system and terminal
CN104735699A (en) * 2015-03-10 2015-06-24 Tcl移动通信科技(宁波)有限公司 Data traffic monitoring method and system based on mobile terminal and mobile terminal

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10313248B2 (en) * 2014-06-18 2019-06-04 Adobe Inc. Data flow node validation
US10230821B2 (en) * 2014-12-30 2019-03-12 Research Electronics International, Llc System and method for detecting VOIP traffic

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104009892A (en) * 2014-06-12 2014-08-27 北京奇虎科技有限公司 Monitoring method and device for traffic of mobile terminal and client side
CN104410962A (en) * 2014-11-10 2015-03-11 华为软件技术有限公司 A terminal user network traffic monitoring method and device
CN104735699A (en) * 2015-03-10 2015-06-24 Tcl移动通信科技(宁波)有限公司 Data traffic monitoring method and system based on mobile terminal and mobile terminal
CN104717368A (en) * 2015-04-08 2015-06-17 宇龙计算机通信科技(深圳)有限公司 Flow-data updating method, flow-data updating system and terminal

Also Published As

Publication number Publication date
CN107276853A (en) 2017-10-20

Similar Documents

Publication Publication Date Title
JP6530462B2 (en) Determining and monitoring the performance capabilities of computer resource services
US10355934B2 (en) Vertical scaling of computing instances
US8782215B2 (en) Performance testing in a cloud environment
CN113924554A (en) Automated cloud edge flow workload distribution and bi-directional migration with lossless one-time processing
JP6526907B2 (en) Performance monitoring of distributed storage systems
KR20220062101A (en) Information transmission method, apparatus, readable medium and electronic device
JP6259920B2 (en) Dynamic storage management facilitation mechanism for multiple mobile computing devices
EP2819011A2 (en) Task execution by idle resources in grid computing system
JP2018503275A (en) Method, apparatus, and system for exploring application topology relationships
KR20130142961A (en) Automatic application updates
US11057280B2 (en) User interface with expected response times of commands
CN112100034A (en) Service monitoring method and device
CN110780887A (en) Method and equipment for providing application installation package
CN107276853B (en) Flow processing method, electronic device and computer system
CN109428926B (en) Method and device for scheduling task nodes
CN104428761A (en) Network congestion reduction
KR101890046B1 (en) Concurrent network application scheduling for reduced power consumption
US20140281322A1 (en) Temporal Hierarchical Tiered Data Storage
US20140040479A1 (en) Method for a self organizing load balance in a cloud file server network
US20180234491A1 (en) Program deployment according to server efficiency rankings
KR101810180B1 (en) Method and apparatus for distributed processing of big data based on user equipment
CN113138772B (en) Construction method and device of data processing platform, electronic equipment and storage medium
CN112463616A (en) Chaos testing method and device for Kubernetes container platform
US20160274799A1 (en) Increase memory scalability using table-specific memory cleanup
US20180011789A1 (en) Reducing idle resource usage

Legal Events

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