Network card testing method, device and equipment and storage medium
By building a closed-loop testing environment for two-way devices, dynamically adjusting the rate to respond to network status, the problem of time-consuming performance testing of traditional network card is solved, and efficient and accurate network card performance testing is achieved.
Patent Information
- Application Number
- CN202510650689.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-20
- Publication Date
- 2025-09-02
AI Technical Summary
Traditional network card performance testing tools are difficult to dynamically adjust according to real-time network status, resulting in hundreds of step tests required to be performed in high-speed network scenarios, which is time-consuming and difficult to obtain the true value of network card performance parameters.
By building a closed-loop testing environment for two-way devices, the first device is controlled to send test data to the second device at a dynamic rate, monitor the transmission quality data, and use the first-order rate to quickly approximate the network card performance threshold and switch to the low-gain fine-tuning mode of the second-order rate, and perform fine calibration in combination with real-time quality feedback, and dynamically adjust the rate to respond to network state fluctuations.
It significantly shortens the test cycle, improves the testing efficiency and accuracy, and ensures that the test results are close to the performance limit of the network card.
Smart Images

Figure CN120583019A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of computer system testing, and in particular to a network card testing method, device, electronic device, and computer-readable storage medium. Background Art
[0002] In the field of computer system testing, performance testing of network interface cards (NICs) is a key component in evaluating throughput, latency, and stability. However, traditional testing tools employ static testing, relying on manually preset fixed rates for one-way testing. This makes it difficult to dynamically adjust to real-time network conditions to reflect true performance in dynamic network environments. To address this, segmented, stepped rate adjustment is often employed. This method requires hundreds of step tests in high-speed network scenarios, which is significantly time-consuming. Summary of the Invention
[0003] The present application provides a network card testing method, apparatus, device and storage medium to at least solve the technical problems of difficulty in obtaining the true values of network card performance parameters and long testing time.
[0004] The present application provides a network card testing method, which includes: controlling a first device to send test data to a second device at a dynamic rate, and monitoring transmission quality data of the test data at the dynamic rate; wherein the first device and the second device are respectively provided with a network card to be tested, and the dynamic rate of the first device includes a first-order rate and a second-order rate; assigning a first dynamic gain to the first-order rate to form a new first-order rate; in response to meeting a phase switching condition, assigning a second dynamic gain to the second-order rate to form a new second-order rate; wherein the second-order rate is higher than the first-order rate, the first dynamic gain and the second dynamic gain are associated with the transmission quality data of the instantaneous rate, and the first dynamic gain is higher than the second dynamic gain; and outputting the test result of the network card to be tested.
[0005] The present application also provides a network card testing device, which includes: a data module and a control module, the data module is used to obtain transmission quality data; the control module is connected to the data module, and is used to implement the steps of any of the above-mentioned network card testing methods.
[0006] The present application also provides an electronic device, which includes: a memory for storing a computer program; and a processor for implementing the steps of any of the above-mentioned network card testing methods when executing the computer program.
[0007] The present application also provides a computer-readable storage medium, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned network card testing methods are implemented.
[0008] This application constructs a closed-loop test environment for bidirectional devices. First, it controls the first device to send test data to the second device at a dynamic rate, breaking through the limitations of traditional one-way static testing and ensuring that the test path is consistent with the actual network topology; on this basis, it dynamically adjusts the rate strategy by real-time monitoring of transmission quality data: in the first-order rate stage, a high-gain growth mode is used to quickly approach the network card performance threshold, significantly shortening the test cycle and solving the redundant and time-consuming problem of the traditional step method; when the preset stage switching conditions are reached, it switches to the low-gain fine-tuning mode of the second-order rate, and fine-calibrates the rate in combination with real-time quality feedback; further combined with the strong correlation mechanism between transmission quality data and dynamic gain, the rate adjustment always responds to network status fluctuations; and finally outputs the performance results of the tested network card.
[0009] Therefore, this method can solve the technical problems of difficulty in obtaining the true values of parameters close to the performance limit of the network card and the long testing time, achieving the technical effect of improving test efficiency and test accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0010] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0011] Figure 1 An application environment diagram of a network card testing method provided in an embodiment of the present application;
[0012] Figure 2 A flowchart of a network card testing method provided in an embodiment of the present application;
[0013] Figure 3 A flowchart of another network card testing method provided in an embodiment of the present application;
[0014] Figure 4 A flowchart of another network card testing method provided in an embodiment of the present application;
[0015] Figure 5 A flow chart of a closed-loop control algorithm of the method provided in an embodiment of the present application;
[0016] Figure 6 A schematic diagram of the structure of a network card testing system provided in an embodiment of the present application;
[0017] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0018] The following will be combined with the accompanying drawings in the embodiments of this application to clearly and completely describe the technical solutions in the embodiments of this application. Obviously, the embodiments described are only part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0019] It should be noted that, in the description of this application, the terms "comprises," "includes," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements, but also other elements not explicitly listed, or elements inherent to such process, method, article, or device. The terms "first," "second," etc., in this application are used to distinguish similar objects, and are not used to describe a particular order or sequence.
[0020] It should be noted that the terms "S1", "S2", etc. are used only for the purpose of describing the steps and do not specifically refer to the order or sequence, nor are they used to limit this application. They are merely for the convenience of describing the method of this application and should not be understood as indicating the order of the steps. In addition, the technical solutions between the various embodiments can be combined with each other, but this must be based on the fact that ordinary technicians in this field can implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by this application.
[0021] In order to solve the technical problems of difficulty in obtaining the true value of network card performance parameters and long testing time, the present application controls the first device to send test data to the second device at a dynamic rate, and monitors the transmission quality data of the test data at the dynamic rate; wherein, the first device and the second device are respectively provided with a network card to be tested, and the dynamic rate of the first device includes a first-order rate and a second-order rate; a first dynamic gain is assigned to the first-order rate to form a new first-order rate; in response to meeting the stage switching condition, a second dynamic gain is assigned to the second-order rate to form a new second-order rate; wherein, the second-order rate is higher than the first-order rate, the first dynamic gain and the second dynamic gain are associated with the transmission quality data of the instantaneous rate, and the first dynamic gain is higher than the second dynamic gain; the test results of the network card to be tested are output to solve the technical problems of the true value of the network card performance parameters and the long testing time, and achieve the technical effect of improving test efficiency and test accuracy.
[0022] In order to make those skilled in the art better understand the present application, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods. The network card testing method provided by the present application can be applied to Figure 1 , Figure 1This diagram illustrates an application environment for a network card testing method provided in an embodiment of the present application. Terminal 12 communicates with server 14 via a network. Terminal 12 may be, but is not limited to, various personal computers, laptops, smartphones, tablet computers, and portable wearable devices. Server 14 may be implemented as a standalone server or a server cluster consisting of multiple servers.
[0023] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0024] The embodiments of the present application provide a network card testing method, and the method is described in detail in conjunction with the execution process of the network card testing method.
[0025] In one embodiment, Figure 2 As shown, Figure 2 A flowchart of a network card testing method provided in an embodiment of the present application.
[0026] S101: Control the first device to send test data to the second device at a dynamic rate, and monitor the transmission quality data of the test data at the dynamic rate; wherein the first device and the second device are respectively provided with a network card to be tested, and the dynamic rate of the first device includes a first-order rate and a second-order rate.
[0027] In this embodiment, the first device refers to the test data sending end, and the test data is sent to the second device at a dynamic rate through the first device; the second device refers to the test data receiving end, and the transmission quality data of the test data at the dynamic rate is statistically collected through the second device.
[0028] The dynamic rate refers to a real-time adjustable rate used when the first device sends test data, and its value can change dynamically according to the network status.
[0029] The transmission quality data is a set of real-time network card performance indicators fed back by the second device to the first device, and is used to guide the adjustment of the dynamic rate.
[0030] In this embodiment, a first device and a second device form a closed-loop network interface card (NIC) test circuit, with the NIC under test deployed in each of the first and second devices. The first device, acting as a test data transmitter, sends test data (such as test traffic) at a dynamic rate to the second device. The second device collects statistics on the test data sent by the first device and feeds the statistical results back to the first device, thus forming a closed-loop NIC test circuit.
[0031] Specifically, the dynamic rate can be a first-order rate, controlling the first device to transmit test data at the first-order rate. The second device acquires the test data transmitted by the first device at the first-order rate and performs transmission quality statistics and feedback. Furthermore, the dynamic rate can be a second-order rate, controlling the first device to transmit test data at the second-order rate. The second device acquires the test data transmitted by the first device at the second-order rate and performs transmission quality statistics and feedback. In other words, the dynamic rate can include both first-order and second-order rates.
[0032] The first-order rate and the second-order rate are two hierarchical stages of dynamic rate control. The first-order rate is suitable for the initial stage of rate control, where an exponential growth strategy can be used to quickly approach the network card performance threshold. The second-order rate is suitable for the fine-tuning stage of rate control. When the rate approaches the network card performance threshold, the fine-tuning stage is switched to suppress overshoot through closed-loop feedback, achieving precise rate convergence.
[0033] In this embodiment, a closed-loop test circuit is constructed by the first device and the second device to achieve two-way data interaction and quality feedback.
[0034] S102: Assign a first dynamic gain to the first-order rate to form a new first-order rate; in response to meeting the stage switching condition, assign a second dynamic gain to the second-order rate to form a new second-order rate; wherein, the second-order rate is higher than the first-order rate, the first dynamic gain and the second dynamic gain are associated with the transmission quality data of the instantaneous rate, and the first dynamic gain is higher than the second dynamic gain.
[0035] In this embodiment, the first and second dynamic gains refer to rate adjustment factors that determine the rate increase. The first dynamic gain is higher than the second dynamic gain, meaning that the first dynamic gain can achieve a greater rate change than the second dynamic gain. The first and second dynamic gains are associated with the real-time transmission quality data, and the dynamic gains are dynamically adjusted based on the transmission quality data.
[0036] In this embodiment, the first dynamic gain is used to adjust the rate based on the first-order rate to obtain a new first-order rate. When the new first-order rate meets the phase switching condition, the initial phase of rate control is switched to the fine-tuning phase of rate control, and the second dynamic gain is used to adjust the rate based on the second-order rate to obtain a new second-order rate.
[0037] The phase switching condition may be determined based on an immediate rate or a preset test period.
[0038] Specifically, when a new first-order rate is obtained through the first dynamic gain, it is determined whether the immediate new first-order rate meets the phase switching condition. When the immediate new first-order rate meets the phase switching condition, the initial stage of rate control is switched to the fine-tuning stage of rate control; or when a new first-order rate is obtained through the first dynamic gain, it is determined whether the new first-order rate meets the phase switching condition after a preset test cycle length. When the new first-order rate meets the phase switching condition after a preset test cycle length, the initial stage of rate control is switched to the fine-tuning stage of rate control. The setting of the phase switching condition can be used to control the dynamic rate to adjust the rate according to real-time requirements or phase or periodic requirements.
[0039] In this embodiment, a hierarchical strategy based on first-order and second-order rates uses transmission quality data as control input. The high dynamic gain of the first-order rate allows for rapid approach to the network card performance threshold, improving test efficiency. After switching between phases, the low dynamic gain of the second-order rate, combined with transmission quality data feedback, is finely calibrated to ensure that the test rate accurately converges to the actual performance limit. The dynamic correlation between dual-gain hierarchical control and transmission quality data allows for balanced efficiency and accuracy in rate adjustment.
[0040] S103: Output the test result of the network card to be tested.
[0041] In this embodiment, by adjusting the first-order rate and the second-order rate to achieve a stable state of adjusted network transmission performance, the test results of the network card under test in the stable state can be obtained to obtain the performance parameters of the network card under test corresponding to the test results at that time. This parameter reflects the performance threshold of the network card under test, and under the performance parameters of the corresponding network card, network transmission performance that meets user requirements can be achieved.
[0042] This embodiment constructs a closed-loop test environment for bidirectional devices. First, it controls the first device to send test data to the second device at a dynamic rate, breaking through the limitations of traditional one-way static testing and ensuring that the test path is consistent with the actual network topology. On this basis, the rate strategy is dynamically adjusted by real-time monitoring of transmission quality data: in the first-order rate stage, a high-gain growth mode is used to quickly approach the network card performance threshold, significantly shortening the test cycle and solving the redundant and time-consuming problem of the traditional step method. When the preset stage switching conditions are reached, it switches to the low-gain fine-tuning mode of the second-order rate and fine-calibrates the rate in combination with real-time quality feedback. It further combines the strong correlation mechanism between transmission quality data and dynamic gain to ensure that the rate adjustment always responds to network status fluctuations. Finally, it outputs the performance results of the tested network card. Therefore, this method can solve the technical problems of difficulty in obtaining the true value of parameters close to the performance limit of the network card and the long testing time, achieving the technical effect of improving test efficiency and test accuracy.
[0043] In one embodiment, Figure 3 As shown, Figure 3 A flowchart of another network card testing method provided in an embodiment of the present application.
[0044] S201: Obtain a third weight factor, and use the third weight factor to weight the nominal rate of the network card to be tested as a starting dynamic rate.
[0045] In this embodiment, the third weighting factor is a proportional coefficient, which is used to adjust the nominal rate of the network card, thereby determining the starting dynamic rate of the network card test. This proportional coefficient can be set manually. For example, if the proportional coefficient is set to 50%, if the nominal rate of the network card is 100G, the nominal rate of the network card is weighted according to the proportional coefficient of 50%, resulting in a rate of 50Gbps. By setting the third weighting factor, the problem of low data transmission rate caused by too low a starting dynamic rate can be avoided.
[0046] S202: Control the first device to send test data to the second device at a dynamic rate.
[0047] In this embodiment, the first device is controlled to use the rate value obtained after weighting as the starting dynamic rate to send test data to the second device.
[0048] S203: Determine whether the instantaneous rate is within a preset rate range.
[0049] In this embodiment, it is determined whether the instantaneous rate is within a preset rate range. If the instantaneous rate is within the preset rate range, step S204 is executed; if the instantaneous rate is not within the preset rate range, step S205 is executed.
[0050] Specifically, the first device has applied the initial dynamic rate to send test data to the second device. At this time, the instantaneous rate during the transmission process can be obtained, and it can be determined whether the rate is within the preset rate range.
[0051] The preset rate range includes a preset upper and lower rate limits. For example, the lower rate limit can be set to 1 Gbps, and the upper rate limit can be set to 120% of the network card's nominal rate. The system then determines whether the actual rate of the test data transmission process falls within the preset upper and lower rate limits. Setting the upper and lower rate limits constrains the rate adjustment range to prevent algorithm overflow.
[0052] In an alternative embodiment, when the network card is initially tested at the starting dynamic rate, the step of determining whether the instantaneous rate is within the preset rate range can be omitted. The starting dynamic rate is obtained by weighting the nominal rate, and the starting dynamic rate is configured to be within the preset rate range. Therefore, there is no need to determine whether it is within the preset rate range, which can reduce redundant steps and further improve the efficiency of network card testing.
[0053] S204: Control the network card test at the real-time rate.
[0054] In this embodiment, in response to the instantaneous rate being within the preset rate range, it is considered that the instantaneous rate meets the rate condition of the network card test. At this time, the first device is controlled to send test data to the second device at the instantaneous rate to start the network card test.
[0055] S205: Update the instantaneous rate to be within a preset rate range, and control the first device to send test data to the second device at the updated instantaneous rate.
[0056] In this embodiment, in response to the instantaneous rate not being within the preset rate range, it is considered that the instantaneous rate does not yet meet the rate condition of the network card test. At this time, it is necessary to readjust the third weight factor, and control the first device to use the rate value obtained after weighting as the starting dynamic rate, send test data to the second device, and obtain the updated instantaneous rate. When the updated instantaneous rate meets the preset rate range condition, the network card test is started.
[0057] In this embodiment, the starting dynamic rate is dynamically calculated through the third weight factor, combined with the boundary constraints of the preset rate range, which can avoid test overload or underload problems caused by rate deviation, improve the safety of the initial test stage, and ensure that the dynamic adjustment process is always within a controllable range through real-time rate correction to ensure that the test conditions meet the test requirements.
[0058] In one embodiment, Figure 4 As shown, Figure 4 A flowchart of another network card testing method provided in an embodiment of the present application.
[0059] S301: Control the first device to send test data to the second device at an initial dynamic rate, and monitor transmission quality data.
[0060] In this embodiment, the first device sends test data to the second device, and the second device obtains transmission quality data for evaluating the current network transmission quality.
[0061] S302: Obtain a phase switching rate using a first weight factor.
[0062] In this embodiment, the first weight factor is a proportional coefficient used to adjust the nominal rate of the network card, thereby determining the actual dynamic rate of the network card during testing. The first weight factor can be set manually and is not limited here.
[0063] Specifically, the first weight factor may be obtained first, and the nominal rate of the network card to be tested may be obtained. The nominal rate may be weighted using the first weight factor, and the current rate may be adjusted to obtain the phase switching rate.
[0064] S303: Evaluate whether the transmission quality in the first-order period meets the expected quality.
[0065] In this embodiment, in response to the stage switching rate obtained based on the first weight factor, the corresponding transmission quality in the first-order period meets the expected quality, and step S304 is executed to determine to exit the first-order test and switch to the second-order test. At this time, it is considered that the transmission quality in the first-order period has met the expected quality, and the second-order period can be entered for further adjustment of the rate.
[0066] In response to the transmission quality within the first-order period not meeting the expected quality, step S301 is executed to control the first device to send test data to the second device at an initial dynamic rate to monitor the transmission quality data.
[0067] In this embodiment, the method further includes determining whether the transmission quality within the first-order period meets the expected quality by determining whether the first-order instantaneous rate reaches the stage switching rate. If the first-order instantaneous rate reaches the stage switching rate, the transmission quality within the first-order period is considered to meet the expected quality, and the first-order test can be exited and the second-order test can be entered. If the first-order instantaneous rate does not reach the stage switching rate, the rate needs to be readjusted. That is, before controlling the first device to send test data to the second device at the initial dynamic rate in step S301, the instantaneous rate that does not reach the stage switching rate can also be adjusted using a third compensation factor.
[0068] Specifically, the third compensation factor is used to update the first-order instantaneous rate to obtain a new first-order rate. The third compensation factor can be obtained by combining the instantaneous rate and the first dynamic gain. If the instantaneous rate is a and the third compensation factor is (1+b), then the new first-order rate is a*(1+b). The third compensation factor can be obtained using a PID (proportional, integral, derivative) control algorithm. The specific process of obtaining the third compensation factor is described in detail below.
[0069] After updating the first-order instantaneous rate using the third compensation factor to obtain a new first-order rate, it is again determined whether the transmission quality within the first-order period meets the expected quality. If it does not meet the expected quality, the first device resends the test data to the second device, and the second device obtains the corresponding transmission quality data. Based on the transmission quality data, the third compensation factor applicable to the current rate can be obtained. Based on the new third compensation factor, the instantaneous rate can be readjusted, and then it is again determined whether the adjusted rate meets the expected quality. By repeating the rate adjustment steps, the instantaneous rate of the first-order test can be made to meet the stage switching rate, and then the second-order test can be entered.
[0070] In this embodiment, the third compensation factor is derived based on the instantaneous rate and can reflect the current true network quality. Adjusting the instantaneous rate based on the third compensation factor can quickly adjust the rate to a rate that satisfies the phase switching condition. The phase switching condition rate can be 90%-95% of the network card's nominal rate, i.e., a numerical range or an independent value of 90%. The specific setting method and value of the condition are not limited herein.
[0071] S304: Determine to exit the first-order test and switch to the second-order test.
[0072] In this embodiment, if the first-order instantaneous rate meets the phase switching condition, the first-order test can be exited and the second-order test can be entered. Furthermore, it can also be determined whether the first-order instantaneous rate meets the expected transmission quality corresponding to the second-order instantaneous rate. If so, the second-order test can be skipped and step S312 can be executed to output the test results. Specifically, the expected transmission quality corresponding to the second-order instantaneous rate is described in detail below.
[0073] In this embodiment, after entering the second-order test, it is also possible to determine whether the second-order instantaneous rate is lower than the second-order rate threshold, including using the second weight factor to obtain the second-order rate threshold, wherein the setting of the second weight factor is the same as the setting of the first weight factor, and can be set manually to adjust the nominal rate of the network card. For details, see the embodiment corresponding to step S201, which will not be repeated here. Specifically, the second weight factor is obtained, and the second weight factor is used to weight the nominal rate to obtain the second-order rate. Determine whether the second-order instantaneous rate is lower than the second-order rate threshold. If it is lower than the second-order rate threshold, it is considered that the second-order rate does not meet the second-order test conditions. At this time, steps S301-S304 are executed to readjust the second-order rate so that the rate meets the second-order test conditions, that is, the stage switching conditions of step S303.
[0074] S305: Determine whether the data loss parameter reaches a preset loss threshold.
[0075] In this embodiment, the data loss parameter may be a packet loss rate. The actual packet loss rate is obtained from the transmission quality data collected by the second device, and the data loss parameter is obtained by calculating the difference between the actual packet loss rate and the target packet loss rate. The target packet loss rate and the preset packet loss threshold may be manually set.
[0076] A determination is made as to whether the data loss parameter reaches a preset loss threshold. If so, the packet loss rate is considered high, indicating poor network quality. Step S306 is then executed to use the first compensation factor to obtain a new second-order rate, which is used to reduce the packet loss rate. If the data loss parameter does not reach the preset loss threshold, the packet loss rate is considered to meet the test conditions, indicating good network quality. Step S307 is then executed to use the second compensation factor to obtain a new second-order rate, further increasing the packet loss rate until it approaches the preset loss threshold, thereby obtaining the network card's performance limit.
[0077] S306: Obtain a new second-order rate using the first compensation factor.
[0078] In this embodiment, in response to the data loss parameter reaching a preset loss threshold, a first compensation factor is obtained. The first compensation factor is used to adjust the rate. When the rate changes, the data loss parameter changes, and the data loss parameter is adjusted by adjusting the rate. The first compensation factor is obtained in the same manner as the third compensation factor in step S303 and will not be further described here.
[0079] S307: Obtain a new second-order rate using the second compensation factor.
[0080] In this embodiment, in response to the data loss parameter not reaching the preset loss threshold, a second compensation factor is obtained, wherein the second compensation factor is used to adjust the rate. The second compensation factor is obtained in the same manner as the third compensation factor in step S303 and will not be repeated here.
[0081] In this embodiment, the first compensation factor is a negative value, used to reduce the second-order rate in the hope of lowering the data loss parameter, which can be generally understood as representing the packet loss rate. The second compensation factor is a positive value, used to increase the second-order rate, thereby approaching higher data transmission rates while ensuring data transmission reliability, fully testing the performance of the network card under test. Through the dynamic adjustment mechanism of positive and negative compensation factors, the second-order rate can accurately respond to real-time packet loss data. When the packet loss rate exceeds the preset loss threshold, the speed is automatically reduced to avoid overload. When it does not exceed the preset loss threshold, the speed is steadily increased to approach the performance limit of the network card. This allows the true performance boundary of the network card to be quickly identified while ensuring test stability, overcoming the inefficiency of the step method and the deviation from reality of static testing.
[0082] S308: Determine whether the loss discrete reaches the discrete loss threshold.
[0083] In this embodiment, it is determined whether the loss discrete reaches the discrete loss threshold. In response to the loss discrete reaching the discrete loss threshold, step S309 is executed to control the duration of the test period to the first duration; in response to the loss discrete not reaching the discrete loss threshold, step S310 is executed to control the duration of the test period to the second duration.
[0084] Specifically, loss dispersion refers to the standard deviation of the packet loss rate. The standard deviation is used to indicate the degree of dispersion of data. The calculation formula of the standard deviation is a conventional standard deviation calculation method in the field of mathematics.
[0085] In this embodiment, the packet loss rate of multiple cycles can be obtained. The cycle can be a continuous cycle or an interval cycle. The specific setting method of the cycle, the length of the cycle and the number of cycles obtained are not restricted here and can be adjusted according to the test needs. The preferred cycle is 1 second, and 5 consecutive cycles can be selected for standard deviation calculation to obtain loss discreteness.
[0086] The discrete loss threshold is used to determine whether the calculated loss discreteness satisfies the preset conditions for the data loss parameters in the second stage. The preferred discrete loss threshold may be 0.3%. If the standard deviation of the packet loss rate calculated over five consecutive cycles is greater than 0.3%, it is considered that the network transmission quality is unstable at the second-order rate, and the feedback period of the transmission quality data needs to be adjusted by extending the feedback period to the first duration. If the standard deviation of the packet loss rate calculated over five consecutive cycles is not greater than 0.3%, it is considered that the network transmission quality is good at the second-order rate, and the feedback period of the transmission quality data can be adjusted by extending the feedback period to the second duration, preferably 1 second.
[0087] S309: Control the duration of the test period to be the first duration.
[0088] In this embodiment, in response to the loss discrete reaching the discrete loss threshold, the feedback period of the transmission quality data is adjusted to a first duration.
[0089] S310: Control the duration of the test period to be the second duration.
[0090] In this embodiment, in response to the loss discrete not reaching the discrete loss threshold, the feedback period of the transmission quality data is adjusted to the second duration.
[0091] Among them, the first duration is greater than the second duration.
[0092] In this embodiment, by dynamically adjusting the feedback cycle length of the transmission quality data, the sampling time is extended when the discrete fluctuation of the loss is large to improve data stability and reduce the impact of random interference. The sampling time is shortened when the discrete fluctuation of the loss is small to speed up the test progress, thereby improving the test efficiency.
[0093] S311: Evaluate whether the transmission quality at the second-order instantaneous rate meets the expected quality.
[0094] In this embodiment, when it is determined that the transmission quality at the second-order instantaneous rate meets the expected quality, step S312 is executed to output the test result; when it is determined that the transmission quality at the second-order instantaneous rate does not meet the expected quality, step S304 is executed to exit the first-order test and switch to the second-order test.
[0095] Optionally, the expected quality may include that the fluctuation amplitude of the dynamic rate within the second-order period is less than a preset fluctuation threshold and the delay dispersion is less than a discrete delay threshold.
[0096] Among them, the second-order cycle represents a preset second-order number of test cycles. For example, if the preset second-order number is 5, the transmission quality data within 5 cycles is obtained, and it is determined whether the data calculated from the transmission quality data within 5 cycles meets the transmission quality judgment condition.
[0097] Specifically, the fluctuation amplitude of the dynamic rate within the second-order period can be obtained, or the discrete degree of the data delay parameter can be obtained as the delay discreteness. The fluctuation amplitude of the dynamic rate within the second-order period and the discrete degree of the data delay parameter can also be obtained. Preferably, different expected quality conditions can be set for different network cards, wherein the fluctuation amplitude condition of the dynamic rate is a general condition for judging whether the transmission quality meets the expected quality; the discrete degree of the data delay parameter is a special condition for judging whether the transmission quality meets the expected quality. Different special conditions can be set for network cards of different capacities, as well as the specific values used for the special conditions. For example, for high-performance data center network cards (such as 100G / 200G), the rate fluctuation can be set to ≤0.05% and the delay standard deviation can be set to <10μs; for low-performance data center network cards (such as 1G), only the rate fluctuation can be set to ≤0.05%, and the delay standard deviation is not limited.
[0098] In this embodiment, by simultaneously monitoring the fluctuation amplitude of the dynamic rate or the discrete degree of the delay parameter, the transmission quality is determined to be qualified only when the value reaches the stable threshold, thereby effectively eliminating the influence of instantaneous interference or occasional abnormal data, ensuring that the network card test results truly reflect the performance of the network card in a continuous steady state, and improving the reliability and anti-interference ability of the network card test results.
[0099] Combined with the examples of expected quality in the previous steps, in this embodiment, after evaluating that the transmission quality at the second-order instantaneous rate meets the expected quality, the second-order instantaneous rate of the preset steady-state time length can also be maintained, and the transmission data within the preset steady-state time length can be used as the test result.
[0100] In this embodiment, in response to the transmission quality at the second-order instantaneous rate meeting the expected quality, a steady-state test phase can be performed. In the steady-state test phase, the second-order instantaneous rate can be maintained for a preset steady-state duration, and the transmission data within the preset steady-state duration is used as the test result.
[0101] Among them, the preset steady-state duration is used to indicate the duration of the test whether it is in a steady state. For example, it can be set to 30 seconds. When the fluctuation amplitude of the dynamic rate or the discrete degree of the delay parameter within 30 seconds meets the conditions, the current transmission state is considered to be steady state.
[0102] Transmission data includes at least one of average data throughput, peak data delay, and jitter. This can include only average data throughput, only peak data delay, or all three. Average data throughput refers to the total amount of valid data successfully transmitted per unit time; peak data delay refers to the maximum time observed during the test for a data packet to travel from the first device to the second device; and jitter refers to the degree of delay dispersion, calculated by calculating the standard deviation of the delay data. These three values reflect the transmission quality of the network.
[0103] In this embodiment, through the steady-state test phase, data collection is continuously performed for a preset period of time after the transmission quality meets the standard, effectively eliminating the impact of instantaneous fluctuations or occasional interference on the test results, ensuring that the output data average throughput, delay peak and jitter value truly reflect the performance limit of the network card in a stable state, and significantly improving the reliability of the test results.
[0104] S312: Output test results.
[0105] In this embodiment, based on the rate obtained in the steady-state test phase, test data at the rate is output. The data is used to represent the performance limit of the network card, so as to obtain transmission data at the limit performance of the network card.
[0106] In this embodiment, the exit condition of the second-order test may not be restricted. After the steady-state test phase is completed, the transmission is performed at the rate maintained in the steady state, that is, the first device is controlled to send test data to the second device at the steady-state rate, and the first-order test and the second-order test are cycled. The rate is cyclically adjusted according to the rate adjustment method of the first-order test and the second-order test to keep the network card in a better performance state. This implementation method is suitable for scenarios with simple network environments and small scopes, such as user test terminals, to dynamically adjust the network card performance parameters to maintain network quality in the long term.
[0107] In one embodiment, Figure 5 As shown, Figure 5 A flow chart of a closed-loop control algorithm provided in an embodiment of the present application.
[0108] In this embodiment, the difference between the data loss parameter and a preset loss threshold is obtained as the loss factor e(t).
[0109] The loss factor is processed by a closed-loop control algorithm (PID control algorithm) to obtain a third compensation factor.
[0110] In this embodiment, the PID control algorithm can include proportional, integral, and differential operations. Proportional operation can be used to adjust the output proportionally based on the current error. The larger the error, the greater the adjustment. Integral operation can be used to accumulate the integral value of historical errors, eliminating long-term steady-state errors that cannot be resolved by proportional control. Excessive integration may cause overshoot or slow response. Differential operation can be used to predict future error trends, suppress oscillations, and accelerate convergence.
[0111] Specifically, the weight values for proportional operation, integral operation, and differential operation can be preset, such as the preset proportional operation weight value Kp = 0.8, the preset integral operation weight value Ki = 0.15, and the preset proportional operation weight value Kd = 0.05. These weight values can all be adjusted. When the loss factor is less than the preset loss factor threshold, the integral operation can be stopped. When the loss factor is not less than the preset loss factor threshold, the integral operation can be continued. When the loss factor fluctuation is greater than the preset loss factor fluctuation threshold, the rate is reduced. When the loss factor fluctuation is not greater than the preset loss factor threshold, the rate is increased.
[0112] Based on the closed-loop control algorithm, the values ΔP, ΔI, and ΔD of the proportional, integral, and differential operations are obtained and summed to obtain a third compensation factor Δ. The third compensation factor is used to obtain a new first-order rate, where the new first-order rate is the first-order instantaneous rate superimposed on the first-order instantaneous rate weighted by the third compensation factor. Based on the new first-order rate, step S311 is performed to evaluate whether the transmission quality at the second-order instantaneous rate meets the expected quality. The specific method is the same as that of the embodiment corresponding to step S311 and is not further described here.
[0113] In one embodiment, Figure 6 As shown, Figure 6 This is a schematic diagram of the structure of a network card testing device provided in an embodiment of the present application. The network card testing device may include a data module 21 and a control module 22. The data module 21 is connected to the control module 22 and is used to perform at least the following steps:
[0114] Control the first device to send test data to the second device at a dynamic rate, and monitor the transmission quality data of the test data at the dynamic rate; wherein the first device and the second device are respectively provided with a network card to be tested, and the dynamic rate of the first device includes a first-order rate and a second-order rate; assign a first dynamic gain to the first-order rate to form a new first-order rate; in response to meeting the phase switching condition, assign a second dynamic gain to the second-order rate to form a new second-order rate; wherein the second-order rate is higher than the first-order rate, the first dynamic gain and the second dynamic gain are associated with the transmission quality data of the instantaneous rate, and the first dynamic gain is higher than the second dynamic gain; and output the test result of the network card to be tested.
[0115] Each module in the network card testing device can be implemented in whole or in part through software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in an electronic device in hardware form, or can be stored in a memory in the electronic device in software form, so that the processor can call and execute the corresponding operations of each module.
[0116] An embodiment of the present application further provides an electronic device, comprising a memory for storing a computer program;
[0117] A processor, when used to execute a computer program, can perform at least the following steps:
[0118] Control the first device to send test data to the second device at a dynamic rate, and monitor the transmission quality data of the test data at the dynamic rate; wherein the first device and the second device are respectively provided with a network card to be tested, and the dynamic rate of the first device includes a first-order rate and a second-order rate; assign a first dynamic gain to the first-order rate to form a new first-order rate; in response to meeting the phase switching condition, assign a second dynamic gain to the second-order rate to form a new second-order rate; wherein the second-order rate is higher than the first-order rate, the first dynamic gain and the second dynamic gain are associated with the transmission quality data of the instantaneous rate, and the first dynamic gain is higher than the second dynamic gain; and output the test result of the network card to be tested.
[0119] In one embodiment, the electronic device may be a server, and its internal structure diagram may be as shown in FIG. Figure 7 As shown. The electronic device includes a processor, memory, network interface and database connected via a system bus. The processor of the electronic device is used to provide computing and control capabilities. The memory of the electronic device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The database of the electronic device is used to store software management data. The network interface of the electronic device is used to communicate with an external terminal via a network connection.
[0120] Those skilled in the art will understand that Figure 7 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the electronic device to which the solution of the present application is applied. The specific electronic device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0121] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the computer program can at least perform the following steps:
[0122] Control the first device to send test data to the second device at a dynamic rate, and monitor the transmission quality data of the test data at the dynamic rate; wherein the first device and the second device are respectively provided with a network card to be tested, and the dynamic rate of the first device includes a first-order rate and a second-order rate; assign a first dynamic gain to the first-order rate to form a new first-order rate; in response to meeting the phase switching condition, assign a second dynamic gain to the second-order rate to form a new second-order rate; wherein the second-order rate is higher than the first-order rate, the first dynamic gain and the second dynamic gain are associated with the transmission quality data of the instantaneous rate, and the first dynamic gain is higher than the second dynamic gain; and output the test result of the network card to be tested.
[0123] In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to, various media that can store computer programs, such as a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk, or an optical disk.
[0124] An embodiment of the present application further provides a computer program product, which includes a computer program. When the computer program is executed by a processor, it can perform at least the following steps:
[0125] Control the first device to send test data to the second device at a dynamic rate, and monitor the transmission quality data of the test data at the dynamic rate; wherein the first device and the second device are respectively provided with a network card to be tested, and the dynamic rate of the first device includes a first-order rate and a second-order rate; assign a first dynamic gain to the first-order rate to form a new first-order rate; in response to meeting the phase switching condition, assign a second dynamic gain to the second-order rate to form a new second-order rate; wherein the second-order rate is higher than the first-order rate, the first dynamic gain and the second dynamic gain are associated with the transmission quality data of the instantaneous rate, and the first dynamic gain is higher than the second dynamic gain; and output the test result of the network card to be tested.
[0126] Professionals can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing related hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0127] It can be further appreciated that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in terms of function in the above description. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0128] The above describes in detail a network card testing method, system, device, and storage medium provided by the present application. Specific examples are used herein to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only intended to help understand the method and core concept of the present application. It should be noted that, for those skilled in the art, without departing from the principles of the present application, several improvements and modifications may be made to the present application, and such improvements and modifications also fall within the scope of protection of the claims of the present application.
Claims
1. A network card testing method, characterized in that: The test method includes: Controlling a first device to send test data to a second device at a dynamic rate, and monitoring transmission quality data of the test data at the dynamic rate; wherein the first device and the second device are respectively provided with a network card to be tested, and the dynamic rate of the first device includes a first-order rate and a second-order rate; Assigning a first dynamic gain to a first-order rate to form a new first-order rate; in response to meeting a phase switching condition, assigning a second dynamic gain to a second-order rate to form a new second-order rate; wherein the second-order rate is higher than the first-order rate, the first dynamic gain and the second dynamic gain are associated with the transmission quality data of the instantaneous rate, and the first dynamic gain is higher than the second dynamic gain; Output the test result of the network card to be tested.
2. The network card testing method according to claim 1, wherein: The assigning a second dynamic gain to the second-order rate to form a new second-order rate includes: Acquire transmission quality data within a second-order period at a second-order instantaneous rate to evaluate whether the transmission quality at the second-order instantaneous rate meets expected quality; wherein the second-order period represents a preset second-order number of test periods; In response to the transmission quality meeting the expected quality, maintaining the second-order instantaneous rate for a preset steady-state duration, and using transmission data within the preset steady-state duration as the test result; the transmission data including at least one of an average data throughput, a peak data delay, and a jitter value; In response to the transmission quality not meeting the expected quality, a second dynamic gain matching the transmission quality is evaluated, and the second-order rate is updated using the second dynamic gain.
3. The network card testing method according to claim 2, wherein: The transmission quality data includes a data loss parameter and a data delay parameter; the evaluation of whether the transmission quality at the second-order instantaneous rate meets the expected quality includes: obtaining the fluctuation amplitude of the dynamic rate within the second-order period; obtaining the discrete degree of the data delay parameter as the delay discrete; judging whether the fluctuation amplitude is less than a preset fluctuation threshold and whether the delay discrete is less than a discrete delay threshold; in response to the fluctuation amplitude being less than the preset fluctuation threshold and the delay discrete being less than the discrete delay threshold, judging that the transmission quality meets the expected quality; and / or, The evaluating whether the transmission quality at the second-order instantaneous rate meets the expected quality further includes: Obtaining a degree of discreteness of the data loss parameter within the second-order period as loss discreteness; determining whether the loss discreteness reaches a discrete loss threshold; in response to the loss discreteness reaching the discrete loss threshold, controlling the duration of the test period to be a first duration; in response to the loss discreteness not reaching the discrete loss threshold, controlling the duration of the test period to be a second duration; wherein the first duration is greater than the second duration.
4. The network card testing method according to claim 2, wherein: The transmission quality data includes a data loss parameter; and the evaluating a second dynamic gain that matches the transmission quality and updating the second-order rate using the second dynamic gain includes: Determining whether the data loss parameter reaches a preset loss threshold; In response to the data loss parameter reaching the preset loss threshold, obtaining a first compensation factor, and using the first compensation factor to obtain a new second-order rate; wherein the new second-order rate is the second-order instantaneous rate superimposed on the second-order instantaneous rate weighted by the first compensation factor; In response to the data loss parameter not reaching the preset loss threshold, obtaining a second compensation factor, and obtaining a new second-order rate using the second compensation factor; The first compensation factor is a negative value, and the second compensation factor is a positive value.
5. The network card testing method according to claim 1, wherein: Then, assigning the first dynamic gain to the first-order rate to form a new first-order rate comprises: Obtaining a first weight factor, obtaining a nominal rate of the network card to be tested, weighting the nominal rate using the first weight factor to obtain a phase switching rate, determining whether a first-order instantaneous rate reaches the phase switching rate, and in response to the first-order instantaneous rate reaching the phase switching rate, determining that the phase switching condition is met; and / or exiting the first-order test and determining that the phase switching condition is met; wherein the first-order test indicates a phase of performing network card testing at the first-order rate; After assigning the second dynamic gain to the second-order rate to form a new second-order rate, the method further includes: Obtaining a second weighting factor, and weighting the nominal rate using the second weighting factor to obtain a second-order rate threshold; determining whether the second-order instantaneous rate is lower than the second-order rate threshold; and determining to exit the second-order test in response to the second-order instantaneous rate being lower than the second-order rate threshold; The second weighting factor is less than or equal to the first weighting factor.
6. The network card testing method according to claim 1, wherein: The transmission quality includes a data loss parameter at the instantaneous rate, the first dynamic gain includes a third compensation factor, and the assigning of the first dynamic gain to the first-order rate to form a new first-order rate includes: Obtaining a difference between the data loss parameter and a preset loss threshold as a loss factor; Performing a closed-loop control algorithm on the loss factor to obtain a third compensation factor; The new first-order rate is obtained by using the third compensation factor; wherein the new first-order rate is the first-order instantaneous rate superimposed on the first-order instantaneous rate weighted by the third compensation factor.
7. The network card testing method according to claim 1, wherein: Before controlling the first device to send test data to the second device at a dynamic rate, the method further includes: Obtaining a third weight factor, and using the third weight factor to weight the nominal rate of the network card to be tested as a starting dynamic rate; Controlling the first device to send test data to the second device at a dynamic rate includes: Determining whether the instantaneous rate is within a preset rate range; In response to the instantaneous rate being within the preset rate range, the network card test is controlled to be performed at the instantaneous rate; otherwise, the instantaneous rate is updated to be within the preset rate range.
8. A network card testing device, characterized in that: The network card testing device comprises: Data module, used to obtain transmission quality data; A control module, connected to the data module, is used to implement the network card testing method according to any one of claims 1 to 7.
9. An electronic device, characterized in that: The electronic device comprises: memory for storing computer programs; A processor, configured to implement the steps of the network card testing method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores a computer program, wherein when the computer program is executed by a processor, the steps of the method for dynamically testing the performance of a network card according to any one of claims 1 to 7 are implemented.