Software-defined network link average delay statistics method, apparatus, device and medium

CN122802403APending Publication Date: 2026-09-22SHANDONG NORMAL UNIV +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610641421.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-05-11
Publication Date
2026-09-22

AI Technical Summary

Technical Problem

然而,现有技术并未考虑如何在保证测量准确性的前提下,对控制器的负载进行有效控制,导致在面对动态变化的网络流量时,难以提供及时且可靠的数据支持

Benefits of technology

[0010]采用上述进一步方案的有益效果是:利用OpenFlow协议中的OFPMP_PORT_DESCRIPTION查询消息,可以高效、标准化地获取链路的实时流量数据。curr_speed字段的引入,使得流量评估更加直观和精确,能够有效反映链路当前的负载状态和发展趋势。为后续延迟测量优先度计算提供了可靠的数据支持,从而提升了整个链路延迟统计的稳定性与实用性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122802403A_ABST
    Figure CN122802403A_ABST
Patent Text Reader

Abstract

This invention relates to a method, apparatus, device, and medium for calculating the average latency of links in a software-defined network (SDN), belonging to the field of network performance monitoring technology. The method involves the SDN controller sending traffic query messages to the switch to obtain the current traffic value of each link. Based on the traffic segment sequence number, the number of historical latency measurements, and a preset measurement weight, the latency measurement priority of each link is calculated. Links with higher priority are selected for latency measurement first, achieving efficient and accurate statistics of the average latency of links under limited controller load. This application has the effect of optimizing link latency sampling under limited controller load, thereby improving the accuracy of average latency statistics.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of network performance monitoring technology. In particular, it relates to a method, apparatus, device, and medium for calculating the average latency of software-defined network links. Background Technology

[0002] With the continuous development of network technology, network service quality and performance evaluation have become increasingly important. Especially in large-scale network deployments, network latency, as a key performance indicator, directly affects user experience and system efficiency.

[0003] In current software-defined networking (SDN) environments, link latency measurements are typically initiated directly by the controller and implemented through interaction with switches. For example, the controller can send specific probe streams to the switch to measure the transmission latency of data packets in the link. This method relies on the controller's real-time processing capabilities and can obtain relatively accurate average link latency information. To reduce the controller's load, some solutions employ random sampling for link latency measurements and dynamically adjust the measurement frequency and targets based on traffic statistics.

[0004] However, in high-traffic or complex network environments, existing technologies may fail to effectively identify links with significant latency variations. Furthermore, due to limited controller resources, frequent or disordered latency measurements can degrade system response speed and even affect normal network operation. In this context, more intelligent scheduling of latency measurement tasks, prioritizing measurements of links with high current traffic and significant latency variations, could improve the statistical accuracy of average link latency. However, existing technologies do not consider how to effectively control the controller load while ensuring measurement accuracy, making it difficult to provide timely and reliable data support when facing dynamically changing network traffic. Summary of the Invention

[0005] The technical problem to be solved by the present invention is to provide a method, apparatus, device and medium for calculating the average latency of software-defined network links, in order to solve at least one of the above-mentioned technical problems.

[0006] The technical solution of the present invention to solve the above-mentioned technical problems is as follows: Firstly, this application provides a method for statistical analysis of average latency of software-defined network links, employing the following technical solution: A method for statistically analyzing the average latency of a software-defined network link includes: Obtain the current traffic value of each link in the software-defined network; For each link, the latency measurement priority of the link is determined based on the traffic segment number where the current traffic value of the link is located, the number of historical latency measurements of the link, and the preset measurement weight; Based on the latency measurement priority, a set number of links with a latency measurement priority higher than a preset threshold are selected in descending order of priority and used as the target links for the current batch of latency measurement. If the number of target links selected is zero, stop the link traffic measurement and latency measurement for the current batch and end the statistics for this batch. Otherwise, delay measurement is performed on each target link to obtain the delay data of the current batch corresponding to each target link; Based on the latency data, historical measurement count, and preset measurement weights corresponding to each target link, the current average latency of each target link is calculated, and the link latency measurement history information database is updated.

[0007] The beneficial effects of this invention are: by periodically performing delay statistics, combined with traffic status and measurement load, it is possible to dynamically determine whether to perform delay measurements based on the actual usage of the link, thereby avoiding meaningless measurement operations when the controller load is too high. This batch sampling mechanism reduces the frequency of data acquisition and processing, alleviating the computational and communication burden on the controller, while maintaining sufficient measurement coverage to ensure the accuracy of link delay statistics. By combining traffic segment sequence numbers, historical measurement counts, and measurement weights, measurement strategies can be flexibly adjusted, thus achieving efficient link delay statistics and analysis even with limited controller resources, ultimately improving the real-time performance and stability of average link delay assessment.

[0008] Based on the above technical solution, the present invention can be further improved as follows.

[0009] Furthermore, obtaining the current traffic value of each link in the software-defined network includes: The software-defined network controller sends a traffic query message to the switches in the software-defined network. The traffic query message is the OFPMP_PORT_DESCRIPTION query message in the OpenFlow protocol. The current traffic value of each link is obtained based on the feedback message returned by the switch. The feedback message contains a curr_speed field, and the current traffic value of each link is obtained through the curr_speed field.

[0010] The advantages of adopting the above-mentioned further solution are: Real-time traffic data of the link can be obtained efficiently and in a standardized manner by using the OFPMP_PORT_DESCRIPTION query message in the OpenFlow protocol. The introduction of the curr_speed field makes traffic assessment more intuitive and accurate, effectively reflecting the current load status and development trend of the link. It provides reliable data support for subsequent latency measurement priority calculation, thereby improving the stability and practicality of the entire link latency statistics.

[0011] Further, determining the latency measurement priority of the link based on the traffic segment number where the current traffic value of the link is located, the historical latency measurement count of the link, and a preset measurement weight includes: For each link, based on the current traffic value of the link, determine the traffic segment number where the current traffic value of the link belongs; Based on a preset traffic segment distribution function, the traffic segment number where the current traffic value of the link is located, the number of historical delay measurements of the link, and a preset measurement weight, the delay measurement priority of the link is determined. The preset flow segment distribution function is as follows: ; in, Let i be the measurement weight of link i. X(k,z) represents the number of historical delay measurements for the j-th traffic segment of link i, z is the traffic segment number where the current traffic value of link i is located, X(k,z)=0 when k=z, X(k,z)=1 when k≠z, and m is the total number of traffic segments, and m is an integer.

[0012] The beneficial effects of adopting the above-mentioned further scheme are as follows: By introducing a traffic segment distribution function to calculate the priority of link delay measurement, it is possible to determine whether a link needs delay measurement in a more scientific way. This formula, by weighting the current traffic segment with the inverse square of the distance between it and historical measurement segments, prioritizes traffic segments that have not yet been measured or have been measured less frequently, effectively improving the representativeness and uniformity of the measurement, thereby enhancing the accuracy and reliability of the link average delay statistics. Simultaneously, adjusting the measurement weights allows for differentiated resource allocation based on the importance of the links, ensuring more accurate delay data for critical links and improving the effectiveness of overall network quality assessment.

[0013] Furthermore, the preset measurement weight of each link is set by the network administrator, wherein the measurement weight of the network backbone link is higher than that of the non-backbone link.

[0014] The beneficial effect of adopting the above-mentioned further solutions is that backbone links usually carry a large amount of traffic, and their latency fluctuations have a more significant impact on the overall network performance. Therefore, under the condition of limited resources, increasing their measurement priority helps to more accurately reflect network bottleneck problems.

[0015] Furthermore, the lengths of the m traffic segments are the same, and the default value of m is 100; The default value of the preset threshold is 0.01.

[0016] The advantages of adopting the above-mentioned further scheme are: setting traffic segments of the same length makes the division of the time axis more uniform, which is conducive to continuous tracking of link traffic changes. The default value of 100 provides sufficient time granularity, which can ensure the detail of data sampling without wasting resources; the preset threshold setting of 0.01 ensures that only those links that make a significant contribution to latency statistics are included in the measurement range, avoiding over-measurement of low-value links.

[0017] Furthermore, the delay measurement for each of the target links includes: Send a link delay probe stream to the switch so that the switch returns a PACKET_IN message to the controller based on the probe stream; Delay measurements are performed on each selected link to be measured based on the PACKET_IN and PACKET_OUT messages.

[0018] The advantages of adopting the above-mentioned further scheme are: it enables accurate calculation of link latency using the PACKET_IN and PACKET_OUT messages returned by the switch; it avoids redundant communication overhead caused by relying on other network devices, such as routers; and it fully utilizes the SDN controller's direct control capability over switches in the network.

[0019] Furthermore, updating the link delay measurement history database includes: Record the number of delay measurements for each link on each traffic segment; Record the measurement weight for each link; Based on the measurement results of the current batch, the number of historical measurements, and the latency data, recalculate the current average latency for each link; The formula for calculating the current average delay is: ; The current time period delay data is the delay value obtained in this measurement; This represents the number of times the j-th traffic segment of link i has been measured.

[0020] The beneficial effects of adopting the above-mentioned further scheme are: it not only records the number of measurements and measurement weights for each link in different traffic segments, but also dynamically calculates the current average latency of the link based on this data and the current measurement results, realizing continuous updating and optimization of latency data. This weighted average calculation method considers both the cumulative impact of historical data and the current traffic status, making the statistical results closer to the actual network operation. Simultaneously, by recording and updating historical information, it is possible to continuously track changes in link latency, providing data support for latency analysis and prediction, and improving the real-time performance and accuracy of link average latency statistics.

[0021] Secondly, this application provides a software-defined network link average delay statistics device, which adopts the following technical solution: A software-defined network link average latency statistics device, comprising: The link traffic measurement module is used to obtain the current traffic value of each link in the software-defined network; The measurement priority calculation module is used to determine the delay measurement priority of each link based on the traffic segment number where the current traffic value of the link is located, the historical delay measurement count of the link, and the preset measurement weight. The selection module is used to select a set number of links with a delay measurement priority higher than a preset threshold in descending order of priority, based on the delay measurement priority, as the target links for the current batch of delay measurement. If the number of target links selected is zero, the stop measurement module is executed. The stop measurement module is used to stop the link traffic measurement and latency measurement of the current batch and end the statistics of this batch. Otherwise, the delay acquisition module is executed. The delay acquisition module is used to measure the delay of each target link and acquire the delay data of the current batch corresponding to each target link. The link average delay calculation module is used to calculate the current average delay of each target link based on the delay data, historical measurement count, and preset measurement weights corresponding to each target link, and to update the link delay measurement history information database.

[0022] Thirdly, this application provides an electronic device that adopts the following technical solution: An electronic device includes a memory and a processor, wherein the memory stores a computer program capable of being loaded by the processor and executing the software-defined network link average delay statistics method according to any one of the first aspects.

[0023] Fourthly, this application provides a computer-readable storage medium, which adopts the following technical solution: A computer-readable storage medium storing a computer program capable of being loaded by a processor and executing the software-defined network link average delay statistics method as described in any of the first aspects.

[0024] Additional aspects and advantages of this application will be set forth in part in the description which follows, and will become apparent from the description or may be learned by practice of this application. Attached Figure Description

[0025] Figure 1 A flowchart illustrating a software-defined network link average delay statistics method according to an embodiment of the present invention; Figure 2 A schematic diagram of a software-defined network link average delay statistics device provided in one embodiment of the present invention; Figure 3 This is a schematic diagram of the structure of an electronic device according to the present invention. Detailed Implementation

[0026] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0027] Furthermore, the term "and / or" in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this article, unless otherwise specified, generally indicates that the preceding and following related objects have an "or" relationship.

[0028] This application provides a method for calculating the average latency of links in a software-defined network (SDN) controller. The method employs a "batch statistics" mechanism, periodically (e.g., every 30 seconds) selecting a specified number of links for latency measurement. This optimizes link latency sampling under limited controller load conditions, resulting in accurate average link latency statistics.

[0029] like Figure 1 As shown, a method for statistically analyzing the average latency of a software-defined network link mainly includes: S101, Obtain the current traffic value of each link in the software-defined network; In this embodiment, a software-defined network refers to a network architecture where the control plane and data plane are decoupled, allowing the controller to communicate and interact directly with the switches. A link refers to the communication connection between two adjacent switches in a software-defined network. The current traffic value refers to the data transmission rate or traffic volume passing through the link at the current moment.

[0030] Specifically, at the beginning of each statistical period, a traffic query message is sent from the software-defined network controller to the switches in the software-defined network. The traffic query message is the OFPMP_PORT_DESCRIPTION query message in the OpenFlow protocol. The current traffic value of each link is obtained based on the feedback message returned by the switch. The feedback message contains a curr_speed field, and the current traffic value of each link is obtained through the curr_speed field.

[0031] For example, suppose a software-defined network contains switches s1 to s8. The controller sends an OFPMP_PORT_DESCRIPTION query message to each switch. Each switch returns the curr_speed value of its respective port. The controller maps the traffic value of each port to the corresponding link according to the network topology information, thereby obtaining the current traffic value of all links.

[0032] S102, for each link, the delay measurement priority of the link is determined according to the traffic segment number where the current traffic value of the link is located, the number of historical delay measurements of the link, and the preset measurement weight; In this embodiment, a traffic segment refers to dividing the possible traffic range of a link into several equal-length intervals, each interval being a traffic segment. The traffic segment number refers to the number of the traffic segment to which the current traffic value falls within all traffic segments. Each link corresponds to m traffic segments of the same length, and the default value of m is 100.

[0033] Historical latency measurement count refers to the number of times latency measurements have been performed on this link under various traffic segments, as recorded in the link latency measurement history database. Measurement weight is a pre-set weighting parameter by the network administrator based on the importance of the link. Typically, backbone links have higher measurement weights than non-backbone links to ensure critical links receive more latency measurement opportunities. Latency measurement priority is a priority value calculated by comprehensively considering the link's current traffic location, historical measurement distribution, and link importance. A higher value indicates that the link is more likely to require latency measurement in the current batch.

[0034] Specifically, for each link i, its traffic segment number z is first determined based on its current traffic value. For example, if the link's traffic range is 0 to 100 Mbps, m=100, then the length of each traffic segment is 1 Mbps. When the current traffic value is 35.6 Mbps, this traffic value falls into the 36th traffic segment, i.e., z=36. Then, the delay measurement priority p of link i is calculated based on a preset traffic segment distribution function. i The distribution function for this flow segment is: ; in, Let i be the measurement weight of link i. X(k,z) represents the number of historical delay measurements for the j-th traffic segment of link i, z is the traffic segment number where the current traffic value of link i is located, X(k,z)=0 when k=z, X(k,z)=1 when k≠z, and m is the total number of traffic segments, and m is a positive integer.

[0035] As can be seen from the above formula, the calculation logic of delay measurement priority reflects the following strategy: for the traffic segment k that is closer to the current traffic segment number z, its weight contribution... Smaller, thus making the fraction A larger value means that the measurement data of adjacent flow segments has a greater impact on priority; at the same time, the number of historical delayed measurements for a certain flow segment... The fewer the links, the greater their contribution to priority. This mechanism makes link delay measurement scheduling tend to select those links that have not yet been fully measured near the current traffic conditions, thereby uniformly measuring delays under different traffic segments and improving the accuracy of average delay statistics.

[0036] Assuming the network has link 1 and link 2, the measurement weight of link 1 is... (Backbone Link), Measurement Weight of Link 2 (Non-backbone links), total number of traffic segments m=100. Link 1's current traffic value is located in traffic segment number z=50. Its 49th traffic segment has 1 historical delay measurement count, its 51st traffic segment has 1 historical delay measurement count, and other traffic segments also have recorded historical delay measurement counts. Link 2's current traffic value is located in traffic segment number z=30, and all traffic segments have a relatively high number of historical delay measurement counts. Calculate the delay measurement priority of Link 1 and Link 2 using the above formula. Since Link 1 has a higher measurement weight and its nearby traffic segments have fewer historical measurement counts, its priority p1 is usually higher than Link 2's priority p2.

[0037] S103, Based on the delay measurement priority, select a set number of links with a delay measurement priority higher than a preset threshold in order of priority from high to low, and use them as the target links for the current batch of delay measurement. In this embodiment, the set quantity is represented by the parameter η, which is determined based on the link delay measurement load acceptable to the software-defined network controller, i.e., the maximum number of link delay measurements that the controller can withstand per cycle without affecting normal operation. The preset threshold is a threshold value used to filter links with too low delay measurement priority, and its default value is 0.01, meaning that only links with a delay measurement priority greater than 0.01 are eligible to be selected for delay measurement in the current batch.

[0038] The selection process begins with the link with the highest priority, sequentially filtering links whose latency measurement priority is greater than a preset threshold (default is 0.01) until η links are selected. If the total number of links with latency measurement priority greater than the preset threshold is less than η, then only all links with latency measurement priority greater than the preset threshold are selected as target links.

[0039] S104. If the number of target links selected is zero, stop the link traffic measurement and latency measurement for the current batch and end the statistics for this batch. In this embodiment, when the latency measurement priority of all links is no greater than a preset threshold, it indicates that all links have sufficient latency measurement data in each traffic segment, and no further latency measurement is needed. At this point, traffic query messages are stopped, and the statistical process for the current batch ends directly, no longer consuming the controller's computing and communication resources. This mechanism effectively avoids unnecessary measurement operations when sufficient link latency data has been collected, further reducing the controller load.

[0040] S105, otherwise, perform delay measurement on each target link to obtain the delay data of the current batch corresponding to each target link; In this embodiment of the application, the delay data refers to the actual transmission delay value of the target link at the current moment, obtained through delay measurement.

[0041] Specifically, the delay measurement for each of the target links includes: Send a link delay probe stream to the switch so that the switch returns a PACKET_IN message to the controller based on the probe stream; Delay measurements are performed on each selected link to be measured based on the PACKET_IN and PACKET_OUT messages.

[0042] In this embodiment, a delay measurement operation is performed on each target link selected in step S103. The delay measurement can be implemented using existing software-defined network link delay measurement techniques, such as measurement based on the PACKET_IN and PACKET_OUT messages of the OpenFlow controller. Specifically, the controller injects probe packets by sending a PACKET_OUT message to one end of the target link's switch. When the probe packet reaches the other end of the target link's switch, the switch reports the probe packet information to the controller via a PACKET_IN message. The controller calculates the one-way delay or round-trip delay of the target link based on the difference between the probe packet's sending and receiving timestamps, and deducts the known communication delay between the controller and the two ends of the switch. After performing the above measurement operation on each target link, the delay data for each target link in the current batch is obtained.

[0043] S106, based on the delay data, historical measurement count, and preset measurement weight corresponding to each target link, calculate the current average delay of each target link and update the link delay measurement history information database.

[0044] In this embodiment of the application, updating the link delay measurement history information database includes: Record the number of delay measurements for each link on each traffic segment; Record the measurement weight for each link; Based on the measurement results of the current batch, the number of historical measurements, and the latency data, recalculate the current average latency for each link; The formula for calculating the current average delay is: ; The current time period delay data is the delay value obtained in this measurement; This represents the number of times the j-th traffic segment of link i has been measured.

[0045] In this embodiment of the application, for each target link i, let its current delay measurement result be... Its current average latency, recorded in the link latency measurement history database, is If the total number of existing measurements is N (i.e., the sum of the number of measurements for all flow segments), then the updated average delay can be calculated using incremental averaging: ; After the update is complete, the delay measurement count corresponding to the traffic segment z where the current traffic value of target link i is located will be recorded. Add 1, and calculate the new average delay. The data is written to the link delay measurement history database, replacing the existing current average delay value. In this way, the link delay measurement history database always maintains the latest average delay statistics for each link and the distribution of measurement frequency for each traffic segment, providing accurate historical data support for the priority calculation of delay measurements in subsequent batches.

[0046] It should be noted that steps S101 to S106 constitute a complete batch statistics process. This batch statistics process is repeated at a preset period (e.g., 30 seconds). At the beginning of each period, step S101 is re-executed to obtain the latest link traffic information, and then the delay measurement priority of each link is recalculated to select a new target link for measurement. As the batch statistics continue, the number of measurements for each traffic segment in the link delay measurement history information database gradually becomes more uniform, and the delay measurement priority of each link gradually decreases. When the priority of all links is lower than the preset threshold, the delay measurement is automatically stopped, thereby achieving optimized link delay sampling under the limited load conditions of the controller.

[0047] This method, by periodically performing delay statistics and combining traffic status with measurement load, dynamically determines whether to conduct delay measurements based on the actual usage of the link, thus avoiding meaningless measurement operations when the controller load is too high. This batch sampling mechanism reduces the frequency of data acquisition and processing, alleviating the computational and communication burden on the controller, while maintaining sufficient measurement coverage to ensure the accuracy of link delay statistics. By combining traffic segment sequence numbers, historical measurement counts, and measurement weights, the measurement strategy can be flexibly adjusted, enabling efficient link delay statistics and analysis even with limited controller resources, ultimately improving the real-time performance and stability of average link delay assessment.

[0048] Figure 2 A schematic diagram of a software-defined network link average delay statistics device 200 is shown.

[0049] like Figure 2 As shown, a software-defined network link average latency statistics device 200 mainly includes: The link traffic measurement module 201 is used to obtain the current traffic value of each link in the software-defined network; The measurement priority calculation module 202 is used to determine the delay measurement priority of each link based on the traffic segment number where the current traffic value of the link is located, the historical delay measurement count of the link, and the preset measurement weight. The selection module 203 is used to select a set number of links with a delay measurement priority higher than a preset threshold in descending order of priority, based on the delay measurement priority, as the target links for the current batch of delay measurement. If the number of target links selected is zero, then the stop measurement module 204 is executed. The stop measurement module 204 is used to stop the link traffic measurement and latency measurement of the current batch and end the statistics of this batch. Otherwise, the delay acquisition module 205 is executed. The delay acquisition module 205 is used to measure the delay of each target link and acquire the delay data of the current batch corresponding to each target link. The link average delay calculation module 206 is used to calculate the current average delay of each target link based on the delay data, historical measurement count and preset measurement weight corresponding to each target link, and update the link delay measurement history information database.

[0050] In one example, the module in any of the above devices may be one or more integrated circuits configured to implement the above methods, such as one or more application-specific integrated circuits (ASICs), or one or more digital signal processors (DSPs), or one or more field-programmable gate arrays (FPGAs), or a combination of at least two of these integrated circuit forms.

[0051] For example, when modules in a device can be implemented via a processing element scheduler, the processing element can be a general-purpose processor, such as a central processing unit (CPU) or other processor capable of calling programs. Alternatively, these modules can be integrated together as a system-on-a-chip (SOC).

[0052] In this application, various objects such as messages / information / devices / network elements / systems / apparatus / actions / operations / processes / concepts may be named. It is understood that these specific names do not constitute a limitation on the relevant objects. The names may be changed depending on the scenario, context, or usage habits. The understanding of the technical meaning of the technical terms in this application should be mainly determined from their functions and technical effects embodied / performed in the technical solution.

[0053] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and modules described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.

[0054] Those skilled in the art will recognize that the modules and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0055] Figure 3 This is a structural block diagram of an electronic device 300 according to an embodiment of this application.

[0056] like Figure 3 As shown, the electronic device 300 includes a processor 301 and a memory 302, and may further include one or more of an information input / output (I / O) interface 303, a communication component 304, and a communication bus 305.

[0057] The processor 301 controls the overall operation of the electronic device 300 to complete all or part of the steps in the software-defined network link average latency statistics method described above. The memory 302 stores various types of data to support the operation of the electronic device 300. This data may include, for example, instructions for any application or method operating on the electronic device 300, as well as application-related data. The memory 302 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as one or more of Static Random Access Memory (SRAM), Electrically Erasable Programmable Read-Only Memory (EEPROM), Erasable Programmable Read-Only Memory (EPROM), Programmable Read-Only Memory (PROM), Read-Only Memory (ROM), magnetic storage, flash memory, magnetic disk, or optical disk.

[0058] I / O interface 303 provides an interface between processor 301 and other interface modules, such as keyboards, mice, and buttons. These buttons can be virtual or physical. Communication component 304 is used to test wired or wireless communication between electronic device 300 and other devices. Wireless communication includes Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G, or 4G, or a combination thereof. Therefore, the corresponding communication component 304 may include a Wi-Fi component, a Bluetooth component, and an NFC component.

[0059] The communication bus 305 may include a path for transmitting information between the aforementioned components. The communication bus 305 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. The communication bus 305 may be divided into an address bus, a data bus, a control bus, etc.

[0060] The electronic device 300 may be implemented by one or more application-specific integrated circuits (ASICs), digital signal processors (DSPs), digital signal processing devices (DSPDs), programmable logic devices (PLDs), field-programmable gate arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic components to execute the software-defined network link average delay statistics method given in the above embodiments.

[0061] The following describes the computer-readable storage medium provided in the embodiments of this application. The computer-readable storage medium described below can be referred to in correspondence with the software-defined network link average latency statistics method described above.

[0062] This application also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the above-described software-defined network link average delay statistics method.

[0063] The computer-readable storage medium may include various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0064] The terms “comprising,” “including,” or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus.

[0065] The above description is merely a preferred embodiment of this application and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this application is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the foregoing application concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features with similar functions claimed in this application.

Claims

1. A method for statistically analyzing the average latency of a software-defined network link, characterized in that, include: Obtain the current traffic value of each link in the software-defined network; For each link, the latency measurement priority of the link is determined based on the traffic segment number where the current traffic value of the link is located, the number of historical latency measurements of the link, and the preset measurement weight; Based on the latency measurement priority, a set number of links with a latency measurement priority higher than a preset threshold are selected in descending order of priority and used as the target links for the current batch of latency measurement. If the number of target links selected is zero, stop the link traffic measurement and latency measurement for the current batch and end the statistics for this batch. Otherwise, delay measurement is performed on each target link to obtain the delay data of the current batch corresponding to each target link; Based on the latency data, historical measurement count, and preset measurement weights corresponding to each target link, the current average latency of each target link is calculated, and the link latency measurement history information database is updated.

2. The method for calculating the average latency of a software-defined network link according to claim 1, characterized in that, The acquisition of the current traffic value of each link in the software-defined network includes: The software-defined network controller sends a traffic query message to the switches in the software-defined network. The traffic query message is the OFPMP_PORT_DESCRIPTION query message in the OpenFlow protocol. The current traffic value of each link is obtained based on the feedback message returned by the switch. The feedback message contains a curr_speed field, and the current traffic value of each link is obtained through the curr_speed field.

3. The method for calculating the average latency of a software-defined network link according to claim 1, characterized in that, The step of determining the latency measurement priority of the link based on the traffic segment number where the current traffic value of the link is located, the historical latency measurement count of the link, and the preset measurement weight includes: For each link, based on the current traffic value of the link, determine the traffic segment number where the current traffic value of the link belongs; Based on a preset traffic segment distribution function, the traffic segment number where the current traffic value of the link is located, the number of historical delay measurements of the link, and a preset measurement weight, the delay measurement priority of the link is determined. The preset flow segment distribution function is as follows: ; in, Let i be the measurement weight of link i. X(k,z) represents the number of historical delay measurements for the j-th traffic segment of link i, z is the traffic segment number where the current traffic value of link i is located, X(k,z)=0 when k=z, X(k,z)=1 when k≠z, and m is the total number of traffic segments, and m is an integer.

4. The method for calculating the average latency of a software-defined network link according to claim 3, characterized in that, The preset measurement weights for each link are set by the network administrator, wherein the measurement weights for backbone links are higher than those for non-backbone links.

5. The method for calculating the average latency of a software-defined network link according to claim 3, characterized in that, The m traffic segments have the same length, and the default value of m is 100; The default value of the preset threshold is 0.

01.

6. The method for calculating the average latency of a software-defined network link according to claim 1, characterized in that, The delay measurement for each of the target links includes: Send a link delay probe stream to the switch so that the switch returns a PACKET_IN message to the controller based on the probe stream; Delay measurements are performed on each selected link to be measured based on the PACKET_IN and PACKET_OUT messages.

7. The method for calculating the average latency of a software-defined network link according to claim 1, characterized in that, The updating of the link delay measurement history database includes: Record the number of delay measurements for each link on each traffic segment; Record the measurement weight for each link; Based on the measurement results of the current batch, the number of historical measurements, and the latency data, recalculate the current average latency for each link; The formula for calculating the current average delay is: ; The current time period delay data is the delay value obtained in this measurement; This represents the number of times the j-th traffic segment of link i has been measured.

8. A software-defined network link average delay statistics device, characterized in that, include: The link traffic measurement module is used to obtain the current traffic value of each link in the software-defined network; The measurement priority calculation module is used to determine the delay measurement priority of each link based on the traffic segment number where the current traffic value of the link is located, the historical delay measurement count of the link, and the preset measurement weight. The selection module is used to select a set number of links with a delay measurement priority higher than a preset threshold in descending order of priority, based on the delay measurement priority, as the target links for the current batch of delay measurement. If the number of target links selected is zero, the stop measurement module is executed. The stop measurement module is used to stop the link traffic measurement and latency measurement of the current batch and end the statistics of this batch. Otherwise, the delay acquisition module is executed. The delay acquisition module is used to measure the delay of each target link and acquire the delay data of the current batch corresponding to each target link. The link average delay calculation module is used to calculate the current average delay of each target link based on the delay data, historical measurement count, and preset measurement weights corresponding to each target link, and to update the link delay measurement history information database.

9. An electronic device, characterized in that, Includes a processor, which is coupled to a memory; The processor is configured to execute a computer program stored in the memory to cause the electronic device to perform the method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, Includes a computer program or instructions that, when run on a computer, cause the computer to perform the method as described in any one of claims 1-7.