Server testing methods and apparatus, storage media and electronic devices

CN116401107BActive Publication Date: 2026-08-14INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-06
Publication Date
2026-08-14

AI Technical Summary

Technical Problem

[0004]相关技术中,往往通过手动的方式对各个服务器的配置信息进行比对,这样的方式非常繁琐,并且存在着出错率较高,比对效率较低的缺点

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116401107B_ABST
    Figure CN116401107B_ABST
Patent Text Reader

Abstract

This application discloses a server testing method and apparatus, storage medium, and electronic device. The server testing method includes: acquiring hardware device information of the hardware in each of N servers to obtain N sets of hardware device information; when the format of the hardware device information is a format that a preset comparison tool does not allow for comparison, converting the N sets of hardware device information into information in a first format to obtain N sets of first format information; comparing the N sets of first format information using a comparison tool to obtain a first comparison result, wherein the first comparison result is used to indicate whether the hardware device information in each of the N sets of hardware device information is consistent; and, if it is determined based on the first comparison result that testing of the N servers is permitted, testing the N servers. By adopting the above technical solution, the problem of low accuracy in comparing server configuration information in related technologies is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computers, and more specifically, to a server testing method and apparatus, a storage medium, and an electronic device. Background Technology

[0002] Since database performance plays a crucial role in business efficiency, database stress tests that simulate business scenarios are often performed on servers to test application performance, such as benchmark performance tests on the server's database.

[0003] Before testing the application performance of a server, it is necessary to compare and align the hardware configuration, database configuration, and simulated test data volume of each server. Only when the configuration information of each server is consistent can the server be tested; otherwise, the comparison of test data between servers will be meaningless.

[0004] In related technologies, the configuration information of each server is often compared manually. This method is cumbersome and suffers from high error rates and low comparison efficiency. No effective solution has yet been proposed to address the low accuracy of server configuration information comparison in these technologies. Summary of the Invention

[0005] This application provides a server testing method and apparatus, storage medium and electronic device to at least solve the problem of low accuracy in comparing server configuration information in related technologies.

[0006] According to one embodiment of this application, a server testing method is provided, comprising: acquiring hardware device information of hardware in each of N servers to obtain N sets of hardware device information, wherein N is a positive integer greater than or equal to 2, and the hardware device information is information associated with testing the N servers; when the format of the hardware device information is a format that a preset comparison tool does not allow to be compared, converting the N sets of hardware device information into information in a first format to obtain N sets of first format information, wherein the first format is a format of information that the comparison tool allows to be compared; comparing the N sets of first format information with the comparison tool to obtain a first comparison result, wherein the first comparison result is used to indicate whether the hardware device information in the N sets of hardware device information is consistent; and if it is determined based on the first comparison result that testing the N servers is allowed, testing the N servers.

[0007] Optionally, before testing the N servers, the method further includes: obtaining a set of configuration information for each of the N servers to obtain N sets of configuration information, wherein the set of configuration information is the information associated with testing the N servers; if the format of the configuration information is the format of information allowed to be compared by the comparison tool, comparing the N sets of configuration information by the comparison tool to obtain a second comparison result, wherein the second comparison result is used to indicate whether the configuration information in the N sets of configuration information is consistent; if the first comparison result indicates that the hardware device information in the N sets of hardware device information is consistent, and the second comparison result indicates that the configuration information in the N sets of configuration information is consistent, then it is determined that testing the N servers is allowed.

[0008] Optionally, obtaining a set of configuration information for each of the N servers to obtain N sets of configuration information includes at least one of the following: obtaining database configuration information for the databases in each of the N servers, wherein the set of configuration information includes the database configuration information; obtaining system configuration information for the operating systems in each of the N servers, wherein the set of configuration information includes the system configuration information; obtaining network configuration information for each of the N servers, wherein the set of configuration information includes the network configuration information.

[0009] Optionally, before obtaining the database configuration information of the databases in each of the N servers, the method further includes: sending first database configuration information in a second format to each of the N servers, wherein each of the N servers is used to convert the first database configuration information in the second format into second database configuration information in a third format, the second database configuration information being used to perform the same database configuration on the databases in each of the N servers, the third format being a format of database configuration information that is allowed to be used when performing the same database configuration on the databases, and the second format being a format of database configuration information that is not allowed to be used when performing the same database configuration on the databases.

[0010] Optionally, sending the first database configuration information in a second format to each of the N servers includes: sending a target table in the second format to each of the N servers, wherein the target table includes the first database configuration information, and each of the N servers is used to convert the first database configuration information in the target table into the second database configuration information in a third format, wherein the third format includes an object format, or a key-value pair format, or a string format.

[0011] Optionally, before testing the N servers, the method further includes: obtaining a set of configuration information for each of the N servers to obtain N sets of configuration information, wherein the set of configuration information is the information associated with testing the N servers; if the format of the configuration information is a format that the comparison tool does not allow to be compared, converting the N sets of configuration information into a fourth format to obtain N sets of fourth format information, wherein the fourth format is a format that the comparison tool allows to be compared; comparing the N sets of fourth format information with the comparison tool to obtain a third comparison result, wherein the third comparison result is used to indicate whether the configuration information in the N sets of configuration information is consistent; if the first comparison result indicates that the hardware device information in the N sets of hardware device information is consistent and the third comparison result indicates that the configuration information in the N sets of configuration information is consistent, determining that testing the N servers is allowed.

[0012] Optionally, before testing the N servers, the method further includes: obtaining a set of test configuration information for each of the N servers to obtain N sets of test configuration information, wherein the set of test configuration information includes the test permissions of the database in the server, the number of test instances of the database in the server, and the test time of the database in the server; configuring the test permissions of the database, the number of test instances, and the test time for each of the N servers according to the N sets of test configuration information; and testing the N servers includes: testing the N servers according to the configured test permissions of the database, the number of test instances, and the test time.

[0013] According to another embodiment of the present application, a server testing apparatus is also provided, comprising:

[0014] The first acquisition module is used to acquire hardware device information of each of the N servers to obtain N sets of hardware device information, where N is a positive integer greater than or equal to 2, and the hardware device information is the information associated with the N servers during testing.

[0015] The first conversion module is used to convert the N sets of hardware device information into information in a first format when the format of the hardware device information is a format that the preset comparison tool does not allow to be compared, to obtain N sets of first format information, wherein the first format is the format of information that the comparison tool allows to be compared.

[0016] The first comparison module is used to compare the N sets of first format information using the comparison tool to obtain a first comparison result, wherein the first comparison result is used to indicate whether the hardware device information in the N sets of hardware device information is consistent;

[0017] The testing module is used to test the N servers if it is determined from the first comparison result that testing of the N servers is permitted.

[0018] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, wherein a computer program is stored in the computer program, which is configured to execute the test method of the server described above when it is run.

[0019] According to another aspect of the embodiments of this application, an electronic device is also provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the test method of the server described above through the computer program.

[0020] In this embodiment, hardware device information of the hardware in each of N servers is obtained, resulting in N sets of hardware device information, where N is a positive integer greater than or equal to 2. The hardware device information is the information associated with testing the N servers. If the format of the hardware device information is a format that a preset comparison tool does not allow, the N sets of hardware device information are converted into a first format, resulting in N sets of first format information, where the first format is the format that the comparison tool allows. The N sets of first format information are compared using the comparison tool to obtain a first comparison result, where the first comparison result indicates whether the hardware device information in the N sets of hardware device information is consistent. Based on the first comparison result... Given that testing is permitted on N servers, testing is performed on N servers. Before testing multiple servers, hardware device information for the hardware associated with the test is obtained for each of the servers. This hardware device information may be in a format that is not compatible with comparison tools. In such cases, the hardware device information can be converted to a format compatible with comparison tools. Then, the conversion tool automatically compares the converted hardware device information. This method achieves automatic comparison of the acquired hardware device information, improving the accuracy of hardware device information comparison and avoiding comparison errors caused by manual comparison. This technical solution solves the problem of low accuracy in comparing server configuration information in related technologies, achieving the technical effect of improving the accuracy of server configuration information comparison. Attached Figure Description

[0021] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0022] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0023] Figure 1 This is a hardware structure block diagram of a mobile terminal for a server testing method according to an embodiment of this application.

[0024] Figure 2 This is a flowchart of a server testing method according to an embodiment of this application;

[0025] Figure 3 This is a schematic diagram illustrating a method for determining whether to allow testing of a server according to an embodiment of this application;

[0026] Figure 4 This is a schematic diagram of a server test according to an embodiment of this application;

[0027] Figure 5 This is a structural block diagram of a server testing apparatus according to an embodiment of this application. Detailed Implementation

[0028] The embodiments of this application will be described in detail below with reference to the accompanying drawings and examples.

[0029] It should be noted that the terms "first," "second," etc., in the specification, claims, and drawings of the embodiments of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.

[0030] The methods and embodiments provided in this application can be executed on a mobile terminal, computer terminal, or similar computing device. Taking running on a mobile terminal as an example, Figure 1 This is a hardware structure block diagram of a mobile terminal for a server testing method according to an embodiment of this application. Figure 1 As shown, a mobile terminal may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 (which may include, but is not limited to, a microprocessor MCU or a programmable logic device FPGA, etc.) and a memory 104 for storing data are also shown. The mobile terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1The structure shown is for illustrative purposes only and does not limit the structure of the mobile terminal described above. For example, the mobile terminal may also include components that are more... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.

[0031] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the server testing method in this embodiment. The processor 102 executes various functional applications and data processing by running the computer programs stored in the memory 104, thus implementing the aforementioned method. The memory 104 may include high-speed random access memory and non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0032] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the mobile terminal's communication provider. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module used for wireless communication with the Internet.

[0033] This embodiment provides a testing method for a server running on the aforementioned mobile terminal. Figure 2 This is a flowchart of a server testing method according to an embodiment of this application, such as... Figure 2 As shown, the process includes the following steps:

[0034] Step S202: Obtain hardware device information of each of the N servers to obtain N sets of hardware device information, where N is a positive integer greater than or equal to 2. The hardware device information is the information associated with the N servers during testing.

[0035] Step S204: If the format of the hardware device information is a format that the preset comparison tool does not allow to be compared, the N sets of hardware device information are converted into information in a first format to obtain N sets of first format information, wherein the first format is the format of information that the comparison tool allows to be compared.

[0036] Step S206: The comparison tool is used to compare the N sets of first format information to obtain a first comparison result, wherein the first comparison result is used to indicate whether the hardware device information in the N sets of hardware device information is consistent.

[0037] Step S208: If it is determined from the first comparison result that testing of the N servers is permitted, then the N servers are tested.

[0038] Through the above steps, before testing multiple servers, the hardware device information of the hardware associated with the test is obtained for each of the servers. This hardware device information may be in a format that is not compatible with comparison tools. In such cases, the hardware device information can be converted to a format compatible with comparison tools. Then, the comparison tool automatically compares the converted hardware device information. This method achieves automatic comparison of the obtained hardware device information of the servers, improving the accuracy of hardware device information comparison and avoiding comparison errors caused by manual comparison. By adopting the above technical solution, the problem of low accuracy in comparing server configuration information in related technologies is solved, achieving the technical effect of improving the accuracy of server configuration information comparison.

[0039] The entity performing the above steps can be a terminal, but is not limited to this.

[0040] In the technical solution provided in step S202 above, hardware device information of the same or different hardware in each of the N servers can be obtained, but is not limited to obtaining N sets of hardware device information.

[0041] Optionally, in this embodiment, the server hardware may be limited to, but is not limited to, hardware devices such as the CPU (Central Processing Unit), hard drive, and network card. A set of hardware device information may include, but is not limited to, the CPU model, clock speed, number of cores, and number of threads, the hard drive model and capacity, the memory frequency and capacity, and the network card model, etc.

[0042] Optionally, in this embodiment, the N sets of hardware device information can be, but is not limited to, the dependency conditions when testing N servers. It can also be understood that the N sets of hardware device information are the basis for testing N servers. For example, when testing N servers, it is necessary to test based on the hardware device information of each server.

[0043] In the technical solution provided in step S204 above, the N sets of hardware device information obtained may include, but are not limited to, hardware device information of the same hardware in each of the N servers, or hardware device information of different hardware in each of the N servers. The format of the hardware device information may be a first format that the comparison tool does not allow to be compared. In such a case, the N sets of hardware device information in the first format can be converted into a second format that the comparison tool allows to be compared.

[0044] Optionally, in this embodiment, the preset comparison tool may be, but is not limited to, a tool developed using computer languages ​​such as JAVA, C, and Pathol, such as the Apache POI utility class for Java.

[0045] In the technical solution provided in step S206 above, before testing a group of servers, the hardware device information of the same hardware of each server in the group of servers, or the hardware device information of different hardware of each server in the group of servers, can be compared to obtain a first comparison result. In this way, the comparison efficiency of the hardware device information of the server hardware is improved.

[0046] Optionally, in this embodiment, the first comparison result may be used, but is not limited to, to indicate whether the hardware device information of the same hardware in the N groups of hardware device information is consistent, or whether the hardware device information of different hardware in the N groups of hardware device information is consistent.

[0047] In the technical solution provided in step S208 above, when the first comparison result indicates that the hardware device information of each group of N groups of hardware device information is consistent, it can be shown that the hardware device information of each server in the N groups of servers meets the conditions for testing N servers. However, each server in the N groups of servers still needs to be compared with the configuration information associated with the test. In this case, it is possible, but not limited to, to determine that testing N servers is allowed based on the first comparison result, and then test N servers.

[0048] Optionally, in this embodiment, if it is determined from the first comparison result that testing N servers is permitted, it can be indicated that the hardware device information of each of the N servers and other configuration information associated with testing each of the N servers are consistent. In such a case, testing of the N servers is permissible. This approach ensures that the test results obtained from each of the N servers are comparable after testing, thus improving the accuracy of the server test results.

[0049] In an exemplary embodiment, whether testing of N servers is permitted can be determined, but is not limited to, by: obtaining a set of configuration information for each of the N servers to obtain N sets of configuration information, wherein the set of configuration information is the information associated with testing the N servers; if the format of the configuration information is the format of information allowed to be compared by the comparison tool, comparing the N sets of configuration information by the comparison tool to obtain a second comparison result, wherein the second comparison result is used to indicate whether the configuration information in the N sets of configuration information is consistent; if the first comparison result indicates that the hardware device information in the N sets of hardware device information is consistent, and the second comparison result indicates that the configuration information in the N sets of configuration information is consistent, then it is determined that testing of the N servers is permitted.

[0050] Optionally, in this embodiment, the N sets of configuration information can be, but are not limited to, the dependency conditions when testing N servers. They can also be understood as the basis for testing N servers. For example, when testing N servers, it is necessary to test based on a set of configuration information for each server.

[0051] Optionally, in this embodiment, the format of the N sets of configuration information obtained may be a format that allows the comparison tool to perform comparison. In this case, the configuration information of each of the N servers can be compared, and if the hardware device information in the N sets of hardware device information is consistent and the configuration information in the N sets of configuration information is consistent, it is determined that testing of the N servers is allowed.

[0052] Optionally, in this embodiment, if the first comparison result indicates that the hardware device information in each of the N sets of hardware device information is consistent, it can be determined that testing of N servers is allowed.

[0053] Optionally, in this embodiment, if the first comparison result indicates that some groups of hardware device information in the N groups of hardware device information are consistent, and the second comparison result indicates that some groups of configuration information in the N groups of configuration information are consistent, then the servers with consistent hardware device information and consistent configuration information among the N servers can be tested, but are not limited to.

[0054] In one exemplary embodiment, the N sets of configuration information may include, but are not limited to, at least one of the following:

[0055] Obtain the database configuration information of the database in each of the N servers, wherein the set of configuration information includes the database configuration information;

[0056] Obtain the system configuration information of the operating system of each of the N servers, wherein the set of configuration information includes the system configuration information;

[0057] Obtain the network configuration information of each of the N servers, wherein the set of configuration information includes the network configuration information.

[0058] Optionally, in this embodiment, each server in the N services may, but is not limited to, have a corresponding database, and the database configuration information may, but is not limited to, include the database parameters of each server in the N services, such as: the size of the database buffer pool, the storage path of the data files, etc.

[0059] Optionally, in this embodiment, the system configuration information may include, but is not limited to, the file system's memory pages, user access permissions to the database, new users creating the database, etc., and the network configuration information may include, but is not limited to, the network card's MTU (Maximum Transmission Unit) value, network card speed, etc.

[0060] Optionally, in this embodiment, at least one of the database configuration information, system configuration information, and network configuration information is a dependency condition when testing N servers. It can also be understood that at least one of the database configuration information, system configuration information, and network configuration information is the basis for testing N servers. For example, when testing N servers, it is necessary to test based on at least one of the database configuration information, system configuration information, and network configuration information of each server. Before testing N servers, it is necessary to align the hardware device information of each server in the N servers with at least one of the database configuration information, system configuration information, and network configuration information to ensure the accuracy of the test results of N servers.

[0061] To better understand the server testing methods in the embodiments of this application, the server testing methods in the embodiments of this application will be explained and described below in conjunction with optional embodiments, which may be applicable to, but are not limited to, the embodiments of this application.

[0062] Figure 3 This is a schematic diagram illustrating how to determine whether to allow testing of a server according to an embodiment of this application, as shown below. Figure 3As shown, the servers to be tested may include, but are not limited to, server 102, server 104, and server 106. The hardware device information 1 and database configuration information 1 of server 102, the hardware device information 2 and database configuration information 2 of server 104, and the hardware device information 3 and database configuration information 3 of server 106 may be obtained, but are not limited to. The hardware device information 1 of server 102, the hardware device information 2 of server 104, and the hardware device information 3 of server 106 may be compared for consistency, and the database configuration information 1 of server 102, the database configuration information 2 of server 104, and the database configuration information 3 of server 106 may be compared for consistency.

[0063] It is permissible, but not limited to, that server 102, server 104, and server 106 pass the consistency check if their hardware device information 1, 2, and 3 are consistent, and their database configuration information 1, 2, and 3 are consistent.

[0064] It is permissible, but not limited to, if at least two pieces of hardware device information in server 102's hardware device information 1, server 104's hardware device information 2, and server 106's hardware device information 3 are inconsistent (e.g., hardware device information 1 and hardware device information 2 are inconsistent, while hardware device information 2 and hardware device information 3 are consistent), and / or, if at least two pieces of database configuration information in server 102's database configuration information 1, server 104's database configuration information 2, and server 106's database configuration information 3 are inconsistent (e.g., database configuration information 1 and database configuration information 2 are inconsistent, while database configuration information 2 and database configuration information 3 are consistent), it can be determined that servers 102, 104, and 106 have failed the consistency check. It is understood that testing servers 102, 104, and 106 is not allowed.

[0065] In an exemplary embodiment, before obtaining the database configuration information of the databases in each of the N servers, the method may include, but is not limited to, the following: sending first database configuration information in a second format to each of the N servers, wherein each of the N servers is used to convert the first database configuration information in the second format into second database configuration information in a third format, the second database configuration information being used to perform the same database configuration on the databases in each of the N servers, the third format being a format of database configuration information that is allowed to be used when performing the same database configuration on the databases, and the second format being a format of database configuration information that is not allowed to be used when performing the same database configuration on the databases.

[0066] Optionally, in this embodiment, the hardware device information of the hardware in each of the N servers can be uniformly configured, but is not limited to: sending first hardware device configuration information in a second format to each of the N servers, wherein each of the N servers is used to convert the first hardware device configuration information in the second format into second hardware device configuration information in a third format, the second hardware device configuration information is used to configure the same hardware or different hardware in each of the N servers with the same hardware device information, the third format is the format of hardware device configuration information that is allowed to be used when configuring the same hardware or different hardware in each of the N servers with the same hardware device information, and the second format is the format of hardware device configuration information that is not allowed to be used when configuring the same hardware or different hardware in each of the N servers with the same hardware device information.

[0067] Optionally, in this embodiment, the system configuration information of each of the N servers can be uniformly configured: sending first system configuration information in a second format to each of the N servers, wherein each of the N servers is used to convert the first system configuration information in the second format into second system configuration information in a third format, the second system configuration information is used to perform the same system configuration on the operating systems of each of the N servers, the third format is the format of system configuration information that is allowed to be used when the operating systems of each of the N servers perform the same system configuration, and the second format is the format of system configuration information that is not allowed to be used when the operating systems of each of the N servers perform the same system configuration.

[0068] Optionally, in this embodiment, the network configuration information of each of the N servers can be uniformly configured in the following way, but not limited to: sending first network configuration information in a second format to each of the N servers, wherein each of the N servers is used to convert the first network configuration information in the second format into second network configuration information in a third format, the second network system configuration information is used to perform the same network configuration on the networks of each of the N servers, the third format is the format of network configuration information that is allowed to be used when performing the same network configuration on the networks of each of the N servers, and the second format is the format of network configuration information that is not allowed to be used when performing the same network configuration on the networks of each of the N servers.

[0069] In one exemplary embodiment, the first database configuration information in a second format may be sent to each of the N servers in the following manner, but not limited to: sending a target table in the second format to each of the N servers, wherein the target table includes the first database configuration information, and each of the N servers is used to convert the first database configuration information in the target table into the second database configuration information in a third format, wherein the third format includes an object format, or a key-value pair format, or a string format.

[0070] Optionally, in this embodiment, the first hardware device configuration information in a second format may be sent to each of the N servers in the following manner, but not limited to: sending a first table in a second format to each of the N servers, wherein the first table includes the first hardware device configuration information, and each of the N servers is used to convert the first hardware device configuration information in the first table into second hardware device configuration information in a third format, wherein the third format includes an object format, or a key-value pair format, or a string format.

[0071] Optionally, in this embodiment, the first system configuration information in a second format may be sent to each of the N servers in the following manner, but not limited to: sending a second table in a second format to each of the N servers, wherein the second table includes the first system configuration information, and each of the N servers is used to convert the first system configuration information in the second table into second system configuration information in a third format, wherein the third format includes an object format, or a key-value pair format, or a string format.

[0072] Optionally, in this embodiment, the first network configuration information in a second format may be sent to each of the N servers in the following manner, but not limited to: sending a third table in a second format to each of the N servers, wherein the third table includes the first network configuration information, and each of the N servers is used to convert the first network configuration information in the third table into second network configuration information in a third format, wherein the third format includes an object format, or a key-value pair format, or a string format.

[0073] In an exemplary embodiment, before testing the N servers, the following methods may be included, but are not limited to: obtaining a set of configuration information for each of the N servers to obtain N sets of configuration information, wherein the set of configuration information is the information associated with testing the N servers; if the format of the configuration information is an information format that the comparison tool does not allow to be compared, converting the N sets of configuration information into information in a fourth format to obtain N sets of fourth format information, wherein the fourth format is an information format that the comparison tool allows to be compared; comparing the N sets of fourth format information with the comparison tool to obtain a third comparison result, wherein the third comparison result is used to indicate whether the configuration information in the N sets of configuration information is consistent; if the first comparison result indicates that the hardware device information in the N sets of hardware device information is consistent, and the third comparison result indicates that the configuration information in the N sets of configuration information is consistent, then it is determined that testing the N servers is allowed.

[0074] Optionally, in this embodiment, the format of the N sets of configuration information may be, but is not limited to, a format of information that the comparison tool does not allow to be compared. In such a case, the N sets of configuration information may be converted into information in a fourth format to obtain N sets of information in a fourth format. The fourth format may be, but is not limited to, the same as the first format, or the fourth format may be different from the first format.

[0075] Optionally, in this embodiment, if the first comparison result indicates that some groups of hardware device information in the N groups of hardware device information are consistent, and the third comparison result indicates that some groups of configuration information in the N groups of configuration information are consistent, then the servers with consistent hardware device information and consistent configuration information among the N servers can be tested, but are not limited to.

[0076] In an exemplary embodiment, before testing N servers, the N servers may be deployed in the following manner, but not limited to: obtaining a set of test configuration information for each of the N servers to obtain N sets of test configuration information, wherein the set of test configuration information includes the test permissions of the database in the server, the number of test instances of the database in the server, and the test time of the database in the server; configuring the test permissions of the database, the number of test instances, and the test time for each of the N servers according to the N sets of test configuration information; and testing the N servers includes: testing the N servers according to the configured test permissions of the database, the number of test instances, and the test time.

[0077] Optionally, in this embodiment, a set of test configuration information may also include, but is not limited to, the installation path of the database in the server, and the scale of the test data in the database of the server (e.g., data volume, etc.). It may indicate that testing of the server is allowed if the test permission level of the database in the server is greater than or equal to the permission level threshold. In such a case, a corresponding number of test instances are deployed in the server, and the database in the server is tested for the same amount of time using the same amount of test data.

[0078] To better understand the server testing methods in the embodiments of this application, the server testing methods in the embodiments of this application will be explained and described below in conjunction with optional embodiments, which may be applicable to, but are not limited to, the embodiments of this application.

[0079] Figure 4 This is a schematic diagram of a server test according to an embodiment of this application, such as... Figure 4 As shown, the IP (Internet Protocol) address information table of the server stored by the administrator in a fixed directory location can be parsed through the environment overview settings module, and a test machine list can be generated. The test machine list records N servers.

[0080] Before testing N servers, the administrator can, but is not limited to, use the environment overview settings module to distribute the server configurations (such as hardware settings, database parameters, OS (operating system) parameters, network parameters, etc.) that the administrator wants to standardize to each of the N servers in a table format (equivalent to a second format), according to the information's ownership module. The respective information read / write modules will then parse the data and apply it to all servers, thereby ensuring the consistency of key configurations across all servers and guaranteeing the comparability of test results between them.

[0081] When the administrator performs unified configuration on each server, the environment overview settings module can be used, but is not limited to, to collect the test machine environment configuration information of N servers collected by various information read and write modules, to ensure that each server has been uniformly configured, and to display the configuration information details of each server in tabular form according to the classification of the test servers.

[0082] Configuration and hardware information for each server can be obtained, but is not limited to, through the following methods:

[0083] Hardware information read / write module: This module can be implemented based on Redfish, but is not limited to, acquiring hardware device information from various servers. Specifically, it can, but is not limited to, use the Redfish protocol to capture information about the server's CPU (Central Processing Unit), memory, hard drive, network card, etc., obtaining information such as CPU model, number of cores, and number of threads; memory capacity and frequency; hard drive model and capacity; and network card model and interface speed. It can also, but is not limited to, use the ipmitool command to configure server fan speeds, power options, disable power capping, set temperature thresholds, etc., and can, but is not limited to, obtain JSON format data (equivalent to hardware device information).

[0084] Database configuration information read / write module: This module can be implemented in Java (or other programming languages ​​such as C), establishing a connection to the server's database via JDBC (Java Database Connectivity) to dynamically retrieve all configuration information of the database in its current state. It can also distribute unified, fixed configuration parameters to various test machines to ensure complete consistency across them. Dynamically modifiable database parameters (those that can be modified without shutting down the database on the server) are set dynamically via JDBC; non-dynamically modifiable parameters (those that can only be modified when the database on the server is down) are added to the database configuration file, and the database is automatically restarted to load the parameters. The final input / output format can be, but is not limited to, string format.

[0085] The OS information read / write module can be implemented in Java, but is not limited to, obtaining server system configuration information. This includes, but is not limited to, obtaining the system and kernel versions via the `uname -a` command; obtaining memory capacity information via the `free -g` command; and obtaining hard disk information and mount status via the `lsblk` command. It can also read and write the ` / etc / sysctl.conf` file, thereby reading and setting OS parameters.

[0086] Network information read / write module: This module can be implemented in Java, but is not limited to, to obtain the server's network configuration information. It can locate pre-configured service network interfaces by executing the `ifconfig` command and obtain network interface card (NIC) information and speed using the `ethtool + NIC number` command. It can also read and set the NIC's MTU value.

[0087] Once the hardware device information, database configuration information, system configuration information, and network configuration information of each server are obtained, the information comparison module can be used to compare the hardware device information, database configuration information, system configuration information, and network configuration information of each server.

[0088] The information comparison module parses data collected by various information read / write modules. It can, but is not limited to, use Java's Apache POI utility class (equivalent to a comparison tool) to convert the obtained database configuration information, system configuration information, and network configuration information into object data, key-value pairs, or string text, etc., formats that allow the comparison tool to perform comparisons, before performing the data comparisons. If all information matches, it returns a test environment consistency check, indicating that the server test is allowed. If data discrepancies are found, it returns information about the test environment inconsistency and the inconsistent server.

[0089] In addition, after converting the obtained hardware device information, database configuration information, system configuration information, and network configuration information into object data, key-value pairs, or string text formats using the Apache POI utility class in Java, the object data, key-value pairs, or string text can also be converted into tables using the Apache POI utility class in Java, making it easier for users to view the information obtained by each read and write module.

[0090] Database test execution module: Once all servers pass consistency checks, testing of each server is permitted. In this case, administrators can define database test specifications, including database user password permissions, database installation path, database test data size, number of database instances, test duration, and client-side connection count (essentially, the number of servers allowed to run tests concurrently). Following the administrator-defined test specifications, the module automatically installs and deploys the database on the servers. It automatically builds the basic database test environment for the servers, including creating the necessary users, databases, tables, indexes, etc., and writing the test data. It also automatically executes test scripts and outputs the results to the log feedback module.

[0091] Log feedback module: It can be used, but is not limited to, to collect and display log information, which can include, but is not limited to: various errors and log information reported by the server's system program during execution; the output of the comparison and detection results of the information comparison module; and during the test execution module, to capture the CPU, memory, network, and I / O (Input / output) usage of all servers every second and display the data graphically.

[0092] The server testing method described in this application avoids the need for manual collection and comparison of configuration information for each server, greatly improving work efficiency. Furthermore, by uniformly configuring each server, it avoids discrepancies in the test environment and configuration caused by human factors, ensuring consistency in server hardware configuration, database OS environment, and database configuration parameters during database benchmark testing. Moreover, if problems are discovered during consistency analysis, factors affecting consistency between test machines can be removed, and feedback can be provided to the testers.

[0093] It should be noted that, in Figure 4 This paper explains the server testing method in this application embodiment by taking the acquisition of hardware device information, database configuration information, system configuration information, and network configuration information of each of the N servers as an example, and determining whether testing of the N servers is allowed when the hardware device information, database configuration information, system configuration information, and network configuration information of each of the N servers are consistent. In fact, when determining whether testing of the N servers is allowed, it is possible to acquire, but is not limited to, at least one of the hardware device information, database configuration information, system configuration information, and network configuration information of each of the N servers.

[0094] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solutions of the embodiments of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.

[0095] This embodiment also provides a server testing apparatus for implementing the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0096] Figure 5 This is a structural block diagram of a server testing apparatus according to an embodiment of this application, such as... Figure 5 As shown, it includes:

[0097] The first acquisition module 502 is used to acquire hardware device information of the hardware in each of the N servers to obtain N sets of hardware device information, where N is a positive integer greater than or equal to 2, and the hardware device information is the information associated with the N servers during testing.

[0098] The first conversion module 504 is used to convert the N sets of hardware device information into information in a first format when the format of the hardware device information is a format of information that the comparison tool does not allow to be compared, to obtain N sets of first format information, wherein the first format is the format of information that the comparison tool allows to be compared.

[0099] The first comparison module 506 is used to compare the N sets of first format information using the comparison tool to obtain a first comparison result, wherein the first comparison result is used to indicate whether the hardware device information in the N sets of hardware device information is consistent;

[0100] The testing module 508 is used to test the N servers if it is determined from the first comparison result that testing of the N servers is permitted.

[0101] It should be noted that the above modules can be implemented by software or hardware. For the latter, they can be implemented in the following ways, but are not limited to: all the above modules are located in the same processor; or, the above modules are located in different processors in any combination.

[0102] Through the above embodiments, before testing multiple servers, hardware device information of the hardware associated with the test is obtained for each of the multiple servers. This hardware device information may be in a format that is not allowed for comparison by comparison tools. In such cases, the format of the hardware device information can be converted to a format that allows comparison by tools. Then, the comparison tool automatically compares the converted hardware device information. In this way, the accuracy of comparing the obtained hardware device information of the server hardware is improved, avoiding comparison errors caused by manual comparison. By adopting the above technical solution, the problem of low accuracy in comparing server configuration information in related technologies is solved, achieving the technical effect of improving the accuracy of server configuration information comparison.

[0103] In one exemplary embodiment, the apparatus further includes:

[0104] The second acquisition module is used to acquire a set of configuration information for each of the N servers before testing the N servers, thereby obtaining N sets of configuration information, wherein the set of configuration information is the information associated with the N servers during testing;

[0105] The second comparison module is used to compare the N sets of configuration information with the comparison tool when the format of the configuration information is the format of the information that the comparison tool allows to be compared, and obtain a second comparison result, wherein the second comparison result is used to indicate whether the configuration information in the N sets of configuration information is consistent;

[0106] The first determining module is used to determine whether testing of the N servers is allowed when the first comparison result indicates that the hardware device information in the N groups of hardware device information is consistent and the second comparison result indicates that the configuration information in the N groups of configuration information is consistent.

[0107] In one exemplary embodiment, the second acquisition module includes at least one of the following:

[0108] The first acquisition unit is used to acquire the database configuration information of the database in each of the N servers, wherein the set of configuration information includes the database configuration information;

[0109] The second acquisition unit is used to acquire system configuration information of the operating system of each of the N servers, wherein the set of configuration information includes the system configuration information;

[0110] The third acquisition unit is used to acquire the network configuration information of each of the N servers, wherein the set of configuration information includes the network configuration information.

[0111] In one exemplary embodiment, the apparatus further includes:

[0112] The sending module is configured to send first database configuration information in a second format to each of the N servers before obtaining the database configuration information of the databases in each of the N servers. Each of the N servers is configured to convert the first database configuration information in the second format into second database configuration information in a third format. The second database configuration information is used to perform the same database configuration on the databases in each of the N servers. The third format is a format of database configuration information that is allowed to be used when performing the same database configuration on the databases, and the second format is a format of database configuration information that is not allowed to be used when performing the same database configuration on the databases.

[0113] In one exemplary embodiment, the sending module includes:

[0114] The sending unit is configured to send a target table in the second format to each of the N servers, wherein the target table includes the first database configuration information, and each of the N servers is configured to convert the first database configuration information in the target table into the second database configuration information in the third format, wherein the third format includes an object format, or a key-value pair format, or a string format.

[0115] In one exemplary embodiment, the apparatus further includes:

[0116] The third acquisition module is used to acquire a set of configuration information for each of the N servers before testing the N servers, thereby obtaining N sets of configuration information, wherein the set of configuration information is the information associated with the N servers during testing;

[0117] The second conversion module is used to convert the N sets of configuration information into information in a fourth format when the format of the configuration information is not allowed to be compared by the comparison tool, so as to obtain N sets of fourth format information, wherein the fourth format is the format of information that the comparison tool allows to be compared.

[0118] The third comparison module is used to compare the N sets of fourth format information with the comparison tool to obtain a third comparison result, wherein the third comparison result is used to indicate whether the configuration information in the N sets of configuration information is consistent;

[0119] The second determining module is used to determine whether testing of the N servers is allowed when the first comparison result indicates that the hardware device information in the N groups of hardware device information is consistent and the third comparison result indicates that the configuration information in the N groups of configuration information is consistent.

[0120] In one exemplary embodiment, the apparatus further includes: a fourth acquisition module, configured to acquire a set of test configuration information for each of the N servers before testing the N servers, to obtain N sets of test configuration information, wherein the set of test configuration information includes test permissions for the database in the server, the number of test instances for the database in the server, and the test time for the database in the server; and configure the test permissions for the database, the number of test instances, and the test time for each of the N servers according to the N sets of test configuration information;

[0121] The testing module includes a testing unit, used to test the N servers according to the configured test permissions of the database, the number of test instances, and the test time.

[0122] It should be noted that the above modules can be implemented by software or hardware. For the latter, they can be implemented in the following ways, but are not limited to: all the above modules are located in the same processor; or, the above modules are located in different processors in any combination.

[0123] Embodiments of this application also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above method embodiments when run.

[0124] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard disk, magnetic disk, or optical disk.

[0125] Embodiments of this application also provide an electronic device including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.

[0126] In one exemplary embodiment, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.

[0127] Specific examples in this embodiment can be found in the examples described in the above embodiments and exemplary implementations, and will not be repeated here.

[0128] Obviously, those skilled in the art should understand that the modules or steps of the embodiments of this application described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. They can be implemented using computer-executable program code, and thus can be stored in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those presented here, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, the embodiments of this application are not limited to any particular combination of hardware and software.

[0129] The above description is merely a preferred embodiment of this application and is not intended to limit the embodiments of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the principles of the embodiments of this application should be included within the protection scope of the embodiments of this application.

Claims

1. A server testing method, characterized in that, include: Obtain hardware device information for each of the N servers to obtain N sets of hardware device information, where N is a positive integer greater than or equal to 2. The hardware device information is the information associated with the N servers during testing. When the format of the hardware device information is a format that the preset comparison tool does not allow to be compared, the N sets of hardware device information are converted into information in a first format to obtain N sets of first format information, wherein the first format is the format of information that the comparison tool allows to be compared. The comparison tool is used to compare the N sets of first format information to obtain a first comparison result, wherein the first comparison result is used to indicate whether the hardware device information in the N sets of hardware device information is consistent. If, based on the first comparison result, it is determined that testing of the N servers is permitted, then the N servers are tested. Before testing the N servers, the method further includes: obtaining a set of configuration information for each of the N servers to obtain N sets of configuration information, wherein the set of configuration information is the information associated with testing the N servers; if the format of the configuration information is the format of information allowed to be compared by the comparison tool, comparing the N sets of configuration information by the comparison tool to obtain a second comparison result, wherein the second comparison result is used to indicate whether the configuration information in the N sets of configuration information is consistent; if the first comparison result indicates that the hardware device information in the N sets of hardware device information is consistent, and the second comparison result indicates that the configuration information in the N sets of configuration information is consistent, then it is determined that testing the N servers is allowed. The set of configuration information includes database configuration information of the databases in each of the N servers. Before obtaining the set of configuration information of each of the N servers, the method further includes: sending first database configuration information in a second format to each of the N servers, wherein each of the N servers is used to convert the first database configuration information in the second format into second database configuration information in a third format. The second database configuration information is used to perform the same database configuration on the databases in each of the N servers. The third format is a format of database configuration information that is allowed to be used when performing the same database configuration on the databases, and the second format is a format of database configuration information that is not allowed to be used when performing the same database configuration on the databases. The step of sending the first database configuration information in a second format to each of the N servers includes: sending a target table in the second format to each of the N servers, wherein the target table includes the first database configuration information, and each of the N servers is used to convert the first database configuration information in the target table into the second database configuration information in a third format, wherein the third format includes an object format, a key-value pair format, or a string format.

2. The method according to claim 1, characterized in that, The step of obtaining a set of configuration information for each of the N servers to obtain N sets of configuration information also includes at least one of the following: Obtain the system configuration information of the operating system of each of the N servers, wherein the set of configuration information includes the system configuration information; Obtain the network configuration information of each of the N servers, wherein the set of configuration information includes the network configuration information.

3. The method according to claim 1, characterized in that, Before testing the N servers, the method further includes: Obtain a set of configuration information for each of the N servers to obtain N sets of configuration information, wherein the set of configuration information is the information associated with the N servers when testing them; If the format of the configuration information is a format that the comparison tool does not allow to be compared, the N sets of configuration information are converted into information in a fourth format to obtain N sets of fourth format information, wherein the fourth format is a format of information that the comparison tool allows to be compared. The comparison tool is used to compare the N sets of fourth format information to obtain a third comparison result, wherein the third comparison result is used to indicate whether the configuration information in the N sets of configuration information is consistent; If the first comparison result indicates that the hardware device information in each of the N groups of hardware device information is consistent, and the third comparison result indicates that the configuration information in each of the N groups of configuration information is consistent, then it is determined that testing of the N servers is permitted.

4. The method according to any one of claims 1 to 3, characterized in that, Before testing the N servers, the method further includes: obtaining a set of test configuration information for each of the N servers to obtain N sets of test configuration information, wherein the set of test configuration information includes the test permissions of the database in the server, the number of test instances of the database in the server, and the test time of the database in the server; and configuring the test permissions of the database, the number of test instances, and the test time for each of the N servers according to the N sets of test configuration information. The testing of the N servers includes: testing the N servers according to the configured test permissions of the database, the number of test instances, and the test time.

5. A server testing device, characterized in that, include: The first acquisition module is used to acquire hardware device information of each of the N servers to obtain N sets of hardware device information, where N is a positive integer greater than or equal to 2, and the hardware device information is the information associated with the N servers during testing. The first conversion module is used to convert the N sets of hardware device information into information in a first format when the format of the hardware device information is a format that the preset comparison tool does not allow to be compared, to obtain N sets of first format information, wherein the first format is the format of information that the comparison tool allows to be compared. The first comparison module is used to compare the N sets of first format information using the comparison tool to obtain a first comparison result, wherein the first comparison result is used to indicate whether the hardware device information in the N sets of hardware device information is consistent; The testing module is used to test the N servers if it is determined from the first comparison result that testing of the N servers is permitted. The device further includes: a second acquisition module, configured to acquire a set of configuration information for each of the N servers before testing the N servers, obtaining N sets of configuration information, wherein the set of configuration information is information associated with the testing of the N servers; a second comparison module, configured to compare the N sets of configuration information using the comparison tool when the format of the configuration information is the format of information allowed to be compared by the comparison tool, and obtain a second comparison result, wherein the second comparison result is used to indicate whether the configuration information in the N sets of configuration information is consistent; and a first determination module, configured to determine that testing of the N servers is allowed when the first comparison result indicates that the hardware device information in the N sets of hardware device information is consistent and the second comparison result indicates that the configuration information in the N sets of configuration information is consistent. The set of configuration information includes database configuration information of the databases in each of the N servers. The device further includes a sending module, configured to send first database configuration information in a second format to each of the N servers before obtaining the set of configuration information of each of the N servers and obtaining the N sets of configuration information. Each of the N servers is configured to convert the first database configuration information in the second format into second database configuration information in a third format. The second database configuration information is used to perform the same database configuration on the databases in each of the N servers. The third format is a format of database configuration information that is allowed to be used when performing the same database configuration on the databases. The second format is a format of database configuration information that is not allowed to be used when performing the same database configuration on the databases. The sending module includes a sending unit, configured to send a target table in the second format to each of the N servers, wherein the target table includes the first database configuration information, and each of the N servers is configured to convert the first database configuration information in the target table into the second database configuration information in the third format, wherein the third format includes an object format, a key-value pair format, or a string format.

6. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein the program, when executed, performs the method of any one of claims 1 to 4.

7. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to execute the method of any one of claims 1 to 4 through the computer program.

Citation Information

Patent Citations

  • Server test preparation method and system, electronic equipment and storage medium

    CN115576753A

  • Database comparison-based interface testing method and system, device and storage medium

    WO2020000706A1