Reliability testing methods, devices, equipment and storage media for communication latency indicators
By combining a data heap and a binary search tree structure, the problem of long detection time for communication latency indicators in existing technologies is solved, realizing real-time and fast reliability detection of communication latency indicators, which is suitable for mobile devices.
Patent Information
- Application Number
- CN202410375080.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-29
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2044-03-29
AI Technical Summary
Existing technologies for reliability testing of communication latency indicators have limited data processing capacity and are time-consuming, failing to meet the requirements for real-time updates and testing.
A combination of data heap and binary search tree structure is used to store latency data. The data heap is grouped according to a preset ratio and the binary search tree is used to optimize data search, so as to quickly find the target latency data.
It enables real-time detection and updating of communication latency metrics, reduces computational complexity and storage requirements, improves response speed, and is suitable for processing large amounts of data on mobile devices.
Smart Images

Figure CN118200201B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of communication testing technology, and in particular to a method, apparatus, device, and storage medium for reliable testing of communication latency indicators. Background Technology
[0002] The continuous development of power grid systems and communication technologies has given rise to new possibilities for smart grids. In recent years, with the development of smart grids and 5G technology, technicians can use high-speed communication technologies to monitor the operating status and data of power generation, transmission, substation, distribution, and consumption terminals in real time. To accurately and promptly identify and resolve potential problems, technicians typically use wired or wireless testing terminals to test the power grid system. For example, they may use a power grid testing terminal app to test the communication latency of 5G in the power grid. The timeliness, accuracy, and effectiveness of this testing are crucial. Generally, to verify whether the communication latency of 5G in the power grid meets the prescribed reliability standards, all latency data generated during testing needs to be sorted and the communication latency index calculated to ensure it meets the reliability standards. Furthermore, as latency data is continuously added, the communication latency index data also needs to be updated in real time.
[0003] In existing technologies, the methods for reliability testing of communication latency indicators mainly rely on traditional calculation methods. These methods have high computational complexity and long processing time when dealing with a large number of sampling points, and cannot meet the requirements of real-time performance. In addition, these methods consume a lot of computing resources, which cannot meet the requirements of testing using test terminal APP. When the amount of data generated by communication latency testing is very large, it is easy to encounter unresponsive problems. Summary of the Invention
[0004] The main objective of this invention is to address the problem that existing methods for reliability testing of communication latency indicators can only handle a limited amount of data and are time-consuming, failing to meet the need for real-time updates and testing of communication latency indicators.
[0005] The first aspect of this invention provides a method for detecting the reliability of communication latency indicators, characterized in that it includes:
[0006] Obtain the target time quantile corresponding to the latency index required for reliability testing of communication latency indicators;
[0007] Receive new latency data, and divide the new latency data into a first data group and a second data group according to the value of the new latency data and a preset value ratio. The data in the first data group and the second data group are stored using a data heap. The amount of data in the first data group is greater than the amount of data in the second data group, and the value of the new latency data stored in the first data group is less than the value of the new latency data stored in the second data group.
[0008] Update the data in the third data group based on the data in the second data group, where the data in the third data group is stored using a binary search tree;
[0009] The target time delay data is found in at least one of the first data group, the second data group, or the third data group based on the target time value location.
[0010] Determine whether the target latency data meets the standard threshold. If it does, then the current communication latency index meets the requirements of the reliability standard.
[0011] Optionally, in a first implementation of the first aspect of the present invention, before dividing the newly added data into a first data group and a second data group according to a preset numerical ratio based on the magnitude of the newly added latency data, the method further includes: creating a first data heap and a second data heap, wherein the first data heap is a max-heap used to store the first data group, and the second data heap is a min-heap used to store the second data group; dividing the newly added data into a first data group and a second data group according to a preset numerical ratio based on the magnitude of the newly added latency data includes: comparing the magnitude relationship between the newly added latency data and the top value of the first data heap; if the newly added latency data is less than or equal to the top value of the first data heap, then the newly added latency data is saved to the first data heap; otherwise, it is saved to the second data heap; adjusting the amount of data in the first data heap or the second data heap according to the preset numerical ratio.
[0012] Optionally, in a second implementation of the first aspect of the present invention, adjusting the amount of data in the first data pile or the second data pile according to a preset numerical ratio includes: calculating the total number of data elements contained in the first data pile and the second data pile; calculating the expected number of elements in the first data pile and the expected number of elements in the second data pile according to a preset numerical ratio; determining whether the actual amount of data in the first data pile exceeds the expected number of elements in the first data pile, and if so, popping the top data of the first data pile and adding it to the second data pile; determining whether the actual amount of data in the first data pile is insufficient for the expected number of elements in the first data pile, and if so, popping the top data of the second data pile and adding it to the first data pile.
[0013] Optionally, in a third implementation of the first aspect of the present invention, the target time value quantile includes a first target time value quantile and a second target time value quantile, and the target time delay data includes first target time delay data corresponding to the first target time value quantile and second target time delay data corresponding to the second target time value quantile; the step of searching for the target time delay data in at least one of the first data group, the second data group, or the third data group based on the target time value quantile includes: searching for the first target time delay data corresponding to the first target time value quantile in the first data group or the second data group; and searching for the second target time delay data corresponding to the second target time value quantile in the third data group.
[0014] Optionally, in a fourth implementation of the first aspect of the present invention, the communication latency indicator reliability detection method further includes: creating a binary search tree; the step of updating the data in the third data group according to the data in the second data group includes: synchronously adding the newly added latency data added to the second data pile to the binary search tree; and adding or deleting data stored in the binary search tree according to the operation when adjusting the first data pile or the second data pile.
[0015] Optionally, in the fifth implementation of the first aspect of the present invention, the binary search tree is a red-black tree; the communication latency index reliability detection method further includes: creating a reverse iterator of the red-black tree and setting the initial position of the reverse iterator at the end; the step of finding the second target latency data corresponding to the second target time value quantile in the third data group includes: calculating the number of remaining elements based on the number of elements corresponding to the second target time value quantile and the total number of elements in the third data group; determining the reverse movement step size of the reverse iterator based on the number of remaining elements; moving the reverse iterator according to the reverse movement step size to find the second target latency data corresponding to the second target time value quantile.
[0016] Optionally, in a sixth implementation of the first aspect of the present invention, the preset numerical ratio is 99%:1%.
[0017] A second aspect of the present invention provides a communication latency reliability detection device, comprising:
[0018] The acquisition module is used to acquire the target time value quantile corresponding to the latency index required for reliability testing of communication latency index;
[0019] The classification module is used to receive new latency data and divide the new latency data into a first data group and a second data group according to the value of the new latency data and a preset value ratio. The data in the first data group and the second data group are stored using a data heap. The amount of data in the first data group is greater than the amount of data in the second data group, and the value of the new latency data stored in the first data group is less than the value of the new latency data stored in the second data group.
[0020] The synchronization module is used to update the data in the third data group based on the data in the second data group. The data in the third data group is stored using a binary search tree.
[0021] The lookup module is used to find the target time delay data in at least one of the first data group, the second data group, or the third data group according to the target time value.
[0022] The judgment module is used to determine whether the target latency data meets the standard threshold. If it does, the current communication latency index meets the requirements of the reliability standard.
[0023] A third aspect of the present invention provides a communication latency reliability detection device, comprising: a memory and at least one processor, wherein the memory stores instructions; the at least one processor invokes the instructions in the memory to cause the communication latency reliability detection device to perform the steps of the above-described communication latency reliability detection method.
[0024] A fourth aspect of the present invention provides a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the steps of the above-described method for detecting the reliability of communication latency indicators.
[0025] The technical solution provided by this invention involves: obtaining the target time value quantile corresponding to the latency index required for reliability detection of communication latency indicators; receiving newly added latency data; dividing the newly added latency data into a first data group and a second data group according to the magnitude of the newly added latency data and a preset numerical ratio, wherein the data in the first data group and the second data group are stored using a data heap, the amount of data in the first data group is greater than the amount of data in the second data group, and the value of the newly added latency data stored in the first data group is less than the value of the newly added latency data stored in the second data group; updating the data in the third data group according to the data in the second data group, wherein the data in the third data group is stored using a binary search tree; searching for the target latency data in at least one of the first data group, the second data group, or the third data group according to the target time value quantile; determining whether the target latency data meets the standard threshold, and if it does, then the current communication latency index meets the requirements of the reliability standard. This method can detect whether the communication latency index meets the reliability standard and can update it in real time. Attached Figure Description
[0026] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0027] Figure 1 This is a flowchart illustrating the first embodiment of the communication latency index reliability detection method in this invention.
[0028] Figure 2 This is a flowchart illustrating the second embodiment of the communication latency index reliability detection method in this invention.
[0029] Figure 3 This is a schematic diagram of the process for saving a newly added latency value in the communication latency index reliability detection method in this embodiment of the invention;
[0030] Figure 4 This is a schematic diagram of an algorithm principle in the communication latency index reliability detection method in this embodiment of the invention;
[0031] Figure 5 This is a schematic diagram of the process for calculating a quantile value in the reliability detection method for communication latency index in an embodiment of the present invention;
[0032] Figure 6 This is a schematic diagram of one embodiment of the communication latency reliability detection device in this invention.
[0033] Figure 7 This is a schematic diagram of one embodiment of the communication latency reliability detection device in this invention.
[0034] Figure 8 This is a schematic diagram illustrating the principle of a computer-readable medium according to an embodiment of the present invention. Detailed Implementation
[0035] Exemplary embodiments of the invention will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limiting the invention to the embodiments set forth herein. Rather, these exemplary embodiments are provided to make the invention more comprehensive and complete, and to facilitate a full communication of the inventive concept to those skilled in the art. The same reference numerals in the drawings denote the same or similar elements, components, or parts, and therefore repeated descriptions of them will be omitted.
[0036] Subject to the technical concept of this invention, the features, structures, characteristics or other details described in a particular embodiment may be combined in one or more other embodiments in a suitable manner.
[0037] In the description of specific embodiments, the features, structures, characteristics, or other details described in this invention are intended to enable those skilled in the art to fully understand the embodiments. However, it is not excluded that those skilled in the art can practice the technical solutions of this invention without one or more of the specific features, structures, characteristics, or other details.
[0038] The flowcharts shown in the accompanying drawings are merely illustrative and do not necessarily include all content and operations / steps, nor do they necessarily have to be performed in the described order. For example, some operations / steps can be broken down, while others can be combined or partially combined; therefore, the actual execution order may change depending on the specific circumstances.
[0039] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.
[0040] The terms “and / or” or “and / or” include all combinations of any one or more of the listed items.
[0041] Please see Figure 1 The first embodiment of the communication latency reliability detection method in this invention includes:
[0042] S101. Obtain the target time value quantile corresponding to the latency index required for reliability testing of communication latency index;
[0043] It is understood that the executing entity of this invention can be a communication latency indicator reliability detection device, which can be a terminal, an APP (Application) installed on a mobile device terminal, or a server, and is not specifically limited here. This embodiment of the invention will be described using an application as the executing entity as an example.
[0044] The application described in this embodiment can be used to perform communication latency tests, such as latency tests of 5G communication transmission in the power grid. In order to detect whether the 5G latency index of the power grid meets the prescribed reliability standards, it is necessary to sort all the latency data (in ms) generated in the test according to the size relationship of the data, calculate the time value quantile of the communication latency index to be detected, and find the value of the corresponding target time value quantile.
[0045] Specifically, in this embodiment, the application can receive a communication latency index reliability detection request and then obtain the target time value quantile corresponding to the latency index required for the reliability detection of the communication latency index corresponding to the current request.
[0046] S102. Receive newly added delay data, and divide the newly added delay data into a first data group and a second data group according to the value of the newly added delay data and a preset value ratio.
[0047] The application in this embodiment is preferably used on a mobile device. Due to the memory space limitations and computational response speed requirements of mobile devices, the method of sequentially adding latency data to an array and then using quicksort to calculate quantiles is not feasible, because quicksort has a time complexity of O(n log n). When the test terminal application needs to test latency metrics through high-frequency isochronous packet sending and other methods, it will obtain data in the millions. For data in the millions, the computation time for each quantile sort on the mobile device will far exceed 1 second, which cannot guarantee the rapid and timely acquisition of latency metric information. Therefore, in this embodiment, when receiving new latency data, instead of using the method of adding data and then quicksorting, the new latency data is directly stored using a specific data structure.
[0048] When new latency data is received, it is saved to either the first data group or the second data group according to the value of the new latency data. The data in the first data group and the second data group are stored using a data heap. The amount of data in the first data group is greater than the amount of data in the second data group, and the value of the new latency data stored in the first data group is less than the value of the new latency data stored in the second data group.
[0049] Specifically, the ratio of the number of data elements stored in the first data group and the second data group is the same as a preset numerical ratio. The data in the first and second data groups is stored using a data heap, and the amount of data in the first data group is greater than the amount of data in the second data group. Preferably, in this embodiment, the reliability test is more effective when the difference in data volume between the first and second data groups is a large multiple; for example, when the preset ratio between the first and second data groups is 99%:1%, maintaining the same amount of data in the subsequent third data group as the second data group can prevent the third data group from using excessive memory space.
[0050] In computer science, a heap is a special type of data structure that can typically be viewed as an array of trees. A heap always satisfies the following properties: (1) the value of a node in the heap is never greater than or less than the value of its parent node; (2) a heap is always a complete binary tree.
[0051] In this step, the newly added latency data is saved to the first data group and the second data group according to the value of the newly added latency data. The value of the newly added latency data saved in the first data group is smaller than the value of the newly added latency data saved in the second data group. The newly added latency data can be divided into two parts according to the size. When the preset value ratio is the same as the value of the target time value quantile, the latency data value corresponding to the target time value quantile can be found more quickly according to the data sorting information in the first data group or the second data group.
[0052] S103. Update the data in the third data group based on the data in the second data group;
[0053] In this embodiment, to save data while ensuring minimal storage space usage, and to conveniently find the delay data values corresponding to more target time quantiles (i.e., the second target time quantile) that are later than the first target time quantile, a binary search tree (BST) can be pre-created to store the data in the third data group. A binary search tree, also known as a binary search tree or binary sort tree, is either an empty tree or a binary tree with the following properties: if its left subtree is not empty, then the value of all nodes in the left subtree is less than the value of its root node; if its right subtree is not empty, then the value of all nodes in the right subtree is greater than the value of its root node; and its left and right subtrees are also binary sort trees. As a classic data structure, the binary search tree combines the fast insertion and deletion operations of a linked list with the fast search advantages of an array.
[0054] The data in the third data group remains the same as that in the second data group in real time. Whenever there is a deletion or addition in the second data group, the same operation will be performed on the data in the third data group stored in the binary search tree.
[0055] S104. Find the target time delay data in at least one of the first data group, the second data group, or the third data group according to the target time value location.
[0056] In this step, the target time delay data is found based on the target time value quantile. Depending on the different target time value quantiles and the way the target time delay data is taken, the target time delay data is found in at least one of the first data group, the second data group, or the third data group.
[0057] To illustrate with a specific example, in step S102 of this embodiment, the preset numerical ratio is 99%:1%. That is, the first data group stores 99% of the smaller latency data, and the second data group stores 1% of the larger latency data. When the target latency quantile is 99%, if the target latency data is rounded down, the largest value is found in the first data group, which is the target latency data at the 99% quantile. If the target latency data is rounded up, the smallest value is found in the second data group, which is the target latency data at the 99% quantile. If the target latency quantile is 99.9% or 99.99%, or a larger target latency quantile than 99%, its sequential position in the third data group can be calculated based on the target latency quantile value and the specific rounding method (rounding up or rounding down). The corresponding target latency data is then found using a binary search tree structure.
[0058] There can be multiple target time delay data. Based on the specific target time value quantile, multiple corresponding target time delay data are found in the corresponding data group.
[0059] S105. Determine whether the target latency data meets the standard threshold.
[0060] S106. If satisfied, the current communication latency index meets the requirements of the reliability standard.
[0061] In this embodiment, after obtaining the corresponding target latency data, it is determined whether the target latency data meets the standard threshold. If it does, the current communication latency index meets the requirements of the reliability standard; if it does not, the current communication latency index does not meet the requirements of the reliability standard, and the target time value quantile corresponding to the target latency data that does not meet the reliability standard is marked.
[0062] In addition, in this embodiment, the target latency data is displayed and new data is continuously received. The target latency data is judged in real time to determine whether it meets the requirements of the reliability standard according to the target time value quantile corresponding to the required latency index, and the judgment result is displayed in real time.
[0063] The method of this invention can detect whether the communication latency index meets the reliability standard and can update the communication latency index in real time.
[0064] Please refer to Figure 2-5 The second embodiment of the communication latency reliability detection method in this invention includes:
[0065] S201. Obtain the target time value quantile corresponding to the latency index required for reliability testing of communication latency index;
[0066] In this embodiment, upon receiving a communication latency indicator reliability detection request, the target time value quantile corresponding to the latency indicator required for the reliability detection of the current request is obtained. In one specific implementation, the target time value quantile can be 99%, 99.9%, 99.99%, 99.999%, 99.9999%, and 99.99999%. The latency data at these target time value quantiles are then detected using the scheme described in this embodiment to determine whether they meet the reliability requirements.
[0067] S202, Create the first data heap, the second data heap, and the binary search tree;
[0068] A heap is a general term for a special type of data structure in computer science, which is usually an array object that can be viewed as a tree. A heap always satisfies the following properties: (1) the value of a node in the heap is always no greater than or no less than the value of its parent node; (2) a heap is always a complete binary tree. In this embodiment, the first heap is a max-heap, used to store the first data group; the second heap is a min-heap, used to store the second data group. A max-heap is also called a max-root heap, which is the heap with the largest value at the root node (also called the heap top); a min-heap is also called a min-root heap, which is the heap with the smallest value at the root node (also called the heap top).
[0069] A binary search tree (BST), also known as a binary search tree or binary sort tree, is either an empty tree or a binary tree with the following properties: if its left subtree is not empty, then the value of all nodes in the left subtree is less than the value of its root node; if its right subtree is not empty, then the value of all nodes in the right subtree is greater than the value of its root node; and its left and right subtrees are also binary sort trees. As a classic data structure, the binary search tree combines the fast insertion and deletion operations of a linked list with the fast search capabilities of an array. In this embodiment, the created binary search tree is used to store the third data set.
[0070] In this embodiment, a max-heap and a min-heap are first created and initialized; a binary search tree is then created and initialized, wherein the binary search tree supports duplicate elements.
[0071] S203. Receive the newly added delay data, compare the size relationship between the newly added delay data and the top value of the first data pile, and add the newly added delay data to the first data pile or the second data pile according to the size relationship.
[0072] In this step, the application receives newly added latency data and first checks if the first data heap is empty. If the first data heap is empty, the newly added latency data is added to the first data heap. If the first data heap is not empty, the application checks if the newly added latency data is less than or equal to the top value of the first data heap, that is, whether the newly added latency data is less than or equal to the largest value in the first data heap. If the newly added latency data is less than or equal to the top value of the first data heap, the newly added latency data is added to the first data heap. If the newly added latency data is not less than or equal to the top value of the first data heap, the newly added latency data is added to the second data heap.
[0073] S204. Adjust the amount of data in the first data pile or the second data pile according to the preset numerical ratio;
[0074] After receiving a latency metric calculation request or saving newly added latency data, a data rebalancing operation will be performed, which specifically involves adjusting the amount of data in the first or second data pile according to a preset numerical ratio.
[0075] Specifically, firstly, the number of elements contained in the first data pile and the second data pile are obtained respectively, and the total number of data elements contained in the first data pile and the second data pile is calculated. According to the preset numerical ratio, the expected number of elements in the first data pile and the expected number of elements in the second data pile are calculated. In this embodiment, the preset numerical ratio is preferably 99%:1%, that is, the data in the first data pile and the second data pile are kept with 99% of the latency data and 1% of the latency data respectively.
[0076] When adjusting the data volume, it is determined whether the actual data volume in the first data heap exceeds the expected number of elements in the first data heap. If the actual data volume in the first data heap exceeds the expected number of elements, the top element of the first data heap is popped and added to the second data heap. Then, it is determined again whether the actual data volume in the first data heap exceeds the expected number of elements, until the actual data volume in the first data heap does not exceed the expected number of elements. It is then determined whether the actual data volume in the first data heap is insufficient for the expected number of elements. If the actual data volume in the first data heap is insufficient for the expected number of elements, the top element of the second data heap is popped and added to the first data heap, until the actual data volume in the first data heap meets the expected number of elements.
[0077] Alternatively, determine whether the actual amount of data in the second data heap is insufficient to meet the required number of elements in the second data heap. If the actual amount of data in the second data heap is insufficient to meet the required number of elements in the second data heap, pop the top element of the first data heap and add it to the second data heap. Then, determine again whether the actual amount of data in the second data heap is insufficient to meet the required number of elements in the second data heap, until the actual amount of data in the second data heap meets the required number of elements in the second data heap. Determine whether the actual amount of data in the second data heap exceeds the required number of elements in the second data heap. If the actual amount of data in the second data heap exceeds the required number of elements in the second data heap, pop the top element of the second data heap and add it to the first data heap, until the actual amount of data in the second data heap does not exceed the required number of elements.
[0078] S205. Add the newly added latency data to the second data heap and synchronously add it to the binary search tree. Add or delete data stored in the binary search tree according to the operation when adjusting the first data heap or the second data heap.
[0079] In this embodiment, when new latency data is added to the second data pile, the new latency data is simultaneously added to the binary search tree. Furthermore, in step S204, when adjusting the elements stored in the first and second data piles according to a preset ratio, if data is popped from the first data pile and saved to the second data pile, the popped data is also simultaneously added to the binary search tree; if data is popped from the second data pile and saved to the first data pile, the corresponding popped data is found in the binary search tree and then deleted. That is to say, the binary search tree always maintains the same size and set of elements as the second data pile.
[0080] S206. Locate the first target time delay data corresponding to the first target time value quantile in the first data pile or the second data pile;
[0081] In this step, when acquiring target time delay data, the target time delay data can be found in at least one of the first data group, the second data group, or the third data group based on the target time value quantile. The target time value quantile includes the first target time value quantile and the second target time value quantile, and the target time delay data includes the first target time delay data corresponding to the first target time value quantile and the second target time delay data corresponding to the second target time value quantile.
[0082] In one specific implementation, when the data volume in the first and second data heaps is maintained at 99% and 1% respectively, if the 99th percentile value needs to be calculated, since the proportion of the quantile value does not change during the calculation process, a dynamic balancing method using a max-heap and min-heap is adopted to obtain the 99th percentile value. The latency data is always stored in the max-heap and min-heap according to the proportions of 99% and 1% respectively, thus allowing for rapid retrieval of the target element. Specifically, when the 99th percentile value is rounded up, it is always the top element of the max-heap; when the 99th percentile value is rounded down, it is always the top element of the min-heap. In this case, by utilizing the characteristic of a fixed 99th percentile, the time required to calculate the quantile value is reduced from logarithmic time O(log n) to constant time O(1).
[0083] In a preferred embodiment, the value is obtained by rounding down. To obtain the first target delay data corresponding to the 99th percentile, the first target delay data corresponding to the first target time value quantile is found in the first data pile, specifically, the top value of the first data pile is found. Compared to the general algorithm for finding arbitrary quantile values, which requires a complete sorting each time, and the time complexity of performing a complete sorting each time is at least O(n log n), this solution saves the required time.
[0084] S207. Find the second target delay data corresponding to the second target time value quantile in the binary search tree;
[0085] In practical implementation, there can be multiple target quantile values, such as 99%, 99.9%, 99.99%, 99.999%, 99.9999%, and 99.99999%. Based on the aforementioned scheme, these quantiles can actually be implemented using both max-heap and max-heap. However, if all these quantiles are implemented using max-heap and max-heap, a problem of insufficient memory space on mobile devices will arise. This is because the space complexity of a single max-heap is O(n), and calculating six quantile values would require six times the space. Taking the Android app's memory limit of 512MB as an example, assuming there are 20 million data points and each latency data point is 8 bytes, then the required memory space would be 20MB * 8 * 6 = 960MB, which far exceeds the memory limit.
[0086] Therefore, in this embodiment, a binary search tree is pre-constructed to store 1% of the time delay data. When it is necessary to obtain the quantile values of 99.9%, 99.99%, 99.999%, 99.9999%, and 99.99999%, the characteristics of the binary search tree are used to find the second target time delay data corresponding to the second target time value quantile.
[0087] Specifically, the elements of this binary search tree are always arranged in ascending order. Therefore, the values corresponding to the 99.9%, 99.99%, 99.999%, 99.9999%, and 99.99999% quantiles are all concentrated in the last 10% of the third data group. Therefore, before this step, a reverse iterator for the binary search tree is created, and its initial position is set at the end. The number of remaining elements is calculated based on the number of elements corresponding to the second target time value quantile and the total number of elements in the third data group. The reverse movement step size of the reverse iterator is determined based on the number of remaining elements. The reverse iterator is moved according to the reverse movement step size to find the second target time delay data corresponding to the second target time value quantile.
[0088] S208. Determine whether the target latency data meets the standard threshold.
[0089] S209. If satisfied, the current communication latency index meets the requirements of the reliability standard.
[0090] In this embodiment, after obtaining the corresponding target latency data, it is determined whether the target latency data meets the standard threshold. If it does, the current communication latency index meets the requirements of the reliability standard; if it does not, the current communication latency index does not meet the requirements of the reliability standard, and the target time value quantile corresponding to the target latency data that does not meet the reliability standard is marked.
[0091] In addition, in this embodiment, the target latency data is displayed and new data is continuously received. The target latency data is judged in real time to determine whether it meets the requirements of the reliability standard according to the target time value quantile corresponding to the required latency index, and the judgment result is displayed in real time.
[0092] In a preferred embodiment of this example, the output target latency data consists of six values, corresponding to the target latency data for the 99%, 99.9%, 99.99%, 99.999%, 99.9999%, and 99.99999% quantile values. Specifically, only a pair of heaps (both large and small) is created for the 99% quantile value, while the remaining five quantile values (99%, 99.9%, 99.99%, 99.999%, 99.9999%, and 99.99999%) are searched using the same red-black tree structure. This avoids the storage space required by creating five additional pairs of heaps.
[0093] Specifically, in step S202, a max-heap and a min-heap are created and initialized; a binary search tree is also created and initialized, preferably a red-black tree (multiSet) that supports duplicate elements. A red-black tree is a self-balancing binary search tree and a highly efficient search tree. It was invented by Rudolf Bayer in 1972 and was initially called a symmetric binary B-tree. Later, in 1978, it was modified by Leo J. Guibas and Robert Sedgewick into the red-black tree we know today.
[0094] The process for saving newly added data is similar to steps S203-S205; please refer to the appendix for details. Figure 3 The processing flow differs from S203-S205 in that the third data group is specifically stored using a red-black tree. Although the search time complexity of a red-black tree is O(log n), which is less than the O(1) time complexity of a min-heap, its time consumption is negligible if only 1% of the total dataset needs to be calculated. Therefore, we can simultaneously maintain a red-black tree with the same size as the min-heap, ensuring that the size and elements of the red-black tree always remain consistent with the min-heap. Only a red-black tree with a size of 1% of the total data needs to be maintained, and the space complexity of this red-black tree is O(n), thus solving the space saving problem. This red-black tree can simultaneously satisfy the calculation of five quantile values: 99.9%, 99.99%, 99.999%, 99.9999%, and 99.99999%.
[0095] And, please see Figure 4 Due to the balanced binary tree nature of red-black trees, the data is arranged in ascending order, and all the quantile values to be calculated are concentrated in the last 10%. Pre-creating a reverse iterator for the red-black tree and setting its initial position at the end improves the search efficiency. For details, please refer to [link to relevant documentation]. Figure 5 In this embodiment, the 99th percentile value is calculated using a max-heap, and the 99.9%, 99.99%, 99.999%, 99.9999%, and 99.99999% percentile values are calculated using a red-black tree and a reverse iterator, resulting in six percentile values.
[0096] The specific steps for obtaining the second target quantile value are as follows:
[0097] (S1) Set the initial variable i = 5. When the value range of i is [1,2,3,4,5], it corresponds to the 99.9%, 99.99%, 99.999%, 99.9999% and 99.99999% quantile values, respectively.
[0098] (S2) Move the reverse iterator of the red-black tree (multiSet) to the position corresponding to the 99.9...9% (i decimal places) quantile. The value at this position is the 99.9...9% (i decimal places) quantile value. The specific calculation method for the corresponding position is as follows: First, calculate the total number of elements (totalSize) of the current max-heap (maxHeap) and min-heap (minHeap). Then, calculate the number of elements corresponding to the 99.9...9% (i decimal places) quantile: headSize = floor(0.9...9 * totalSize) (i + 2 decimal places), where floor is the floor function. Next, calculate the number of remaining elements: tailSize = totalSize - headSize. The number of remaining elements (tailSize) is the step size that the reverse iterator needs to move backward.
[0099] (S3) Set i to i-1. If i = 0 at this time, return the calculation result; if i is not equal to 0 at this time, repeat (S2).
[0100] In this embodiment, the time complexity of using a red-black tree for searching is O(log n), which is less than the O(1) time complexity of a min-heap. However, if only 1% of the total dataset needs to be calculated, its time consumption is almost negligible. Therefore, we can simultaneously maintain a red-black tree with the same size as the min-heap, ensuring that the elements it contains are always consistent with the min-heap. The space complexity of this red-black tree is O(n), which is 1% of the total data, thus solving the space saving problem. This red-black tree can simultaneously calculate five quantile values: 99.9%, 99.99%, 99.999%, 99.9999%, and 99.99999%. We leverage the balanced binary tree property of the red-black tree (elements are always arranged in ascending order) and the fact that the quantiles to be calculated are concentrated in the last 10%. During the search, a reverse iterator is used to traverse the red-black tree, sequentially searching for the 99.99999%, 99.999%, 99.99%, and 99.99% quantile values, significantly reducing the red-black tree's search time. Therefore, it is possible to reduce the required time while maintaining sufficient storage space.
[0101] The solution in this embodiment can detect whether the communication latency index meets the reliability standard and can update it in real time. Furthermore, this embodiment integrates the characteristics of max-heap, min-heap, and binary search tree, which can improve the speed of calculation and detection while saving required storage space; it greatly improves computational efficiency, enabling a response time of less than 500ms when processing tens of millions of test sample data locally on the mobile app. Moreover, this embodiment does not use approximate values but precise values, which can obtain precisely specified quantiles; it can accurately calculate the 99.99999% quantile value of tens of millions of data points in real time on the mobile app using only its limited computing power. It is particularly suitable for use in high-frequency isochronous packet transmission tests, such as those in power grid testing terminal apps, and can improve the local processing performance of the mobile app.
[0102] The communication latency reliability detection method in the embodiments of the present invention has been described above. The communication latency reliability detection device in the embodiments of the present invention will be described below. Please refer to [link / reference]. Figure 6 One embodiment of the communication latency reliability detection device in this invention includes:
[0103] The acquisition module 601 is used to acquire the target time value quantile corresponding to the latency index required for reliability detection of communication latency index;
[0104] The classification module 602 is used to receive newly added latency data and divide the newly added latency data into a first data group and a second data group according to the value of the newly added latency data and a preset value ratio. The data in the first data group and the second data group are stored using a data heap. The amount of data in the first data group is greater than the amount of data in the second data group, and the value of the newly added latency data stored in the first data group is less than the value of the newly added latency data stored in the second data group.
[0105] Synchronization module 603 is used to update the data in the third data group based on the data in the second data group, wherein the data in the third data group is stored using a binary search tree;
[0106] The lookup module 604 is used to find the target time delay data in at least one of the first data group, the second data group, or the third data group according to the target time value location.
[0107] The judgment module 605 is used to determine whether the target latency data meets the standard threshold. If it does, the current communication latency index meets the requirements of the reliability standard.
[0108] The embodiments of the present invention can detect whether the communication latency index meets the reliability standard and can update the communication latency index in real time.
[0109] In another embodiment of this application, the communication latency index reliability detection device further includes: a heap construction module, used to create a first data heap and a second data heap, wherein the first data heap is a max heap used to store a first data group, and the second data heap is a min heap used to store a second data group;
[0110] The classification module 602 includes: a classification and storage unit, used to compare the size relationship between the newly added latency data and the top value of the first data pile, and add the newly added latency data to the first data pile or the second data pile according to the size relationship; and a data balancing unit, used to adjust the amount of data in the first data pile or the second data pile according to a preset numerical ratio.
[0111] In another embodiment of this application, the data balancing unit is specifically used for: calculating the total number of data elements contained in the first data pile and the second data pile; calculating the expected number of elements in the first data pile and the expected number of elements in the second data pile according to a preset numerical ratio; determining whether the actual amount of data in the first data pile exceeds the expected number of elements in the first data pile; if it exceeds, popping the top data of the first data pile and adding it to the second data pile; determining whether the actual amount of data in the first data pile is insufficient for the expected number of elements in the first data pile; if it is insufficient, popping the top data of the second data pile and adding it to the first data pile.
[0112] In another embodiment of this application, the target time value quantile includes a first target time value quantile and a second target time value quantile, and the target time delay data includes first target time delay data corresponding to the first target time value quantile and second target time delay data corresponding to the second target time value quantile;
[0113] The search module 604 is specifically used to: search for the first target time delay data corresponding to the first target time value quantile in the first data group or the second data group; and search for the second target time delay data corresponding to the second target time value quantile in the third data group.
[0114] In another embodiment of this application, the communication latency reliability detection device further includes: a binary tree creation module, which is used to create a binary search tree;
[0115] The synchronization module 603 is specifically used to: synchronously add newly added delay data to the binary search tree when the second data pile is added; and to add or delete data stored in the binary search tree according to the operation when adjusting the first data pile or the second data pile.
[0116] In another embodiment of this application, the binary search tree is a red-black tree; the communication latency index reliability detection device further includes: an iterator creation module, used to create a reverse iterator of the red-black tree, and set the initial position of the reverse iterator at the end; the step of finding the second target latency data corresponding to the second target time value quantile in the third data group includes: calculating the number of remaining elements based on the number of elements corresponding to the second target time value quantile and the total number of elements in the third data group; determining the reverse movement step size of the reverse iterator based on the number of remaining elements; moving the reverse iterator according to the reverse movement step size to find the second target latency data corresponding to the second target time value quantile.
[0117] In another embodiment of this application, the preset numerical ratio is 99%:1%.
[0118] The solution in this embodiment can detect whether the communication latency index meets the reliability standard and can update it in real time. Furthermore, this embodiment combines the characteristics of max-heap, min-heap, and binary search tree, which improves the speed of calculation and detection while saving required storage space; it greatly improves computational efficiency, enabling a response time of less than 500ms even when processing tens of millions of test sample data locally on the mobile app. Moreover, this embodiment does not use approximate values but precise values, capable of obtaining precisely specified quantiles; it can accurately calculate the 99.99999% quantile value of tens of millions of data points in real time on the mobile app using only its limited computing power. It is particularly suitable for use in high-frequency isochronous packet transmission tests, such as those in power grid testing terminal apps, improving the local processing performance of the mobile app.
[0119] above Figure 6 The communication latency reliability detection device in this embodiment of the invention is described in detail from the perspective of modular functional entities. Based on the same inventive concept, this specification also provides a communication latency reliability detection device. The communication latency reliability detection device in this embodiment of the invention is described in detail below from the perspective of hardware processing.
[0120] Figure 7 This is a schematic diagram of an electronic device provided as an embodiment of this specification. Refer to the following... Figure 7 To describe the electronic device 700 according to this embodiment of the invention. Figure 7 The electronic device 700 shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.
[0121] like Figure 7As shown, the electronic device 700 is presented in the form of a general-purpose computing device. The components of the electronic device 700 may include, but are not limited to: at least one processing unit 710, at least one storage unit 720, a bus 730 connecting different system components (including storage unit 720 and processing unit 710), a display unit 740, etc.
[0122] The storage unit stores program code that can be executed by the processing unit 710, causing the processing unit 710 to perform the steps described in the processing method section of this specification according to various exemplary embodiments of the present invention. For example, the processing unit 710 can perform actions such as... Figure 1 or Figure 2 The steps are shown.
[0123] The storage unit 720 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) 7201 and / or a cache storage unit 7202, and may further include a read-only memory unit (ROM) 7203.
[0124] The storage unit 720 may also include a program / utility 7204 having a set (at least one) program module 7205, such program module 7205 including but not limited to: an operating system, one or more application programs, other program modules and program data, each or some combination of these examples may include an implementation of a network environment.
[0125] Bus 730 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of the various bus structures.
[0126] Electronic device 700 can also communicate with one or more external devices 100 (e.g., keyboard, pointing device, Bluetooth device, etc.), and with one or more devices that enable a user to interact with electronic device 700, and / or with any device that enables electronic device 700 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed via input / output (I / O) interface 750. Furthermore, electronic device 700 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 760. Network adapter 760 can communicate with other modules of electronic device 700 via bus 730. It should be understood that, although... Figure 7As not shown in the diagram, other hardware and / or software modules may be used in conjunction with the electronic device 700, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0127] Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described in this invention can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this invention can be embodied in the form of a software product, which can be stored in a computer-readable storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, or network device, etc.) to execute the above-described method according to this invention. When the computer program is executed by a data processing device, it enables the computer-readable medium to implement the above-described method of this invention, i.e.: as... Figure 1 Or the method shown in Figure 2.
[0128] Figure 8 This is a schematic diagram of a computer-readable medium provided for embodiments of this specification.
[0129] accomplish Figure 1 The computer program of method 2 may be stored on one or more computer-readable media. A computer-readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of readable storage media include: an electrical connection having one or more wires, a portable disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof.
[0130] The computer-readable storage medium may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The readable storage medium may also be any readable medium other than a readable storage medium, capable of transmitting, propagating, or transmitting programs for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the readable storage medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.
[0131] Program code for performing the operations of this invention can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java and C++, and conventional procedural programming languages such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0132] In summary, this invention can be implemented in hardware, or as software modules running on one or more processors, or a combination thereof. Those skilled in the art will understand that in practice, general-purpose data processing devices such as microprocessors or digital signal processors (DSPs) can be used to implement some or all of the functions of some or all of the components according to the embodiments of the invention. The invention can also be implemented as a device or apparatus program (e.g., a computer program and computer program product) for performing part or all of the methods described herein. Such programs implementing the invention can be stored on a computer-readable medium or can take the form of one or more signals. Such signals can be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.
[0133] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the present invention is not inherently related to any specific computer, virtual device, or electronic device, and various general-purpose devices can also implement the present invention. The above descriptions are merely specific embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
[0134] The various embodiments in this specification are described in a progressive manner. The same or similar parts between the various embodiments can be referred to each other. Each embodiment focuses on describing the differences from other embodiments.
[0135] The above description is merely an embodiment of this application and is not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A method for reliable detection of communication latency indicators, characterized in that, include: Obtain the target time quantile corresponding to the latency index required for reliability testing of communication latency indicators; Receive new latency data, and divide the new latency data into a first data group and a second data group according to the value of the new latency data and a preset value ratio. The data in the first data group and the second data group are stored using a data heap. The amount of data in the first data group is greater than the amount of data in the second data group, and the value of the new latency data stored in the first data group is less than the value of the new latency data stored in the second data group. Update the data in the third data group based on the data in the second data group, where the data in the third data group is stored using a binary search tree; The target time delay data is found in at least one of the first data group, the second data group, or the third data group based on the target time value location. Determine whether the target latency data meets the standard threshold. If it does, then the current communication latency index meets the requirements of the reliability standard.
2. The communication delay index reliability detection method according to claim 1, characterized in that, Before dividing the newly added data into a first data group and a second data group according to a preset numerical ratio based on the magnitude of the newly added latency data, the method further includes: Create a first data heap and a second data heap, where the first data heap is a max heap used to store the first data group, and the second data heap is a min heap used to store the second data group; The step of dividing the newly added latency data into a first data group and a second data group according to a preset numerical ratio based on the magnitude of the newly added latency data includes: Compare the newly added latency data with the top value of the first data heap. If the newly added latency data is less than or equal to the top value of the first data heap, then the newly added latency data is saved to the first data heap; otherwise, it is saved to the second data heap. Adjust the amount of data in the first or second data pile according to the preset numerical ratio.
3. The communication delay index reliability detection method according to claim 2, characterized in that, The step of adjusting the amount of data in the first data pile or the second data pile according to a preset numerical ratio includes: Calculate the total number of elements contained in the first and second data heaps; The required number of elements in the first data pile and the required number of elements in the second data pile are calculated based on the preset numerical ratio. Determine whether the actual amount of data in the first data heap exceeds the number of elements that the first data heap should contain. If it does, pop the top data of the first data heap and add it to the second data heap. Determine if the actual amount of data in the first data heap is insufficient to meet the required number of elements in the first data heap. If insufficient, pop the top data of the second data heap and add it to the first data heap.
4. The communication delay index reliability detection method according to claim 3, characterized in that, The target time value quantile includes a first target time value quantile and a second target time value quantile, and the target time delay data includes first target time delay data corresponding to the first target time value quantile and second target time delay data corresponding to the second target time value quantile; The step of finding the target time delay data based on the target time value categorized in at least one of the first data group, the second data group, or the third data group includes: Find the first target time delay data corresponding to the first target time value quantile in the first data group or the second data group; Find the second target time delay data corresponding to the second target time value quantile in the third data group.
5. The communication delay index reliability detection method according to claim 4, characterized in that, The reliability detection method for communication latency index further includes: creating a binary search tree; The step of updating the data in the third data group based on the data in the second data group includes: The newly added latency data added to the second data pile is synchronously added to the binary search tree; In addition, data stored in the binary search tree can be added or deleted based on the operations performed when adjusting the first or second data heap.
6. The communication delay index reliability detection method according to claim 5, characterized in that, The binary search tree is a red-black tree; The reliability detection method for communication latency index also includes: Create a reverse iterator for the red-black tree and set the initial position of the reverse iterator to the end; The step of finding the second target time delay data corresponding to the second target time value quantile in the third data group includes: The number of remaining elements is calculated based on the number of elements corresponding to the second target time value quantile and the total number of elements in the third data group. The reverse movement step size of the reverse iterator is determined based on the number of remaining elements. The reverse iterator is moved according to the reverse movement step size to find the second target time delay data corresponding to the second target time value quantile.
7. The method for reliable detection of communication delay index according to any one of claims 1-6, characterized in that, The preset numerical ratio is 99%:1%.
8. A reliability testing device for communication delay indicators, characterized in that, The communication latency reliability detection device includes: The acquisition module is used to acquire the target time value quantile corresponding to the latency index required for reliability testing of communication latency index; The classification module is used to receive new latency data and divide the new latency data into a first data group and a second data group according to the value of the new latency data and a preset value ratio. The data in the first data group and the second data group are stored using a data heap. The amount of data in the first data group is greater than the amount of data in the second data group, and the value of the new latency data stored in the first data group is less than the value of the new latency data stored in the second data group. The synchronization module is used to update the data in the third data group based on the data in the second data group. The data in the third data group is stored using a binary search tree. The lookup module is used to find the target time delay data in at least one of the first data group, the second data group, or the third data group according to the target time value. The judgment module is used to determine whether the target latency data meets the standard threshold. If it does, the current communication latency index meets the requirements of the reliability standard.
9. A reliability testing device for communication delay indicators, characterized in that, The communication latency reliability testing device includes: a memory and at least one processor, wherein the memory stores instructions; The at least one processor invokes the instructions in the memory to cause the communication latency index reliability detection device to perform the steps of the communication latency index reliability detection method as described in any one of claims 1-7.
10. A computer-readable storage medium storing instructions thereon, characterized in that, When the instruction is executed by the processor, it implements the steps of the communication latency index reliability detection method as described in any one of claims 1-7.
Citation Information
Patent Citations
Time delay reliability determination method, access network equipment and storage medium
CN114885360A
Methods and devices for improved percentile extraction of network monitoring data
US11695662B1