A method, device, storage medium and system for multi-operator traffic statistics

By conducting operator packets and multi-threaded concurrent query on IoT devices, the problems of low efficiency and poor statistical accuracy of operator data query in the existing technology are solved, and more efficient and accurate traffic statistics are achieved.

CN119402396BActive Publication Date: 2025-04-15GUANGZHOU JUNBO NETWORK TECH INC
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510001394.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-02
Publication Date
2025-04-15
Estimated Expiration
2045-01-02

AI Technical Summary

Technical Problem

The existing Internet of Things equipment network card traffic statistics system has problems such as low data query efficiency and poor statistical accuracy, especially when the traffic settlement time of different operators is different and the query interface timeout is over.

Method used

By grouping IoT devices based on operator type, dividing them into multiple thread query groups, and using concurrent query methods to obtain traffic usage data, calculate usage differences, and make abnormal judgments, and finally update the total traffic data to improve statistical accuracy.

Benefits of technology

It improves the efficiency and accuracy of IoT device traffic statistics, reduces the number of calls and response time of query interfaces, and ensures the timeliness and accuracy of traffic data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119402396B_ABST
    Figure CN119402396B_ABST
Patent Text Reader

Abstract

The present invention is applicable to the field of Internet of Things technology, and provides a method, device, storage medium and system for multi-operator traffic statistics, the method comprising grouping all Internet of Things devices to be queried based on operator type to obtain several operator query groups; dividing each of the operator query groups into several thread query groups; concurrently querying all the thread query groups to obtain the traffic usage data of each Internet of Things device under the query cycle; based on the traffic usage data of two consecutive query cycles, obtaining the usage difference of each Internet of Things device; making an abnormal judgment on the usage difference to obtain an abnormal judgment result; when the abnormal judgment result is normal, updating the total traffic volume data to obtain the Internet of Things device usage statistics result. The present application has high accuracy and fast speed for data usage query of Internet of Things devices, and can also customize the traffic statistics cycle and settlement date, with flexible configuration.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of Internet of Things, and in particular relates to a method, device, storage medium and system for multi-operator traffic statistics. Background Art

[0002] Internet of Things devices (IoT devices) refer to various devices that can connect, collect and exchange data via the Internet. These devices can be household appliances, industrial machinery, sensors, wearable devices, etc. They are usually equipped with sensors, software and other technologies to monitor and control the status of the environment or equipment in real time.

[0003] With the popularization of 5G technology and the increasing number of IoT devices, the traffic usage of operators by IoT devices is becoming increasingly huge. In order to control traffic costs and operate IoT devices, IoT equipment vendors have higher and higher requirements for traffic statistics of IoT cards in devices.

[0004] However, there are many problems in the network card traffic statistics system for IoT devices. For example, due to the different traffic query rules and methods of different operators and different statistical periods, it is difficult for IoT equipment vendors to count the traffic consumption within a certain period based on actual needs. For another example, due to the large number of IoT cards in the operator system, traffic query interface timeouts, anomalies, slow response speeds and other problems often occur, and data query efficiency is low. For another example, in the process of IoT card traffic statistics, due to the different traffic settlement times of different operators, it is often the case that the traffic in the same historical time period is queried at different time points, and the amount of data obtained from the query is different, and the traffic statistics are inaccurate.

[0005] Therefore, it is necessary to improve the existing traffic statistics methods, such as low operator data query efficiency and poor statistical accuracy. Summary of the invention

[0006] The purpose of the embodiments of the present application is to provide a method for multi-operator traffic statistics, aiming to solve the problems existing in the existing traffic statistics methods, such as low operator data query efficiency and poor statistical accuracy.

[0007] The embodiment of the present application is implemented by providing a method for multi-operator traffic statistics, the method comprising:

[0008] All IoT devices to be queried are grouped based on the operator type to obtain several operator query groups; each of the operator query groups is divided into several thread query groups, each of which contains a number of IoT devices; all of the thread query groups are concurrently queried to obtain the traffic usage data of each IoT device in the query cycle; based on the traffic usage data of two consecutive query cycles, the usage difference of each IoT device is obtained; an abnormality judgment is performed on the usage difference, and the abnormality judgment is used to eliminate erroneous traffic usage data caused by operator data abnormality to obtain an abnormality judgment result; when the abnormality judgment result is normal, the total traffic volume data is updated to obtain the usage statistics of IoT devices.

[0009] Preferably, the method of dividing each of the operator query groups into a plurality of thread query groups is:

[0010] Get the response speed parameters of each operator;

[0011] Based on the response speed parameter of the operator, query the response speed-query volume mapping table to obtain the preset number of devices in each thread corresponding to different response speeds;

[0012] Get the number n of thread query groups for this operator:

[0013]

[0014] Wherein, T is the number of IoT devices using the operator, and k is the number of preset devices;

[0015] Based on the number of thread query groups, the IoT devices in the operator query group are evenly grouped to obtain n thread query groups corresponding to the operator.

[0016] Preferably, the method of concurrently querying all the thread query groups to obtain the traffic usage data of each IoT device in the query cycle also includes:

[0017] Get the timeout threshold and retry count threshold;

[0018] In each query cycle, when the response time of the IoT device exceeds the timeout threshold, it is recorded as a timeout error;

[0019] When the number of timeout errors exceeds the retry number threshold, the query of the Internet of Things device within the query cycle is abandoned.

[0020] Preferably, based on the traffic usage data of two consecutive query cycles, the method for obtaining the usage difference of each IoT device is:

[0021] Get the traffic usage data of each IoT device in two consecutive query cycles;

[0022] Based on the timing of the query, the traffic usage data of the next query cycle is subtracted from the traffic usage data of the previous query cycle to obtain the usage difference.

[0023] Preferably, the method for determining whether the usage difference is abnormal is:

[0024] When the usage difference is greater than or equal to zero, the result of the abnormality judgment is normal;

[0025] When the usage difference is less than zero, a flow change verification threshold is obtained, where the flow change verification threshold is used to determine whether the operator has updated the flow statistics cycle;

[0026] The usage difference is compared with the flow change verification threshold. If the flow usage data of the subsequent query cycle is greater than the flow change verification threshold, the result of the abnormal judgment is abnormal; if the flow usage data of the subsequent query cycle is less than the flow change verification threshold, the result of the abnormal judgment is normal, and the total flow data is updated.

[0027] Preferably, when the result of the abnormal judgment is abnormal, it is regarded as an operator traffic abnormality, and the abnormal data is ignored, and the total traffic volume data of the Internet of Things device is not updated.

[0028] Another object of an embodiment of the present application is to provide a device for multi-operator traffic statistics, the device for multi-operator traffic statistics comprising:

[0029] An operator query group acquisition module is used to group all IoT devices to be queried based on operator type to obtain several operator query groups;

[0030] A thread query group acquisition module, used to divide each of the operator query groups into a plurality of thread query groups, each of the thread query groups containing a plurality of IoT devices;

[0031] A flow usage data acquisition module, used to perform concurrent queries on all the thread query groups to obtain flow usage data of each IoT device in the query cycle;

[0032] A usage difference acquisition module is used to obtain the usage difference of each IoT device based on the traffic usage data of two consecutive query cycles;

[0033] An abnormality judgment result acquisition module is used to perform abnormality judgment on the usage difference, and the abnormality judgment is used to eliminate erroneous traffic usage data caused by abnormal operator data to obtain an abnormality judgment result;

[0034] The usage statistics result acquisition module is used to update the total flow data when the abnormal judgment result is normal, and obtain the usage statistics result of the Internet of Things device.

[0035] Preferably, the thread query group acquisition module includes:

[0036] A response speed parameter acquisition module is used to obtain the response speed parameters of each operator;

[0037] A preset device quantity acquisition module is used to query the response speed-query volume mapping table based on the response speed parameter of the operator to obtain the preset device quantity in each thread corresponding to different response speeds;

[0038] The thread query group number acquisition module is used to obtain the number n of thread query groups of the operator:

[0039]

[0040] Wherein, T is the number of IoT devices using the operator, and k is the number of preset devices;

[0041] The average grouping module is used to averagely group the IoT devices in the operator query group based on the number of thread query groups to obtain n thread query groups corresponding to the operator.

[0042] Another object of an embodiment of the present application is to provide a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the processor executes the steps of the method for multi-operator traffic statistics as described above.

[0043] Another object of an embodiment of the present application is to provide a system for multi-operator traffic statistics, which, when running, executes the steps of the multi-operator traffic statistics method as described above.

[0044] The method for multi-operator traffic statistics provided in the embodiment of the present application first groups based on different operators, then uses multi-threading to group, and then integrates a large number of IoT devices, so as to facilitate the overall statistical summary results, which is conducive to the management of large-scale various types of IoT devices. Compared with the existing statistical system, this method adopts a multi-threaded statistical method, which has a faster overall statistical speed and higher traffic calculation accuracy. Since the query cycle can be customized, the active query method adopted by this solution can facilitate IoT device service providers to obtain data usage information of IoT devices in real time, and then customize the traffic statistical cycle and settlement date, which is flexible to configure and more practical. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Figure 1 An application environment diagram of a multi-operator traffic statistics method provided in an embodiment of the present application;

[0046] Figure 2 A flowchart of a method for multi-operator traffic statistics provided in an embodiment of the present application;

[0047] Figure 3 A module diagram of a device for multi-operator traffic statistics provided in an embodiment of the present application;

[0048] Figure 4 FIG. 4 is a block diagram of the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0049] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.

[0050] It is understood that the terms "first", "second", etc. used in this application may be used herein to describe various elements, but unless otherwise specified, these elements are not limited by these terms. These terms are only used to distinguish a first element from another element. For example, a first script may be referred to as a second script, and similarly, a second script may be referred to as a first script without departing from the scope of this application.

[0051] Figure 1 The application environment diagram of the method for multi-operator traffic statistics provided in the embodiment of the present application is as follows: Figure 1 As shown, in the application environment, a terminal 110 and a computer device 120 are included.

[0052] The computer device 120 may be an independent physical server or terminal, or a server cluster composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud servers, cloud databases, cloud storage, and CDN, but is not limited thereto.

[0053] The terminal 110 may be various IoT devices, tablet computers, smart speakers, smart watches, etc., but is not limited thereto. The terminal 110 and the computer device 120 may be connected via a network, and this application does not limit this.

[0054] like Figure 2 As shown, in one embodiment, a method for multi-operator traffic statistics is proposed. This embodiment mainly applies this method to the above Figure 1 A method for multi-operator traffic statistics may specifically include the following steps:

[0055] Step S10: grouping all IoT devices to be queried based on operator type to obtain a number of operator query groups.

[0056] In this embodiment, the IoT device has an IoT card built in it for counting its traffic consumption. The IoT card has a carrier to which it belongs. For example, if it is found that all IoT device cards belong to three carriers, namely, China Mobile, China Unicom, and China Telecom, then corresponding statistical groups based on these three carriers are obtained.

[0057] Step S20: divide each of the operator query groups into a plurality of thread query groups, each of the thread query groups including a plurality of IoT devices.

[0058] In this embodiment, considering that each operator has a large number of IoT devices, they are further grouped. For example, there are 100 IoT devices with queries under operator A, which are subdivided into 10 thread query groups, group 1 to group 10, and a number of IoT devices are assigned to each thread query group. The IoT devices in each thread query group are queried in sequence according to their label order.

[0059] Step S30, concurrently query all the thread query groups to obtain the traffic usage data of each IoT device in the query cycle.

[0060] In this embodiment, query rules can be pre-set, for example, all thread query groups are all concurrently queried to improve query efficiency. A query cycle refers to a round of concurrent queries for all threads, from the start of the query to the end of all queries. After the query is completed, the traffic usage value of each IoT device fed back from the operator is obtained.

[0061] Step S40, based on the traffic usage data of two consecutive query cycles, obtain the usage difference of each IoT device.

[0062] Step S50, performing an abnormality judgment on the usage difference, wherein the abnormality judgment is used to eliminate erroneous traffic usage data caused by abnormal operator data to obtain an abnormality judgment result.

[0063] In this embodiment, since the data fed back by the operator is affected by various factors and may not necessarily be a correct value, the value needs to be further judged to shield abnormal results.

[0064] Step S60: When the abnormality judgment result is normal, the total flow data is updated to obtain the usage statistics of the Internet of Things devices.

[0065] In this embodiment, when the result is judged to be a normal value, the actual usage of the IoT device is updated and processed based on the value, thereby obtaining relatively accurate total flow data.

[0066] In an embodiment of the present application, this solution provides a data query method that can integrate multiple different operators. By first grouping based on different operators, and then using multi-threading to group, a large number of IoT devices are integrated to facilitate the overall statistical summary results, which is conducive to the management of large-scale various types of IoT devices. Compared with the existing statistical system, this method adopts a multi-threaded statistical method, which has a faster overall statistical speed and higher traffic calculation accuracy. Since the query cycle can be customized, the active query method adopted by this solution can facilitate IoT device service providers to obtain data usage information of IoT devices in real time, and then customize the traffic statistical cycle and settlement date, which is flexible to configure and more practical.

[0067] In a preferred embodiment, the method of dividing each of the operator query groups into a plurality of thread query groups is:

[0068] Get the response speed parameter of each operator; based on the response speed parameter of the operator, query the response speed-query volume mapping table to obtain the preset number of devices in each thread corresponding to different response speeds; get the number n of thread query groups of the operator:

[0069]

[0070] Among them, T is the number of IoT devices using the operator, and k is the preset number of devices; based on the number of thread query groups, the IoT devices in the operator query group are evenly grouped to obtain n thread query groups corresponding to the operator.

[0071] In the embodiments of the present application, the researchers of the present application found that under the influence of specific communication environments in different regions, different operators can provide different network conditions. For example, in a certain environment, the response speed of the IoT card of a mobile operator is generally slower than that of the IoT card of a telecom operator. Therefore, if the same number of IoT cards with queries are set in each query thread of different operators, the end time of each thread running in parallel during the query is different, which slows down the overall query time.

[0072] Therefore, first obtain the response speed parameters of each operator. For example, network delay, etc., and then build a corresponding mapping table of response speed and query volume based on the actual network conditions. That is, for operators with slow response speed, the number of IoT devices with query in each thread query group is set to be smaller; correspondingly, for operators with fast response speed, the number of IoT cards that need to be queried in each thread is further increased, further improving the query efficiency. By default, the number of IoT devices in each query thread corresponding to different operators can be set to the same.

[0073] In a preferred embodiment, a method for concurrently querying all the thread query groups to obtain the traffic usage data of each IoT device in the query cycle also includes: obtaining a timeout threshold and a retry threshold; in each query cycle, when the response time of the IoT device exceeds the timeout threshold, it is recorded as a timeout error; when the number of timeout errors exceeds the retry threshold, the query of the IoT device in the query cycle is abandoned.

[0074] In an embodiment of the present application, in order to avoid unresponsive interfaces occupying the query thread, a timeout threshold and a retry threshold are set to improve query efficiency. For example, when querying usage, the response timeout of the operator interface or other types is processed, and a timeout for each call can be set, such as 5 seconds, and multiple attempts are made to retry the number of times when a timeout occurs. If the retry query is successful, the retry is terminated, and if all queries fail, the query is abandoned. Avoid thread interruption caused by no response.

[0075] In a preferred embodiment, based on the traffic usage data of two consecutive query cycles, the method for obtaining the usage difference of each IoT device is as follows:

[0076] Get the traffic usage data of each IoT device in two consecutive query cycles;

[0077] Based on the timing of the query, the traffic usage data of the next query cycle is subtracted from the traffic usage data of the previous query cycle to obtain the usage difference.

[0078] In the embodiment of the present application, in order to further improve the accuracy of traffic statistics, this solution does not directly quote the data provided by the operator, but can obtain the traffic statistics segment usage when each query time occurs based on each difference.

[0079] In a preferred embodiment, the method for making an abnormality judgment on the usage difference is as follows: when the usage difference is greater than or equal to zero, the result of the abnormality judgment is normal; when the usage difference is less than zero, a traffic change verification threshold is obtained, and the traffic change verification threshold is used to determine whether the operator has updated the traffic statistics period; the usage difference is compared with the traffic change verification threshold, and if the traffic usage data of the subsequent query period is greater than the traffic change verification threshold, the result of the abnormality judgment is abnormal; if the traffic usage data of the subsequent query period is less than the traffic change verification threshold, the result of the abnormality judgment is normal, and the total traffic data is updated.

[0080] When the result of the abnormal judgment is abnormal, it is regarded as the operator's traffic abnormality, and the abnormal data is ignored, and the total traffic data of the Internet of Things device is not updated.

[0081] In the embodiment of the present application, whether the flow statistics are abnormal can be judged based on the flow difference, and then the total flow usage can be updated. The specific method may include the following steps:

[0082] First, add two fields to the information table of the network card of the IoT device: device_current_flow and operator_current_flow. IoT device vendors reset the current flow of the device vendor (device_current_flow) to 0 during the periodic settlement according to the settlement cycle they set. The operator's current flow (operator_current_flow) is kept consistent with the official one, and the operator's current flow is synchronized every time the query is normal, which is not affected by the settlement cycle of the device vendor.

[0083] Then, each time the operator's current usage is synchronized, the difference between the next usage (operator_current_flow2) and the previous usage (operator_current_flow1) is calculated to get the usage difference :

[0084]

[0085] When flow_change>0, the change is accumulated to device_current_flow:

[0086]

[0087] When flow_change=0, the current usage of the equipment supplier is not updated.

[0088] When flow_change<0, there are two situations. Situation 1: The operator's traffic is abnormal, resulting in the usage of the subsequent query being smaller than the previous one. Situation 2: The operator has just completed the periodic settlement, and the usage queried later is the increased usage after the current usage is cleared. In order to distinguish the above two situations, the traffic change verification threshold verify_flow is set (assuming 1GB=1024MB=1048576 KB), and operator_current_flow2 and verify_flow are compared. When operator_current_flow2>verify_flow, it is considered that the operator's traffic is abnormal, and the current usage of the equipment vendor is not updated, nor is the operator's current usage. When operator_current_flow2<=verify_flow, it is considered that the operator has completed the periodic settlement, and the current usage of the equipment vendor is updated with the following program segment:

[0089]

[0090] Finally, update the operator's current usage to be equal to operator_current_flow2.

[0091] Through the above method, a traffic update is completed.

[0092] In one embodiment of the present application, for example, the settlement cycle of the Internet of Things card cmcc1 is one quarter (90 days), the start time of the cycle is 2024-09-02 00:00:00, and the next settlement date is 2024-12-01 00:00:00. The settlement cycle of the operator of cmcc1 is one natural month, the start date of the cycle is 2024-09-01 00:00:00, the next settlement date is 2024-10-01 00:00:00, and the operator's current usage on 2024-09-02 is 1GB. Assuming the flow verification value verify_flow = 1GB = 1024MB = 1048576 KB, the following table can be obtained:

[0093] In the embodiment of the present application, by introducing the device_current_flow field, the IoT device vendors are allowed to customize the settlement cycle, and the present invention realizes a flexible traffic statistics cycle to meet the business needs of different device vendors. This flexibility not only improves the efficiency of traffic management, but also reduces the additional costs and complexity caused by the mismatch of settlement cycles. By adopting a multi-threaded concurrent query mechanism, the IoT card data is grouped by operator, and then further grouped and processed in parallel, which significantly improves the efficiency of traffic query. At the same time, by optimizing the query logic and data processing flow, the number of calls and response time of the query interface are reduced, ensuring the timeliness and accuracy of traffic data. By introducing the operator_current_flow field and the traffic change verification threshold, the traffic change can be accurately calculated, and the two situations of traffic abnormality and operator periodic settlement can be effectively distinguished. When the traffic is abnormal, the current usage of the equipment vendor is not updated, avoiding the cost increase caused by erroneous data; when the operator settles periodically, the commercial usage of the equipment is accurately updated to ensure the accuracy and reliability of the statistical results.

[0094] This application demonstrates significant superiority in terms of traffic statistics cycle, query efficiency, statistical accuracy, operating costs and user experience, providing IoT equipment vendors with a more efficient, flexible and reliable traffic management solution.

[0095] like Figure 3 As shown, in one embodiment, a device for multi-operator traffic statistics is provided, which can be integrated into the above-mentioned computer device 120, and can specifically include an operator query group acquisition module 510, a thread query group acquisition module 520, a traffic usage data acquisition module 530, a usage difference acquisition module 540, an abnormal judgment result acquisition module 550, and a usage statistics result acquisition module 560.

[0096] The operator query group acquisition module 510 is used to group all IoT devices to be queried based on operator type to obtain a number of operator query groups;

[0097] A thread query group acquisition module 520 is used to divide each of the operator query groups into a plurality of thread query groups, each of which includes a plurality of IoT devices;

[0098] The traffic usage data acquisition module 530 is used to perform concurrent queries on all the thread query groups to obtain the traffic usage data of each IoT device in the query cycle;

[0099] The usage difference acquisition module 540 is used to obtain the usage difference of each IoT device based on the traffic usage data of two consecutive query cycles;

[0100] The abnormality judgment result acquisition module 550 is used to perform abnormality judgment on the usage difference, and the abnormality judgment is used to eliminate the erroneous traffic usage data caused by the abnormal operator data to obtain the abnormality judgment result;

[0101] The usage statistics result acquisition module 560 is used to update the total flow data when the abnormality judgment result is normal, and obtain the usage statistics result of the Internet of Things device.

[0102] In the embodiment of the present application, the explanation and description of the above-mentioned multi-operator traffic statistics device can refer to the explanation and description of the above-mentioned corresponding method. For the description of the above-mentioned multi-operator traffic statistics method, please refer to the above, which will not be repeated here.

[0103] In the embodiment of the present application, by first grouping based on different operators, and then using multi-threading to group, and then integrating a large number of IoT devices, it is convenient to summarize the overall statistical results, which is conducive to the management of large-scale various types of IoT devices. Compared with the existing statistical system, this method adopts a multi-threaded statistical method, which has a faster overall statistical speed and higher traffic calculation accuracy. Since the query cycle can be customized, the active query method adopted by this solution can facilitate IoT device service providers to obtain data usage information of IoT devices in real time, and then customize the traffic statistical cycle and settlement date, which is flexible to configure and more practical.

[0104] In one embodiment, the thread query group acquisition module includes:

[0105] A response speed parameter acquisition module is used to obtain the response speed parameters of each operator;

[0106] A preset device quantity acquisition module is used to query the response speed-query volume mapping table based on the response speed parameter of the operator to obtain the preset device quantity in each thread corresponding to different response speeds;

[0107] The thread query group number acquisition module is used to obtain the number n of thread query groups of the operator:

[0108]

[0109] Wherein, T is the number of IoT devices using the operator, and k is the number of preset devices;

[0110] The average grouping module is used to averagely group the IoT devices in the operator query group based on the number of thread query groups to obtain n thread query groups corresponding to the operator.

[0111] Figure 4The internal structure diagram of a computer device in one embodiment is shown. The computer device may specifically be Figure 1 The computer device 120 in FIG. 4 . As shown in FIG. 4 , the computer device includes a processor, a memory, a network interface, an input device, and a display screen connected via a system bus. Among them, the memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the computer device stores an operating system and may also store a computer program, which, when executed by the processor, enables the processor to implement a method for multi-operator traffic statistics. The internal memory may also store a computer program, which, when executed by the processor, enables the processor to execute a method for multi-operator traffic statistics. The display screen of the computer device may be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device may be a touch layer covered on the display screen, or may be a button, trackball, or touchpad provided on the housing of the computer device, or may be an external keyboard, touchpad, or mouse, etc.

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

[0113] In one embodiment, the apparatus for multi-operator traffic statistics provided by the present application can be implemented in the form of a computer program, and the computer program can be used in Figure 4 The computer device is run on the computer device shown. The memory of the computer device can store various program modules constituting the device for multi-operator traffic statistics, for example, Figure 3 The modules 510, 520 and 530 shown in the figure, etc. The computer program composed of various program modules enables the processor to execute the steps of the method for multi-operator traffic statistics in various embodiments of the present application described in this specification.

[0114] For example, Figure 4 The computer device shown can be Figure 3 The module 510 in the apparatus for multi-operator traffic statistics shown in the figure executes step S10. The computer device can execute step S20 through the module 520. And so on.

[0115] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the processor executes the steps of the method for multi-operator traffic statistics as described above.

[0116] In the embodiment of the present application, for the description of the above-mentioned method for multi-operator traffic statistics, please refer to the above and will not be repeated here.

[0117] In the embodiment of the present application, the program run by the method stored in the storage medium of the embodiment of the present application, by first grouping based on different operators, and then using multi-threading to group, and then integrating a large number of IoT devices, is convenient for overall statistical summary results, which is conducive to the management of large-scale various types of IoT devices. Compared with the existing statistical system, this method adopts a multi-threaded statistical method, the overall statistical speed is faster, and the traffic calculation accuracy is higher. Since the query cycle can be customized, the active query method adopted by this solution can facilitate IoT device service providers to obtain data usage information of IoT devices in real time, and then customize the traffic statistical cycle and settlement date, which is flexible to configure and more practical.

[0118] In one embodiment, a system for multi-operator traffic statistics is provided. When the system is running, the system executes the steps of the multi-operator traffic statistics method described above.

[0119] In the embodiment of the present application, the system can be a computer software or program system, which runs in hardware containing a processing device, and when the above system is running, the corresponding method is executed. For the description of the above multi-operator traffic statistics method, please refer to the above, which will not be repeated here.

[0120] In the embodiment of the present application, based on this system, by first grouping based on different operators, and then using multi-threading to group, a large number of IoT devices are integrated, which is convenient for overall statistical summary results, and is conducive to the management of large-scale various types of IoT devices. Compared with the existing statistical system, this method adopts a multi-threaded statistical method, which has a faster overall statistical speed and higher traffic calculation accuracy. Since the query cycle can be customized, the active query method adopted by this solution can facilitate IoT device service providers to obtain data usage information of IoT devices in real time, and then customize the traffic statistical cycle and settlement date, which is flexible to configure and more practical.

[0121] It should be understood that, although each step in the flow chart of each embodiment of the present application is shown in sequence according to the indication of the arrow, these steps are not necessarily performed in sequence according to the order indicated by the arrow. Unless there is clear explanation in this article, the execution of these steps does not have strict order restriction, and these steps can be performed in other orders. Moreover, at least a portion of the steps in each embodiment may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these sub-steps or stages is not necessarily performed in sequence, but can be performed in turn or alternately with at least a portion of other steps or sub-steps or stages of other steps.

[0122] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0123] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0124] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A method for multi-operator traffic statistics, characterized in that: The method comprises: All IoT devices to be queried are grouped based on operator type to obtain several operator query groups; Divide each of the operator query groups into a plurality of thread query groups, each of the thread query groups including a plurality of IoT devices; Concurrently query all the thread query groups to obtain traffic usage data of each IoT device during the query period; Based on the traffic usage data of two consecutive query cycles, the usage difference of each IoT device is obtained; Performing an abnormality judgment on the usage difference, wherein the abnormality judgment is used to eliminate erroneous traffic usage data caused by abnormal operator data to obtain an abnormality judgment result; When the abnormal judgment result is normal, the total flow data is updated to obtain the usage statistics of the IoT devices; Based on the traffic usage data of two consecutive query cycles, the method to obtain the usage difference of each IoT device is as follows: Get the traffic usage data of each IoT device in two consecutive query cycles; Based on the query timing, the traffic usage data of the next query cycle is subtracted from the traffic usage data of the previous query cycle to obtain the usage difference; The method for judging abnormality of the usage difference is: When the usage difference is greater than or equal to zero, the result of the abnormality judgment is normal; When the usage difference is less than zero, a flow change verification threshold is obtained, where the flow change verification threshold is used to determine whether the operator has updated the flow statistics cycle; The flow usage data of the subsequent query cycle is compared with the flow change verification threshold. If the flow usage data of the subsequent query cycle is greater than the flow change verification threshold, the result of the abnormal judgment is abnormal; if the flow usage data of the subsequent query cycle is less than the flow change verification threshold, the result of the abnormal judgment is normal, and the total flow data is updated.

2. The method for multi-operator traffic statistics according to claim 1, characterized in that: The method of dividing each of the operator query groups into a plurality of thread query groups is: Get the response speed parameters of each operator; Based on the response speed parameter of the operator, query the response speed-query volume mapping table to obtain the preset number of devices in each thread corresponding to different response speeds; Get the number n of thread query groups for this operator: Wherein, T is the number of IoT devices using the operator, and k is the number of preset devices; Based on the number of thread query groups, the IoT devices in the operator query group are evenly grouped to obtain n thread query groups corresponding to the operator.

3. The method for multi-operator traffic statistics according to claim 1, characterized in that: The method of concurrently querying all the thread query groups to obtain the traffic usage data of each IoT device in the query period also includes: Get the timeout threshold and retry count threshold; In each query cycle, when the response time of the IoT device exceeds the timeout threshold, it is recorded as a timeout error; When the number of timeout errors exceeds the retry number threshold, the query of the Internet of Things device within the query cycle is abandoned.

4. The method for multi-operator traffic statistics according to claim 1, characterized in that: When the result of the abnormal judgment is abnormal, it is regarded as the operator's traffic abnormality, and the abnormal data is ignored, and the total traffic data of the IoT device is not updated.

5. A device for multi-operator traffic statistics, characterized in that: The device for collecting traffic statistics of multiple operators includes: An operator query group acquisition module is used to group all IoT devices to be queried based on operator type to obtain several operator query groups; A thread query group acquisition module, used to divide each of the operator query groups into a plurality of thread query groups, each of the thread query groups containing a plurality of IoT devices; A traffic usage data acquisition module, used to perform concurrent queries on all the thread query groups to obtain traffic usage data of each IoT device during the query period; A usage difference acquisition module is used to obtain the usage difference of each IoT device based on the traffic usage data of two consecutive query cycles; An abnormality judgment result acquisition module is used to perform abnormality judgment on the usage difference, and the abnormality judgment is used to eliminate erroneous traffic usage data caused by abnormal operator data to obtain an abnormality judgment result; A usage statistics result acquisition module, used to update the total flow data when the abnormal judgment result is normal, and obtain the usage statistics result of the Internet of Things device; Based on the traffic usage data of two consecutive query cycles, the method to obtain the usage difference of each IoT device is as follows: Get the traffic usage data of each IoT device in two consecutive query cycles; Based on the query timing, the traffic usage data of the next query cycle is subtracted from the traffic usage data of the previous query cycle to obtain the usage difference; The method for judging abnormality of the usage difference is: When the usage difference is greater than or equal to zero, the result of the abnormality judgment is normal; When the usage difference is less than zero, a flow change verification threshold is obtained, where the flow change verification threshold is used to determine whether the operator has updated the flow statistics cycle; The flow usage data of the subsequent query cycle is compared with the flow change verification threshold. If the flow usage data of the subsequent query cycle is greater than the flow change verification threshold, the result of the abnormal judgment is abnormal; if the flow usage data of the subsequent query cycle is less than the flow change verification threshold, the result of the abnormal judgment is normal, and the total flow data is updated.

6. The device for multi-operator traffic statistics according to claim 5, characterized in that: The thread query group acquisition module includes: A response speed parameter acquisition module is used to obtain the response speed parameters of each operator; A preset device quantity acquisition module is used to query the response speed-query volume mapping table based on the response speed parameter of the operator to obtain the preset device quantity in each thread corresponding to different response speeds; The thread query group number acquisition module is used to obtain the number n of thread query groups of the operator: Wherein, T is the number of IoT devices using the operator, and k is the number of preset devices; The average grouping module is used to averagely group the IoT devices in the operator query group based on the number of thread query groups to obtain n thread query groups corresponding to the operator.

7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor executes the steps of the multi-operator traffic statistics method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Method and device for calibrating data traffic of mobile terminal

    CN106899775A

  • Service abnormity monitoring method and device, electronic equipment and computer storage medium

    CN114880194A