Traffic statistical method and device and storage medium

By obtaining the traffic statistics strategies and data packets of user equipment and carefully counting their use traffic information, the problem that the existing technology cannot accurately count and optimize user equipment traffic is solved, and the efficiency and user experience of traffic statistics are improved.

CN119521254APending Publication Date: 2025-02-25ZTE CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311086359.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-08-25
Publication Date
2025-02-25

AI Technical Summary

Technical Problem

The prior art cannot conduct detailed statistics on the traffic of each user device connected to the wifi device, resulting in the inability to fine management and optimization. In the case of many user devices, the traffic statistics method will consume too much device resources, resulting in performance degradation and user experience impact.

Method used

By obtaining the traffic statistics policy of the user equipment and obtaining its data packets to determine the usage traffic information, it realizes fine statistics of the traffic of the user equipment.

Benefits of technology

It improves the efficiency and accuracy of traffic statistics, can manage and optimize the traffic of each user device more carefully, reduces the consumption of device resources, and improves the overall performance and user experience of wifi devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119521254A_ABST
    Figure CN119521254A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a wifi device flow statistical method and device and a storage medium, and belongs to the field of communication. The method comprises the following steps: under the condition that user equipment accesses wifi equipment, acquiring a flow statistical strategy corresponding to the user equipment; acquiring a data packet of the user equipment according to the traffic statistical strategy to obtain a plurality of target data packets; and according to the traffic statistical strategy and the plurality of target data packets, determining usage traffic information of the user equipment. According to the technical scheme of the invention, the traffic information used by the user equipment can be accurately calculated through the traffic statistics strategy and the plurality of target data packets, and the efficiency and accuracy of traffic statistics are greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of communication technology, and in particular to a traffic statistics method, device and storage medium. Background Art

[0002] Mobile wireless fidelity (wifi) devices are portable wireless routers that can provide mobile network connections for user devices, allowing them to access the Internet at different locations and times. WiFi devices are in a rapid development stage. With the popularization of mobile Internet and the increasing demand for network connections, the demand for WiFi devices is also showing a rapid growth trend. Users' requirements for the functions and performance of WiFi devices are also constantly improving, and the demand for more fine-grained traffic statistics and optimization is increasing.

[0003] At present, the way to conduct traffic statistics for Wi-Fi devices is a traffic statistics method based on the Simple Network Management Protocol. It obtains device-level traffic statistics information by querying the management information library of the device, such as total traffic, received traffic and sent traffic. However, it is impossible to separately count the traffic used by each connected user device, resulting in the inability to perform fine management and optimization of each user device. In addition, when there are many connected user devices, using the aforementioned traffic statistics method will consume too many device resources, resulting in a decrease in the overall performance of the Wi-Fi device and affecting the user experience. Summary of the invention

[0004] The embodiment of the present invention provides a wifi device traffic statistics method, device and storage medium, aiming to accurately and efficiently count the traffic consumed by each user device.

[0005] In a first aspect, an embodiment of the present invention provides a traffic statistics method, including:

[0006] When the user device is connected to a wifi device, a traffic statistics strategy corresponding to the user device is obtained;

[0007] Acquire data packets of the user equipment according to the traffic statistics strategy to obtain multiple target data packets;

[0008] The traffic usage information of the user equipment is determined according to the traffic statistics strategy and the multiple target data packets.

[0009] In a second aspect, an embodiment of the present invention further provides a WiFi device, comprising a processor, a memory, a computer program stored in the memory and executable by the processor, and a data bus for realizing connection and communication between the processor and the memory, wherein when the computer program is executed by the processor, the steps of any traffic statistics method provided in the specification of the present invention are implemented.

[0010] In a third aspect, an embodiment of the present invention further provides a storage medium for computer-readable storage, characterized in that the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of any traffic statistics method provided in the specification of the present invention.

[0011] The embodiment of the present invention provides a method, device and storage medium for counting traffic of a wifi device. When a user device is connected to a wifi device, the embodiment of the present invention obtains a traffic counting strategy corresponding to the user device; then obtains a data packet of the user device according to the traffic counting strategy to obtain multiple target data packets; and then accurately determines the traffic information used by the user device according to the traffic counting strategy and the multiple target data packets. This solution obtains a traffic counting strategy matched by the user device, and obtains multiple target data packets corresponding to the user device based on the traffic counting strategy. Through the traffic counting strategy and the multiple target data packets, the traffic information used by the user device can be accurately calculated, which greatly improves the efficiency and accuracy of traffic statistics. BRIEF DESCRIPTION OF THE DRAWINGS

[0012] Figure 1 A flow chart of a flow statistics method provided by an embodiment of the present invention;

[0013] Figure 2 for Figure 1 A flow chart of sub-steps of the traffic statistics method in FIG.

[0014] Figure 3 for Figure 1 A flow chart of sub-steps of the traffic statistics method in FIG.

[0015] Figure 4 A schematic diagram of a scenario of a traffic statistics method provided by an embodiment of the present invention;

[0016] Figure 5 A schematic block diagram of the structure of a Wi-Fi device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0017] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0018] The flowcharts shown in the accompanying drawings are only examples and do not necessarily include all the contents and operations / steps, nor must they be executed in the order described. For example, some operations / steps may also be decomposed, combined or partially merged, so the actual execution order may change according to actual conditions.

[0019] It should be understood that the terms used in the present specification are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the present specification, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0020] The embodiment of the present invention provides a method, device and storage medium for counting traffic of a wifi device. The method for counting traffic can be applied to a wifi device, which can be a mobile wifi device, a router and other devices. Of course, the wifi device can also be an electronic device such as a mobile phone. For example, when a mobile phone is used as a wifi hotspot device, each user device accesses the wifi hotspot of the mobile phone, and the traffic usage information of each user device accessing the wifi hotspot of the mobile phone is counted.

[0021] Some embodiments of the present invention are described in detail below in conjunction with the accompanying drawings. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.

[0022] Please refer to Figure 1 , Figure 1 A flow chart of a flow statistics method provided by an embodiment of the present invention.

[0023] like Figure 1 As shown, the traffic statistics method includes steps S101 to S103.

[0024] Step S101: When a user device is connected to a wifi device, a traffic statistics strategy corresponding to the user device is obtained.

[0025] Among them, the traffic statistics strategy is a strategy for collecting traffic used by user devices, and the traffic statistics strategy includes sampling granularity, and the sampling granularity includes information such as sampling time, sampling interval, and number of data packets. The user device can be set according to actual conditions, and the embodiment of the present invention does not specifically limit this. For example, the user device can be a mobile phone, a computer, a tablet computer, a laptop computer, a smart TV, and a smart wearable device. The traffic statistics strategies of different user devices are different, and the differences in traffic statistics strategies include different sampling times and different sampling intervals, etc.

[0026] In one embodiment, if Figure 2 As shown, step S101 includes sub-steps S1011 to S1012.

[0027] Sub-step S1011: when the user equipment is connected to the wifi device, obtain characteristic information of the user equipment using network resources.

[0028] Among them, the characteristic information includes at least one of a habit characteristic and a behavior characteristic. The habit characteristic is used to characterize the habit of the user device in using traffic, and the habit characteristic is statistically analyzed based on multiple traffic usage situations of the user device; the behavior characteristic is used to characterize the characteristics of the behavior of the user device in the usage scenario, and the usage scenario can be determined based on actual conditions. The embodiment of the present invention does not make specific limitations on this. For example, the behavior characteristic can be the type of traffic used, and the traffic type includes web browsing, file downloading, and video streaming.

[0029] In one embodiment, when a user device is connected to a wifi device, characteristic information of the user device's use of network resources is obtained, and the characteristic information includes at least one of a habit characteristic and a behavior characteristic, and a traffic statistics strategy corresponding to the user device is matched according to the habit characteristic and / or the behavior characteristic.

[0030] In one embodiment, the method for obtaining the characteristic information of the user device using the network resources may be: obtaining the account information of the user device, and obtaining the characteristic information of the user device using the network resources according to the account information of the user device. The characteristic information of the user device using the network resources may be stored in the local storage of the wifi device or in the cloud. When the characteristic information of the user device using the network resources is needed, it is obtained from the local storage or downloaded from the cloud. The characteristic information of the user device using the network resources can be accurately downloaded through the account information of the user device.

[0031] In one embodiment, when the characteristic information of using the network resources is not obtained according to the account information of the user equipment, it is determined that the user equipment is accessing the wifi device for the first time, and the characteristic information of using the network resources of the user equipment is empty.

[0032] Sub-step S1012: matching a traffic statistics strategy corresponding to the user equipment according to the characteristic information.

[0033] In one embodiment, the traffic statistics priority of the user device is determined according to at least one of the habit feature and the behavior feature; and the corresponding traffic statistics strategy is matched for the user device according to the traffic statistics priority of the user device. According to the traffic statistics priority of the user device, the traffic statistics strategy corresponding to the user device can be accurately determined, which greatly improves the efficiency and accuracy of traffic statistics.

[0034] In one embodiment, the method of determining the traffic statistics priority of the user device according to at least one of the habit feature and the behavior feature may be: determining a first priority score of the user device according to the habit feature, and determining a second priority score of the user device according to the behavior feature; performing a weighted summation of the first priority score and the second priority score to obtain a target statistics priority score of the user device; and determining the traffic statistics priority of the user device according to the target statistics priority score of the user device. By performing a weighted summation of the priority scores of the habit feature and the behavior feature, the target statistics priority score of the user device can be accurately obtained, and the traffic statistics priority of the user device can be accurately obtained based on the target statistics priority score.

[0035] It should be noted that when the feature information only includes the habit feature, the second priority score is 0, and the first priority score is determined as the target statistical priority score. When the feature information only includes the behavioral feature, the first priority score is 0, and the second priority score is determined as the target statistical priority score. In the case where the feature information of the user device is empty, the preset statistical priority score is used as the target statistical priority score of the user device, wherein the preset statistical priority score can be set according to the actual situation, and the embodiment of the present invention does not specifically limit this.

[0036] In one embodiment, according to the habit characteristics, the method for determining the first priority score of the user device can be: obtaining a mapping relationship table between preset habit characteristics and priority scores, determining the priority scores corresponding to each habit characteristic from the mapping relationship table, obtaining multiple priority scores, and accumulating each priority score to obtain a first priority score. Among them, the mapping relationship table is established in advance based on the habit characteristics and the priority scores, and the mapping relationship table can be established according to actual conditions, and the embodiment of the present invention does not make specific limitations on this. The mapping relationship table can accurately obtain the priority scores of multiple habit characteristics, and the first priority score can be accurately obtained by superimposing each priority score.

[0037] In one embodiment, the method for determining the second priority score of the user device according to the behavior characteristics can be: obtaining a mapping relationship table between preset behavior characteristics and priority scores, determining the priority scores corresponding to each behavior characteristic from the mapping relationship table, obtaining multiple priority scores, and accumulating each priority score to obtain a second priority score. Among them, the mapping relationship table is established in advance based on the behavior characteristics and the priority scores, and the mapping relationship table can be established according to actual conditions, and the embodiment of the present invention does not specifically limit this. The mapping relationship table can accurately obtain the priority scores of multiple behavior characteristics, and the first priority score can be accurately obtained by superimposing each priority score.

[0038] In one embodiment, the first priority score and the second priority score are weighted and summed to obtain the target statistical priority score of the user device. The method may be: obtaining a preset first weight parameter and a preset second weight parameter, multiplying the first priority score and the preset first weight parameter to obtain a third priority score; multiplying the second priority score and the preset second weight parameter to obtain a fourth priority score; adding the third priority score and the fourth priority score to obtain the target statistical priority score of the user device. The preset first weight parameter and the preset second weight parameter may be set according to actual conditions, and the embodiment of the present invention does not specifically limit this. By weighted summing the first priority score and the second priority score, the target statistical priority score can be accurately obtained.

[0039] In one embodiment, according to the target statistical priority score of the user equipment, the method of determining the traffic statistical priority of the user equipment can be: obtaining a mapping relationship table between preset traffic statistical priorities and traffic statistical policies; and determining the traffic statistical policy corresponding to the traffic statistical priority of the user equipment from the mapping relationship table. The mapping relationship table is established in advance according to the traffic statistical priority and the traffic statistical policy, and the traffic statistical policy matched by the user equipment can be accurately determined according to the mapping relationship table.

[0040] Step S102: Acquire data packets of the user equipment according to the traffic statistics strategy to obtain multiple target data packets.

[0041] The target data packet is a data packet sent to the user equipment.

[0042] In one embodiment, if Figure 3 As shown, step S102 includes sub-steps S1021 and S1022.

[0043] Sub-step S1021: acquiring a data packet whose IP address is the IP address of the user equipment according to the sampling granularity in the traffic statistics strategy, to obtain a plurality of target data packets.

[0044] The sampling granularity includes the sampling time and the sampling interval. For example, the sampling time of the sampling granularity is from 8:00 to 24:00, and the sampling interval is 30 minutes, that is, sampling starts from 8:00 and is sampled every 30 minutes until 24:00.

[0045] In one embodiment, a data packet whose Internet Protocol (IP) address is the IP address of the user device is sniffed according to the sampling granularity in the traffic statistics strategy to obtain multiple target data packets. By sniffing the IP address in the data packet, the target data packet of the user device can be accurately obtained.

[0046] Sub-step S1022: acquiring a data packet whose port number is the port number of the user equipment according to the sampling granularity in the traffic statistics strategy, to obtain a plurality of target data packets.

[0047] According to the sampling granularity in the traffic statistics strategy, the data packet whose port number is the port number of the user device is sniffed to obtain multiple target data packets. By sniffing the port number of the user device receiving the data packet as the port number of the target user device, the target data packet belonging to the target user device can be accurately sniffed, greatly improving the accuracy of traffic statistics.

[0048] Exemplarily, the port number of the target user device is 121, and the sniffed data packets include data packet 1, data packet 2, data packet 3 and data packet 4, among which the port number of the user device receiving data packet 1 is 111, the port number of the user device receiving data packet 2 is 112, the port number of the user device receiving data packet 3 is 121, and the port number of the user device receiving data packet 4 is 111, then data packet 3 is determined to be the target data packet.

[0049] Step S103: Determine the usage traffic information of the user equipment according to the traffic statistics strategy and the multiple target data packets.

[0050] Determine the flow size of each target data packet; generate the usage flow information of the user device according to the flow size of each target data packet and the sampling granularity in the flow statistics strategy. According to the flow size of the data packet and the sampling granularity, the usage flow information of the user device can be accurately calculated.

[0051] In one embodiment, the flow size of each target data packet can be determined by: obtaining the number of bytes of each target data packet and obtaining the flow required to send each byte; multiplying the number of bytes of the target data packet by the flow required to send each byte to obtain the flow size of the target data packet. By calculating the flow per unit byte sent and the number of bytes of the target data packet, the flow size of each target data packet can be accurately obtained.

[0052] In one embodiment, according to the flow size of each target data packet and the sampling granularity in the flow statistics policy, the method of generating the flow information of the user device can be: superimposing the flow size of each target data packet to obtain the total flow at the sampling time point, dividing the total flow at the sampling time point by the sampling number of sampling granularity to obtain the average flow, and multiplying the average flow by the total time of use of the user device to obtain the total flow of the user device. Through the flow statistics policy corresponding to the user device, flow sampling is performed, and the total flow of the user device can be accurately inferred based on the data packet obtained by sampling and the flow statistics policy, and the flow consumption of the user device can be calculated with low consumption and high efficiency.

[0053] For example, Figure 4 As shown, the wifi device 20 is connected to the user device A21, the user device B22, the user device C23 and the user device D24, and the wifi device 20 obtains the traffic statistics policies corresponding to the user device A21, the user device B22, the user device C23 and the user device D24 respectively, and obtains the data packets of the user devices, multiple target data packets of the user device A21, multiple target data packets of the user device B22, multiple target data packets of the user device C23 and multiple target data packets of the user device D24 according to the traffic statistics policies; determines the usage traffic information of the user device A21 according to the traffic statistics policy and the multiple target data packets of the user device A21; determines the usage traffic information of the user device B22 according to the traffic statistics policy and the multiple target data packets of the user device B22; determines the usage traffic information of the user device C23 according to the traffic statistics policy and the multiple target data packets of the user device C23; determines the usage traffic information of the user device D24 according to the traffic statistics policy and the multiple target data packets of the user device D24.

[0054] In one embodiment, the traffic usage information corresponding to each user device is obtained, and a traffic usage information statistics table is generated according to the traffic usage information corresponding to the user device; and the traffic usage information statistics table is displayed. By displaying the traffic usage information statistics table, it is convenient for users to allocate traffic resources to each user device, so as to improve the user experience of each user device and improve the traffic usage efficiency.

[0055] The traffic statistics method in the above embodiment, when the user device is connected to the wifi device, obtains the traffic statistics policy corresponding to the user device; then obtains the data packet of the user device according to the traffic statistics policy to obtain multiple target data packets; then, according to the traffic statistics policy and the multiple target data packets, the traffic information used by the user device can be accurately determined. This solution obtains the traffic statistics policy matched by the user device, and obtains multiple target data packets corresponding to the user device based on the traffic statistics policy. Through the traffic statistics policy and the multiple target data packets, the traffic information used by the user device can be accurately calculated, which greatly improves the efficiency and accuracy of traffic statistics.

[0056] See also Figure 5 , Figure 5 A schematic block diagram of the structure of a Wi-Fi device provided in an embodiment of the present invention.

[0057] like Figure 5 As shown, the wifi device 300 includes a processor 301 and a memory 302, and the processor 301 and the memory 302 are connected via a bus 303, such as an I2C (Inter-integrated Circuit) bus.

[0058] Specifically, the processor 301 is used to provide computing and control capabilities to support the operation of the entire wifi device. The processor 301 can be a central processing unit (CPU), and the processor 301 can also be other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor can be a microprocessor or the processor can also be any conventional processor, etc.

[0059] Specifically, the memory 302 may be a Flash chip, a read-only memory (ROM) disk, an optical disk, a USB flash drive, or a mobile hard disk.

[0060] Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present invention, and does not constitute a limitation on the WiFi device to which the solution of the present invention is applied. The specific WiFi device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0061] The processor 301 is used to run a computer program stored in a memory, and implement any one of the traffic statistics methods provided by the embodiments of the present invention when executing the computer program.

[0062] In one embodiment, the processor 301 is used to run a computer program stored in a memory, and implement the following steps when executing the computer program:

[0063] When the user device is connected to a wifi device, a traffic statistics strategy corresponding to the user device is obtained;

[0064] Acquire data packets of the user equipment according to the traffic statistics strategy to obtain multiple target data packets;

[0065] The traffic usage information of the user equipment is determined according to the traffic statistics strategy and the multiple target data packets.

[0066] In one embodiment, when the processor 301 implements the acquisition of the traffic statistics strategy corresponding to the user equipment when the user equipment is connected to the wifi device, it is used to implement:

[0067] When the user equipment is connected to the wifi device, obtaining characteristic information of the network resources used by the user equipment;

[0068] A traffic statistics strategy corresponding to the user equipment is matched according to the characteristic information.

[0069] In one embodiment, the processor 301 implements that the characteristic information includes at least one of a habit characteristic and a behavior characteristic; and when matching the traffic statistics strategy corresponding to the user equipment according to the characteristic information, is used to implement:

[0070] Determining a traffic statistics priority of the user equipment according to at least one of the habit feature and the behavior feature;

[0071] According to the traffic statistics priority of the user equipment, a corresponding traffic statistics policy is matched for the user equipment.

[0072] In one embodiment, when the processor 301 determines the traffic statistics priority of the user equipment according to at least one of the habit feature and the behavior feature, it is configured to implement:

[0073] Determining a first priority score for the user device based on the habit feature, and determining a second priority score for the user device based on the behavior feature;

[0074] Taking a weighted sum of the first priority score and the second priority score to obtain a target statistical priority score of the user equipment;

[0075] Determine the traffic statistics priority of the user equipment according to the target statistics priority score of the user equipment.

[0076] In one embodiment, when the processor 301 matches the corresponding traffic statistics policy for the user equipment according to the traffic statistics priority of the user equipment, it is configured to implement:

[0077] Obtain a mapping relationship table between preset traffic statistics priorities and traffic statistics policies;

[0078] A traffic statistics policy corresponding to the traffic statistics priority of the user equipment is determined from the mapping relationship table.

[0079] In one embodiment, when the processor 301 obtains the data packet of the user equipment according to the traffic statistics strategy to obtain multiple target data packets, it is configured to implement:

[0080] Acquire a data packet whose IP address is the IP address of the user device according to the sampling granularity in the traffic statistics strategy to obtain multiple target data packets; or,

[0081] According to the sampling granularity in the traffic statistics strategy, a data packet whose port number is the port number of the user equipment is acquired to obtain a plurality of target data packets.

[0082] In one embodiment, when the processor 301 determines the usage traffic information of the user equipment according to the traffic statistics strategy and the plurality of target data packets, it is configured to implement:

[0083] Determine the flow size of each of the target data packets;

[0084] The usage traffic information of the user equipment is generated according to the traffic size of each target data packet and the sampling granularity in the traffic statistics strategy.

[0085] In one embodiment, after implementing the determination of the usage traffic information of the user equipment according to the traffic statistics strategy and the plurality of target data packets, the processor 301 is further configured to implement:

[0086] Acquire the traffic usage information corresponding to each of the user equipments, and generate a traffic usage information statistics table according to the traffic usage information corresponding to the user equipments;

[0087] Display the traffic usage statistics table.

[0088] It should be noted that those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the wifi device described above can refer to the corresponding process in the aforementioned traffic statistics method embodiment, and will not be repeated here.

[0089] An embodiment of the present invention also provides a storage medium for computer-readable storage, wherein the storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of any traffic statistics method provided in the specification of the present invention.

[0090] The storage medium may be an internal storage unit of the wifi device described in the above embodiment, such as a hard disk or memory of the wifi device. The storage medium may also be an external storage device of the wifi device, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (SecureDigital, SD) card, a flash card (Flash Card), etc. equipped on the wifi device.

[0091] It will be appreciated by those skilled in the art that all or some of the steps, systems, and functional modules / units in the methods disclosed above may be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementations, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those of ordinary skill in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

[0092] It should be understood that the term "and / or" used in the present specification refers to any combination of one or more of the associated listed items and all possible combinations, including these combinations. It should be noted that, in this article, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprises a..." does not exclude the presence of other identical elements in the process, method, article or system including the element.

[0093] The serial numbers of the embodiments of the present invention are only for description and do not represent the advantages and disadvantages of the embodiments. The above description is only a specific implementation of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed by the present invention, and these modifications or replacements should be covered within the protection scope of the present invention.

Claims

1. A traffic statistics method, characterized in that: include: When the user device is connected to a wifi device, a traffic statistics strategy corresponding to the user device is obtained; Acquire data packets of the user equipment according to the traffic statistics strategy to obtain multiple target data packets; The traffic usage information of the user equipment is determined according to the traffic statistics strategy and the multiple target data packets.

2. The traffic statistics method according to claim 1, characterized in that: When the user equipment is connected to a wifi device, obtaining a traffic statistics strategy corresponding to the user equipment includes: When the user equipment is connected to the wifi device, obtaining characteristic information of the network resources used by the user equipment; A traffic statistics strategy corresponding to the user equipment is matched according to the characteristic information.

3. The traffic statistics method according to claim 2, characterized in that: The characteristic information includes at least one of a habit characteristic and a behavior characteristic; and matching the traffic statistics strategy corresponding to the user equipment according to the characteristic information includes: Determining a traffic statistics priority of the user equipment according to at least one of the habit feature and the behavior feature; According to the traffic statistics priority of the user equipment, a corresponding traffic statistics policy is matched for the user equipment.

4. The traffic statistics method according to claim 3, characterized in that: The determining the traffic statistics priority of the user equipment according to at least one of the habit feature and the behavior feature includes: Determining a first priority score for the user device based on the habit feature, and determining a second priority score for the user device based on the behavior feature; Taking a weighted sum of the first priority score and the second priority score to obtain a target statistical priority score of the user equipment; Determine the traffic statistics priority of the user equipment according to the target statistics priority score of the user equipment.

5. The traffic statistics method according to claim 3, characterized in that: The matching a corresponding traffic statistics policy for the user equipment according to the traffic statistics priority of the user equipment includes: Obtain a mapping relationship table between preset traffic statistics priorities and traffic statistics policies; A traffic statistics policy corresponding to the traffic statistics priority of the user equipment is determined from the mapping relationship table.

6. The traffic statistics method according to claim 1, characterized in that: The step of acquiring the data packet of the user equipment according to the traffic statistics strategy to obtain a plurality of target data packets includes: Acquire a data packet whose IP address is the IP address of the user device according to the sampling granularity in the traffic statistics strategy to obtain multiple target data packets; or, According to the sampling granularity in the traffic statistics strategy, a data packet whose port number is the port number of the user equipment is acquired to obtain a plurality of target data packets.

7. The traffic statistics method according to claim 1, characterized in that: Determining the usage traffic information of the user equipment according to the traffic statistics strategy and the plurality of target data packets includes: Determine the flow size of each of the target data packets; The usage traffic information of the user equipment is generated according to the traffic size of each target data packet and the sampling granularity in the traffic statistics strategy.

8. The traffic statistics method according to any one of claims 1 to 7, characterized in that: After determining the usage traffic information of the user equipment according to the traffic statistics strategy and the plurality of target data packets, the method further includes: Acquire the traffic usage information corresponding to each of the user equipments, and generate a traffic usage information statistics table according to the traffic usage information corresponding to the user equipments; Display the traffic usage statistics table.

9. A wifi device, characterized in that: The wifi device includes a processor, a memory, a computer program stored in the memory and executable by the processor, and a data bus for realizing connection and communication between the processor and the memory, wherein when the computer program is executed by the processor, the steps of the traffic statistics method described in any one of claims 1 to 8 are implemented.

10. A storage medium for computer-readable storage, characterized in that: The storage medium stores one or more programs, and the one or more programs can be executed by one or more processors to implement the steps of the traffic statistics method according to any one of claims 1 to 8.