Data statistics method, device and equipment and readable storage medium
By using cache queues in data processing equipment to obtain and count traffic usage data of SD-WAN technology users, the problem of poor statistical flexibility in the prior art is solved, and the accurate reflection of user traffic usage and user experience is achieved.
Patent Information
- Application Number
- CN202411772302.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-04
- Publication Date
- 2025-02-25
AI Technical Summary
When the prior art provides network services with SD-WAN technology to users based on the periodic service model, there is a problem of poor statistical flexibility, especially for users who use less traffic data, it is difficult to accurately reflect their traffic usage.
By deploying the first cache queue in the data processing device, the traffic usage data of the target account within each unit time in the preset time interval is obtained, and the data is statistically processed to obtain the periodic traffic data. This method allows detailed records based on different time intervals and unit time, improving statistical flexibility.
It realizes flexible statistics of user traffic data, can more accurately reflect the user's traffic usage during the current statistical cycle, and improves the user's user experience.
Smart Images

Figure CN119520355A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a data statistics method, device, equipment and readable storage medium. Background Art
[0002] SD-WAN (Software Defined Wide Area Network) is a network management technology that applies software-defined networking technology to the management of wide area networks. Related companies will provide users with network services using SD-WAN technology, enabling users to use network traffic data for network communications.
[0003] In related technologies, when enterprises provide network services using SD-WAN technology to users, they usually adopt a periodic service model, such as monthly or annual packages. During the service period, users can use network traffic data without restrictions based on the network services provided by the enterprise.
[0004] However, the above statistics on the network traffic data used by users have the problem of poor flexibility. Summary of the invention
[0005] Based on this, it is necessary to provide a data statistics method, device, equipment and readable storage medium that can improve statistical flexibility in response to the above technical problems.
[0006] In a first aspect, the present application provides a data statistics method, comprising:
[0007] Based on the first cache queue, obtaining the traffic usage data of the target account in each unit time in a preset time interval, where the traffic usage data is uploaded to the first cache queue by the resource device corresponding to the target account;
[0008] Performing statistical processing on each flow usage data to obtain first flow statistics data of the target account within a preset time interval;
[0009] According to the first traffic statistics data of the target account in each preset time interval in the current statistical period, the periodic traffic data of the target account in the current statistical period is obtained.
[0010] In one embodiment, obtaining periodic flow data of the target account in the current statistical period according to first flow statistics data of the target account in each preset time interval in the current statistical period includes:
[0011] If the current moment reaches the preset statistical moment corresponding to the target statistical time period in the current statistical cycle, then the second flow statistical data corresponding to the target statistical time period is obtained according to the first flow statistical data in each preset time interval in the target statistical time period;
[0012] If the current time reaches the end time of the current statistical period, the periodic flow data is acquired according to the second flow statistical data corresponding to each statistical time period in the current statistical period.
[0013] In one embodiment, the method further comprises:
[0014] If the current time does not reach the preset statistical time, each first traffic statistical data is written into the second cache queue corresponding to the target statistical time period;
[0015] Acquiring second traffic statistical data corresponding to the target statistical time period according to first traffic statistical data in each preset time interval in the target statistical time period includes:
[0016] Based on the second cache queue, obtaining first traffic statistical data within each preset time interval in the target statistical time period;
[0017] The first traffic statistical data in each preset time interval in the target statistical time period is used as the second traffic statistical data corresponding to the target statistical time period.
[0018] In one embodiment, the method further comprises:
[0019] Receive the end time of the period sent by the client corresponding to the target account. The end time of the period is determined by the client based on user input.
[0020] In a second aspect, the present application provides a data statistics method, comprising:
[0021] According to the network card information corresponding to the target account, obtain the traffic usage file corresponding to the target account;
[0022] According to the preset unit time and traffic usage file, the traffic usage data of the target account in each unit time is obtained, and each traffic usage data is written into the target storage space;
[0023] The traffic usage data in the target storage space is uploaded to the first cache queue, and the first cache queue is used by the data processing device to obtain the periodic traffic data of the target account in the current statistical period according to the method of the first aspect mentioned above.
[0024] In one embodiment, uploading each flow usage data in the target storage space to the first cache queue includes:
[0025] Obtaining current queue length information of the first cache queue, and determining an upload time interval according to the queue length information;
[0026] According to the upload time interval and the timing information corresponding to each flow usage data, each flow usage data is sequentially uploaded to the first cache queue.
[0027] In a third aspect, the present application further provides a data statistics device, comprising:
[0028] A first acquisition module, configured to acquire, based on the first cache queue, traffic usage data of the target account in each unit time in a preset time interval, the traffic usage data being uploaded to the first cache queue by a resource device corresponding to the target account;
[0029] A first statistics module is used to perform statistics processing on each flow usage data to obtain first flow statistics data of the target account within a preset time interval;
[0030] The second statistical module is used to obtain the periodic flow data of the target account in the current statistical period according to the first flow statistical data of the target account in each preset time interval in the current statistical period.
[0031] In a fourth aspect, the present application further provides a data statistics device, including:
[0032] The second acquisition module is used to acquire the traffic usage file corresponding to the target account according to the network card information corresponding to the target account;
[0033] The third statistics module is used to obtain the traffic usage data of the target account in each unit time according to the preset unit time and traffic usage file, and write each traffic usage data into the target storage space;
[0034] The upload module is used to upload the traffic usage data in the target storage space to the first cache queue, and the first cache queue is used by the data processing device to obtain the periodic traffic data of the target account in the current statistical period according to the method of the first aspect mentioned above.
[0035] In a fifth aspect, an embodiment of the present application provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the method of the first aspect and / or the second aspect are implemented.
[0036] In a sixth aspect, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the method of the first aspect and / or the second aspect described above are implemented.
[0037] In a seventh aspect, the present application further provides a computer program product, wherein the computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the method in the first aspect and / or the second aspect are implemented.
[0038] The above-mentioned data statistics method, device, equipment and readable storage medium, based on the first cache queue, can obtain the traffic usage data of the target account in each unit time in a preset time interval, and perform statistical processing on each traffic usage data to obtain the first traffic statistical data of the target account in the preset time interval, and then obtain the periodic traffic data of the target account in the current statistical period based on the first traffic statistical data of the target account in each preset time interval in the current statistical period, wherein the traffic usage data is uploaded to the first cache queue by the resource device corresponding to the target account. In this way, through the first cache queue, the traffic usage data of multiple unit times corresponding to the target account uploaded by different resource devices are obtained, and the traffic usage data are statistically processed to obtain the first traffic statistical data within multiple preset time intervals, and then the first traffic statistical data are statistically analyzed to determine the periodic traffic data within the current statistical period. The traffic data used by the target account within the current statistical period is recorded in detail according to different time intervals and unit times, thereby avoiding the problem of poor statistical flexibility when the traditional technology provides users with related network services of SD-WAN technology based on a periodic service model without counting the traffic data used by the user. In addition, for users who use less traffic data, statistics on the periodic traffic data of the target account corresponding to the user within the current statistical period based on the technical solution provided in the present application can more clearly reflect the user's usage of the traffic data and enhance the user's usage experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the technical solutions in the embodiments of the present application or related technologies, the drawings required for use in the embodiments of the present application or related technical descriptions will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0040] Figure 1 An application environment diagram of a data statistics method in an embodiment;
[0041] Figure 2 A schematic diagram of a flow chart of a data statistics method for a data processing device in one embodiment;
[0042] Figure 3 is a schematic flow chart of step 203 in another embodiment;
[0043] Figure 4 It is a flowchart of a data statistics method for resource equipment in one embodiment;
[0044] Figure 5A schematic diagram of a flow chart of an exemplary data statistics method in one embodiment;
[0045] Figure 6 is a structural block diagram of a data statistics device for a data processing device in one embodiment;
[0046] Figure 7 is a structural block diagram of a data statistics device for resource equipment in one embodiment;
[0047] Figure 8 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0048] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application 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 application and are not used to limit the present application.
[0049] SD-WAN (Software Defined Wide Area Network) is a network management technology that applies software-defined network technology to the management of wide area networks. Related companies provide users with network services using SD-WAN technology, which can interconnect the company's multiple sites and multiple clouds, thereby providing users with a high-quality cloud experience. The key network management cost is low and the management is convenient and fast.
[0050] In some cases, network services provided to users using SD-WAN technology can be provided to users through multiple resource pools.
[0051] In the related technology, when enterprises provide users with network services using SD-WAN technology, they usually adopt a periodic service model, such as monthly or annual packages. During the service period, users can use network traffic data without restrictions based on the network services provided by the enterprise. However, for some special users, the traffic data they use is relatively small, and there is a problem of poor flexibility in using the above method to collect statistics on traffic data.
[0052] In view of this, the present application provides a data statistics method, apparatus, device and readable storage medium. Based on the first cache queue, the traffic usage data of the target account in each unit time in a preset time interval can be obtained, and each traffic usage data can be statistically processed to obtain the first traffic statistical data of the target account in the preset time interval, and then based on the first traffic statistical data of the target account in each preset time interval in the current statistical period, the periodic traffic data of the target account in the current statistical period is obtained, wherein the traffic usage data is uploaded to the first cache queue by the resource device corresponding to the target account. In this way, through the first cache queue, the traffic usage data of multiple unit times corresponding to the target account uploaded by different resource devices are obtained, and the traffic usage data are statistically processed to obtain the first traffic statistical data within multiple preset time intervals, and then the first traffic statistical data are statistically analyzed to determine the periodic traffic data within the current statistical period. The traffic data used by the target account within the current statistical period is recorded in detail according to different time intervals and unit times, thereby avoiding the problem of poor statistical flexibility when the traditional technology provides users with related network services of SD-WAN technology based on a periodic service model without counting the traffic data used by the user. In addition, for users who use less traffic data, statistics on the periodic traffic data of the target account corresponding to the user within the current statistical period based on the technical solution provided in the present application can more clearly reflect the user's usage of the traffic data and enhance the user's usage experience.
[0053] The data statistics method provided in the embodiment of the present application can be applied to Figure 1 In the application environment shown. Among them, the data processing device 101 can be connected to multiple resource devices 102 in communication. The data processing device 101 and each resource device 102 can be independent physical servers, or a server cluster or distributed system composed of multiple physical servers, or a cloud server providing cloud computing services. The data processing device 101 and each resource device 102 can be in the same geographical area or in different geographical areas, and each resource device 102 can be in the same geographical area or in different geographical areas.
[0054] In an exemplary embodiment, Figure 2 As shown, a data statistical method is provided, which is applied to Figure 1 The data processing device 101 in the example is used as an example to illustrate, including the following steps 201 to 203. Among them:
[0055] Step 201: Based on the first cache queue, traffic usage data of a target account in each unit time in a preset time interval is obtained.
[0056] The traffic usage data is uploaded to the first cache queue by the resource device corresponding to the target account.
[0057] The data processing device can be a device that performs data statistics on the traffic usage data uploaded by each resource device. In an embodiment of the present application, since the amount of traffic usage data uploaded by multiple resource devices is extremely large, in order to improve the processing performance of the data processing device, a first cache queue is deployed in the data processing device. The first cache queue can be a queue data structure or a thread that can store data tasks, which can be used to store the traffic usage data uploaded by different resource devices.
[0058] When there is data in the first cache queue, the data processing device can continuously perform dequeue operations on the first cache queue, thereby obtaining a plurality of traffic usage data for data statistics.
[0059] In an embodiment of the present application, the traffic usage data corresponds to a unit time, and the unit time can be set according to the actual application scenario, for example, it can be one minute, that is, the data processing device obtains the traffic usage data corresponding to each account within each minute uploaded by each resource device.
[0060] As for the process of the data processing device obtaining the traffic usage data of the target account in each unit time in the preset time interval, in the embodiment of the present application, the traffic usage data may include the account identifier, the network card identifier, the time information and the traffic usage amount, etc. The data processing device can determine the traffic usage data corresponding to the target account according to the account identifier included in the traffic usage data. The data processing device can also determine the specific time period in which the traffic usage data is generated according to the time information, and determine the traffic usage data of the target account in the preset time interval according to the time period.
[0061] As for the process of the resource device uploading each traffic usage data to the first cache queue, in the embodiment of the present application, for each resource device, the resource device can monitor the traffic data files corresponding to each virtual network card based on the virtual network card corresponding to each account to obtain the traffic usage data corresponding to the target account in each unit time. Optionally, after obtaining the traffic usage data, the resource device will directly upload it to the first cache queue; optionally, after obtaining the traffic usage data, the resource device will first store it in a local storage space, such as a cache or memory, and establish communication with the data processing device to obtain the attribute information corresponding to the first cache queue, such as the queue length. The longer the queue length, the more traffic usage data to be counted accumulated in the first cache queue, and the busier the data processing device. At this time, the resource device can set the time interval for uploading the traffic usage data according to the queue length. The size of the time interval is proportional to the queue length. In the embodiment of the present application, the value range of the time interval can be set to be less than 1 hour and greater than one minute.
[0062] Step 202: Perform statistical processing on each flow usage data to obtain first flow statistical data of the target account within a preset time interval.
[0063] After obtaining the traffic usage data of the target account in each unit time in the preset time interval, the data processing device may perform statistical processing on the traffic usage data of the target account in each unit time in the preset time interval.
[0064] In an embodiment of the present application, the data processing device can determine the traffic usage data belonging to a preset time interval based on the time information corresponding to each traffic usage data. Optionally, the data processing device can accumulate the traffic usage corresponding to the traffic usage data in each unit time, thereby obtaining the sum of the traffic data used by the target account in the preset time interval, and determine the first traffic statistical data of the target account in the preset time interval based on the sum; optionally, the data processing device can directly use the traffic usage data in each unit time as the first traffic statistical data.
[0065] Step 203: acquiring periodic flow data of the target account in the current statistical period according to the first flow statistics data of the target account in each preset time interval in the current statistical period.
[0066] In an embodiment of the present application, the length of the statistical period can be preset according to actual application requirements, for example, one month is a statistical period.
[0067] The data processing device can determine the current statistical period according to the current moment, and determine multiple first traffic statistical data in the current statistical period according to each preset time interval. Optionally, the data processing device can directly use each first traffic statistical data in the current statistical period as period traffic data; optionally, it can be understood that in order to refine the usage details of the traffic data of the target account in the current statistical period and reduce the amount of data processed by the data processing device at one time, the current statistical period can also be divided into multiple statistical time periods according to time, and each statistical time period includes multiple preset time intervals. In this way, when the current moment reaches the preset statistical moment corresponding to each statistical time period, the data processing device can obtain the second traffic statistical data corresponding to the statistical time period based on the first traffic statistical data in each preset time interval in the statistical time period. When the current moment reaches the end moment of the current statistical cycle, the data processing device can obtain the period traffic data based on the second traffic statistical data corresponding to each statistical time period in the current statistical cycle.
[0068] Exemplarily, the preset time interval is each hour, the statistical time period can be each day, the preset statistical time corresponding to each statistical time period can be twelve o'clock in the evening of the same day, and the current statistical period can be one month. Optionally, the cycle end time corresponding to the current statistical period can be the last day of each month. Optionally, it can also be set by the user. It can be understood that the cycle end time must be later than the actual end time of the current statistical period.
[0069] Regarding the process of the data processing device obtaining the cycle end time, in a possible implementation, the data processing device may receive the cycle end time sent by the client corresponding to the target account, wherein the cycle end time is determined by the client based on user input.
[0070] In the above embodiment, the traffic usage data within multiple unit times corresponding to the target account uploaded by different resource devices are obtained through the first cache queue, and the traffic usage data are statistically processed to obtain the first traffic statistical data within multiple preset time intervals, and then the first traffic statistical data are statistically analyzed to determine the periodic traffic data within the current statistical period, and the traffic data used by the target account within the current statistical period is recorded in detail according to different time intervals and unit times, thereby avoiding the problem of poor statistical flexibility when the traditional technology does not perform statistics on the traffic data used by the user when providing users with related network services of SD-WAN technology based on a periodic service model. In addition, for users who use less traffic data, statistics on the periodic traffic data of the target account corresponding to the user within the current statistical period based on the technical solution provided in the present application can more clearly reflect the user's usage of the traffic data and enhance the user's usage experience.
[0071] In one embodiment, based on the above Figure 2 The embodiment shown, see Figure 3 This embodiment relates to a process of obtaining periodic flow data of a target account in a current statistical period according to first flow statistics data of the target account in each preset time interval in the current statistical period. Figure 3 As shown, step 203 may include step 301 and step 302 .
[0072] Step 301: if the current time reaches the preset statistical time corresponding to the target statistical time period in the current statistical cycle, obtain the second traffic statistical data corresponding to the target statistical time period according to the first traffic statistical data in each preset time interval in the target statistical time period.
[0073] In an embodiment of the present application, in order to reduce the amount of data processed each time the data processing device performs data statistics, a statistical cycle is divided into statistical time periods. For example, if the statistical cycle is one month, the statistical time period is every day, and the target statistical time period can be the statistical time period at the current moment.
[0074] The preset statistical time can be a time set according to actual needs, and can be the statistical timing of the first traffic statistical data in each preset time interval within the target statistical time period. It can be understood that the preset statistical time is equal to or later than the actual end time of the target statistical time period.
[0075] Regarding the process in which a data processing device obtains second traffic statistical data corresponding to a target statistical time period based on first traffic statistical data within each preset time interval in the target statistical time period, in a possible implementation, the data processing device may directly use the first traffic statistical data within each preset time interval as the second traffic statistical data.
[0076] In another possible implementation, a corresponding second cache queue is established for each time period. If the current moment has not reached the preset statistical moment, the data processing device may write each first traffic statistical data into the second cache queue corresponding to the target statistical time period until the current moment reaches the preset statistical moment corresponding to the target statistical time period in the current statistical cycle. The data processing device may obtain the first traffic statistical data within each preset time interval in the target statistical time period based on the second cache queue, and then use the first traffic statistical data within each preset time interval in the target statistical time period as the second traffic statistical data corresponding to the target statistical time period.
[0077] In the embodiment of the present application, after the data processing device obtains the second traffic statistical data corresponding to the target statistical time period, the data processing device may delete the second cache queue to avoid unnecessary waste of computing resources.
[0078] Step 302: If the current time reaches the end time of the current statistical period, the periodic flow data is obtained according to the second flow statistical data corresponding to each statistical time period in the current statistical period.
[0079] Based on step 301, the data processing device can obtain the second flow statistical data corresponding to each statistical time period within the current statistical cycle. Optionally, if the current time has not reached the end time of the current statistical cycle, in order to ensure the security of the data, the data processing device can record the second flow statistical data in the data statistical table corresponding to each statistical time period after obtaining it, and archive each data statistical table to ensure the security of the data.
[0080] Optionally, if the current moment reaches the end moment of the current statistical cycle, the data processing device can obtain the data statistical table corresponding to each statistical time period, thereby obtaining the second traffic statistical data corresponding to each statistical time period. The data processing device can sort the second traffic statistical data in time series and directly use them as the period traffic data corresponding to the current statistical cycle.
[0081] In an exemplary embodiment, Figure 4 As shown, a data statistical method is provided, which is applied to Figure 1 The resource device 102 in the example is used as an example to illustrate, including the following steps 401 to 403. Among them:
[0082] Step 401, obtaining the traffic usage file corresponding to the target account according to the network card information corresponding to the target account.
[0083] The resource devices may be resource devices corresponding to different geographical locations, and network communication services can be provided to users corresponding to each account through the resource devices. It can be understood that different users have different network services activated, and their corresponding resource devices are different, that is, the target account may be an account that has activated the service corresponding to the current resource device.
[0084] Regarding the process of the resource device obtaining the target account network card information, when the user corresponding to the target account activates the network service corresponding to the current resource device, optionally, the current resource device can communicate with the control device that uniformly manages each resource device, thereby obtaining the network card information corresponding to the target account issued by the control device; optionally, the current resource device can obtain the virtual network card issued by the control device. When the current resource device runs the virtual network card, the network card information corresponding to the target account can be obtained based on the virtual network card.
[0085] In an embodiment of the present application, the network card information may include an account identifier, a service identifier, and a network card identifier corresponding to the target account.
[0086] Step 402, according to the preset unit time and traffic usage file, obtain the traffic usage data of the target account in each unit time, and write each traffic usage data into the target storage space.
[0087] For each account recorded in the resource device, the resource device can obtain its traffic usage data in each unit time. In the embodiment of the present application, for the target account, the resource device can determine the virtual network card corresponding to the target account based on its corresponding network card information, and then, by monitoring the traffic data file corresponding to the virtual network card, the traffic usage data of the target account in each unit time can be obtained. The traffic usage data may include account identification, network card identification, time information, and traffic usage, etc. In the embodiment of the present application, since the traffic data file records the total amount of traffic used by the target account at different times, the data processing device can determine the time information corresponding to the traffic usage data according to the unit time, and determine the first total amount of traffic corresponding to the start time of the unit time and the second total amount of traffic corresponding to the end time according to the time information. The resource device can subtract the first total amount of traffic from the second total amount of traffic to obtain the traffic usage information in the traffic usage data.
[0088] After obtaining the traffic usage data within a unit time, the resource device may write the traffic usage data into a target storage space, which may be in a cache or in a memory.
[0089] Step 403: upload each flow usage data in the target storage space to the first cache queue.
[0090] For each flow usage data in the target storage space, in one possible implementation, as long as the flow usage data exists in the target storage space, the resource device can continuously upload the flow usage data in the target storage space to the first cache queue corresponding to the data processing device.
[0091] In another possible implementation, the resource device may obtain the current queue length information of the first cache queue and determine the upload time interval based on the queue length information. In this way, the resource device may upload each traffic usage data sequentially to the first cache queue based on the upload time interval and the timing information corresponding to each traffic usage data.
[0092] In order to alleviate the high load situation of the data processing device, the resource device can establish communication with the data processing device to obtain the queue length information of the first cache queue. The longer the queue length, the more traffic usage data to be counted accumulated in the first cache queue, and the busier the data processing device. At this time, the resource device can set the time interval for uploading the traffic usage data according to the queue length, and the size of the time interval is proportional to the queue length.
[0093] If the time interval at the current moment reaches the actual time for uploading the traffic usage data, the resource device can upload the traffic usage data written earliest in the target storage space to the first cache queue according to the timing information of the sequence of each traffic usage data.
[0094] In an embodiment of the present application, the first cache queue is used for the data processing device to obtain the periodic traffic data of the target account in the current statistical period according to the method in any of the above embodiments. Regarding the process of the data processing device obtaining the periodic traffic data of the target account in the current statistical period, reference can be made to the above embodiments and will not be repeated here.
[0095] In one embodiment, referring to Figure 5 , provides an exemplary data statistics method, which can be applied to Figure 1 In the implementation environment shown.
[0096] Step 501: The resource device obtains the traffic usage file corresponding to the target account according to the network card information corresponding to the target account.
[0097] Step 502 , the resource device obtains the traffic usage data of the target account in each unit time according to the preset unit time and traffic usage file, and writes each traffic usage data into the target storage space.
[0098] Step 503: The resource device obtains the current queue length information of the first cache queue, and determines the upload time interval according to the queue length information.
[0099] Step 504 : The resource device sequentially uploads each flow usage data to the first cache queue according to the upload time interval and the timing information corresponding to each flow usage data.
[0100] Step 505: The data processing device receives the period end time sent by the client corresponding to the target account.
[0101] The end time of the cycle is determined by the client based on user input.
[0102] Step 506: The data processing device obtains the traffic usage data of the target account in each unit time in a preset time interval based on the first cache queue.
[0103] The traffic usage data is uploaded to the first cache queue by the resource device corresponding to the target account.
[0104] Step 507: The data processing device performs statistical processing on each flow usage data to obtain first flow statistical data of the target account within a preset time interval.
[0105] Step 508: If the current time does not reach the preset statistical time, the data processing device writes each first traffic statistical data into a second cache queue corresponding to the target statistical time period.
[0106] Step 509: If the current time reaches the preset statistical time corresponding to the target statistical time period in the current statistical cycle, the data processing device obtains the first traffic statistical data in each preset time interval in the target statistical time period based on the second cache queue.
[0107] Step 510: Use the first traffic statistical data in each preset time interval in the target statistical time period as the second traffic statistical data corresponding to the target statistical time period.
[0108] Step 511: If the current time reaches the end time of the current statistical period, the data processing device obtains the period traffic data according to the second traffic statistical data corresponding to each statistical time period in the current statistical period.
[0109] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0110] Based on the same inventive concept, the embodiment of the present application also provides a data statistics device for implementing the data statistics method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more data statistics device embodiments provided below can refer to the limitations on the data statistics method above, and will not be repeated here.
[0111] In an exemplary embodiment, Figure 6 As shown, a data statistics device is provided, including: a first acquisition module 601, a first statistics module 602 and a second statistics module 603, wherein:
[0112] A first acquisition module 601 is used to acquire, based on a first cache queue, traffic usage data of a target account in each unit time in a preset time interval, where the traffic usage data is uploaded to the first cache queue by a resource device corresponding to the target account;
[0113] A first statistics module 602 is used to perform statistics processing on each of the traffic usage data to obtain first traffic statistics data of the target account within the preset time interval;
[0114] The second statistical module 603 is used to obtain the periodic flow data of the target account in the current statistical period according to the first flow statistical data of the target account in each of the preset time intervals in the current statistical period.
[0115] In one embodiment, the second statistics module 603 includes:
[0116] a time period statistics unit, configured to obtain second flow statistics data corresponding to the target statistical time period according to the first flow statistics data in each of the preset time intervals in the target statistical time period if the current moment reaches the preset statistical moment corresponding to the target statistical time period in the current statistical cycle;
[0117] The period statistics unit is used to obtain the period traffic data according to the second traffic statistics data corresponding to each statistical time period in the current statistical period if the current time reaches the end time of the current statistical period.
[0118] In one embodiment, the apparatus further comprises:
[0119] a time period cache unit, configured to write each of the first traffic statistics data into a second cache queue corresponding to the target statistics time period if the current time period does not reach the preset statistics time period;
[0120] The time period statistics unit is specifically used to perform: based on the second cache queue, obtaining the first traffic statistical data within each of the preset time intervals in the target statistical time period; using the first traffic statistical data within each of the preset time intervals in the target statistical time period as the second traffic statistical data corresponding to the target statistical time period.
[0121] In one embodiment, the apparatus further comprises:
[0122] The receiving module is used to receive the period end time sent by the client corresponding to the target account, where the period end time is determined by the client based on user input.
[0123] In an exemplary embodiment, Figure 7 As shown, a data statistics device is provided, including: a second acquisition module 701, a third statistics module 702 and an upload module 703, wherein:
[0124] The second acquisition module 701 is used to acquire the traffic usage file corresponding to the target account according to the network card information corresponding to the target account;
[0125] The third statistics module 702 is used to obtain the traffic usage data of the target account in each unit time according to the preset unit time and the traffic usage file, and write each traffic usage data into the target storage space;
[0126] The upload module 703 is used to upload the traffic usage data in the target storage space to the first cache queue, and the first cache queue is used by the data processing device to obtain the periodic traffic data of the target account in the current statistical period according to the method described in any one of claims 1 to 4.
[0127] In one embodiment, the upload module 703 includes:
[0128] An information acquisition unit, used to acquire current queue length information of the first cache queue, and determine an upload time interval according to the queue length information;
[0129] The periodic uploading unit is used to sequentially upload each of the traffic usage data to the first cache queue according to the upload time interval and the timing information corresponding to each of the traffic usage data.
[0130] Each module in the above-mentioned data statistics device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute the operations corresponding to each module above.
[0131] In an exemplary embodiment, a computer device is provided. The computer device may be a data processing device or a resource device. The internal structure diagram of the computer device may be as follows: Figure 8 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data statistics. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a data statistics method is implemented.
[0132] Those skilled in the art will understand that Figure 8 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.
[0133] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0134] Based on the first cache queue, obtaining traffic usage data of the target account in each unit time in a preset time interval, where the traffic usage data is uploaded to the first cache queue by a resource device corresponding to the target account;
[0135] Performing statistical processing on each of the traffic usage data to obtain first traffic statistical data of the target account within the preset time interval;
[0136] According to the first traffic statistics data of the target account in each of the preset time intervals in the current statistical period, the periodic traffic data of the target account in the current statistical period is obtained.
[0137] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0138] If the current moment reaches the preset statistical moment corresponding to the target statistical time period in the current statistical cycle, obtaining the second traffic statistical data corresponding to the target statistical time period according to the first traffic statistical data in each of the preset time intervals in the target statistical time period;
[0139] If the current time reaches the end time of the current statistical period, the period traffic data is acquired according to the second traffic statistical data corresponding to each statistical time period in the current statistical period.
[0140] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0141] If the current time does not reach the preset statistical time, writing each of the first traffic statistical data into the second cache queue corresponding to the target statistical time period;
[0142] The acquiring, according to the first traffic statistical data in each of the preset time intervals in the target statistical time period, second traffic statistical data corresponding to the target statistical time period includes:
[0143] Based on the second cache queue, obtaining the first traffic statistical data within each of the preset time intervals in the target statistical time period;
[0144] The first traffic statistical data within each of the preset time intervals in the target statistical time period is used as the second traffic statistical data corresponding to the target statistical time period.
[0145] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0146] The period end time sent by the client corresponding to the target account is received, where the period end time is determined by the client based on user input.
[0147] In an exemplary embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0148] According to the network card information corresponding to the target account, obtain the traffic usage file corresponding to the target account;
[0149] According to the preset unit time and the traffic usage file, the traffic usage data of the target account in each unit time is obtained, and each traffic usage data is written into the target storage space;
[0150] The traffic usage data in the target storage space are uploaded to a first cache queue, where the first cache queue is used for a data processing device to obtain the periodic traffic data of the target account in the current statistical period according to the method described in any one of claims 1 to 4.
[0151] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0152] Obtaining current queue length information of the first cache queue, and determining an upload time interval according to the queue length information;
[0153] The traffic usage data are sequentially uploaded to the first cache queue according to the upload time interval and the timing information corresponding to each traffic usage data.
[0154] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0155] Based on the first cache queue, obtaining traffic usage data of the target account in each unit time in a preset time interval, where the traffic usage data is uploaded to the first cache queue by a resource device corresponding to the target account;
[0156] Performing statistical processing on each of the traffic usage data to obtain first traffic statistical data of the target account within the preset time interval;
[0157] According to the first traffic statistics data of the target account in each of the preset time intervals in the current statistical period, the periodic traffic data of the target account in the current statistical period is obtained.
[0158] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0159] If the current moment reaches the preset statistical moment corresponding to the target statistical time period in the current statistical cycle, obtaining the second traffic statistical data corresponding to the target statistical time period according to the first traffic statistical data in each of the preset time intervals in the target statistical time period;
[0160] If the current time reaches the end time of the current statistical period, the period traffic data is acquired according to the second traffic statistical data corresponding to each statistical time period in the current statistical period.
[0161] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0162] If the current time does not reach the preset statistical time, writing each of the first traffic statistical data into the second cache queue corresponding to the target statistical time period;
[0163] The acquiring, according to the first traffic statistical data in each of the preset time intervals in the target statistical time period, second traffic statistical data corresponding to the target statistical time period includes:
[0164] Based on the second cache queue, obtaining the first traffic statistical data within each of the preset time intervals in the target statistical time period;
[0165] The first traffic statistical data within each of the preset time intervals in the target statistical time period is used as the second traffic statistical data corresponding to the target statistical time period.
[0166] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0167] The period end time sent by the client corresponding to the target account is received, where the period end time is determined by the client based on user input.
[0168] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0169] According to the network card information corresponding to the target account, obtain the traffic usage file corresponding to the target account;
[0170] According to the preset unit time and the traffic usage file, the traffic usage data of the target account in each unit time is obtained, and each traffic usage data is written into the target storage space;
[0171] The traffic usage data in the target storage space are uploaded to a first cache queue, where the first cache queue is used for a data processing device to obtain the periodic traffic data of the target account in the current statistical period according to the method described in any one of claims 1 to 4.
[0172] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0173] Obtaining current queue length information of the first cache queue, and determining an upload time interval according to the queue length information;
[0174] The traffic usage data are sequentially uploaded to the first cache queue according to the upload time interval and the timing information corresponding to each traffic usage data.
[0175] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:
[0176] Based on the first cache queue, obtaining traffic usage data of the target account in each unit time in a preset time interval, where the traffic usage data is uploaded to the first cache queue by a resource device corresponding to the target account;
[0177] Performing statistical processing on each of the traffic usage data to obtain first traffic statistical data of the target account within the preset time interval;
[0178] According to the first traffic statistics data of the target account in each of the preset time intervals in the current statistical period, the periodic traffic data of the target account in the current statistical period is obtained.
[0179] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0180] If the current moment reaches the preset statistical moment corresponding to the target statistical time period in the current statistical cycle, obtaining the second traffic statistical data corresponding to the target statistical time period according to the first traffic statistical data in each of the preset time intervals in the target statistical time period;
[0181] If the current time reaches the end time of the current statistical period, the period traffic data is acquired according to the second traffic statistical data corresponding to each statistical time period in the current statistical period.
[0182] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0183] If the current time does not reach the preset statistical time, writing each of the first traffic statistical data into the second cache queue corresponding to the target statistical time period;
[0184] The acquiring, according to the first traffic statistical data in each of the preset time intervals in the target statistical time period, second traffic statistical data corresponding to the target statistical time period includes:
[0185] Based on the second cache queue, obtaining the first traffic statistical data within each of the preset time intervals in the target statistical time period;
[0186] The first traffic statistical data within each of the preset time intervals in the target statistical time period is used as the second traffic statistical data corresponding to the target statistical time period.
[0187] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0188] The period end time sent by the client corresponding to the target account is received, where the period end time is determined by the client based on user input.
[0189] In one embodiment, a computer program product is provided, comprising a computer program, which, when executed by a processor, implements the following steps:
[0190] According to the network card information corresponding to the target account, obtain the traffic usage file corresponding to the target account;
[0191] According to the preset unit time and the traffic usage file, the traffic usage data of the target account in each unit time is obtained, and each traffic usage data is written into the target storage space;
[0192] The traffic usage data in the target storage space are uploaded to a first cache queue, where the first cache queue is used for a data processing device to obtain the periodic traffic data of the target account in the current statistical period according to the method described in any one of claims 1 to 4.
[0193] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0194] Obtaining current queue length information of the first cache queue, and determining an upload time interval according to the queue length information;
[0195] The traffic usage data are sequentially uploaded to the first cache queue according to the upload time interval and the timing information corresponding to each traffic usage data.
[0196] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0197] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment method can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., but are not limited to this.
[0198] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above 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 application.
[0199] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be construed as limiting the scope of the present application. It should be noted that, for a person of ordinary skill in the art, several modifications 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 data statistics method, characterized in that: The method comprises: Based on the first cache queue, obtaining traffic usage data of the target account in each unit time in a preset time interval, where the traffic usage data is uploaded to the first cache queue by a resource device corresponding to the target account; Performing statistical processing on each of the traffic usage data to obtain first traffic statistical data of the target account within the preset time interval; According to the first traffic statistics data of the target account in each of the preset time intervals in the current statistical period, the periodic traffic data of the target account in the current statistical period is obtained.
2. The method according to claim 1, characterized in that The acquiring, according to the first traffic statistical data of the target account in each of the preset time intervals in the current statistical period, the periodic traffic data of the target account in the current statistical period includes: If the current moment reaches the preset statistical moment corresponding to the target statistical time period in the current statistical cycle, obtaining the second traffic statistical data corresponding to the target statistical time period according to the first traffic statistical data in each of the preset time intervals in the target statistical time period; If the current time reaches the end time of the current statistical period, the period traffic data is acquired according to the second traffic statistical data corresponding to each statistical time period in the current statistical period.
3. The method according to claim 2, characterized in that The method further comprises: If the current time does not reach the preset statistical time, writing each of the first traffic statistical data into the second cache queue corresponding to the target statistical time period; The acquiring, according to the first traffic statistical data in each of the preset time intervals in the target statistical time period, second traffic statistical data corresponding to the target statistical time period includes: Based on the second cache queue, obtaining the first traffic statistical data within each of the preset time intervals in the target statistical time period; The first traffic statistical data within each of the preset time intervals in the target statistical time period is used as the second traffic statistical data corresponding to the target statistical time period.
4. The method according to claim 2, characterized in that: The method further comprises: The period end time sent by the client corresponding to the target account is received, where the period end time is determined by the client based on user input.
5. A data statistics method, characterized in that: The method comprises: According to the network card information corresponding to the target account, obtain the traffic usage file corresponding to the target account; According to the preset unit time and the traffic usage file, the traffic usage data of the target account in each unit time is obtained, and each traffic usage data is written into the target storage space; The traffic usage data in the target storage space are uploaded to a first cache queue, where the first cache queue is used for a data processing device to obtain the periodic traffic data of the target account in the current statistical period according to the method described in any one of claims 1 to 4.
6. The method according to claim 5, characterized in that The uploading of each of the traffic usage data in the target storage space to the first cache queue includes: Obtaining current queue length information of the first cache queue, and determining an upload time interval according to the queue length information; The traffic usage data are sequentially uploaded to the first cache queue according to the upload time interval and the timing information corresponding to each traffic usage data.
7. A data statistics device, characterized in that: The device comprises: A first acquisition module, configured to acquire, based on a first cache queue, traffic usage data of a target account in each unit time in a preset time interval, wherein the traffic usage data is uploaded to the first cache queue by a resource device corresponding to the target account; A first statistical module, used for performing statistical processing on each of the traffic usage data to obtain first traffic statistical data of the target account within the preset time interval; The second statistical module is used to obtain the periodic flow data of the target account in the current statistical period according to the first flow statistical data of the target account in each of the preset time intervals in the current statistical period.
8. A data statistics device, characterized in that: The device comprises: A second acquisition module is used to acquire a traffic usage file corresponding to the target account according to the network card information corresponding to the target account; A third statistics module, configured to obtain the traffic usage data of the target account in each unit time according to a preset unit time and the traffic usage file, and write each traffic usage data into a target storage space; An upload module is used to upload the traffic usage data in the target storage space to a first cache queue, and the first cache queue is used by a data processing device to obtain the periodic traffic data of the target account in the current statistical period according to the method described in any one of claims 1 to 4.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Traffic data processing method and device, computer equipment and storage medium
CN116389322A
Traffic data processing method and device, equipment and storage medium
CN117221178A
Distributed distribution system deployment and distribution method, system and device and medium
CN118101757A
Network device management method and apparatus
US20180375740A1