Interface testing method, device, equipment and storage medium

Through the test request to the target server, the connection status of the target network card is determined and data exchange is performed to determine its optimal bandwidth and delay value, which solves the problem of difficulty in automated testing in the existing technology and achieves an accurate evaluation of the server interface performance. and tuning.

CN117459432BActive Publication Date: 2024-09-03NETTRIX INFORMATION IND CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311403412.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-10-26
Publication Date
2024-09-03
Estimated Expiration
2043-10-26

AI Technical Summary

Technical Problem

It is difficult with the existing technology to automatically conduct bandwidth testing and delay testing on the target network card connected to the server, thereby indirectly evaluating the performance of the server interface.

Method used

By responding to the test request of the target server, determine the connection status of the target network card, and use the same model of test server to interact with the target server to determine the optimal bandwidth value and optimal delay value of the target network card, and generate test results based on these values. , and perform bundled core tuning when necessary to meet the preset conditions.

Benefits of technology

It achieves accurate evaluation of server interface performance, improves the accuracy and effectiveness of testing, and ensures that the bandwidth and delay of the target network card meet the preset tuning conditions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117459432B
    Figure CN117459432B
Patent Text Reader

Abstract

The present invention discloses an interface testing method, device, equipment and storage medium. The method comprises: in response to a test request for a target interface in a target server, determining the connection status of a target network card corresponding to the target interface; when the connection status is connected, determining a test server having the same model network card as the target server, and controlling the target server and the test server to perform data interaction; in the process of data interaction between the target server and the test server, determining the optimal bandwidth value and the optimal delay value of the target network card, and generating a test result of the target interface according to the optimal bandwidth value, the optimal delay value, the expected bandwidth value and the expected delay value. The technical solution of the present invention can automatically perform bandwidth testing and delay testing on a target network card connected to a server, so as to indirectly implement performance testing of a server interface, and improve the accuracy and effectiveness of server interface testing.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computers, and in particular to an interface testing method, device, equipment and storage medium. Background Art

[0002] Servers are often used to respond to and process terminal service requests. How to respond quickly and provide corresponding services quickly involves the performance of the server interface. In other words, the performance of the server interface can directly affect the server's ability to transmit data and respond to receiving data.

[0003] Therefore, how to automatically perform bandwidth testing and delay testing on the target network card connected to the server to indirectly implement performance testing on the server interface is a problem that needs to be solved urgently. Summary of the invention

[0004] The present invention provides an interface testing method, device, equipment and storage medium, which can automatically perform bandwidth testing and delay testing on a target network card connected to a server, so as to indirectly implement performance testing on the server interface.

[0005] According to one aspect of the present invention, there is provided an interface testing method, comprising:

[0006] In response to a test request for a target interface in a target server, determining a connection state of a target network card corresponding to the target interface;

[0007] When the connection status is connected, determine the test server with the same network card model as the target server, and control the target server and the test server to exchange data;

[0008] During data interaction between the target server and the test server, the optimal bandwidth value and optimal delay value of the target network card are determined, and the test result of the target interface is generated according to the optimal bandwidth value, optimal delay value, expected bandwidth value and expected delay value.

[0009] Optionally, during the data interaction between the target server and the test server, determining the optimal bandwidth value and the optimal delay value of the target network card includes:

[0010] In the process of controlling the target server to interact with the test server, a target bandwidth value and a target delay value of the target network card are determined;

[0011] Check whether the target bandwidth value and target delay value meet the preset tuning conditions;

[0012] If the conditions are met, tuning operations are performed by binding different cores to determine the optimal bandwidth and latency values ​​of the target network card.

[0013] The advantage of this setting is that by controlling the interaction between the target server and the test server, the current accurate target bandwidth and target delay values ​​of the target network card can be determined. Furthermore, when the target bandwidth and target delay values ​​meet the preset tuning conditions, core binding tuning can be performed, providing an implementable method for determining the optimal bandwidth and delay of the target network card, which is helpful for the subsequent evaluation of the target interface performance.

[0014] Optionally, determine a target bandwidth value and a target latency value of a target network card, including:

[0015] Control the test server as a sending end to send data packets to the target server based on a preset period, and determine the target bandwidth value of the target network card according to the number of data packets received by the target server as a receiving end within the preset period;

[0016] The target server is controlled as a sending end to send a preset number of data packets to the test server, and the target delay value of the target network card is determined according to the feedback data received and fed back by the test server as a receiving end.

[0017] The advantage of this setting is that by using the target server as the sender and receiver respectively, interaction with the test server can be achieved, thereby determining the accurate target bandwidth value and target delay value, and providing an implementable method for determining the current bandwidth and delay of the target network card corresponding to the target interface of the target server, which is helpful for the subsequent evaluation of the target interface performance.

[0018] Optionally, checking whether the target bandwidth value and target delay value meet preset tuning conditions includes:

[0019] Determine bandwidth performance efficiency based on target bandwidth value and theoretical bandwidth value;

[0020] If the bandwidth performance efficiency is less than a preset efficiency threshold, and / or the target delay value is less than a preset delay threshold, it is determined that the target bandwidth value and the target delay value meet the preset tuning conditions.

[0021] The advantage of this setting is that it provides an implementable method for evaluating the target bandwidth value and the target delay value based on the preset efficiency threshold and the delay threshold. By judging the tuning conditions for the target bandwidth value and the target delay value, it helps to perform the core binding operation later when the tuning conditions are met, so as to determine the accurate optimal bandwidth value and the optimal delay value, and better characterize the interface performance.

[0022] Optionally, determining the connection status of the target interface corresponding to the target network card includes: determining whether the current firewall service is closed according to a preset firewall status query instruction; if so, using a preset network card status query tool to determine the connection status of the target interface corresponding to the target network card.

[0023] The advantage of this setting is that by performing the interface determination operation when the firewall is closed, the accuracy and effectiveness of the determined connection status can be guaranteed. By using the preset network card status query tool to determine the connection status, an implementable method for determining the network card status is provided, which can quickly and accurately determine the connection status of the interface network card and ensure the smooth progress of subsequent interface testing.

[0024] Optionally, after determining the connection status of the target interface corresponding to the target network card, the method further includes:

[0025] If the connection state is the initialization state, a preset number screening tool is used to determine the globally unique identifier of the target interface corresponding to the target network card;

[0026] A state change instruction is generated according to the global unique identifier, and a preset state change tool is used to update the connection state of the target interface corresponding to the target network card to connected.

[0027] The advantage of this setting is that by providing an implementation method for changing the state using a preset number screening tool and a state change tool when the target network card connection state is disconnected, it is possible to ensure that the interface test is performed when the target network card connection state is connected, thereby ensuring the accuracy and effectiveness of subsequent interface tests.

[0028] Optionally, before controlling the target server and the test server to interact with each other, the following steps are also included:

[0029] According to the preset static address setting instruction, a first static address is set for the target network card of the target server, and a second static address is set for the test network card of the test server;

[0030] According to the correspondence between the first static address and the second static address, the transmission rate between the target server and the test server is tested, and according to the transmission rate, it is determined that the network cards of the target server and the test server complete intercommunication.

[0031] The advantage of this setting is that by setting static addresses for the target server and the test server respectively before controlling the data exchange between the target server and the test server, the stability of communication between the two can be guaranteed. At the same time, subsequent operations can be performed when the mutual ping is successful, which can improve the efficiency and accuracy of subsequent determination of bandwidth and latency.

[0032] According to another aspect of the present invention, there is provided an interface testing device, comprising:

[0033] A determination module, configured to determine, in response to a test request for a target interface in a target server, a connection state of a target network card corresponding to the target interface;

[0034] The control module is used to determine the test server with the same network card model as the target server when the connection state is connected, and control the target server and the test server to perform data exchange;

[0035] The test module is used to determine the optimal bandwidth value and optimal delay value of the target network card during data interaction between the target server and the test server, and generate the test result of the target interface according to the optimal bandwidth value, optimal delay value, expected bandwidth value and expected delay value.

[0036] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0037] at least one processor; and

[0038] a memory communicatively connected to the at least one processor; wherein,

[0039] The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the interface testing method described in any embodiment of the present invention.

[0040] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the interface testing method described in any embodiment of the present invention when executed.

[0041] The technical solution of the embodiment of the present invention, in response to a test request for a target interface in a target server, determines the connection state of a target network card corresponding to the target interface; when the connection state is connected, determines a test server having the same model network card as the target server, and controls the target server and the test server to perform data interaction; during the data interaction between the target server and the test server, determines the optimal bandwidth value and the optimal delay value of the target network card, and generates a test result of the target interface according to the optimal bandwidth value, the optimal delay value, the expected bandwidth value, and the expected delay value. In this way, the bandwidth test and the delay test can be automatically performed on the target network card connected to the server, so as to indirectly realize the performance test of the server interface and improve the accuracy and effectiveness of the server interface test.

[0042] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0044] Figure 1 A flowchart of an interface testing method provided in Embodiment 1 of the present invention;

[0045] Figure 2 A flowchart of an interface testing method provided in Embodiment 2 of the present invention;

[0046] Figure 3 A flowchart of an interface testing method provided in Embodiment 3 of the present invention;

[0047] Figure 4 A schematic diagram of the structure of an interface testing device provided in Embodiment 4 of the present invention;

[0048] Figure 5 This is a schematic diagram of the structure of an electronic device provided in Embodiment 5 of the present invention. DETAILED DESCRIPTION

[0049] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0050] It should be noted that the terms "first", "second", "target", "candidate", "alternative", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0051] Embodiment 1

[0052] Figure 1This is a flowchart of an interface testing method provided in the first embodiment of the present invention; this embodiment can be applied to the case where a test request for a target interface in a target server is responded to to control the interaction between the target server and the test server to determine the optimal bandwidth and optimal delay so as to evaluate the interface performance. The method can be executed by an interface testing device, which can be implemented in the form of hardware and / or software, and the interface testing device can be configured in an electronic device, such as a server. Figure 1 As shown, the interface testing method includes:

[0053] S101 . In response to a test request for a target interface in a target server, determine a connection status of a target network card corresponding to the target interface.

[0054] Among them, the target server refers to the server on which the target interface performance test is performed. The target interface refers to the interface on the server on which the target is to perform performance testing. The target interface can be, for example, a PCIE (peripheral component interconnect express, a high-speed serial computer expansion bus) interface on the server motherboard. The target server is connected to the target network card through the target interface. The target network card can be, for example, an infinite bandwidth network card (IB, InfiniBand). The connection status can be, for example, a connected state (Active, value 1), a disconnected state (down, value -1) and an initializing state (Intializing, value 0).

[0055] Optionally, determining the connection status of the target interface corresponding to the target network card includes: determining whether the current firewall service is closed according to a preset firewall status query instruction; if so, using a preset network card status query tool to determine the connection status of the target interface corresponding to the target network card.

[0056] If the server system is a Linux system, the corresponding preset firewall status query instruction may be, for example, systemctl status firewalld.service. The preset network card status query tool may be, for example, the ibstat tool.

[0057] Optionally, after the command line issues a preset firewall status query instruction, if the feedback information is Active (running), it indicates that the current firewall service is in an open state; if the feedback information is inactive (dead), it indicates that the current firewall service is in a closed state.

[0058] Optionally, if it is determined that the current firewall service is not shut down, the firewall service can be shut down based on a preset firewall shutdown instruction, such as systemctl stop firewalld.service, to facilitate subsequent detection of the target network card connection status.

[0059] It should be noted that firewalld.service is a firewall service under Linux. You can check the status of the firewall and turn it on and off by operating this service under the OS.

[0060] It should be noted that: by performing the interface determination operation when the firewall is closed, the accuracy and effectiveness of the determined connection status can be guaranteed. By using the preset network card status query tool to determine the connection status, an implementable method for determining the network card status is given, which can quickly and accurately determine the connection status of the interface network card and ensure the smooth progress of subsequent interface testing.

[0061] Optionally, after determining the connection status of the target interface corresponding to the target network card, it also includes: if the connection status is an initialization state, using a preset number screening tool to determine the globally unique identifier of the target interface corresponding to the target network card; based on the globally unique identifier, generating a state change instruction, and using a preset state change tool to update the connection status of the target interface corresponding to the target network card to connected.

[0062] Among them, the preset number filtering tool can be, for example, a grep tool. A globally unique identifier (GUID) can uniquely identify an interface. Each target network card has a unique GUID. The state change instruction refers to an instruction to change the connection state of the target network card from an initialization state to a connected state. The state change instruction can be, for example, Opensm-g GUID-B. The preset state change tool can be, for example, an opensm tool.

[0063] Exemplarily, the GUID information of the interface corresponding to the IB card can be captured by combining the screening tool grep, and the connection state of the IB card can be set to Active by using the opensm tool.

[0064] Exemplarily, the ibstat tool can be used in the OS system to view the State value of the target network card. If the State value is 1, it indicates that the connection state is connected; if the State value is -1, it indicates that the connection state is disconnected; if the State value is 0, it indicates that the connection state is initialized.

[0065] For example, if the State value is 0, that is, the connection state is Initializing, the screening tool Grep needs to be used to capture the corresponding Port GUID information to change the state. The GUID may be 0x08c0eb030050ff5a, for example.

[0066] For example, if the State value is -1, that is, the connection status is down, you can check the network cable status to determine whether the network cable is plugged in tightly and the light is on. If so, replace the card and re-determine the connection status of the new target network card. If not, re-plug the network cable until the indicator light is normal.

[0067] Exemplarily, the Opensm -g GUID-B instruction can be used to change the State to the Active connectivity state. Only when the connectivity state of the target network card is guaranteed can subsequent network interaction be performed to obtain accurate bandwidth and latency information.

[0068] It should be noted that: by providing an implementation method of using a preset number screening tool and a state change tool to change the state when the target network card connection state is disconnected, it is possible to ensure that the interface test is performed when the target network card connection state is connected, thereby ensuring the accuracy and effectiveness of subsequent interface tests.

[0069] S102: When the connection state is connected, determine a test server having a network card of the same model as the target server, and control the target server and the test server to perform data exchange.

[0070] The test server refers to a server that exchanges data with the target server through the target network card. The test server and the target server have the same network card model. The target server and the test server can be directly connected or connected through a switch.

[0071] Optionally, after determining the test server, the test server can be controlled as a sender to send data packets to the target server based on a preset period to instruct the target server to receive the data packets as a receiving end; at the same time, the target server can be controlled as a sender to send a preset number of data packets to the test server to instruct the test server to receive the data packets and provide feedback as a receiving end, that is, to control the target server and the test server to exchange data.

[0072] Optionally, before controlling the target server and the test server to interact with each other, it also includes: setting a first static address for the target network card of the target server according to a preset static address setting instruction, and setting a second static address for the test network card of the test server; testing the transmission rate between the target server and the test server according to the correspondence between the first static address and the second static address, and determining, based on the transmission rate, whether the network cards of the target server and the test server have completed intercommunication.

[0073] The static address setting instruction refers to an instruction for setting a static address for the target network card, and the first static address is a preset static address of the target server. The second static address is a preset static address of the test server. The first static address setting instruction can be ifconfig+NET+first static address. The second static address setting instruction can be ifconfig+NET+second static address.

[0074] Exemplarily, within a certain period, test data can be transmitted between the first static address and the second static address according to the correspondence between the first static address and the second static address to determine the transmission rate between the target server and the test server. If the transmission rate is not 0, it can be determined that the network cards of the target server and the test server have completed intercommunication.

[0075] It should be noted that setting a static IP can ensure that the communication between the target server and the test server will not be interrupted or affected. By setting two static IPs in the same network, it can be ensured that the target server and the test server can ping each other and communicate.

[0076] It should be noted that by setting static addresses for the target server and the test server respectively before controlling the target server and the test server to interact with each other, the stability of communication between the two can be guaranteed. At the same time, subsequent operations can be performed when the mutual ping is successful, which can improve the efficiency and accuracy of subsequent determination of bandwidth and latency.

[0077] S103. During data interaction between the target server and the test server, determine the optimal bandwidth value and optimal delay value of the target network card, and generate a test result of the target interface according to the optimal bandwidth value, optimal delay value, expected bandwidth value and expected delay value.

[0078] Among them, the optimal bandwidth value refers to the maximum value of the network IO (input output) bandwidth during the data interaction between the target server and the test server. The network bandwidth can be measured by the number of data packets that the target server can receive per unit time. The optimal delay value refers to the minimum delay value for sending data packets during the data interaction between the target server and the test server. The network delay can be measured by the time required for the target server to successfully send a certain number of data packets to the test server. The expected bandwidth value refers to the threshold for measuring whether the optimal bandwidth value reaches the expected performance of the target interface. The expected delay value refers to the threshold for measuring whether the optimal delay value reaches the expected performance of the target interface.

[0079] Optionally, the optimal bandwidth value may be compared with the expected bandwidth value, and the optimal delay value may be compared with the expected delay value, and based on the comparison, it may be determined whether the expectations are met, thereby generating a test result of the server interface.

[0080] Optionally, during the process of data interaction between the target server and the test server, the optimal bandwidth value and the optimal delay value of the target network card are determined, including: during the process of controlling the target server to interact with the test server, the target bandwidth value and the target delay value of the target network card are determined; detecting whether the target bandwidth value and the target delay value meet the preset tuning conditions; if so, performing tuning operations by binding different kernels to determine the optimal bandwidth value and the optimal delay value of the target network card.

[0081] The preset tuning condition refers to the condition for evaluating whether a core binding tuning operation is required. The tuning condition may be, for example, determining whether the target bandwidth value and the target latency value are respectively within the preset threshold range. The core refers to the CPU core (Central Processing Unit) of the server, and the server may include, for example, 256 cores. Each core has a corresponding number.

[0082] Exemplarily, the target server can be controlled to bind different numbers or different numbered cores to interact with the test server based on preset rules, thereby determining the test bandwidth value and the test delay value, and taking the maximum bandwidth value in the test bandwidth value as the optimal bandwidth value, and taking the minimum delay value in the test delay value as the optimal delay value.

[0083] Exemplarily, the kernels of the target server can be numbered, such as 0-31, 128-159 are all kernels that the target server can bind. Based on preset rules, the five kernels numbered 0-5 can be bound, or only the core numbered 0 can be bound, or the ten cores numbered 5-15 can be bound. The present invention does not limit this.

[0084] Optionally, a preset core binding tool, such as numactl, can be used to bind the core. Specifically, the numactl tool can be used to bind the target network card to a suitable NUMA according to the preset core binding instruction. If the RDMA (Remote Direct Memory Access) code of the sender is mlx5_0 and the receiver is mlx5_2, the core binding instructions of the sender and the receiver can be, for example, "numactl--physcpubind=0-27ib_write_bw-a-dmlx5_0--report_gbits-F" and "numactl--physcpubind=0-27ib_write_bw-a-dmlx5_2--report_gbits-F 1.1.1.1".

[0085] By controlling the interaction between the target server and the test server, the current accurate target bandwidth and target delay values ​​of the target network card can be determined. Furthermore, when the target bandwidth and target delay values ​​meet the preset tuning conditions, core binding tuning can be performed. This provides an implementable method for determining the optimal bandwidth and delay of the target network card, which is helpful for the subsequent evaluation of the target interface performance.

[0086] It should be noted that the present invention can directly reflect the performance of the interface through the bandwidth and delay performance of the target network card, and provides a new solution for automatic testing of server interfaces, which can realize automatic testing of server interface bandwidth and delay.

[0087] The technical solution of the embodiment of the present invention, in response to a test request for a target interface in a target server, determines the connection state of a target network card corresponding to the target interface; when the connection state is connected, determines a test server having the same model network card as the target server, and controls the target server and the test server to perform data interaction; during the data interaction between the target server and the test server, determines the optimal bandwidth value and the optimal delay value of the target network card, and generates a test result of the target interface according to the optimal bandwidth value, the optimal delay value, the expected bandwidth value, and the expected delay value. In this way, the bandwidth test and the delay test can be automatically performed on the target network card connected to the server, so as to indirectly realize the performance test of the server interface and improve the accuracy and effectiveness of the server interface test.

[0088] Embodiment 2

[0089] Figure 2 A flowchart of an interface testing method provided in Embodiment 2 of the present invention; this embodiment is optimized and improved on the basis of the above-mentioned technical solutions.

[0090] Further, "control the target server to exchange data with the test server, and determine the target bandwidth value and target delay value of the target network card" is refined into "control the test server as a sender, to send data packets to the target server based on a preset period, and determine the target bandwidth value of the target network card according to the number of data packets received by the target server as a receiving end within the preset period; control the target server as a sender, to send a preset number of data packets to the test server, and determine the target delay value of the target network card according to the feedback data received and fed back by the test server as a receiving end" to improve the method of determining the target bandwidth value and the target delay value.

[0091] Furthermore, "detecting whether the target bandwidth value and the target delay value meet the preset tuning conditions" is refined into "determining the bandwidth performance efficiency based on the target bandwidth value and the theoretical bandwidth value; if the bandwidth performance efficiency is less than the preset efficiency threshold, and / or the target delay value is less than the preset delay threshold, determining that the target bandwidth value and the target delay value meet the preset tuning conditions" to improve the specific method of judging the tuning conditions.

[0092] like Figure 2 As shown, the method comprises the following specific steps:

[0093] S201 . In response to a test request for a target interface in a target server, determine a connection status of a target network card corresponding to the target interface.

[0094] S202: When the connection state is connected, determine a test server that has the same network card model as the target server, and control the target server and the test server to perform data exchange.

[0095] S203: During data interaction between the target server and the test server, determine a target bandwidth value and a target delay value of the target network card.

[0096] The target bandwidth value refers to the bandwidth value determined by the interaction between the target server and the test server at the current moment, and the target delay value refers to the delay value determined by the interaction between the target server and the test server at the current moment.

[0097] Optionally, determining a target bandwidth value and a target delay value of a target network card includes: controlling a test server as a transmitter to send data packets to a target server based on a preset period, and determining a target bandwidth value of the target network card according to the number of data packets received by the target server as a receiver within the preset period; controlling the target server as a transmitter to send a preset number of data packets to a test server, and determining a target delay value of the target network card according to feedback data received by the test server as a receiver and fed back.

[0098] It should be noted that the target bandwidth value of the target server can be determined by how many data packets the target server can receive per unit time, and the target delay value of the target server can be determined by the time required for the target server to send a certain amount of data packets.

[0099] Exemplarily, the ib_write_bw tool may be used to perform bandwidth measurement to determine a target bandwidth value of the target network card, and the ib_write_lat tool may be used to determine a target latency value of the target network card.

[0100] Optionally, bandwidth measurement instructions of the sender and the receiver can be generated according to the RDMA codes of the sender and the receiver, and the bandwidth measurement can be performed using the Ib_write_bw tool. For example, if the RDMA (Remote Direct Memory Access) code of the sender is mlx5_0 and the receiver is mlx5_2, the bandwidth measurement instructions of the sender and the receiver can be determined as: "ib_write_bw-ad mlx5_0--report_gbits-F" and "ib_write_bw-ad mlx5_2--report_gbits-F 1.1.1.1".

[0101] It should be noted that by using the target server as the sender and receiver respectively, interaction with the test server can be achieved, so as to determine the accurate target bandwidth value and target delay value. This provides an implementable method for determining the current bandwidth and delay of the target network card corresponding to the target interface of the target server, which is helpful for the subsequent evaluation of the target interface performance.

[0102] S204: Detect whether the target bandwidth value and the target delay value meet preset tuning conditions.

[0103] Optionally, detecting whether the target bandwidth value and the target delay value meet preset tuning conditions includes: determining the bandwidth performance efficiency based on the target bandwidth value and the theoretical bandwidth value; if the bandwidth performance efficiency is less than a preset efficiency threshold, and / or the target delay value is less than a preset delay threshold, determining that the target bandwidth value and the target delay value meet the preset tuning conditions.

[0104] The target bandwidth value refers to the bandwidth value of the target network card actually measured. The theoretical bandwidth value (Theo) refers to the theoretical bandwidth of the target network card. The bandwidth performance efficiency may be the ratio of the target bandwidth value to the theoretical bandwidth value. The preset efficiency threshold may be 90%. The preset delay threshold may be, for example, 1 microsecond.

[0105] Optionally, it is possible to perform core binding tuning only when the bandwidth performance efficiency is less than a preset efficiency threshold and consider that the preset tuning conditions are met; it is possible to perform core binding tuning only when the target delay value is less than a preset delay threshold and consider that the preset tuning conditions are met; it is also possible to perform core binding tuning only when the bandwidth performance efficiency is less than the preset efficiency threshold and the target delay value is less than the preset delay threshold and consider that the preset tuning conditions are met.

[0106] It should be noted that: through the above method, an implementable method for evaluating the target bandwidth value and the target delay value based on the preset efficiency threshold and the delay threshold is given. By judging the tuning conditions of the target bandwidth value and the target delay value, it is helpful to perform the core binding operation later when the tuning conditions are met, so as to determine the accurate optimal bandwidth value and the optimal delay value, and better characterize the interface performance.

[0107] S205: If the conditions are met, tuning operations are performed by binding different cores to determine the optimal bandwidth value and optimal delay value of the target network card.

[0108] S206: Generate a test result of the target interface according to the optimal bandwidth value, the optimal delay value, the expected bandwidth value, and the expected delay value.

[0109] The technical solution of the present invention can determine the current accurate target bandwidth and target delay value of the target network card by controlling the interaction between the target server and the test server, and can further perform core binding tuning when the target bandwidth and target delay value meet the preset tuning conditions, thereby providing an implementable method for determining the optimal bandwidth and delay of the target network card, which is helpful for the subsequent evaluation of the target interface performance.

[0110] Embodiment 3

[0111] Figure 3 This is a flow chart of an interface testing method provided in Embodiment 3 of the present invention; this embodiment provides a preferred example based on the above embodiments.

[0112] like Figure 3 As shown, the method comprises the following specific steps:

[0113] S301. In response to a test request for a target interface in a target server, determine whether a current firewall service is closed according to a preset firewall status query instruction.

[0114] S302: If yes, use a preset network card status query tool to determine the connection status of the target interface corresponding to the target network card.

[0115] S303: When the connection state is connected, determine a test server that has the same network card model as the target server, and control the target server and the test server to perform data exchange.

[0116] S304: During data interaction between the target server and the test server, determine a target bandwidth value and a target delay value of the target network card.

[0117] S305: Determine bandwidth performance efficiency according to the target bandwidth value and the theoretical bandwidth value.

[0118] S306: If the bandwidth performance efficiency is less than a preset efficiency threshold, and / or the target delay value is less than a preset delay threshold, it is determined that the target bandwidth value and the target delay value meet a preset tuning condition.

[0119] S307: If the conditions are met, tuning operations are performed by binding different cores to determine the optimal bandwidth value and optimal delay value of the target network card.

[0120] S308. Generate a test result of the target interface according to the optimal bandwidth value, the optimal delay value, the expected bandwidth value, and the expected delay value.

[0121] Embodiment 4

[0122] Figure 4 This is a structural diagram of an interface testing device provided in the fourth embodiment of the present invention; the interface testing device provided in the embodiment of the present invention can be used to control the interaction between the target server and the test server in response to a test request for the target interface in the target server to determine the optimal bandwidth and optimal delay to evaluate the interface performance. The interface testing device can be implemented in the form of hardware and / or software, and the interface testing device can be configured in an electronic device, such as a server. Figure 4 As shown, the device specifically includes: a determination module 401, a control module 402 and a testing module 403.

[0123] The determination module 401 is used to determine the connection state of the target interface corresponding to the target network card in response to the test request for the target interface in the target server;

[0124] The control module 402 is used to determine a test server having the same network card model as the target server when the connection state is connected, and control the target server and the test server to perform data exchange;

[0125] The test module 403 is used to determine the optimal bandwidth value and optimal delay value of the target network card during data interaction between the target server and the test server, and generate a test result of the target interface according to the optimal bandwidth value, optimal delay value, expected bandwidth value and expected delay value.

[0126] The technical solution of the embodiment of the present invention, in response to a test request for a target interface in a target server, determines the connection state of a target network card corresponding to the target interface; when the connection state is connected, determines a test server having the same model network card as the target server, and controls the target server and the test server to perform data interaction; during the data interaction between the target server and the test server, determines the optimal bandwidth value and the optimal delay value of the target network card, and generates a test result of the target interface according to the optimal bandwidth value, the optimal delay value, the expected bandwidth value, and the expected delay value. In this way, the bandwidth test and the delay test can be automatically performed on the target network card connected to the server, so as to indirectly realize the performance test of the server interface and improve the accuracy and effectiveness of the server interface test.

[0127] Furthermore, the testing module 403 may include:

[0128] A first determining unit, used to determine a target bandwidth value and a target delay value of a target network card in a process of controlling data interaction between a target server and a test server;

[0129] A detection unit, used to detect whether the target bandwidth value and the target delay value meet the preset tuning conditions;

[0130] The second determining unit is configured to perform an optimization operation by binding different cores if the conditions are met, so as to determine an optimal bandwidth value and an optimal delay value of the target network card.

[0131] Further, the first determining unit is specifically configured to:

[0132] Control the test server as a sending end to send data packets to the target server based on a preset period, and determine the target bandwidth value of the target network card according to the number of data packets received by the target server as a receiving end within the preset period;

[0133] The target server is controlled as a sending end to send a preset number of data packets to the test server, and the target delay value of the target network card is determined according to the feedback data received and fed back by the test server as a receiving end.

[0134] Furthermore, the detection unit is specifically used for:

[0135] Determine bandwidth performance efficiency based on target bandwidth value and theoretical bandwidth value;

[0136] If the bandwidth performance efficiency is less than a preset efficiency threshold, and / or the target delay value is less than a preset delay threshold, it is determined that the target bandwidth value and the target delay value meet the preset tuning conditions.

[0137] Furthermore, the determination module 401 is specifically used for:

[0138] According to the preset firewall status query instruction, determine whether the current firewall service is closed; if so, use the preset network card status query tool to determine the connection status of the target interface corresponding to the target network card.

[0139] Furthermore, the above device is also used for:

[0140] If the connection state is the initialization state, a preset number screening tool is used to determine the globally unique identifier of the target interface corresponding to the target network card;

[0141] A state change instruction is generated according to the global unique identifier, and a preset state change tool is used to update the connection state of the target interface corresponding to the target network card to connected.

[0142] Furthermore, the above device is also used for:

[0143] According to the preset static address setting instruction, a first static address is set for the target network card of the target server, and a second static address is set for the test network card of the test server;

[0144] According to the correspondence between the first static address and the second static address, the transmission rate between the target server and the test server is tested, and according to the transmission rate, it is determined that the network cards of the target server and the test server complete intercommunication.

[0145] Embodiment 5

[0146] Figure 5 This is a schematic diagram of the structure of an electronic device provided in Embodiment 5 of the present invention. Figure 5 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

[0147] like Figure 5As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0148] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.

[0149] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as the interface testing method.

[0150] In some embodiments, the interface testing method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the interface testing method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to perform the interface testing method in any other appropriate manner (e.g., by means of firmware).

[0151] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0152] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0153] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0154] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0155] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0156] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0157] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0158] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. An interface testing method, characterized in that: include: In response to a test request for a target interface in a target server, determining a connection state of a target network card corresponding to the target interface; When the connection status is connected, determine the test server with the same network card model as the target server, and control the target server and the test server to exchange data; During the data interaction between the target server and the test server, the optimal bandwidth value and the optimal delay value of the target network card are determined, and the test result of the target interface is generated according to the optimal bandwidth value, the optimal delay value, the expected bandwidth value and the expected delay value; During the data exchange between the target server and the test server, the optimal bandwidth and latency of the target network card are determined, including: During the data interaction between the target server and the test server, the target bandwidth value and the target delay value of the target network card are determined; Detect whether the target bandwidth value and the target delay value meet the preset tuning conditions; the tuning conditions are to determine whether the target bandwidth value and the target delay value are respectively within the preset threshold range; If the conditions are met, tuning operations are performed by binding different cores to determine the optimal bandwidth and latency values ​​of the target network card.

2. The method according to claim 1, characterized in that Determine the target bandwidth and latency of the target network card, including: Control the test server as a sending end to send data packets to the target server based on a preset period, and determine the target bandwidth value of the target network card according to the number of data packets received by the target server as a receiving end within the preset period; The target server is controlled as a sending end to send a preset number of data packets to the test server, and the target delay value of the target network card is determined according to the feedback data received and fed back by the test server as a receiving end.

3. The method according to claim 1, characterized in that Check whether the target bandwidth value and target delay value meet the preset tuning conditions, including: Determine bandwidth performance efficiency based on target bandwidth value and theoretical bandwidth value; If the bandwidth performance efficiency is less than a preset efficiency threshold, and / or the target delay value is less than a preset delay threshold, it is determined that the target bandwidth value and the target delay value meet the preset tuning conditions.

4. The method according to claim 1, characterized in that: Determine the connection status of the target interface corresponding to the target network card, including: According to the preset firewall status query instruction, determine whether the current firewall service is closed; If so, a preset network card status query tool is used to determine the connection status of the target interface corresponding to the target network card.

5. The method according to claim 1, characterized in that After determining the connection status of the target interface corresponding to the target network card, it also includes: If the connection state is the initialization state, a preset number screening tool is used to determine the globally unique identifier of the target interface corresponding to the target network card; A state change instruction is generated according to the global unique identifier, and a preset state change tool is used to update the connection state of the target interface corresponding to the target network card to connected.

6. The method according to claim 1, characterized in that Before controlling the target server and the test server to interact with each other, it also includes: According to the preset static address setting instruction, a first static address is set for the target network card of the target server, and a second static address is set for the test network card of the test server; According to the correspondence between the first static address and the second static address, the transmission rate between the target server and the test server is tested, and according to the transmission rate, it is determined that the network cards of the target server and the test server complete intercommunication.

7. An interface testing device, characterized in that: include: A determination module, configured to determine, in response to a test request for a target interface in a target server, a connection state of a target network card corresponding to the target interface; The control module is used to determine the test server with the same network card model as the target server when the connection state is connected, and control the target server and the test server to perform data exchange; The test module is used to determine the optimal bandwidth value and optimal delay value of the target network card during the data interaction between the target server and the test server, and generate the test result of the target interface according to the optimal bandwidth value, the optimal delay value, the expected bandwidth value and the expected delay value; The test modules include: A first determining unit, used to determine a target bandwidth value and a target delay value of a target network card in a process of controlling data interaction between a target server and a test server; A detection unit, used to detect whether the target bandwidth value and the target delay value meet a preset tuning condition; the tuning condition is to determine whether the target bandwidth value and the target delay value are respectively within a preset threshold range; The second determining unit is configured to perform an optimization operation by binding different cores if the conditions are met, so as to determine an optimal bandwidth value and an optimal delay value of the target network card.

8. An electronic device, characterized in that: The electronic device comprises: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor, and the computer program is executed by the at least one processor so that the at least one processor can execute the interface testing method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the interface testing method according to any one of claims 1 to 6 when executed.