Message sending rate adjusting method, electronic equipment and device

By monitoring and calculating the number of messages received by the network tester and dynamically adjusting the transmission rate, the poor test results caused by fixed message transmission rate in the prior art are solved, and more efficient DUT testing is achieved.

CN119996269APending Publication Date: 2025-05-13NEW H3C TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510220903.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-26
Publication Date
2025-05-13

AI Technical Summary

Technical Problem

When testing equipment DUT, existing network testers cannot dynamically adjust the packet sending rate, which may affect the test effect of the DUT.

Method used

By monitoring the number of DUT feedback messages received by each port within the preset period, calculate the reception rate, and dynamically adjust the client sending rate of the network tester through this port according to the comparison of the reception rate and the transmission rate.

Benefits of technology

Dynamic adjustment of the message transmission rate is realized, so that the transmission rate conforms to the message processing capability of the DUT, thereby improving the testing effect of the network tester on the DUT.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119996269A_ABST
    Figure CN119996269A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a message sending rate adjusting method, electronic equipment and a device, and relates to the technical field of networks, aiming at each port of a network tester, the method comprises the following steps: monitoring the number of messages fed back by a DUT (Device Under Test) in a testing process and received by the port in each preset period; calculating the receiving rate of the port for receiving the message according to the monitored number; under the condition that the receiving rate is larger than the sending rate of the network tester sending the message through the port, the network tester is controlled to improve the sending rate of a client sending the message through the port, and the client is virtual equipment which is configured in the network tester and interacts with the DUT; and under the condition that the receiving rate is smaller than the sending rate, controlling the network tester to reduce the sending rate of the client which sends the message through the port. By applying the scheme provided by the embodiment of the invention, the influence on the DUT test result caused by the fact that the network tester sends the message at the fixed sending rate can be avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of network technology, and in particular to a method, electronic device and apparatus for adjusting a message sending rate. Background Art

[0002] Before mass production of network equipment (such as switches, routers, etc.), it is often necessary to test the network equipment in advance. The relevant tests are often performed through a network tester. The network tester simulates the network device to send messages to the network device under test, namely DUT (Device Under Test), and receives messages fed back by the DUT, thereby testing the DUT's ability to process messages.

[0003] However, most network testers in related technologies can only send messages at a preset fixed packet sending rate. Too high a packet sending rate may cause a delay in DUT message processing, affecting the test effect on the DUT. Summary of the invention

[0004] The purpose of the embodiments of the present application is to provide a method, electronic device and apparatus for adjusting the message transmission rate, so as to avoid the influence of the network tester sending messages at a fixed transmission rate on the DUT test results. The specific technical solution is as follows:

[0005] In a first aspect, an embodiment of the present application provides a method for adjusting a message sending rate. For each port of a network tester, the method includes:

[0006] Monitor the number of messages fed back by the device under test (DUT) during the test process and received by the port in each preset period;

[0007] According to the monitored quantity, calculate the receiving rate of the message received by the port;

[0008] When the receiving rate is greater than the sending rate of the network tester through the port, controlling the network tester to increase the sending rate of the client that sends the message through the port, the client being a virtual device configured in the network tester to interact with the DUT;

[0009] When the receiving rate is lower than the sending rate, the network tester is controlled to reduce the sending rate of the client that sends messages through the port.

[0010] In one embodiment of the present application, the monitoring of the number of messages fed back by the device under test DUT during the test process and received by the port in each preset period includes:

[0011] Monitor the number of messages received by the port in each preset period and fed back by the DUT during the test process that meet the preset filtering rules, wherein the preset filtering rules include at least one of the following information: the protocol based on the message, the interface number of the upper interface on the DUT that transmits the message, and the identifier of the client corresponding to the message;

[0012] The step of calculating the receiving rate of the message received by the port according to the monitored quantity includes:

[0013] According to the monitored quantity, the receiving rate of the message that meets the preset filtering rules is calculated;

[0014] When the receiving rate is greater than the sending rate of the message sent by the network tester through the port, controlling the network tester to increase the sending rate of the client sending the message through the port includes:

[0015] When the receiving rate is greater than the sending rate of the messages that meet the preset filtering rules sent by the network tester through the port, control the network tester to increase the sending rate of the messages that meet the preset filtering rules sent by the client through the port;

[0016] When the receiving rate is lower than the sending rate, controlling the network tester to reduce the sending rate of the client sending the message through the port includes:

[0017] When the receiving rate is lower than the sending rate of the messages that meet the preset filtering rules sent by the network tester through the port, the network tester is controlled to reduce the sending rate of the messages that meet the preset filtering rules sent by the client through the port.

[0018] In one embodiment of the present application, the step of calculating the receiving rate of the message received by the port according to the monitored quantity includes:

[0019] Calculate the average value of the number of packets monitored within the latest preset number of preset periods to obtain the receiving rate of the port receiving packets.

[0020] In one embodiment of the present application, controlling the network tester to increase the sending rate of the client sending the message through the port includes:

[0021] Control the network tester to increase a first target step size based on a current sending rate of a client sending messages through the port, wherein the first target step size is an absolute value of a difference between a most recently monitored number and a last monitored number;

[0022] and / or

[0023] The controlling the network tester to reduce the sending rate of the client sending the message through the port includes:

[0024] The network tester is controlled to reduce a second target step size based on a current sending rate of a client sending messages through the port, wherein the second target step size is an absolute value of a difference between a latest monitored number and a last monitored number.

[0025] In one embodiment of the present application, before monitoring the number of messages fed back by the device under test DUT during the test process received by the port in each preset period, the method further includes:

[0026] Determine a block sending rate corresponding to each client block according to a total sending rate corresponding to the port and the number of client blocks corresponding to the port, wherein each client in the client block corresponding to the port transmits a message through the port;

[0027] For each client block, determining an initial sending rate for each client in the client block according to the block sending rate of the client block and the number of clients in the client block;

[0028] The control network tester configures each client to send messages according to the determined initial sending rate.

[0029] In one embodiment of the present application, each port corresponds to a monitoring thread, and the monitoring of the number of messages fed back by the device under test DUT during the test process received by the port in each preset period includes:

[0030] The number of messages fed back by the DUT during the test and received by the port in each preset period is monitored through the monitoring thread corresponding to the port;

[0031] The step of calculating the receiving rate of the message received by the port according to the monitored quantity includes:

[0032] The receiving rate of the messages received by the port is calculated through the monitoring thread corresponding to the port.

[0033] In a second aspect, an embodiment of the present application provides an electronic device, the electronic device comprising:

[0034] processor;

[0035] Transceiver;

[0036] A machine-readable storage medium storing machine-executable instructions that can be executed by the processor, the machine-executable instructions causing the processor to perform the following steps for each port of the network tester:

[0037] Monitor the number of messages fed back by the device under test (DUT) during the test process and received by the port in each preset period;

[0038] According to the monitored quantity, calculate the receiving rate of the message received by the port;

[0039] When the receiving rate is greater than the sending rate of the network tester through the port, controlling the network tester to increase the sending rate of the client that sends the message through the port, the client being a virtual device configured in the network tester to interact with the DUT;

[0040] When the receiving rate is lower than the sending rate, the network tester is controlled to reduce the sending rate of the client that sends messages through the port.

[0041] In one embodiment of the present application, monitoring the number of messages fed back by the device under test DUT during the test process and received by the port in each preset period specifically includes:

[0042] Monitor the number of messages received by the port in each preset period and fed back by the DUT during the test process that meet the preset filtering rules, wherein the preset filtering rules include at least one of the following information: the protocol based on the message, the interface number of the interface on the DUT that transmits the message, and the identifier of the client corresponding to the message;

[0043] The step of calculating the receiving rate of the port receiving the message according to the monitored quantity specifically includes:

[0044] According to the monitored quantity, the receiving rate of the message that meets the preset filtering rules is calculated;

[0045] When the receiving rate is greater than the sending rate of the message sent by the network tester through the port, controlling the network tester to increase the sending rate of the client sending the message through the port specifically includes:

[0046] When the receiving rate is greater than the sending rate of the messages that meet the preset filtering rules sent by the network tester through the port, control the network tester to increase the sending rate of the messages that meet the preset filtering rules sent by the client through the port;

[0047] When the receiving rate is lower than the sending rate, controlling the network tester to reduce the sending rate of the client sending the message through the port specifically includes:

[0048] When the receiving rate is lower than the sending rate of the messages that meet the preset filtering rules sent by the network tester through the port, the network tester is controlled to reduce the sending rate of the messages that meet the preset filtering rules sent by the client through the port.

[0049] In one embodiment of the present application, the calculation of the receiving rate of the message received by the port according to the monitored quantity specifically includes:

[0050] Calculate the average value of the number of packets monitored within the latest preset number of preset periods to obtain the receiving rate of the port receiving packets.

[0051] In one embodiment of the present application, controlling the network tester to increase the sending rate of the client sending the message through the port specifically includes:

[0052] Control the network tester to increase a first target step size based on a current sending rate of a client sending messages through the port, wherein the first target step size is an absolute value of a difference between a most recently monitored number and a last monitored number;

[0053] and / or

[0054] The controlling the network tester to reduce the sending rate of the client sending the message through the port includes:

[0055] The network tester is controlled to reduce a second target step size based on a current sending rate of a client sending messages through the port, wherein the second target step size is an absolute value of a difference between a latest monitored number and a last monitored number.

[0056] In one embodiment of the present application, the machine executable instructions further cause the processor to perform the following steps:

[0057] Determine a block sending rate corresponding to each client block according to a total sending rate corresponding to the port and the number of client blocks corresponding to the port, wherein each client in the client block corresponding to the port transmits a message through the port;

[0058] For each client block, determining an initial sending rate for each client in the client block according to the block sending rate of the client block and the number of clients in the client block;

[0059] The control network tester configures each client to send messages according to the determined initial sending rate.

[0060] In one embodiment of the present application, each port corresponds to a monitoring thread, and the monitoring of the number of messages fed back by the device under test DUT during the test process received by the port within each preset period specifically includes:

[0061] The number of messages fed back by the DUT during the test and received by the port in each preset period is monitored through the monitoring thread corresponding to the port;

[0062] The step of calculating the receiving rate of the port receiving the message according to the monitored quantity specifically includes:

[0063] The receiving rate of the messages received by the port is calculated through the monitoring thread corresponding to the port.

[0064] In a third aspect, an embodiment of the present application provides a message sending rate adjustment device, for each port of a network tester, the device includes:

[0065] A quantity monitoring module is used to monitor the number of messages fed back by the device under test DUT during the test process and received by the port in each preset period;

[0066] The rate calculation module is used to calculate the receiving rate of the message received by the port according to the monitored quantity;

[0067] A first rate adjustment module, configured to control the network tester to increase the sending rate of a client that sends messages through the port when the receiving rate is greater than the sending rate of messages sent by the network tester through the port, wherein the client is a virtual device configured in the network tester to interact with the DUT;

[0068] The second rate adjustment module is used to control the network tester to reduce the sending rate of the client that sends messages through the port when the receiving rate is lower than the sending rate.

[0069] In one embodiment of the present application, the quantity monitoring module is specifically used to:

[0070] Monitor the number of messages received by the port in each preset period and fed back by the DUT during the test process that meet the preset filtering rules, wherein the preset filtering rules include at least one of the following information: the protocol based on the message, the interface number of the interface on the DUT that transmits the message, and the identifier of the client corresponding to the message;

[0071] The rate calculation module is specifically used for:

[0072] According to the monitored quantity, the receiving rate of the message that meets the preset filtering rules is calculated;

[0073] The first rate adjustment module is specifically configured to:

[0074] When the receiving rate is greater than the sending rate of the messages that meet the preset filtering rules sent by the network tester through the port, control the network tester to increase the sending rate of the messages that meet the preset filtering rules sent by the client through the port;

[0075] The second rate adjustment module is specifically configured to:

[0076] When the receiving rate is lower than the sending rate of the messages that meet the preset filtering rules sent by the network tester through the port, the network tester is controlled to reduce the sending rate of the messages that meet the preset filtering rules sent by the client through the port.

[0077] In one embodiment of the present application, the rate calculation module is specifically used to:

[0078] Calculate the average value of the number of packets monitored within the latest preset number of preset periods to obtain the receiving rate of the port receiving packets.

[0079] In one embodiment of the present application, the first rate adjustment module is specifically configured to:

[0080] When the receiving rate is greater than the sending rate of the message sent by the network tester through the port, the network tester is controlled to increase the first target step size based on the current sending rate of the client sending the message through the port, wherein the first target step size is the absolute value of the difference between the most recently monitored number and the last monitored number;

[0081] and / or

[0082] The second rate adjustment module is specifically configured to:

[0083] When the receiving rate is lower than the sending rate, the network tester is controlled to reduce the second target step size based on the current sending rate of the client that sends messages through the port, wherein the second target step size is the absolute value of the difference between the most recently monitored number and the last monitored number.

[0084] In one embodiment of the present application, the device further includes:

[0085] A block rate determination module, configured to determine a block transmission rate corresponding to each client block according to a total transmission rate corresponding to the port and a number of client blocks corresponding to the port, wherein each client in the client block corresponding to the port transmits a message through the port;

[0086] an initial rate determination module, configured to determine, for each client block, an initial sending rate for each client in the client block according to the block sending rate of the client block and the number of clients in the client block;

[0087] The message sending control module is used to control the network tester to configure each client to send messages according to the determined initial sending rate.

[0088] In one embodiment of the present application, each port corresponds to a monitoring thread, and the quantity monitoring module is specifically used to:

[0089] The number of messages fed back by the DUT during the test and received by the port in each preset period is monitored through the monitoring thread corresponding to the port;

[0090] The rate calculation module is specifically used for:

[0091] The receiving rate of the messages received by the port is calculated through the monitoring thread corresponding to the port.

[0092] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, any method step described in the first aspect is implemented.

[0093] In a fifth aspect, an embodiment of the present application further provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute any of the methods described in the first aspect above.

[0094] Beneficial effects of the embodiments of the present application:

[0095] The scheme provided by the embodiment of the present application can monitor the receiving rate of the message fed back by the DUT received by each port in the network tester. If the receiving rate is higher than the sending rate of the port, it means that the speed at which the DUT feeds back the message to the network tester through the port is greater than the speed at which the DUT receives the network test and sends the message to it through the port, so it can be determined that the current DUT processes the message faster, and can achieve fast message feedback. The message processing capacity of the DUT is sufficient to process the currently received message, so the network tester can further improve the message sending rate. On the contrary, if the receiving rate is lower than the sending rate of the port, the network tester can reduce the message sending rate. That is, the embodiment of the present application realizes the incremental processing mechanism of the message sending rate, which can control the sending rate of the network tester to the message, so that the sending rate meets the message processing capacity of the DUT, thereby completing the message sending rate adjustment without stopping the message interaction between the network tester and the DUT, and can improve the test effect of the network tester on the DUT. BRIEF DESCRIPTION OF THE DRAWINGS

[0096] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other embodiments can also be obtained based on these drawings.

[0097] Figure 1 A schematic diagram of the connection relationship between a network tester and a DUT provided in an embodiment of the present application;

[0098] Figure 2 A schematic diagram of client hierarchical relationship provided in an embodiment of the present application;

[0099] Figure 3 A schematic diagram of a flow chart of a first method for adjusting a message sending rate provided in an embodiment of the present application;

[0100] Figure 4 A schematic diagram of a message sending rate adjustment process provided in an embodiment of the present application;

[0101] Figure 5 A schematic diagram of a flow chart of a second method for adjusting a message sending rate provided in an embodiment of the present application;

[0102] Figure 6 A schematic diagram of a preset filtering rule provided in an embodiment of the present application;

[0103] Figure 7 A schematic diagram of a received message quantity statistics process provided in an embodiment of the present application;

[0104] Figure 8 A schematic diagram of a flow chart of a third method for adjusting the message sending rate provided in an embodiment of the present application;

[0105] Fig. 9 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0106] Fig.10 A schematic diagram of the structure of a message sending rate adjustment device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0107] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field based on the present application belong to the scope of protection of the present application.

[0108] Since the network tester in the related art uses a fixed rate to send messages to the DUT, which affects the test effect on the DUT, in order to solve the above problem, the embodiments of the present application provide a message sending rate adjustment method, electronic device and device.

[0109] First, the application scenario of the present application is described. The network tester sends a message to the DUT to test the DUT's ability to process the message. After receiving the message, the DUT processes the received message and feeds back the message to the network tester.

[0110] The network tester is connected to the DUT via a port. The network tester may include multiple ports, and different ports may be connected to different DUTs.

[0111] See also Figure 1 , is a schematic diagram of the connection relationship between a network tester and a DUT provided in an embodiment of the present application.

[0112] The port of the network tester shown in the figure is port 0 / 1, and the interface of the DUT is interface 0 / 0 / 1. Port 0 / 1 in the figure is connected to interface 0 / 0 / 1 through a physical link. The figure only shows one port of the network tester, but in fact the network tester can include multiple ports, and the embodiment of the present application does not limit this number.

[0113] When testing the DUT, a virtual client can be constructed in the network tester. The client constitutes a client block, and the client block is bound to a port. Different clients can send messages of the same or different protocols to the DUT, thereby performing different tests on the DUT. Under each client block, a device count of clients can be configured, and the parameters of the clients in the client block can be configured in an incremental step. The incremental step includes the IP step and the MAC (Media Access Control) step, etc. The IP step represents the difference between the IP addresses of the clients, and the MA step represents the difference between the MAC addresses of the clients. For each client block, the network tester can perform timing through a first timer. When the first timer reaches the timing duration, a client in the client block is started to interact with the DUT.

[0114] See also Figure 2 , is a schematic diagram of a client hierarchical relationship provided in an embodiment of the present application.

[0115] The network tester in the figure includes multiple ports such as port 1 and port 2. Port 1 corresponds to client block 1, client block 2-client block m, a total of m client blocks, and client block 1 includes client 1, client 2-client n, a total of n clients. The figure only exemplifies the client block corresponding to port 1 and the client corresponding to client block 1. The other ports and client blocks are the same and will not be repeated here.

[0116] See also Figure 3 , which is a flow chart of the first message sending rate adjustment method provided in an embodiment of the present application, applied to an electronic device, for each port of a network tester, the method includes the following steps S301-S304.

[0117] The execution subject of the present application may be independent of the network tester, for example, may be called a rate adjuster, connected to each port of the network tester, and capable of information exchange with the network tester.

[0118] In this case, in the embodiment of the present application, the computing resources of the network tester will not be occupied when monitoring the receiving rate and adjusting the sending rate. That is, the adjustment of the sending rate of the network tester is achieved through edge computing, ensuring the efficiency and real-time nature of the sending rate adjustment.

[0119] The execution subject of the present application may also be some virtual modules in the network tester.

[0120] S301: Monitor the number of messages fed back by the DUT during the test and received by the port in each preset period.

[0121] Specifically, the network tester can continuously monitor the number of messages according to a preset period, and count the number once in each preset period.

[0122] In one embodiment of the present application, each port corresponds to a monitoring thread. In this case, step S301 is implemented by following step A below.

[0123] Step A: Monitor the number of messages fed back by the DUT during the test and received by the port in each preset period through the monitoring thread corresponding to the port.

[0124] Since different ports correspond to different monitoring threads, the number of messages that each monitoring thread needs to monitor will not be too large, so that the number of messages can be collected and processed in real time, reducing delays and improving the efficiency of message quantity statistics.

[0125] In another embodiment of the present application, the number of all messages received through the port may be counted.

[0126] Alternatively, you can also use the following Figure 5The step 301A shown implements the step S301, which will not be described in detail here.

[0127] S302: Calculate the receiving rate of the port receiving messages according to the monitored quantity.

[0128] In one embodiment of the present application, the receiving rate may be obtained by dividing the average value, median value, maximum value or minimum value of the number of monitored messages by the duration of a preset period.

[0129] Specifically, the receiving rate may be calculated using all the quantities monitored in the history, so that the calculated receiving rate can reflect the overall situation of the entire test process.

[0130] Alternatively, the receiving rate can be calculated using the number of messages monitored within the most recent preset number of preset periods, which is equivalent to calculating the receiving rate by means of a sliding window. Each time a new number of messages within a preset period is monitored, the number obtained the longest is discarded, that is, only the number of messages obtained the most recently within the preset number of times is retained when calculating the receiving rate. This method can not only reduce the number of numbers that need to be stored, but also enable the calculated receiving rate to reflect the rate at which the network tester has recently received messages through the port, thereby matching the subsequent result of the sending rate adjustment with the rate at which the port has recently received messages, thereby improving the effect of the sending rate adjustment.

[0131] In one embodiment of the present application, the receiving rate can be calculated by following step B.

[0132] Step B: Calculate the average value of the number monitored within the latest preset number of preset periods to obtain the receiving rate of the port receiving the message.

[0133] In another embodiment of the present application, when each port corresponds to a monitoring thread, the above step 302 can be implemented by the following step C.

[0134] Step C: Calculate the receiving rate of the message received by the port through the monitoring thread corresponding to the port.

[0135] Since different ports correspond to different monitoring threads, each monitoring thread will not calculate the receiving rate too many times, so the receiving rate can be calculated in real time, reducing delays and improving the efficiency of subsequent sending rate adjustment.

[0136] S303: When the receiving rate is greater than the sending rate of the messages sent by the network tester through the port, control the network tester to increase the sending rate of the client sending messages through the port.

[0137] The client is a virtual device configured in the network tester to interact with the DUT.

[0138] The above-mentioned sending rate can be obtained by the network tester's own monitoring. The specific monitoring process is similar to the process of monitoring the receiving rate. The only difference is that what is monitored at this time is the message from the network tester to the DUT, rather than the message fed back by the DUT to the network tester. It will not be repeated here.

[0139] Alternatively, since the message is sent by the network tester to the DUT, the network tester can determine its own sending rate; or, if the execution entity of the embodiment of the present application is independent of the network tester, the above-mentioned sending rate can be notified by the network tester to the execution entity of the embodiment of the present application.

[0140] In one embodiment of the present application, the network tester may be controlled to increase a first preset step size based on a current sending rate.

[0141] In another embodiment of the present application, the difference between the receiving rate and the sending rate can be calculated. The greater the difference between the two, the greater the improvement on the basis of the current sending rate. Specifically, the difference between the receiving rate and the sending rate can be calculated, and the first ratio between the difference and the first preset difference can be calculated. The first ratio is multiplied by the second preset step size to obtain the step size of the sending rate improvement. The step size of the sending rate improvement is matched with the difference between the receiving rate and the sending rate, rather than improving the fixed first preset step size, so that the improved sending rate can be closer to the receiving rate.

[0142] In another embodiment of the present application, the sending rate can also be increased by following the steps D below.

[0143] Step D: Control the network tester to increase the first target step size based on the current sending rate of the client sending messages through the port.

[0144] The first target step size is the absolute value of the difference between the latest monitored quantity and the last monitored quantity.

[0145] That is, the first target step size is the absolute value of the difference between the numbers monitored in the last two preset periods, that is, the increase in the sending rate matches the change in the receiving rate of the network tester receiving messages through the port.

[0146] Furthermore, no matter which of the above methods is used to determine the step length of the increase in the sending rate, the determined step length can be multiplied by a preset smoothing weight coefficient to obtain the final increase step length. The value of the above smoothing weight coefficient can be 0.1-0.3, so as to avoid the sending rate from increasing too much at one time, which makes it difficult for the DUT to quickly respond to the amplitude of the fluctuation of the message sending rate, affecting the test process, making the embodiment of the present application more suitable for network test scenarios that require high stability and real-time performance.

[0147] S304: When the receiving rate is lower than the sending rate, control the network tester to reduce the sending rate of the client that sends messages through the port.

[0148] In one embodiment of the present application, the network tester may be controlled to reduce a third preset step size based on the current sending rate.

[0149] In another embodiment of the present application, the difference between the sending rate and the receiving rate can be calculated. The greater the difference between the two, the greater the reduction on the basis of the current sending rate. Specifically, the difference between the sending rate and the receiving rate can be calculated, and the second ratio between the difference and the second preset difference can be calculated. The second ratio is multiplied by the fourth preset step size to obtain the step size of the sending rate reduction. The step size of the sending rate reduction is matched with the gap between the sending rate and the receiving rate, rather than increasing the fixed third preset step size, so that the reduced sending rate can be closer to the receiving rate.

[0150] In another embodiment of the present application, the sending rate can also be increased by following step E.

[0151] Step E: Control the network tester to reduce the second target step size based on the current sending rate of the client sending messages through the port.

[0152] The second target step size is the absolute value of the difference between the latest monitored quantity and the last monitored quantity.

[0153] That is, the second target step size is the absolute value of the difference between the numbers monitored in the last two preset periods, that is, the amplitude of the drop in the sending rate matches the amplitude of the change in the receiving rate of the network tester receiving messages through the port.

[0154] Furthermore, no matter which of the above methods is used to determine the step length of the transmission rate reduction, the determined step length can be multiplied by a preset smoothing weight coefficient to obtain the final step length of the reduction. The value of the above smoothing weight coefficient can be 0.1-0.3, so as to avoid the transmission rate from decreasing too much at one time, which makes it difficult for the DUT to quickly respond to the amplitude of the message transmission rate fluctuation, affecting the test process, making the embodiment of the present application more suitable for network test scenarios that require high stability and real-time performance.

[0155] In addition, whether increasing the sending rate or decreasing the sending rate, the executing entity of the embodiment of the present application can send a rate adjustment command to the protocol management module in the network tester, so that the protocol management module instructs the protocol interaction module in the network tester to adjust the sending rate of the client that sends messages through each port based on the received command.

[0156] Specifically, the protocol interaction module in the network tester can start the second timer. Each time the second timer completes a timing, the network tester adjusts the sending rate of a client, and then restarts the second timer for the next timing. When adjusting the sending rate, the client startup flag can be combined. Each time the adjustment is made, the sending rate of the client corresponding to the client startup flag is adjusted. Each time an adjustment is completed, the client startup flag is increased by 1.

[0157] As can be seen from the above, the scheme provided by the embodiment of the present application can monitor the receiving rate of the message fed back by the DUT received by each port in the network tester. If the receiving rate is higher than the sending rate of the port, it means that the speed at which the DUT feeds back the message to the network tester through the port is greater than the speed at which the DUT receives the network test and sends the message to it through the port, so it can be determined that the current DUT processes the message faster, and can achieve fast message feedback. The message processing capacity of the DUT is sufficient to process the currently received message, so the network tester can further increase the message sending rate. On the contrary, if the receiving rate is lower than the sending rate of the port, the network tester can reduce the message sending rate. That is, the embodiment of the present application realizes an incremental processing mechanism for the message sending rate, which can control the message sending rate of the network tester so that the sending rate meets the message processing capacity of the DUT, thereby completing the message sending rate adjustment without stopping the message interaction between the network tester and the DUT, and can improve the test effect of the network tester on the DUT.

[0158] In one embodiment of the present application, for each port, all messages received through the port can be uniformly counted, and the receiving rate of the port can be calculated, and then the sending rate of all messages sent through the port can be uniformly adjusted. After the sending rate is uniformly adjusted, the adjusted sending rate is distributed to all client blocks corresponding to the port, so that the sum of the sending rates of all client blocks corresponding to the port is the sending rate of the port. Afterwards, after the sending rate of the client block is uniformly adjusted, the adjusted sending rate is distributed to all clients in the client block, so that the sum of the sending rates of all clients in the client block is the sending rate of the client block.

[0159] Specifically, the sending rate of the port may be evenly distributed to each client block, and then the sending rate of the client block may be evenly distributed to each client.

[0160] Alternatively, the allocation ratio of each client block and the allocation ratio of each client may be preset, and the transmission rate is allocated according to the allocation ratio.

[0161] The above method of adjusting the sending rate is relatively simple, consumes less computing resources, and can quickly adjust the sending rate. However, since the sending rates of all clients are adjusted synchronously when the sending rate is adjusted, the adjustment of the sending rate is likely to not match the actual situation of all clients, which may affect the test effect of the DUT.

[0162] In one embodiment of the present application, when the receiving rate is calculated by the aforementioned step B, see Figure 4 , is a schematic diagram of a message sending rate adjustment process provided in an embodiment of the present application.

[0163] The process shown in the figure includes collecting the number of received packets (i.e., the aforementioned step S301), sliding the window, and removing the earliest data to indicate that only the window size data recently received is retained by means of a sliding window. The window size in this embodiment is 8, and the data 88, 90, 87, 85, 90, 99, 95, and 100 in the 8 rectangles shown in the figure are respectively the number of received messages obtained by statistics in 8 preset cycles. The above window size and the number of received messages are only examples. The more to the right in the figure, the earlier the statistical time. After obtaining 8 sets of statistical data, the average receiving rate is calculated, and then the rate difference is determined (i.e., the difference between the receiving rate and the sending rate is determined), and then the step size is adjusted, and then the packet sending rate is smoothly adjusted (i.e., the step size determined in the previous step is adjusted on the basis of the current sending rate to obtain the adjusted packet sending rate).

[0164] For this purpose, see Figure 5 , is a flow chart of a second message sending rate adjustment method provided in an embodiment of the present application, which is similar to the aforementioned Figure 3 Compared with the illustrated embodiment, the above step S301 can be implemented by the following step S301A, the above step S302 can be implemented by the following step S302A, the above step S303 can be implemented by the following step S303A, and the above step S304 can be implemented by the following step S304A.

[0165] S301A: Monitor the number of messages received by the port in each preset period and fed back by the DUT during the test process that meet the preset filtering rules.

[0166] The preset filtering rule includes at least one of the following information: the protocol on which the message is based, the interface number of the interface on the DUT that transmits the message, and the identifier of the client corresponding to the message.

[0167] Specifically, the protocol based on the above-mentioned message can be a transport layer protocol based on the message, such as UDP (User Datagram Protocol), TCP (Transport Control Protocol), etc., and can further include an application layer protocol, such as DHCP (Dynamic Host Configuration Protocol), etc., and can even include specific services corresponding to the application layer protocol, such as offer service or advertise service corresponding to DHCP, etc. In the embodiment of the present application, the protocol based on the message in the preset filtering rule can be configured according to actual needs, and no specific limitation is made to this.

[0168] The interface on the DUT that transmits the message is the source interface of the message. The identifier of the client corresponding to the message can be the identifier of the client that receives the message, which can be the client number, IP address, MAC address, etc.

[0169] By configuring the protocol based on which the message is sent as the preset filtering rule, the number of received messages can be counted in units of protocol.

[0170] By configuring the port number of the port that transmits the message as the preset filtering rule, the number of received messages can be counted based on the interface on the DUT.

[0171] By configuring the identifier of the client corresponding to the message, the number of received messages can be counted on a client basis.

[0172] In addition, it should be noted that each port can be configured with multiple preset filtering rules, so as to cover various situations of message transmission on the port. Moreover, each client can transmit messages of multiple protocols to interfaces on multiple DUTs. Therefore, by configuring different preset filtering rules, multiple quantity statistics can be performed for one client. In the best case, the preset filtering rules configured for a port should be able to cover all situations of message transmission through this port, so that the sending rate of various messages can be controlled when the sending rate control is performed later.

[0173] In order to achieve the most accurate quantity statistics effect and further to perform the most precise control over the sending rate, the above-mentioned preset filtering rules may include all of the above three types of information.

[0174] In addition, the network tester can adjust the preset filtering rules at any time, thereby flexibly controlling the process of controlling the sending rate.

[0175] In one embodiment of the present application, each item of information in the above-mentioned preset filtering rules can be expressed in the form of Type-Value, where Type represents the type of the information (one of the above-mentioned protocols, interface numbers, and client identifiers), and Value represents a specific value.

[0176] See also Figure 6 , which is a schematic diagram of a preset filtering rule provided in an embodiment of the present application.

[0177] The listening port in the figure refers to the port corresponding to the interface number in the preset filtering rule, the device ID represents the identification of the client in the preset filtering rule, and the protocol content is the protocol based on the message in the preset filtering rule.

[0178] Figure 6 The information of the preset filtering rules shown includes: information 1-type is TProtocol (TransportProtocol, transmission protocol), value is 17 (UDP), that is, the value represents UDP; information 2-type is TsrcPort (TransportSource Port, transmission source interface), value is 67, that is, the interface number is 67; information 3-type is TDhcp (TransportDynamic Host Configuration Protocol, transmission dynamic host configuration protocol), value is 2 (offer), that is, the DHCP service is offer service; information 4-type is ClientMac (client MAC address), value is 94:29:2F:00:16:64. In addition, the preset filtering rules can also contain other information, which is represented by ellipsis in the figure.

[0179] S302A: Calculate the reception rate of the messages that meet the preset filtering rules received by the port according to the monitored quantity.

[0180] Specifically, the method for calculating the receiving rate can refer to the description of step S302 in the previous text. The only difference is that the receiving rate is calculated in step S302A in units of messages that meet the preset filtering rules. The receiving rates of messages that meet different preset filtering rules will be calculated separately, and the specific calculation method will not be repeated here.

[0181] S303A: When the receiving rate is greater than the sending rate of the messages that meet the preset filtering rules sent by the network tester through the port, control the network tester to increase the sending rate of the messages that meet the preset filtering rules sent by the client through the port.

[0182] S304A: When the receiving rate is lower than the sending rate of the messages that meet the preset filtering rules sent by the network tester through the port, control the network tester to reduce the sending rate of the messages that meet the preset filtering rules sent by the client through the port.

[0183] Specifically, the method of adjusting the sending rate is similar to the description of the aforementioned step S303 and step S304, which will not be repeated here.

[0184] In the case where the preset filtering rule includes the protocol on which the message is based, the sending rate of the message of the protocol sent by the client through the port is adjusted.

[0185] When the preset filtering rule includes the interface number of the interface on the DUT for transmitting the message, the sending rate of the message sent by the client to the interface through the port is adjusted.

[0186] When the preset filtering rule includes the identifier of the client corresponding to the message, the sending rate of the message sent by the client through the port is adjusted.

[0187] In one example, the preset filtering rule fixes the protocol based on the message as protocol a, the interface number of the interface on the DUT that transmits the message as the interface number of interface b, and the identifier of the client corresponding to the message as the identifier of client c. Then, the number of messages received through the port with the protocol a, the source interface as interface b, and sent to client c is counted, and the receiving rate of such messages is calculated, and then the sending rate of messages of protocol a sent by client c to interface b is adjusted.

[0188] In addition, when configuring preset filtering rules, a thread can be configured for each preset filtering rule to count the number of messages that meet the preset filtering rules, calculate the receiving rate of such messages, and adjust the sending rate of such messages to speed up the overall speed of sending rate adjustment.

[0189] As can be seen from the above, by setting preset filtering rules in the embodiment of the present application, the receiving rate of different types of messages can be more accurately counted, and the sending rate of the client to the message of this type can be further accurately controlled. In addition, the process of the network tester sending messages to the DUT can be finely controlled.

[0190] See also Figure 7 , is a schematic diagram of a received message quantity statistics process provided in an embodiment of the present application.

[0191] Figure 7 What is shown is a scenario in which the execution subject of the embodiment of the present application is a rate adjuster.

[0192] The network tester in the figure sends relevant configurations to the rate adjuster (including preset filtering rules, preset cycles, the client's initial sending rate, smooth adjustment of packet sending rate, etc.), and sends a start instruction to control the rate adjuster to start adjusting the sending rate.

[0193] The network tester sends a start instruction to each port (including port 1 to port n) so that the port starts to send and receive messages. Port 1 to port n are respectively bound to network card 1 to network card n in the network tester.

[0194] The rate adjuster is configured with DHCP offer filtering rules (preset filtering rules for the offer service of the DHCP protocol), DHCPv6 advertise filtering rules (preset filtering rules for the advertise service of the 6th version of the DHCP protocol) to preset filtering rule m, a total of m preset filtering rules. Each preset filtering rule corresponds to a monitoring thread, and there are a total of m monitoring threads, including monitoring thread 1, monitoring thread 2-monitoring thread m. Among them, monitoring thread 1 and monitoring thread 2 are used to adjust the sending rate at port 1 corresponding to network card 1, and monitoring thread m is used to adjust the sending rate at port n corresponding to network card n.

[0195] In another embodiment of the present application, before executing step S301, the following steps F to H may be performed to configure an initial sending rate of messages for each client.

[0196] Step F: Determine the block sending rate corresponding to each client block according to the total sending rate corresponding to the port and the number of client blocks corresponding to the port.

[0197] Each client in the client block corresponding to the port transmits messages through the port.

[0198] The total sending rate corresponding to the port may be pre-allocated to the port, and the total sending rates of the ports may be the same or different.

[0199] In one embodiment of the present application, the total sending rate may be divided by the number of client blocks to obtain the block sending rate corresponding to each client block. Alternatively, after the total sending rate is divided by the number of client blocks to obtain the calculation result, the calculation result is multiplied by the first coefficient corresponding to each client block to obtain the block sending rate of the client block. The sum of the block sending rates is equal to the total sending rate corresponding to the port.

[0200] Step G: For each client block, determine the initial sending rate of each client in the client block according to the block sending rate of the client block and the number of clients in the client block.

[0201] In one embodiment of the present application, the block sending rate may be divided by the number of clients to obtain the initial sending rate corresponding to each client. Alternatively, after the block sending rate is divided by the number of clients to obtain the calculation result, the calculation result is multiplied by the second coefficient corresponding to each client to obtain the initial sending rate of the client. The sum of the initial sending rates is equal to the block sending rate corresponding to the client block.

[0202] Step H: Control the network tester to configure each client to send messages according to the determined initial sending rate.

[0203] The initial sending rate is the total rate at which the client sends messages of all protocols to all interfaces of the DUT. The rates of messages of different protocols for different interfaces can be obtained by dividing the total rate, or distributed in other ways. The embodiments of the present application do not limit this.

[0204] In one embodiment of the present application, the initial sending rates corresponding to the various clients may be uniformly configured to a network tester, and the network tester uniformly configures the initial sending rates of the various clients.

[0205] Specifically, the protocol interaction module in the network tester can start the first timer, and the first timer continuously performs timing. Each time the first timer completes a timing, the network tester configures the initial sending rate of a client, and then restarts the first timer for the next timing. When configuring the initial sending rate, the client startup flag can be combined. Each time the configuration is performed, the client corresponding to the client startup flag is configured. Each time the configuration is completed, the client startup flag is increased by 1.

[0206] See also Figure 8 , which is a flow chart of the third message sending rate adjustment method provided in an embodiment of the present application.

[0207] Figure 8 What is shown is a scenario in which the execution subject of the embodiment of the present application is a rate adjuster.

[0208] The network tester in the figure controls the rate adjuster to start the receiving rate monitoring. The network tester controls the protocol management module in the network tester to start the protocol. The protocol management module controls the protocol interaction module to start the protocol, and the protocol interaction module starts the first timer. The first timer configures the initial sending rates of client 1, client 2 to client n in turn through cyclic timing.

[0209] The rate adjuster is configured with preset filtering rules such as preset filtering rule 1, preset filtering rule 2, and preset filtering rule 3. Monitoring threads 1 to 3 monitor the receiving rates of ports corresponding to network cards 1 to 3 respectively according to preset filtering rules 1 to preset filtering rules 3, and the monitoring threads report the receiving rates to the rate adjuster. The arrow from monitoring thread 1 to the rate adjuster in the figure indicates the process of all monitoring threads reporting the receiving rates to the rate adjuster. This figure only shows the situation where three monitoring threads monitor the receiving rates, and other monitoring threads are omitted in the form of ellipsis.

[0210] After the rate adjuster adjusts the sending rate based on the receiving rate, it sends a rate adjustment command to the protocol management module.

[0211] In this case, the protocol management module controls the protocol interaction module to adjust the rate. The protocol interaction module first turns off the first timer and starts the second timer. The second timer controls the client 1, client 2 to client n to adjust the sending rate in turn through cyclic timing.

[0212] Corresponding to the aforementioned message sending rate adjustment method, an embodiment of the present application also provides an electronic device.

[0213] See also Fig. 9 , is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application, the electronic device comprising:

[0214] Processor 901;

[0215] transceiver 904;

[0216] A machine-readable storage medium 902, wherein the machine-readable storage medium 902 stores machine-executable instructions that can be executed by the processor 901, and the machine-executable instructions cause the processor 901 to perform the following steps:

[0217] Monitor the number of messages fed back by the device under test (DUT) during the test process and received by the port in each preset period;

[0218] According to the monitored quantity, calculate the receiving rate of the message received by the port;

[0219] When the receiving rate is greater than the sending rate of the network tester through the port, controlling the network tester to increase the sending rate of the client that sends the message through the port, the client being a virtual device configured in the network tester to interact with the DUT;

[0220] When the receiving rate is lower than the sending rate, the network tester is controlled to reduce the sending rate of the client that sends messages through the port.

[0221] like Fig. 9 As shown, the network device may further include a communication bus 903. The processor 901, the machine-readable storage medium 902 and the transceiver 904 communicate with each other through the communication bus 903. The communication bus 903 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus 903 may be divided into an address bus, a data bus, a control bus, etc.

[0222] The transceiver 904 may be a wireless communication module. Under the control of the processor 901 , the transceiver 904 exchanges data with other devices.

[0223] The machine-readable storage medium 902 may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk storage. In addition, the machine-readable storage medium 902 may also be at least one storage device located away from the aforementioned processor.

[0224] Processor 901 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0225] As can be seen from the above, the scheme provided by the embodiment of the present application can monitor the receiving rate of the message fed back by the DUT received by each port in the network tester. If the receiving rate is higher than the sending rate of the port, it means that the speed at which the DUT feeds back the message to the network tester through the port is greater than the speed at which the DUT receives the network test and sends the message to it through the port, so it can be determined that the current DUT processes the message faster, and can achieve fast message feedback. The message processing capacity of the DUT is sufficient to process the currently received message, so the network tester can further increase the message sending rate. On the contrary, if the receiving rate is lower than the sending rate of the port, the network tester can reduce the message sending rate. That is, the embodiment of the present application realizes an incremental processing mechanism for the message sending rate, which can control the message sending rate of the network tester so that the sending rate meets the message processing capacity of the DUT, thereby completing the message sending rate adjustment without stopping the message interaction between the network tester and the DUT, and can improve the test effect of the network tester on the DUT.

[0226] In one embodiment of the present application, monitoring the number of messages fed back by the device under test DUT during the test process and received by the port in each preset period specifically includes:

[0227] Monitor the number of messages received by the port in each preset period and fed back by the DUT during the test process that meet the preset filtering rules, wherein the preset filtering rules include at least one of the following information: the protocol based on the message, the interface number of the interface on the DUT that transmits the message, and the identifier of the client corresponding to the message;

[0228] The step of calculating the receiving rate of the port receiving the message according to the monitored quantity specifically includes:

[0229] According to the monitored quantity, the receiving rate of the message that meets the preset filtering rules is calculated;

[0230] When the receiving rate is greater than the sending rate of the message sent by the network tester through the port, controlling the network tester to increase the sending rate of the client sending the message through the port specifically includes:

[0231] When the receiving rate is greater than the sending rate of the messages that meet the preset filtering rules sent by the network tester through the port, control the network tester to increase the sending rate of the messages that meet the preset filtering rules sent by the client through the port;

[0232] When the receiving rate is lower than the sending rate, controlling the network tester to reduce the sending rate of the client sending the message through the port specifically includes:

[0233] When the receiving rate is lower than the sending rate of the messages that meet the preset filtering rules sent by the network tester through the port, the network tester is controlled to reduce the sending rate of the messages that meet the preset filtering rules sent by the client through the port.

[0234] As can be seen from the above, by setting preset filtering rules in the embodiment of the present application, the receiving rate of different types of messages can be more accurately counted, and the sending rate of the client to the message of this type can be further accurately controlled. In addition, the process of the network tester sending messages to the DUT can be finely controlled.

[0235] In one embodiment of the present application, the calculation of the receiving rate of the message received by the port according to the monitored quantity specifically includes:

[0236] Calculate the average value of the number of packets monitored within the latest preset number of preset periods to obtain the receiving rate of the port receiving packets.

[0237] As can be seen from the above, adopting this method can not only reduce the number of data that need to be stored, but also make the calculated receiving rate reflect the rate at which the network tester recently receives messages through the port, so that the subsequent adjustment of the sending rate matches the rate at which the port recently receives messages, thereby improving the effect of the sending rate adjustment.

[0238] In one embodiment of the present application, controlling the network tester to increase the sending rate of the client sending the message through the port specifically includes:

[0239] Control the network tester to increase a first target step size based on a current sending rate of a client sending messages through the port, wherein the first target step size is an absolute value of a difference between a most recently monitored number and a last monitored number;

[0240] and / or

[0241] The controlling the network tester to reduce the sending rate of the client sending the message through the port includes:

[0242] The network tester is controlled to reduce a second target step size based on a current sending rate of a client sending messages through the port, wherein the second target step size is an absolute value of a difference between a latest monitored number and a last monitored number.

[0243] From the above, it can be seen that the increase and / or decrease range of the sending rate in the embodiment of the present application matches the change range of the receiving rate of the network tester receiving the message through the port, so that the adjusted sending rate matches the actual receiving rate.

[0244] In one embodiment of the present application, the machine executable instructions further cause the processor 901 to perform the following steps:

[0245] Determine a block sending rate corresponding to each client block according to a total sending rate corresponding to the port and the number of client blocks corresponding to the port, wherein each client in the client block corresponding to the port transmits a message through the port;

[0246] For each client block, determining an initial sending rate for each client in the client block according to the block sending rate of the client block and the number of clients in the client block;

[0247] The control network tester configures each client to send messages according to the determined initial sending rate.

[0248] In one embodiment of the present application, each port corresponds to a monitoring thread, and the monitoring of the number of messages fed back by the device under test DUT during the test process received by the port within each preset period specifically includes:

[0249] The number of messages fed back by the DUT during the test and received by the port in each preset period is monitored through the monitoring thread corresponding to the port;

[0250] The step of calculating the receiving rate of the port receiving the message according to the monitored quantity specifically includes:

[0251] The receiving rate of the messages received by the port is calculated through the monitoring thread corresponding to the port.

[0252] As can be seen from the above, since different ports correspond to different monitoring threads, the number of messages that each monitoring thread needs to monitor will not be too large, so that the number of messages can be collected and processed in real time, and the receiving rate can be calculated in real time, reducing delays and improving the efficiency of message quantity statistics and receiving rate calculation.

[0253] Corresponding to the aforementioned message sending rate adjustment method, an embodiment of the present application also provides a message sending rate adjustment device.

[0254] See also Fig.10 , is a structural diagram of a message sending rate adjustment device provided in an embodiment of the present application. For each port of a network tester, the device includes:

[0255] The quantity monitoring module 1001 is used to monitor the quantity of the messages fed back by the device under test DUT during the test process received by the port in each preset period;

[0256] The rate calculation module 1002 is used to calculate the receiving rate of the message received by the port according to the monitored quantity;

[0257] A first rate adjustment module 1003, configured to control the network tester to increase the sending rate of a client that sends messages through the port when the receiving rate is greater than the sending rate of messages sent by the network tester through the port, wherein the client is a virtual device configured in the network tester to interact with the DUT;

[0258] The second rate adjustment module 1004 is used to control the network tester to reduce the sending rate of the client that sends messages through the port when the receiving rate is lower than the sending rate.

[0259] As can be seen from the above, the scheme provided by the embodiment of the present application can monitor the receiving rate of the message fed back by the DUT received by each port in the network tester. If the receiving rate is higher than the sending rate of the port, it means that the speed at which the DUT feeds back the message to the network tester through the port is greater than the speed at which the DUT receives the network test and sends the message to it through the port, so it can be determined that the current DUT processes the message faster, and can achieve fast message feedback. The message processing capacity of the DUT is sufficient to process the currently received message, so the network tester can further increase the message sending rate. On the contrary, if the receiving rate is lower than the sending rate of the port, the network tester can reduce the message sending rate. That is, the embodiment of the present application realizes an incremental processing mechanism for the message sending rate, which can control the message sending rate of the network tester so that the sending rate meets the message processing capacity of the DUT, thereby completing the message sending rate adjustment without stopping the message interaction between the network tester and the DUT, and can improve the test effect of the network tester on the DUT.

[0260] In one embodiment of the present application, the quantity monitoring module 1001 is specifically used to:

[0261] Monitor the number of messages received by the port in each preset period and fed back by the DUT during the test process that meet the preset filtering rules, wherein the preset filtering rules include at least one of the following information: the protocol based on the message, the interface number of the interface on the DUT that transmits the message, and the identifier of the client corresponding to the message;

[0262] The rate calculation module 1002 is specifically used for:

[0263] According to the monitored quantity, the receiving rate of the message that meets the preset filtering rules is calculated;

[0264] The first rate adjustment module 1003 is specifically configured to:

[0265] When the receiving rate is greater than the sending rate of the messages that meet the preset filtering rules sent by the network tester through the port, control the network tester to increase the sending rate of the messages that meet the preset filtering rules sent by the client through the port;

[0266] The second rate adjustment module 1004 is specifically configured to:

[0267] When the receiving rate is lower than the sending rate of the messages that meet the preset filtering rules sent by the network tester through the port, the network tester is controlled to reduce the sending rate of the messages that meet the preset filtering rules sent by the client through the port.

[0268] As can be seen from the above, by setting preset filtering rules in the embodiment of the present application, the receiving rate of different types of messages can be more accurately counted, and the sending rate of the client to the message of this type can be further accurately controlled. In addition, the process of the network tester sending messages to the DUT can be finely controlled.

[0269] In one embodiment of the present application, the rate calculation module 1002 is specifically used to:

[0270] Calculate the average value of the number of packets monitored within the latest preset number of preset periods to obtain the receiving rate of the port receiving packets.

[0271] As can be seen from the above, adopting this method can not only reduce the number of data that need to be stored, but also make the calculated receiving rate reflect the rate at which the network tester recently receives messages through the port, so that the subsequent adjustment of the sending rate matches the rate at which the port recently receives messages, thereby improving the effect of the sending rate adjustment.

[0272] In one embodiment of the present application, the first rate adjustment module 1003 is specifically configured to:

[0273] When the receiving rate is greater than the sending rate of the message sent by the network tester through the port, the network tester is controlled to increase the first target step size based on the current sending rate of the client sending the message through the port, wherein the first target step size is the absolute value of the difference between the most recently monitored number and the last monitored number;

[0274] and / or

[0275] The second rate adjustment module 1004 is specifically configured to:

[0276] When the receiving rate is lower than the sending rate, the network tester is controlled to reduce the second target step size based on the current sending rate of the client that sends messages through the port, wherein the second target step size is the absolute value of the difference between the most recently monitored number and the last monitored number.

[0277] As can be seen from the above, since different ports correspond to different monitoring threads, the number of messages that each monitoring thread needs to monitor will not be too large, so that the number of messages can be collected and processed in real time, and the receiving rate can be calculated in real time, reducing delays and improving the efficiency of message quantity statistics and receiving rate calculation.

[0278] In one embodiment of the present application, the device further includes:

[0279] A block rate determination module, configured to determine a block transmission rate corresponding to each client block according to a total transmission rate corresponding to the port and a number of client blocks corresponding to the port, wherein each client in the client block corresponding to the port transmits a message through the port;

[0280] an initial rate determination module, configured to determine, for each client block, an initial sending rate for each client in the client block according to the block sending rate of the client block and the number of clients in the client block;

[0281] The message sending control module is used to control the network tester to configure each client to send messages according to the determined initial sending rate.

[0282] In one embodiment of the present application, each port corresponds to a monitoring thread, and the quantity monitoring module 1001 is specifically used for:

[0283] The number of messages fed back by the DUT during the test and received by the port in each preset period is monitored through the monitoring thread corresponding to the port;

[0284] The rate calculation module 1002 is specifically used for:

[0285] The receiving rate of the messages received by the port is calculated through the monitoring thread corresponding to the port.

[0286] As can be seen from the above, since different ports correspond to different monitoring threads, the number of messages that each monitoring thread needs to monitor will not be too large, so that the number of messages can be collected and processed in real time, and the receiving rate can be calculated in real time, reducing delays and improving the efficiency of message quantity statistics and receiving rate calculation.

[0287] In another embodiment provided in the present application, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above-mentioned message sending rate adjustment methods are implemented.

[0288] In another embodiment provided in the present application, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute any of the message sending rate adjustment methods in the above embodiments.

[0289] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be transmitted from a website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that includes one or more available media integrated. The available medium may be a magnetic medium, (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive Solid State Disk (SSD)), etc.

[0290] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that the process, method, article or equipment including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or equipment. In the absence of further restrictions, the elements defined by the sentence "comprise a ....." do not exclude the existence of other identical elements in the process, method, article or equipment including the elements.

[0291] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the electronic device, device, computer-readable storage medium, and computer program embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiments.

[0292] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.

Claims

1. A method for adjusting a message sending rate, characterized in that: For each port of the network tester, the method includes: Monitor the number of messages fed back by the device under test (DUT) during the test process and received by the port in each preset period; According to the monitored quantity, calculate the receiving rate of the message received by the port; When the receiving rate is greater than the sending rate of the network tester through the port, controlling the network tester to increase the sending rate of the client that sends the message through the port, the client being a virtual device configured in the network tester to interact with the DUT; When the receiving rate is lower than the sending rate, the network tester is controlled to reduce the sending rate of the client that sends messages through the port.

2. The method according to claim 1, characterized in that The monitoring of the number of messages fed back by the device under test DUT during the test process and received by the port in each preset period includes: Monitor the number of messages received by the port in each preset period and fed back by the DUT during the test process that meet the preset filtering rules, wherein the preset filtering rules include at least one of the following information: the protocol based on the message, the interface number of the interface on the DUT that transmits the message, and the identifier of the client corresponding to the message; The step of calculating the receiving rate of the message received by the port according to the monitored quantity includes: According to the monitored quantity, the receiving rate of the message that meets the preset filtering rules is calculated; When the receiving rate is greater than the sending rate of the message sent by the network tester through the port, controlling the network tester to increase the sending rate of the client sending the message through the port includes: When the receiving rate is greater than the sending rate of the messages that meet the preset filtering rules sent by the network tester through the port, control the network tester to increase the sending rate of the messages that meet the preset filtering rules sent by the client through the port; When the receiving rate is lower than the sending rate, controlling the network tester to reduce the sending rate of the client sending the message through the port includes: When the receiving rate is lower than the sending rate of the messages that meet the preset filtering rules sent by the network tester through the port, the network tester is controlled to reduce the sending rate of the messages that meet the preset filtering rules sent by the client through the port.

3. The method according to claim 1, characterized in that The step of calculating the receiving rate of the message received by the port according to the monitored quantity includes: Calculate the average value of the number of packets monitored within the latest preset number of preset periods to obtain the receiving rate of the port receiving packets.

4. The method according to claim 1, characterized in that: The controlling the network tester to increase the sending rate of the client sending the message through the port includes: Control the network tester to increase a first target step size based on a current sending rate of a client sending messages through the port, wherein the first target step size is an absolute value of a difference between a most recently monitored number and a last monitored number; and / or The controlling the network tester to reduce the sending rate of the client sending the message through the port includes: The network tester is controlled to reduce a second target step size based on a current sending rate of a client sending messages through the port, wherein the second target step size is an absolute value of a difference between a latest monitored number and a last monitored number.

5. The method according to claim 1, characterized in that: Before monitoring the number of messages fed back by the device under test DUT during the test process and received by the port in each preset period, the method further includes: Determine a block sending rate corresponding to each client block according to a total sending rate corresponding to the port and the number of client blocks corresponding to the port, wherein each client in the client block corresponding to the port transmits a message through the port; For each client block, determining an initial sending rate for each client in the client block according to the block sending rate of the client block and the number of clients in the client block; The control network tester configures each client to send messages according to the determined initial sending rate.

6. The method according to any one of claims 1 to 5, characterized in that Each port corresponds to a monitoring thread, and the number of messages fed back by the device under test DUT during the test process received by the port in each preset period is monitored, including: The number of messages fed back by the DUT during the test and received by the port in each preset period is monitored through the monitoring thread corresponding to the port; The step of calculating the receiving rate of the message received by the port according to the monitored quantity includes: The receiving rate of the messages received by the port is calculated through the monitoring thread corresponding to the port.

7. An electronic device, characterized in that: The electronic device comprises: processor; Transceiver; A machine-readable storage medium storing machine-executable instructions that can be executed by the processor, the machine-executable instructions causing the processor to perform the following steps for each port of the network tester: Monitor the number of messages fed back by the device under test (DUT) during the test process and received by the port in each preset period; According to the monitored quantity, calculate the receiving rate of the message received by the port; When the receiving rate is greater than the sending rate of the network tester through the port, controlling the network tester to increase the sending rate of the client that sends the message through the port, the client being a virtual device configured in the network tester to interact with the DUT; When the receiving rate is lower than the sending rate, the network tester is controlled to reduce the sending rate of the client that sends messages through the port.

8. The electronic device according to claim 1, characterized in that: The monitoring of the number of messages fed back by the device under test DUT during the test process and received by the port in each preset period specifically includes: Monitor the number of messages received by the port in each preset period and fed back by the DUT during the test process that meet the preset filtering rules, wherein the preset filtering rules include at least one of the following information: the protocol based on the message, the interface number of the interface on the DUT that transmits the message, and the identifier of the client corresponding to the message; The step of calculating the receiving rate of the port receiving the message according to the monitored quantity specifically includes: According to the monitored quantity, the receiving rate of the message that meets the preset filtering rules is calculated; When the receiving rate is greater than the sending rate of the message sent by the network tester through the port, controlling the network tester to increase the sending rate of the client sending the message through the port specifically includes: When the receiving rate is greater than the sending rate of the messages that meet the preset filtering rules sent by the network tester through the port, control the network tester to increase the sending rate of the messages that meet the preset filtering rules sent by the client through the port; When the receiving rate is lower than the sending rate, controlling the network tester to reduce the sending rate of the client sending the message through the port specifically includes: When the receiving rate is lower than the sending rate of the messages that meet the preset filtering rules sent by the network tester through the port, the network tester is controlled to reduce the sending rate of the messages that meet the preset filtering rules sent by the client through the port.

9. The electronic device according to claim 7, characterized in that: The step of calculating the receiving rate of the port receiving the message according to the monitored quantity specifically includes: Calculate the average value of the number of packets monitored within the latest preset number of preset periods to obtain the receiving rate of the port receiving packets.

10. The electronic device according to claim 7, characterized in that: The controlling the network tester to increase the sending rate of the client sending the message through the port specifically includes: Control the network tester to increase a first target step size based on a current sending rate of a client sending messages through the port, wherein the first target step size is an absolute value of a difference between a most recently monitored number and a last monitored number; and / or The controlling the network tester to reduce the sending rate of the client sending the message through the port includes: The network tester is controlled to reduce a second target step size based on a current sending rate of a client sending messages through the port, wherein the second target step size is an absolute value of a difference between a latest monitored number and a last monitored number.

11. The electronic device according to claim 7, characterized in that: The machine executable instructions further cause the processor to perform the following steps: Determine a block sending rate corresponding to each client block according to a total sending rate corresponding to the port and the number of client blocks corresponding to the port, wherein each client in the client block corresponding to the port transmits a message through the port; For each client block, determining an initial sending rate for each client in the client block according to the block sending rate of the client block and the number of clients in the client block; The control network tester configures each client to send messages according to the determined initial sending rate.

12. The electronic device according to any one of claims 7 to 11, characterized in that: Each port corresponds to a monitoring thread in the electronic device, and the monitoring of the number of messages fed back by the device under test DUT during the test process received by the port in each preset period specifically includes: The number of messages fed back by the DUT during the test and received by the port in each preset period is monitored through the monitoring thread corresponding to the port; The step of calculating the receiving rate of the port receiving the message according to the monitored quantity specifically includes: The receiving rate of the messages received by the port is calculated through the monitoring thread corresponding to the port.

13. A message sending rate adjustment device, characterized in that: For each port of the network tester, the device includes: A quantity monitoring module is used to monitor the number of messages fed back by the device under test DUT during the test process and received by the port in each preset period; The rate calculation module is used to calculate the receiving rate of the message received by the port according to the monitored quantity; A first rate adjustment module, configured to control the network tester to increase the sending rate of a client that sends messages through the port when the receiving rate is greater than the sending rate of messages sent by the network tester through the port, wherein the client is a virtual device configured in the network tester to interact with the DUT; The second rate adjustment module is used to control the network tester to reduce the sending rate of the client that sends messages through the port when the receiving rate is lower than the sending rate.

14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method steps described in any one of claims 1 to 6 are implemented.