WO2020177381A1 - Method and device for server testing, computer equipment, and storage medium - Google Patents

Method and device for server testing, computer equipment, and storage medium Download PDF

Info

Publication number
WO2020177381A1
WO2020177381A1 PCT/CN2019/117751 CN2019117751W WO2020177381A1 WO 2020177381 A1 WO2020177381 A1 WO 2020177381A1 CN 2019117751 W CN2019117751 W CN 2019117751W WO 2020177381 A1 WO2020177381 A1 WO 2020177381A1
Authority
WO
WIPO (PCT)
Prior art keywords
test
refresh
task
data
cache
Prior art date
Application number
PCT/CN2019/117751
Other languages
French (fr)
Chinese (zh)
Inventor
吴启
张慧
Original Assignee
平安科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2020177381A1 publication Critical patent/WO2020177381A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/26Functional testing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/3065Monitoring arrangements determined by the means or processing involved in reporting the monitored data
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating

Definitions

  • This application relates to the field of computer technology, and in particular to a server testing method, device, computer equipment and storage medium.
  • the cached data in the multiple test servers will be refreshed. Since the cache refresh in one or more test servers is not timely, the data update in the cluster server will be missed. To ensure that the data in the cluster server is updated in time, the cluster server needs to be tested for cache refresh. The test process needs to be performed on the cluster server. Multiple test servers perform random access, and traditional test methods cannot completely cover all test servers included in the cluster server, resulting in deviations in test results. Therefore, the existing test methods have the problem of inaccurate test results.
  • the embodiments of the present application provide a server test method, device, computer equipment, and storage medium, and aim to solve the problem of inaccurate test results in the prior art method.
  • an embodiment of the present application provides a server testing method, which includes: if a cache refresh task input by a user is received, perform a test on each test server according to the cache refresh task and a preset refresh database. The cache data is refreshed; if it is detected that the cache refresh task is executed, the preset test tasks are executed in batches to randomly access all the test servers and obtain the test task execution results, wherein the test task execution results include batches Test log and test return data; determine whether each of the test servers is accessed to obtain the access judgment result according to the batch test log; if the access judgment result is that every test server has been accessed, It is determined whether the latest refresh data in the refresh database matches the test return data to obtain a test result of whether the test passes.
  • an embodiment of the present application provides a server testing device, which includes: a cache data refresh unit, configured to, if a cache refresh task input by a user is received, based on the cache refresh task and a preset database refresh The cache data in each test server is refreshed; the test task execution unit is used to execute preset test tasks in batches to perform random access to all the test servers and obtain tests if it is detected that the cache refresh task has been executed.
  • a cache data refresh unit configured to, if a cache refresh task input by a user is received, based on the cache refresh task and a preset database refresh The cache data in each test server is refreshed; the test task execution unit is used to execute preset test tasks in batches to perform random access to all the test servers and obtain tests if it is detected that the cache refresh task has been executed.
  • test task execution result wherein the test task execution result includes batch test logs and test return data; an access judgment unit for judging whether each test server is accessed according to the batch test log to obtain the access judgment result
  • the test result acquisition unit is used to determine whether the latest refresh data in the refresh database matches the test return data if the access determination result is that each of the test servers is accessed to obtain The test result of whether the test passed.
  • an embodiment of the present application provides a computer device, which includes a memory, a processor, and a computer program stored on the memory and running on the processor, and the processor executes the computer
  • the program implements the server test method described in the first aspect.
  • the embodiments of the present application also provide a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor executes the above-mentioned The server test method described on the one hand.
  • the embodiments of the present application provide a server testing method, device, computer equipment, and storage medium.
  • the cache refresh task is executed to refresh the cache data in the test server, and the batch test log and test return data are obtained by executing the test task in batches. If the batch test log determines that each test server is accessed, the test Whether the returned data matches the refreshed database is judged to obtain the test result.
  • FIG. 1 is a schematic flowchart of a server testing method provided by an embodiment of the application
  • FIG. 2 is a schematic diagram of an application scenario of a server testing method provided by an embodiment of the application
  • FIG. 3 is a schematic diagram of a sub-flow of a server testing method provided by an embodiment of the application
  • FIG. 4 is a schematic diagram of another sub-flow of the server testing method provided by an embodiment of the application.
  • FIG. 5 is a schematic diagram of another sub-flow of the server testing method provided by an embodiment of the application.
  • FIG. 6 is a schematic diagram of another sub-flow of the server testing method provided by an embodiment of the application.
  • FIG. 7 is a schematic block diagram of a server testing device provided by an embodiment of the application.
  • FIG. 8 is a schematic block diagram of a subunit of a server testing device provided by an embodiment of the application.
  • FIG. 9 is a schematic block diagram of another subunit of the server testing device provided by an embodiment of the application.
  • FIG. 10 is a schematic block diagram of another subunit of the server testing device provided by an embodiment of the application.
  • FIG. 11 is a schematic block diagram of another subunit of the server testing device provided by an embodiment of the application.
  • FIG. 12 is a schematic block diagram of a computer device provided by an embodiment of the application.
  • Figure 1 is a schematic flowchart of a server testing method provided by an embodiment of the present application
  • Figure 2 is a schematic diagram of an application scenario of the server testing method provided by an embodiment of the present application.
  • the server test method is applied to the management server 10.
  • the method is executed by the application software installed in the management server 10.
  • Multiple test servers 20 form a cluster server and establish a network connection with the management server 10 to realize multiple testing Data information is transmitted between the server 20 and the management server 10.
  • the management server 10 is an enterprise terminal used to execute a server test method to manage and test the test server 20, and the test server 20 is the server under test.
  • the method includes steps S110 to S140.
  • the cache refresh task is the cache data in each test server is refreshed according to the cache refresh task and the preset refresh database.
  • the user enters a cache refresh task to refresh the cache data in each test server connected to the management server.
  • the cluster server contains multiple test servers.
  • the management server and each test server in the cluster server are connected through a network to transmit data information.
  • Each test server contains a storage medium for storing cached data.
  • the cache refresh task is the task information used to execute in the server to refresh the cache data in the test server
  • the preset refresh database is the database used for data interaction with the test server
  • refresh There are multiple pieces of refresh data stored in the database.
  • the cache refresh task includes information such as task name, task status, sleep time, etc.
  • the refresh data stored in the refresh database includes task data name, data identification code, new and old identification information, etc., and the task name and the task data in the corresponding refresh data
  • the names correspond one to one.
  • step S110 includes sub-steps S111, S112, and S113.
  • S111 Determine whether the task status of the cache refresh task is idle.
  • the task status is the information used to identify the status of the cache refresh task. If the task status is idle, it means that the cache refresh task is not executed by the test server at this time; if the task status is not idle, then Indicates that the task is executed by a test server at this time, and other test servers cannot execute the cache refresh task at this time.
  • the cache refresh task is executed in each test server in turn to obtain the cache refresh task in the preset refresh database. Correspondingly refresh the data, and refresh the cached data in the test server.
  • the task name of the cache refresh task is matched with the task data name of the refresh data in the refresh database; if the task data name of the refresh data matches the task name, the refresh data is input to execute the In the test server of the cache refresh task, the cache data in the test server is refreshed.
  • the refresh data corresponding to the cache refresh task can be obtained and the test to execute the cache refresh task can be input.
  • the server to refresh the cached data in the corresponding test server.
  • the sleep time in the cache refresh task is acquired, and after the sleep time ends, the cache refresh task is executed in sequence in each test server to check the cache data in the test server. Refresh.
  • the sleep time is the time information used to wait for the cache refresh task to complete execution in other test servers. After the sleep time expires, the cache refresh task is completed in other test servers, and it can be used in each of the remaining test servers. The cache refresh task is executed in the test server in turn to complete the refresh of the cache data of each test server.
  • the sleep time can be preset by the user (the user of the management server). For example, the sleep time of the cache refresh task in Table 1 is set to 60 seconds.
  • the execution result includes the batch test log and test return data.
  • the batch test log is the log information used to record the process of batch execution of the test task.
  • the test return data includes each test server accessed according to the test task.
  • the returned return data is the test return data containing multiple return data.
  • the test task is task information used to test the cached data refreshed in the test server.
  • the test task includes the number of executions, and the number of executions is the number of times the test task is executed in batches. Since the access to each test server in the cluster server is random when the test task is executed in the management server, the test tasks need to be executed in batches to achieve full coverage access to all test servers in the cluster server.
  • the number of executions can be set to 100 times, and then the test task is executed 100 times in the management server to perform 100 random accesses to all the test servers.
  • step S120 includes sub-steps S121 and S122.
  • S121 Monitor the batch execution process of the test tasks to obtain batch test logs.
  • the batch test log includes the access address information and access time information of the test server accessed during each execution of the test task. Each time the execution of the test task is completed, the access address information and corresponding access address information of the accessed test server are added to the batch test log. Access time, if a certain test server is accessed multiple times, the access address information corresponding to the test server in the batch test log corresponds to multiple access times.
  • Access address information interview time 30.5.160.215 11-02 10:17.32 30.5.160.215 11-02 10:17.36 30.5.160.215 11-02 10:17.44 30.5.160.214 11-02 10:17.41 30.5.160.214 11-02 10:17.43
  • test return data Obtain the return data of each of the accessed test servers according to the test task to obtain test return data.
  • a piece of data information will be fed back to the management server.
  • the data information that is fed back is also the cached data stored in the test server. Because the test server that has been accessed multiple times will return a piece of data information according to the test task. The same, therefore, any piece of data information fed back by the test server can be used as the return data of the test server, and the test return data can be obtained by obtaining the return data of each test server accessed by the above method.
  • the batch test log it is determined whether each test server is accessed to obtain the access determination result.
  • the batch test log includes the access address information and access time information of the test server corresponding to the execution of each test task. Therefore, according to the information contained in the batch test log, it can be judged whether each test server has been accessed, and the access judgment can be finally obtained result.
  • step S130 includes sub-steps S131 and S132.
  • Obtain the access address information contained in the batch test log For example, obtain the network address information contained in the batch test log shown in Table 2 as 30.5.160.215 and 30.5.160.214.
  • S132 Determine whether the access address information includes all address information of the test server to obtain an access determination result.
  • Each test server in the cluster server corresponds to an address information, which can be used to identify the test server. By judging whether the access address information includes the address information of all test servers, the access judgment result can be obtained .
  • the access address information includes the address information of all test servers, and the access judgment result is that each test server is accessed .
  • the access judgment result is not that every test server has been accessed, it indicates that the number of executions in the test task is low, and an alarm message with a low number of executions can be generated and sent to the management server.
  • the refresh data stored in the refresh database includes task data name, data identification code, new and old identification information, etc.
  • the data identification code is the coding information that identifies each piece of refresh data stored in the refresh database, and the new and old identification information is the information used to identify the new and old of the refresh data.
  • the refresh data stored in the refresh database is shown in Table 3.
  • step S140 includes sub-steps S141 and S142.
  • the refresh data corresponding to the cache refresh task in the refresh database is determined to be the latest refresh data. Specifically, one or more pieces of refresh data corresponding to the cache refresh task in the refresh database can be obtained by the task name in the cache refresh task, and the new and old identification information in the database can be refreshed to determine the one corresponding to the cache refresh task.
  • the latest refresh data In the refresh database, the new and old identification information is "0", which indicates that the refreshed data is old data; the new and old identification information is "1", it indicates that the refreshed data is new data.
  • One or more pieces of refresh data corresponding to a certain cache refresh task in the refresh database have and only one piece of refresh data has new and old identification information of "1".
  • the refresh data corresponding to the cache refresh task may be one or more pieces, and if the refresh data corresponding to the cache refresh task is one piece, the refresh data is taken as the latest refresh data corresponding to the cache refresh task; If there are multiple pieces of refresh data corresponding to the cache refresh task, one piece of the latest refresh data corresponding to the cache refresh task is acquired according to the new and old identification information of the refresh data. If there is one refresh data corresponding to the cache refresh task, the refresh data is directly obtained as the latest refresh data corresponding to the cache refresh task; if there are multiple refresh data corresponding to the cache refresh task, the refresh data can be refreshed The new and old identification information in the database acquires a piece of latest refresh data corresponding to the cache refresh task.
  • S142 Determine whether the returned data of each test server in the test return data matches the latest refresh data to obtain a test result of whether the test passes.
  • the cache refresh task is executed to refresh the cache data in the test server, and the batch test log and test return data are obtained by executing the test task in batches. If the batch test log determines that each test server is accessed, the test Whether the returned data matches the refreshed database is judged to obtain the test result.
  • FIG. 7 is a schematic block diagram of a server testing apparatus provided in an embodiment of the present application.
  • the server testing device can be configured in the management server 10.
  • the server test apparatus 100 includes a cache data refresh unit 110, a test task execution unit 120, an access judgment unit 130, and a test result acquisition unit 140.
  • the cache data refresh unit 110 is configured to, if a cache refresh task input by a user is received, refresh the cache data in each test server according to the cache refresh task and a preset refresh database.
  • the cache data refresh unit 110 includes sub-units: a task status judgment unit 111, a first cache data refresh unit 112 and a second cache data refresh unit 113.
  • the task status judgment unit 111 is used to judge whether the task status of the cache refresh task is idle; the first cache data refresh unit 112 is used to determine whether the task status of the cache refresh task is idle, in each test server The cache refresh task is executed in sequence to obtain the refresh data in the refresh database to refresh the cache data in all the test servers; the second cache data refresh unit 113 is configured to determine the task status of the cache refresh task If it is not idle, get the sleep time of the cache refresh task. After the sleep time is over, execute the cache refresh task in each test server to obtain the refresh data in the refresh database. The data is refreshed.
  • the test task execution unit 120 is configured to execute preset test tasks in batches to perform random access to all the test servers and obtain test task execution results if it is detected that the cache refresh task has been executed.
  • the test task execution unit 120 includes sub-units: a batch test log acquisition unit 121 and a test return data acquisition unit 122.
  • the batch test log obtaining unit 121 is used to monitor the process of the batch execution of the test tasks to obtain the batch test log; the test return data obtaining unit 122 is used to obtain each of the accessed test servers according to the test task The returned data is fed back to obtain the test return data.
  • the access judgment unit 130 is configured to judge whether each of the test servers is accessed according to the batch test log to obtain the access judgment result.
  • the access judgment unit 130 includes subunits: an access address information acquisition unit 131 and an access judgment result acquisition unit 132.
  • the access address information obtaining unit 131 is used to obtain the access address information contained in the batch test log; the access judgment result obtaining unit 132 is used to judge whether the access address information includes all the address information of the test server To get the result of the visit.
  • the test result obtaining unit 140 is configured to determine whether the latest refresh data in the refresh database matches the test return data if the access judgment result is that each of the test servers is accessed to obtain The test result of whether the test passed.
  • the test result obtaining unit 140 includes sub-units: a latest refresh data obtaining unit 141 and a test judgment unit 142.
  • the latest refresh data acquisition unit 141 is configured to determine the refresh data corresponding to the cache refresh task in the refresh database as the latest refresh data; the test judgment unit 142 is configured to return data from each test server in the test Whether the returned data all match the latest refreshed data is judged to obtain the test result of whether the test passes.
  • the cache refresh task is executed to refresh the cache data in the test server, and the batch test log and test return data are obtained by executing the test task in batches. If the batch test log determines that each test server is accessed, the test Whether the returned data matches the refreshed database is judged to obtain the test result.
  • the above-mentioned server testing device can be implemented in the form of a computer program, and the computer program can be run on a computer device as shown in FIG. 12.
  • FIG. 12 is a schematic block diagram of a computer device according to an embodiment of the present application.
  • the computer device 500 includes a processor 502, a memory, and a network interface 505 connected through a system bus 501, where the memory may include a non-volatile storage medium 503 and an internal memory 504.
  • the non-volatile storage medium 503 can store an operating system 5031 and a computer program 5032.
  • the processor 502 can execute the server test method.
  • the processor 502 is used to provide calculation and control capabilities, and support the operation of the entire computer device 500.
  • the internal memory 504 provides an environment for the operation of the computer program 5032 in the non-volatile storage medium 503.
  • the processor 502 can execute the server test method.
  • the network interface 505 is used for network communication, such as providing data information transmission.
  • the specific computer device 500 may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
  • the processor 502 is configured to run a computer program 5032 stored in a memory, so as to implement the server testing method of the embodiment of the present application.
  • the embodiment of the computer device shown in FIG. 12 does not constitute a limitation on the specific configuration of the computer device.
  • the computer device may include more or less components than those shown in the figure. Or combine certain components, or different component arrangements.
  • the computer device may only include a memory and a processor. In such an embodiment, the structures and functions of the memory and the processor are consistent with the embodiment shown in FIG. 12, and will not be repeated here.
  • the processor 502 may be a central processing unit (Central Processing Unit, CPU), and the processor 502 may also be other general-purpose processors, digital signal processors (Digital Signal Processors, DSPs), Application Specific Integrated Circuit (ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • the general-purpose processor may be a microprocessor or the processor may also be any conventional processor.
  • a computer-readable storage medium may be a non-volatile computer-readable storage medium.
  • the computer-readable storage medium stores a computer program, where the computer program is executed by a processor to implement the server testing method of the embodiment of the present application.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments of the present application.
  • the functional units in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above-mentioned integrated unit can be implemented in the form of hardware or software functional unit.
  • the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium.
  • the technical solution of this application is essentially or the part that contributes to the existing technology, or all or part of the technical solution can be embodied in the form of a software product.
  • the computer software product is stored in a computer.
  • the read storage medium includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the computer-readable storage medium is a tangible, non-transitory storage medium, and the computer-readable storage medium may be an internal storage unit of the aforementioned device, such as a physical storage medium such as a hard disk or a memory of the device.
  • the storage medium may also be an external storage device of the device, for example, a plug-in hard disk equipped on the device, a smart memory card (Smart Media Card, SMC), a Secure Digital (SD) card, a flash memory card (Flash Card) and other physical storage media.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Quality & Reliability (AREA)
  • Computer Hardware Design (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Debugging And Monitoring (AREA)
  • Test And Diagnosis Of Digital Computers (AREA)

Abstract

A method and device for server testing, computer equipment, and a storage medium. The method comprises: if a cache refresh task inputted by a user is received, refreshing cached data in each test server on the basis of the cache refresh task and of a preset refresh database; if the execution of the cache refresh task is detected to be completed, batch executing preset test tasks to randomly access all of the test servers and acquiring a test task execution result; determining, on the basis of a batch test log, whether each of the test servers is accessed to produce an access determination result; and if the access determination result is such that each of the test servers is accessed, determining whether the latest refresh data in the refresh database matches data returned from the tests to produce a test result.

Description

服务器测试方法、装置、计算机设备及存储介质Server testing method, device, computer equipment and storage medium
本申请要求于2019年03月06日提交中国专利局、申请号为201910168070.0、申请名称为“服务器测试方法、装置、计算机设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。This application claims the priority of a Chinese patent application filed with the Chinese Patent Office, the application number is 201910168070.0, and the application name is "server test method, device, computer equipment and storage medium" on March 6, 2019, the entire content of which is incorporated by reference In this application.
技术领域Technical field
本申请涉及计算机技术领域,尤其涉及一种服务器测试方法、装置、计算机设备及存储介质。This application relates to the field of computer technology, and in particular to a server testing method, device, computer equipment and storage medium.
背景技术Background technique
在对集群服务器中所包含的多台测试服务器在执行部署任务的过程中,会对多台测试服务器中的缓存数据进行刷新。由于一台或多台测试服务器中缓存刷新不及时会导致集群服务器中数据的更新发生遗漏,为确保集群服务器中数据及时更新,需对集群服务器进行缓存刷新测试,该测试过程需对集群服务器中多个测试服务器进行随机访问,而传统的测试方法无法完全覆盖集群服务器中所包含的所有测试服务器,导致测试结果出现偏差。因而现有的测试方法存在测试结果不准确的问题。In the process of performing deployment tasks on multiple test servers included in the cluster server, the cached data in the multiple test servers will be refreshed. Since the cache refresh in one or more test servers is not timely, the data update in the cluster server will be missed. To ensure that the data in the cluster server is updated in time, the cluster server needs to be tested for cache refresh. The test process needs to be performed on the cluster server. Multiple test servers perform random access, and traditional test methods cannot completely cover all test servers included in the cluster server, resulting in deviations in test results. Therefore, the existing test methods have the problem of inaccurate test results.
发明内容Summary of the invention
本申请实施例提供了一种服务器测试方法、装置、计算机设备及存储介质,旨在解决现有技术方法中所存在的测试结果不准确的问题。The embodiments of the present application provide a server test method, device, computer equipment, and storage medium, and aim to solve the problem of inaccurate test results in the prior art method.
第一方面,本申请实施例提供了一种服务器测试方法,其包括:若接收到用户所输入的缓存刷新任务,根据所述缓存刷新任务及预设的刷新数据库对每一台测试服务器中的缓存数据进行刷新;若检测到所述缓存刷新任务执行完毕,批量执行预设的测试任务以对所有所述测试服务器进行随机访问并获取测试任务执行结果,其中,所述测试任务执行结果包括批量测试日志及测试返回数据;根据所述批量测试日志判断每一台所述测试服务器是否均被访问以得到访问判断结果;若所述访问判断结果为每一台所述测试服务器均被访问,对所述刷新数据库中的最新刷新数据是否与所述测试返回数据相匹配的进行判断以得到测 试是否通过的测试结果。In the first aspect, an embodiment of the present application provides a server testing method, which includes: if a cache refresh task input by a user is received, perform a test on each test server according to the cache refresh task and a preset refresh database. The cache data is refreshed; if it is detected that the cache refresh task is executed, the preset test tasks are executed in batches to randomly access all the test servers and obtain the test task execution results, wherein the test task execution results include batches Test log and test return data; determine whether each of the test servers is accessed to obtain the access judgment result according to the batch test log; if the access judgment result is that every test server has been accessed, It is determined whether the latest refresh data in the refresh database matches the test return data to obtain a test result of whether the test passes.
第二方面,本申请实施例提供了一种服务器测试装置,其包括:缓存数据刷新单元,用于若接收到用户所输入的缓存刷新任务,根据所述缓存刷新任务及预设的刷新数据库对每一台测试服务器中的缓存数据进行刷新;测试任务执行单元,用于若检测到所述缓存刷新任务执行完毕,批量执行预设的测试任务以对所有所述测试服务器进行随机访问并获取测试任务执行结果,其中,所述测试任务执行结果包括批量测试日志及测试返回数据;访问判断单元,用于根据所述批量测试日志判断每一台所述测试服务器是否均被访问以得到访问判断结果;测试结果获取单元,用于若所述访问判断结果为每一台所述测试服务器均被访问,对所述刷新数据库中的最新刷新数据是否与所述测试返回数据相匹配的进行判断以得到测试是否通过的测试结果。In the second aspect, an embodiment of the present application provides a server testing device, which includes: a cache data refresh unit, configured to, if a cache refresh task input by a user is received, based on the cache refresh task and a preset database refresh The cache data in each test server is refreshed; the test task execution unit is used to execute preset test tasks in batches to perform random access to all the test servers and obtain tests if it is detected that the cache refresh task has been executed. Task execution result, wherein the test task execution result includes batch test logs and test return data; an access judgment unit for judging whether each test server is accessed according to the batch test log to obtain the access judgment result The test result acquisition unit is used to determine whether the latest refresh data in the refresh database matches the test return data if the access determination result is that each of the test servers is accessed to obtain The test result of whether the test passed.
第三方面,本申请实施例又提供了一种计算机设备,其包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,所述处理器执行所述计算机程序时实现上述第一方面所述的服务器测试方法。In a third aspect, an embodiment of the present application provides a computer device, which includes a memory, a processor, and a computer program stored on the memory and running on the processor, and the processor executes the computer The program implements the server test method described in the first aspect.
第四方面,本申请实施例还提供了一种计算机可读存储介质,其中所述计算机可读存储介质存储有计算机程序,所述计算机程序当被处理器执行时使所述处理器执行上述第一方面所述的服务器测试方法。In a fourth aspect, the embodiments of the present application also provide a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor executes the above-mentioned The server test method described on the one hand.
本申请实施例提供了一种服务器测试方法、装置、计算机设备及存储介质。通过执行缓存刷新任务以对测试服务器中的缓存数据进行刷新,并通过批量执行测试任务获取批量测试日志及测试返回数据,若通过批量测试日志判断得到每一台测试服务器均被访问,则对测试返回数据是否与刷新数据库匹配进行判断以得到测试结果。通过上述服务器测试方法可实现全覆盖测试,避免测试结果出现偏差,在实际应用过程中取得了良好的技术效果。The embodiments of the present application provide a server testing method, device, computer equipment, and storage medium. The cache refresh task is executed to refresh the cache data in the test server, and the batch test log and test return data are obtained by executing the test task in batches. If the batch test log determines that each test server is accessed, the test Whether the returned data matches the refreshed database is judged to obtain the test result. Through the above-mentioned server testing method, full coverage testing can be achieved, avoiding deviations in test results, and achieving good technical effects in the actual application process.
附图说明Description of the drawings
为了更清楚地说明本申请实施例技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to explain the technical solutions of the embodiments of the present application more clearly, the following will briefly introduce the drawings needed in the description of the embodiments. Obviously, the drawings in the following description are some embodiments of the present application. Ordinary technicians can obtain other drawings based on these drawings without creative work.
图1为本申请实施例提供的服务器测试方法的流程示意图;FIG. 1 is a schematic flowchart of a server testing method provided by an embodiment of the application;
图2为本申请实施例提供的服务器测试方法的应用场景示意图;2 is a schematic diagram of an application scenario of a server testing method provided by an embodiment of the application;
图3为本申请实施例提供的服务器测试方法的子流程示意图;FIG. 3 is a schematic diagram of a sub-flow of a server testing method provided by an embodiment of the application;
图4为本申请实施例提供的服务器测试方法的另一子流程示意图;FIG. 4 is a schematic diagram of another sub-flow of the server testing method provided by an embodiment of the application;
图5为本申请实施例提供的服务器测试方法的另一子流程示意图;FIG. 5 is a schematic diagram of another sub-flow of the server testing method provided by an embodiment of the application;
图6为本申请实施例提供的服务器测试方法的另一子流程示意图;FIG. 6 is a schematic diagram of another sub-flow of the server testing method provided by an embodiment of the application;
图7为本申请实施例提供的服务器测试装置的示意性框图;FIG. 7 is a schematic block diagram of a server testing device provided by an embodiment of the application;
图8为本申请实施例提供的服务器测试装置的子单元示意性框图;FIG. 8 is a schematic block diagram of a subunit of a server testing device provided by an embodiment of the application;
图9为本申请实施例提供的服务器测试装置的另一子单元示意性框图;FIG. 9 is a schematic block diagram of another subunit of the server testing device provided by an embodiment of the application;
图10为本申请实施例提供的服务器测试装置的另一子单元示意性框图;FIG. 10 is a schematic block diagram of another subunit of the server testing device provided by an embodiment of the application;
图11为本申请实施例提供的服务器测试装置的另一子单元示意性框图;FIG. 11 is a schematic block diagram of another subunit of the server testing device provided by an embodiment of the application;
图12为本申请实施例提供的计算机设备的示意性框图。FIG. 12 is a schematic block diagram of a computer device provided by an embodiment of the application.
具体实施方式detailed description
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。The technical solutions in the embodiments of the present application will be described clearly and completely in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of them. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative work shall fall within the protection scope of this application.
应当理解,当在本说明书和所附权利要求书中使用时,术语“包括”和“包含”指示所描述特征、整体、步骤、操作、元素和/或组件的存在,但并不排除一个或多个其它特征、整体、步骤、操作、元素、组件和/或其集合的存在或添加。It should be understood that when used in this specification and the appended claims, the terms "including" and "including" indicate the existence of the described features, wholes, steps, operations, elements and/or components, but do not exclude one or The existence or addition of multiple other features, wholes, steps, operations, elements, components, and/or collections thereof.
还应当理解,在此本申请说明书中所使用的术语仅仅是出于描述特定实施例的目的而并不意在限制本申请。如在本申请说明书和所附权利要求书中所使用的那样,除非上下文清楚地指明其它情况,否则单数形式的“一”、“一个”及“该”意在包括复数形式。It should also be understood that the terms used in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit the application. As used in the specification of this application and the appended claims, unless the context clearly indicates other circumstances, the singular forms "a", "an" and "the" are intended to include plural forms.
还应当进一步理解,在本申请说明书和所附权利要求书中使用的术语“和/或”是指相关联列出的项中的一个或多个的任何组合以及所有可能组合,并且包括这些组合。It should be further understood that the term "and/or" used in the specification and appended claims of this application refers to any combination and all possible combinations of one or more of the associated listed items, and includes these combinations .
请参阅图1-图2,图1是本申请实施例提供的服务器测试方法的流程示意图,图2为本申请实施例提供的服务器测试方法的应用场景示意图。该服务器测试方法应用于管理服务器10中,该方法通过安装于管理服务器10中的应用软件进行执行,多台测试服务器20组成集群服务器并通过与管理服务器10建立网络连接,以实现在多台测试服务器20与管理服务器10之间进行数据信息的传 输。管理服务器10即是用于执行服务器测试方法以对测试服务器20进行管理及测试的企业终端,测试服务器20即是被测试的服务器端。Please refer to Figure 1-Figure 2. Figure 1 is a schematic flowchart of a server testing method provided by an embodiment of the present application, and Figure 2 is a schematic diagram of an application scenario of the server testing method provided by an embodiment of the present application. The server test method is applied to the management server 10. The method is executed by the application software installed in the management server 10. Multiple test servers 20 form a cluster server and establish a network connection with the management server 10 to realize multiple testing Data information is transmitted between the server 20 and the management server 10. The management server 10 is an enterprise terminal used to execute a server test method to manage and test the test server 20, and the test server 20 is the server under test.
如图1所示,该方法包括步骤S110~S140。As shown in Figure 1, the method includes steps S110 to S140.
S110、若接收到用户所输入的缓存刷新任务,根据所述缓存刷新任务及预设的刷新数据库对每一台测试服务器中的缓存数据进行刷新。S110: If the cache refresh task input by the user is received, refresh the cache data in each test server according to the cache refresh task and the preset refresh database.
若接收到用户所输入的缓存刷新任务,根据所述缓存刷新任务及预设的刷新数据库对每一台测试服务器中的缓存数据进行刷新。用户(管理服务器的使用者)通过输入缓存刷新任务,以对每一台与管理服务器相连接的测试服务器中的缓存数据进行刷新。具体的,集群服务器中包含多台测试服务器,管理服务器与集群服务器中的每一台测试服务器通过网络连接以进行数据信息的传输,每一台测试服务器中均包含用于存储缓存数据的存储介质(RAM),缓存刷新任务即是用于在服务器中进行执行以对该测试服务器中的缓存数据进行刷新的任务信息,预设的刷新数据库即是用于与测试服务器进行数据交互的数据库,刷新数据库中存储有多条刷新数据。所述缓存刷新任务中包括任务名称、任务状态、休眠时间等信息,刷新数据库中所存储的刷新数据包括任务数据名称、数据识别码、新旧识别信息等,任务名称与对应刷新数据中的任务数据名称一一对应。If the cache refresh task input by the user is received, the cache data in each test server is refreshed according to the cache refresh task and the preset refresh database. The user (the user of the management server) enters a cache refresh task to refresh the cache data in each test server connected to the management server. Specifically, the cluster server contains multiple test servers. The management server and each test server in the cluster server are connected through a network to transmit data information. Each test server contains a storage medium for storing cached data. (RAM), the cache refresh task is the task information used to execute in the server to refresh the cache data in the test server, the preset refresh database is the database used for data interaction with the test server, refresh There are multiple pieces of refresh data stored in the database. The cache refresh task includes information such as task name, task status, sleep time, etc. The refresh data stored in the refresh database includes task data name, data identification code, new and old identification information, etc., and the task name and the task data in the corresponding refresh data The names correspond one to one.
例如,某一缓存刷新任务如表1所示。For example, a certain cache refresh task is shown in Table 1.
任务名称mission name 任务状态Task status 休眠时间Sleep time
targettarget 空闲idle 60秒60 seconds
表1Table 1
在一实施例中,如图3所示,步骤S110包括子步骤S111、S112和S113。In an embodiment, as shown in FIG. 3, step S110 includes sub-steps S111, S112, and S113.
S111、判断所述缓存刷新任务的任务状态是否为空闲。S111: Determine whether the task status of the cache refresh task is idle.
判断所述缓存刷新任务的任务状态是否为空闲。具体的,任务状态即是用于对该缓存刷新任务的状态进行标识的信息,若任务状态为空闲,则表明此时该缓存刷新任务未被测试服务器所执行;若任务状态不为空闲,则表明此时该任务被某一台测试服务器所执行,其他测试服务器此时无法执行该缓存刷新任务。It is determined whether the task status of the cache refresh task is idle. Specifically, the task status is the information used to identify the status of the cache refresh task. If the task status is idle, it means that the cache refresh task is not executed by the test server at this time; if the task status is not idle, then Indicates that the task is executed by a test server at this time, and other test servers cannot execute the cache refresh task at this time.
S112、若所述缓存刷新任务的任务状态为空闲,在每一台测试服务器中依次执行所述缓存刷新任务,以获取所述刷新数据库中的刷新数据对所有所述测试服务器中的缓存数据进行刷新。S112. If the task status of the cache refresh task is idle, execute the cache refresh task in each test server in turn to obtain the refresh data in the refresh database and perform the processing on the cache data in all the test servers. Refresh.
若缓存刷新任务的任务状态为空闲,则表明该缓存刷新任务未被测试服务器所执行,在每一台测试服务器中依次执行该缓存刷新任务,以获取预设刷新数据库中与该缓存刷新任务相对应的刷新数据,并对测试服务器中的缓存数据进行刷新。将所述缓存刷新任务的任务名称与所述刷新数据库中刷新数据的任务数据名称进行匹配;若所述刷新数据的任务数据名称与所述任务名称相匹配,将所述刷新数据输入执行所述缓存刷新任务的测试服务器中,以对所述测试服务器中的缓存数据进行刷新。If the task status of the cache refresh task is idle, it means that the cache refresh task has not been executed by the test server. The cache refresh task is executed in each test server in turn to obtain the cache refresh task in the preset refresh database. Correspondingly refresh the data, and refresh the cached data in the test server. The task name of the cache refresh task is matched with the task data name of the refresh data in the refresh database; if the task data name of the refresh data matches the task name, the refresh data is input to execute the In the test server of the cache refresh task, the cache data in the test server is refreshed.
具体的,通过获取缓存刷新任务中的任务名称,并与刷新数据库中刷新数据的任务数据名称进行匹配,即可获取得到与该缓存刷新任务相对应的刷新数据并输入执行该缓存刷新任务的测试服务器中,以对相应测试服务器中的缓存数据进行刷新。Specifically, by obtaining the task name in the cache refresh task and matching it with the task data name of the refresh data in the refresh database, the refresh data corresponding to the cache refresh task can be obtained and the test to execute the cache refresh task can be input. In the server, to refresh the cached data in the corresponding test server.
S113、若所述缓存刷新任务的任务状态不是空闲,获取所述缓存刷新任务的休眠时间,休眠时间结束后在每一台测试服务器中依次执行所述缓存刷新任务以获取所述刷新数据库中的刷新数据对所有所述测试服务器中的缓存数据进行刷新。S113. If the task status of the cache refresh task is not idle, acquire the sleep time of the cache refresh task, and after the sleep time expires, execute the cache refresh task in each test server in turn to obtain the data in the refresh database. Refresh data refreshes the cached data in all the test servers.
若缓存刷新任务的任务状态不是空闲,则获取所述缓存刷新任务中的休眠时间,并在休眠时间结束后,在每一台测试服务器中依次执行该缓存刷新任务以对测试服务器中的缓存数据进行刷新。具体的,休眠时间即是用于等待缓存刷新任务在其他测试服务器中完成执行的时间信息,在休眠时间结束后该缓存刷新任务即在其他测试服务器中完成执行,则可在剩余的每一台测试服务器中依次执行该缓存刷新任务,即可完成对每一台测试服务器的缓存数据进行刷新。If the task status of the cache refresh task is not idle, the sleep time in the cache refresh task is acquired, and after the sleep time ends, the cache refresh task is executed in sequence in each test server to check the cache data in the test server. Refresh. Specifically, the sleep time is the time information used to wait for the cache refresh task to complete execution in other test servers. After the sleep time expires, the cache refresh task is completed in other test servers, and it can be used in each of the remaining test servers. The cache refresh task is executed in the test server in turn to complete the refresh of the cache data of each test server.
其中,休眠时间可由用户(管理服务器的使用者)进行预先设定,例如,表1中该缓存刷新任务的休眠时间设定为60秒。The sleep time can be preset by the user (the user of the management server). For example, the sleep time of the cache refresh task in Table 1 is set to 60 seconds.
S120、若检测到所述缓存刷新任务执行完毕,批量执行预设的测试任务以对所有所述测试服务器进行随机访问并获取测试任务执行结果。S120: If it is detected that the execution of the cache refresh task is completed, execute preset test tasks in batches to perform random access to all the test servers and obtain test task execution results.
若检测到所述缓存刷新任务执行完毕,也即是完成对每一台测试服务器的缓存数据进行刷新,则在管理服务器中批量执行预设的测试任务以得到测试任务执行结果,具体的测试任务执行结果包括批量测试日志及测试返回数据,批量测试日志即用于对测试任务进行批量执行的过程进行记录的日志信息,测试返回数据中包含被访问的每一所述测试服务器根据所述测试任务所反馈的返回数据,也即是测试返回数据中包含多条返回数据。If it is detected that the cache refresh task has been executed, that is, the cache data of each test server has been refreshed, the preset test tasks are executed in batches in the management server to obtain the test task execution results, and the specific test tasks The execution result includes the batch test log and test return data. The batch test log is the log information used to record the process of batch execution of the test task. The test return data includes each test server accessed according to the test task. The returned return data is the test return data containing multiple return data.
测试任务即是用于对测试服务器中刷新后的缓存数据进行测试的任务信息,测试任务中包括执行次数,执行次数即是用于对该测试任务进行批量执行的次数信息。由于在管理服务器中对测试任务进行执行时,对集群服务器中每一测试服务器的访问是随机的,因此需对测试任务进行批量执行以实现对集群服务器中所有测试服务器进行全覆盖访问。The test task is task information used to test the cached data refreshed in the test server. The test task includes the number of executions, and the number of executions is the number of times the test task is executed in batches. Since the access to each test server in the cluster server is random when the test task is executed in the management server, the test tasks need to be executed in batches to achieve full coverage access to all test servers in the cluster server.
例如,可设置执行次数为100次,则在管理服务器中执行该测试任务100次以对所有所述测试服务器进行100次随机访问。For example, the number of executions can be set to 100 times, and then the test task is executed 100 times in the management server to perform 100 random accesses to all the test servers.
在一实施例中,如图4所示,步骤S120包括子步骤S121和S122。In an embodiment, as shown in FIG. 4, step S120 includes sub-steps S121 and S122.
S121、对所述测试任务批量执行的过程进行监控以得到批量测试日志。S121: Monitor the batch execution process of the test tasks to obtain batch test logs.
对所述测试任务批量执行的过程进行监控以得到批量测试日志。对每次执行测试任务的过程进行监控,以得到包含每一次测试信息的批量测试日志,每执行一次测试任务即是随机对集群服务器中的一台测试服务器进行访问,对测试服务器进行访问的过程即是调用接口获取相应测试服务器所返回的返回数据。批量测试日志中包括每一次执行测试任务过程中访问的测试服务器的访问地址信息及访问时间信息,每完成一次测试任务的执行则在批量测试日志中添加所访问的测试服务器对应的访问地址信息及访问时间,若某一测试服务器被多次访问,则批量测试日志中该测试服务器对应的访问地址信息中对应包含多个访问时间。Monitoring the batch execution process of the test tasks to obtain batch test logs. Monitor the process of each execution of a test task to obtain a batch test log containing each test information. Each execution of a test task is a process of randomly accessing a test server in the cluster server and accessing the test server That is, the interface is called to obtain the return data returned by the corresponding test server. The batch test log includes the access address information and access time information of the test server accessed during each execution of the test task. Each time the execution of the test task is completed, the access address information and corresponding access address information of the accessed test server are added to the batch test log. Access time, if a certain test server is accessed multiple times, the access address information corresponding to the test server in the batch test log corresponds to multiple access times.
例如,某一份批量测试日志如表2所示。For example, a batch test log is shown in Table 2.
访问地址信息Access address information 访问时间interview time
30.5.160.21530.5.160.215 11-02 10:17.3211-02 10:17.32
30.5.160.21530.5.160.215 11-02 10:17.3611-02 10:17.36
30.5.160.21530.5.160.215 11-02 10:17.4411-02 10:17.44
30.5.160.21430.5.160.214 11-02 10:17.4111-02 10:17.41
30.5.160.21430.5.160.214 11-02 10:17.4311-02 10:17.43
表2Table 2
S122、获取被访问的每一所述测试服务器根据所述测试任务所反馈的返回数据以得到测试返回数据。S122. Obtain return data fed back by each of the accessed test servers according to the test task to obtain test return data.
获取被访问的每一所述测试服务器根据所述测试任务所反馈的返回数据以得到测试返回数据。测试服务器被访问一次均会向管理服务器反馈一条数据信息,所反馈的数据信息也即是该测试服务器中所存储的缓存数据,由于被多次 访问的测试服务器根据测试任务所反馈的数据信息均相同,因此可将测试服务器所反馈的任意一条数据信息作为该测试服务器的返回数据,通过上述方法获取被访问的每一测试服务器的返回数据即可得到测试返回数据。Obtain the return data of each of the accessed test servers according to the test task to obtain test return data. Once the test server is accessed, a piece of data information will be fed back to the management server. The data information that is fed back is also the cached data stored in the test server. Because the test server that has been accessed multiple times will return a piece of data information according to the test task. The same, therefore, any piece of data information fed back by the test server can be used as the return data of the test server, and the test return data can be obtained by obtaining the return data of each test server accessed by the above method.
S130、根据所述批量测试日志判断每一台所述测试服务器是否均被访问以得到访问判断结果。S130: Determine whether each test server is accessed according to the batch test log to obtain an access determination result.
根据所述批量测试日志判断每一台测试服务器是否均被访问以得到访问判断结果。批量测试日志中包括执行每一次测试任务对应测试服务器的访问地址信息及访问时间信息,因此根据批量测试日志中所包含的信息可判断每一台测试服务器是否均被访问,即可最终得到访问判断结果。According to the batch test log, it is determined whether each test server is accessed to obtain the access determination result. The batch test log includes the access address information and access time information of the test server corresponding to the execution of each test task. Therefore, according to the information contained in the batch test log, it can be judged whether each test server has been accessed, and the access judgment can be finally obtained result.
在一实施例中,如图5所示,步骤S130包括子步骤S131和S132。In an embodiment, as shown in FIG. 5, step S130 includes sub-steps S131 and S132.
S131、获取所述批量测试日志中所包含的访问地址信息。S131. Obtain access address information contained in the batch test log.
获取所述批量测试日志中所包含的访问地址信息。例如,获取表2所示批量测试日志中所包含的网络地址信息为30.5.160.215、30.5.160.214。Obtain the access address information contained in the batch test log. For example, obtain the network address information contained in the batch test log shown in Table 2 as 30.5.160.215 and 30.5.160.214.
S132、对所述访问地址信息是否包含所有所述测试服务器的地址信息进行判断以得到访问判断结果。S132: Determine whether the access address information includes all address information of the test server to obtain an access determination result.
对所述访问地址信息是否包含所有所述测试服务器的地址信息进行判断以得到访问判断结果。集群服务器中每一台测试服务器对应用于一个地址信息,该地址信息即可以用于对测试服务器进行标识,通过对访问地址信息是否包含所有测试服务器的地址信息进行判断,即可得到访问判断结果。It is judged whether the access address information includes all the address information of the test server to obtain an access judgment result. Each test server in the cluster server corresponds to an address information, which can be used to identify the test server. By judging whether the access address information includes the address information of all test servers, the access judgment result can be obtained .
例如,测试服务器A的地址信息为30.5.160.215,测试服务器B的地址信息为30.5.160.214,则所述访问地址信息包含所有测试服务器的地址信息,访问判断结果为每一台测试服务器均被访问。For example, if the address information of test server A is 30.5.160.215 and the address information of test server B is 30.5.160.214, the access address information includes the address information of all test servers, and the access judgment result is that each test server is accessed .
若访问判断结果不是每一台测试服务器均被访问,则表明测试任务中的执行次数偏低,可生成执行次数偏低的报警提示信息并发送至管理服务器。If the access judgment result is not that every test server has been accessed, it indicates that the number of executions in the test task is low, and an alarm message with a low number of executions can be generated and sent to the management server.
S140、若所述访问判断结果为每一台所述测试服务器均被访问,对所述刷新数据库中的最新刷新数据是否与所述测试返回数据相匹配的进行判断以得到测试是否通过的测试结果。S140. If the access judgment result is that each of the test servers is accessed, judge whether the latest refresh data in the refresh database matches the test return data to obtain a test result of whether the test passes .
若访问判断结果为每一台所述测试服务器均被访问,则表明集群服务器中每一台测试服务器均反馈了的返回数据,可对所述刷新数据库中的最新刷新数据是否与所述测试返回数据相匹配的进行判断以得到测试是否通过的测试结果,并将所得到的测试结果反馈至用户。刷新数据库中所存储的刷新数据包括任务 数据名称、数据识别码、新旧识别信息等。数据识别码即是对刷新数据库中所存储的每一条刷新数据进行识别的编码信息,新旧识别信息即是用于对该刷新数据的新旧进行标识的信息。If the access judgment result is that each of the test servers has been accessed, it indicates that each test server in the cluster server has fed back the return data, and it can be checked whether the latest refresh data in the refresh database is the same as the test return. If the data matches, a judgment is made to obtain a test result of whether the test passes, and the obtained test result is fed back to the user. The refresh data stored in the refresh database includes task data name, data identification code, new and old identification information, etc. The data identification code is the coding information that identifies each piece of refresh data stored in the refresh database, and the new and old identification information is the information used to identify the new and old of the refresh data.
例如,所述刷新数据库中所存储的刷新数据如表3所示。For example, the refresh data stored in the refresh database is shown in Table 3.
任务数据名称Task data name 数据识别码Data identification code 新旧识别信息New and old identification information
targettarget f9b4648d-XXXXXXXf9b4648d-XXXXXXX 11
targettarget f305ae76-XXXXXXXf305ae76-XXXXXXX 00
表3table 3
在一实施例中,如图6所示,步骤S140包括子步骤S141和S142。In an embodiment, as shown in FIG. 6, step S140 includes sub-steps S141 and S142.
S141、将所述刷新数据库中与所述缓存刷新任务对应的刷新数据确定为最新刷新数据。S141. Determine the refresh data corresponding to the cache refresh task in the refresh database as the latest refresh data.
将所述刷新数据库中与所述缓存刷新任务对应的刷新数据确定为最新刷新数据。具体的,通过缓存刷新任务中的任务名称即可获取刷新数据库中与该缓存刷新任务对应的一条或多条刷新数据,通过刷新数据库中的新旧识别信息即可确定与所述缓存刷新任务对应的最新刷新数据,在刷新数据库中新旧识别信息为“0”,则表明该条刷新数据为旧数据;新旧识别信息为“1”,则表明该条刷新数据为新数据。刷新数据库中与某一个缓存刷新任务对应的一条或多条刷新数据有且仅有一条刷新数据的新旧识别信息为“1”。The refresh data corresponding to the cache refresh task in the refresh database is determined to be the latest refresh data. Specifically, one or more pieces of refresh data corresponding to the cache refresh task in the refresh database can be obtained by the task name in the cache refresh task, and the new and old identification information in the database can be refreshed to determine the one corresponding to the cache refresh task. The latest refresh data. In the refresh database, the new and old identification information is "0", which indicates that the refreshed data is old data; the new and old identification information is "1", it indicates that the refreshed data is new data. One or more pieces of refresh data corresponding to a certain cache refresh task in the refresh database have and only one piece of refresh data has new and old identification information of "1".
其中,与该缓存刷新任务对应的刷新数据可能为一条或多条,若与所述缓存刷新任务对应的刷新数据为一条,将所述刷新数据作为与所述缓存刷新任务对应的最新刷新数据;若与所述缓存刷新任务对应的刷新数据为多条,根据所述刷新数据的新旧识别信息获取一条与所述缓存刷新任务对应的最新刷新数据。若与该缓存刷新任务对应的刷新数据为一条,则直接获取该刷新数据作为与所述缓存刷新任务对应的最新刷新数据;若与该缓存刷新任务对应的刷新数据为多条,则可通过刷新数据库中的新旧识别信息获取一条与所述缓存刷新任务对应的最新刷新数据。Wherein, the refresh data corresponding to the cache refresh task may be one or more pieces, and if the refresh data corresponding to the cache refresh task is one piece, the refresh data is taken as the latest refresh data corresponding to the cache refresh task; If there are multiple pieces of refresh data corresponding to the cache refresh task, one piece of the latest refresh data corresponding to the cache refresh task is acquired according to the new and old identification information of the refresh data. If there is one refresh data corresponding to the cache refresh task, the refresh data is directly obtained as the latest refresh data corresponding to the cache refresh task; if there are multiple refresh data corresponding to the cache refresh task, the refresh data can be refreshed The new and old identification information in the database acquires a piece of latest refresh data corresponding to the cache refresh task.
S142、对所述测试返回数据中每一测试服务器的返回数据是否均与所述最新刷新数据匹配进行判断以得到测试是否通过的测试结果。S142: Determine whether the returned data of each test server in the test return data matches the latest refresh data to obtain a test result of whether the test passes.
对测试返回数据中每一测试台服务器的返回数据是否均与所述最新刷新数据匹配进行判断,以得到测试是否通过的测试结果。为确保集群服务器中每一台测试服务器的缓存数据均完成刷新且所刷新的缓存数据为最新刷新数据,需 对每一台测试服务器的返回数据是否与最新刷新数据匹配进行判断,若每一台测试服务器的返回数据均与最新数据相匹配,则得到的测试结果为测试通过,否则得到的测试结果为不通过。得到测试结果后,用户即可通过管理服务器察看测试结果。It is judged whether the returned data of each test bench server in the test return data matches the latest refreshed data, so as to obtain the test result of whether the test passes. In order to ensure that the cache data of each test server in the cluster server is refreshed and the cached data refreshed is the latest refreshed data, it is necessary to judge whether the returned data of each test server matches the latest refreshed data. If the data returned by the test server matches the latest data, the test result obtained is the test passed, otherwise the test result obtained is not passed. After getting the test result, the user can view the test result through the management server.
通过执行缓存刷新任务以对测试服务器中的缓存数据进行刷新,并通过批量执行测试任务获取批量测试日志及测试返回数据,若通过批量测试日志判断得到每一台测试服务器均被访问,则对测试返回数据是否与刷新数据库匹配进行判断以得到测试结果。通过上述服务器测试方法可实现全覆盖测试,避免测试结果出现偏差,在实际应用过程中取得了良好的技术效果。The cache refresh task is executed to refresh the cache data in the test server, and the batch test log and test return data are obtained by executing the test task in batches. If the batch test log determines that each test server is accessed, the test Whether the returned data matches the refreshed database is judged to obtain the test result. Through the above-mentioned server testing method, full coverage testing can be achieved, avoiding deviations in test results, and achieving good technical effects in the actual application process.
本申请实施例还提供一种服务器测试装置,该服务器测试装置用于执行前述服务器测试方法的任一实施例。具体地,请参阅图7,图7是本申请实施例提供的服务器测试装置的示意性框图。该服务器测试装置可以配置于管理服务器10中。The embodiment of the present application also provides a server testing device, which is used to execute any embodiment of the foregoing server testing method. Specifically, please refer to FIG. 7. FIG. 7 is a schematic block diagram of a server testing apparatus provided in an embodiment of the present application. The server testing device can be configured in the management server 10.
如图7所示,服务器测试装置100包括缓存数据刷新单元110、测试任务执行单元120、访问判断单元130和测试结果获取单元140。As shown in FIG. 7, the server test apparatus 100 includes a cache data refresh unit 110, a test task execution unit 120, an access judgment unit 130, and a test result acquisition unit 140.
缓存数据刷新单元110,用于若接收到用户所输入的缓存刷新任务,根据所述缓存刷新任务及预设的刷新数据库对每一台测试服务器中的缓存数据进行刷新。The cache data refresh unit 110 is configured to, if a cache refresh task input by a user is received, refresh the cache data in each test server according to the cache refresh task and a preset refresh database.
其他申请实施例中,如图8所示,所述缓存数据刷新单元110包括子单元:任务状态判断单元111、第一缓存数据刷新单元112和第二缓存数据刷新单元113。In other application embodiments, as shown in FIG. 8, the cache data refresh unit 110 includes sub-units: a task status judgment unit 111, a first cache data refresh unit 112 and a second cache data refresh unit 113.
任务状态判断单元111,用于判断所述缓存刷新任务的任务状态是否为空闲;第一缓存数据刷新单元112,用于若所述缓存刷新任务的任务状态为空闲,在每一台测试服务器中依次执行所述缓存刷新任务,以获取所述刷新数据库中的刷新数据对所有所述测试服务器中的缓存数据进行刷新;第二缓存数据刷新单元113,用于若所述缓存刷新任务的任务状态不是空闲,获取所述缓存刷新任务的休眠时间,休眠时间结束后在每一台测试服务器中依次执行所述缓存刷新任务以获取所述刷新数据库中的刷新数据对所有所述测试服务器中的缓存数据进行刷新。The task status judgment unit 111 is used to judge whether the task status of the cache refresh task is idle; the first cache data refresh unit 112 is used to determine whether the task status of the cache refresh task is idle, in each test server The cache refresh task is executed in sequence to obtain the refresh data in the refresh database to refresh the cache data in all the test servers; the second cache data refresh unit 113 is configured to determine the task status of the cache refresh task If it is not idle, get the sleep time of the cache refresh task. After the sleep time is over, execute the cache refresh task in each test server to obtain the refresh data in the refresh database. The data is refreshed.
测试任务执行单元120,用于若检测到所述缓存刷新任务执行完毕,批量执行预设的测试任务以对所有所述测试服务器进行随机访问并获取测试任务执行结果。The test task execution unit 120 is configured to execute preset test tasks in batches to perform random access to all the test servers and obtain test task execution results if it is detected that the cache refresh task has been executed.
其他申请实施例中,如图9所示,所述测试任务执行单元120包括子单元:批量测试日志获取单元121和测试返回数据获取单元122。In other application embodiments, as shown in FIG. 9, the test task execution unit 120 includes sub-units: a batch test log acquisition unit 121 and a test return data acquisition unit 122.
批量测试日志获取单元121,用于对所述测试任务批量执行的过程进行监控以得到批量测试日志;测试返回数据获取单元122,用于获取被访问的每一所述测试服务器根据所述测试任务所反馈的返回数据以得到测试返回数据。The batch test log obtaining unit 121 is used to monitor the process of the batch execution of the test tasks to obtain the batch test log; the test return data obtaining unit 122 is used to obtain each of the accessed test servers according to the test task The returned data is fed back to obtain the test return data.
访问判断单元130,用于根据所述批量测试日志判断每一台所述测试服务器是否均被访问以得到访问判断结果。The access judgment unit 130 is configured to judge whether each of the test servers is accessed according to the batch test log to obtain the access judgment result.
其他申请实施例中,如图10所示,所述访问判断单元130包括子单元:访问地址信息获取单元131和访问判断结果获取单元132。In other application embodiments, as shown in FIG. 10, the access judgment unit 130 includes subunits: an access address information acquisition unit 131 and an access judgment result acquisition unit 132.
访问地址信息获取单元131,用于获取所述批量测试日志中所包含的访问地址信息;访问判断结果获取单元132,用于对所述访问地址信息是否包含所有所述测试服务器的地址信息进行判断以得到访问判断结果。The access address information obtaining unit 131 is used to obtain the access address information contained in the batch test log; the access judgment result obtaining unit 132 is used to judge whether the access address information includes all the address information of the test server To get the result of the visit.
测试结果获取单元140,用于若所述访问判断结果为每一台所述测试服务器均被访问,对所述刷新数据库中的最新刷新数据是否与所述测试返回数据相匹配的进行判断以得到测试是否通过的测试结果。The test result obtaining unit 140 is configured to determine whether the latest refresh data in the refresh database matches the test return data if the access judgment result is that each of the test servers is accessed to obtain The test result of whether the test passed.
其他申请实施例中,如图11所示,所述测试结果获取单元140包括子单元:最新刷新数据获取单元141和测试判断单元142。In other application embodiments, as shown in FIG. 11, the test result obtaining unit 140 includes sub-units: a latest refresh data obtaining unit 141 and a test judgment unit 142.
最新刷新数据获取单元141,用于将所述刷新数据库中与所述缓存刷新任务对应的刷新数据确定为最新刷新数据;测试判断单元142,用于对所述测试返回数据中每一测试服务器的返回数据是否均与所述最新刷新数据匹配进行判断以得到测试是否通过的测试结果。The latest refresh data acquisition unit 141 is configured to determine the refresh data corresponding to the cache refresh task in the refresh database as the latest refresh data; the test judgment unit 142 is configured to return data from each test server in the test Whether the returned data all match the latest refreshed data is judged to obtain the test result of whether the test passes.
通过执行缓存刷新任务以对测试服务器中的缓存数据进行刷新,并通过批量执行测试任务获取批量测试日志及测试返回数据,若通过批量测试日志判断得到每一台测试服务器均被访问,则对测试返回数据是否与刷新数据库匹配进行判断以得到测试结果。通过上述服务器测试方法可实现全覆盖测试,避免测试结果出现偏差,在实际应用过程中取得了良好的技术效果。The cache refresh task is executed to refresh the cache data in the test server, and the batch test log and test return data are obtained by executing the test task in batches. If the batch test log determines that each test server is accessed, the test Whether the returned data matches the refreshed database is judged to obtain the test result. Through the above-mentioned server testing method, full coverage testing can be achieved, avoiding deviations in test results, and achieving good technical effects in the actual application process.
上述服务器测试装置可以实现为计算机程序的形式,该计算机程序可以在如图12所示的计算机设备上运行。The above-mentioned server testing device can be implemented in the form of a computer program, and the computer program can be run on a computer device as shown in FIG. 12.
请参阅图12,图12是本申请实施例提供的计算机设备的示意性框图。Please refer to FIG. 12, which is a schematic block diagram of a computer device according to an embodiment of the present application.
参阅图12,该计算机设备500包括通过系统总线501连接的处理器502、存储器和网络接口505,其中,存储器可以包括非易失性存储介质503和内存储 器504。Referring to FIG. 12, the computer device 500 includes a processor 502, a memory, and a network interface 505 connected through a system bus 501, where the memory may include a non-volatile storage medium 503 and an internal memory 504.
该非易失性存储介质503可存储操作系统5031和计算机程序5032。该计算机程序5032被执行时,可使得处理器502执行服务器测试方法。该处理器502用于提供计算和控制能力,支撑整个计算机设备500的运行。该内存储器504为非易失性存储介质503中的计算机程序5032的运行提供环境,该计算机程序5032被处理器502执行时,可使得处理器502执行服务器测试方法。该网络接口505用于进行网络通信,如提供数据信息的传输等。本领域技术人员可以理解,图12中示出的结构,仅仅是与本申请方案相关的部分结构的框图,并不构成对本申请方案所应用于其上的计算机设备500的限定,具体的计算机设备500可以包括比图中所示更多或更少的部件,或者组合某些部件,或者具有不同的部件布置。The non-volatile storage medium 503 can store an operating system 5031 and a computer program 5032. When the computer program 5032 is executed, the processor 502 can execute the server test method. The processor 502 is used to provide calculation and control capabilities, and support the operation of the entire computer device 500. The internal memory 504 provides an environment for the operation of the computer program 5032 in the non-volatile storage medium 503. When the computer program 5032 is executed by the processor 502, the processor 502 can execute the server test method. The network interface 505 is used for network communication, such as providing data information transmission. Those skilled in the art can understand that the structure shown in FIG. 12 is only a block diagram of part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device 500 to which the solution of the present application is applied. The specific computer device 500 may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
其中,所述处理器502用于运行存储在存储器中的计算机程序5032,以实现本申请实施例的服务器测试方法。Wherein, the processor 502 is configured to run a computer program 5032 stored in a memory, so as to implement the server testing method of the embodiment of the present application.
本领域技术人员可以理解,图12中示出的计算机设备的实施例并不构成对计算机设备具体构成的限定,在其他实施例中,计算机设备可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。例如,在一些实施例中,计算机设备可以仅包括存储器及处理器,在这样的实施例中,存储器及处理器的结构及功能与图12所示实施例一致,在此不再赘述。Those skilled in the art can understand that the embodiment of the computer device shown in FIG. 12 does not constitute a limitation on the specific configuration of the computer device. In other embodiments, the computer device may include more or less components than those shown in the figure. Or combine certain components, or different component arrangements. For example, in some embodiments, the computer device may only include a memory and a processor. In such an embodiment, the structures and functions of the memory and the processor are consistent with the embodiment shown in FIG. 12, and will not be repeated here.
应当理解,在本申请实施例中,处理器502可以是中央处理单元(Central Processing Unit,CPU),该处理器502还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。其中,通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。It should be understood that, in this embodiment of the application, the processor 502 may be a central processing unit (Central Processing Unit, CPU), and the processor 502 may also be other general-purpose processors, digital signal processors (Digital Signal Processors, DSPs), Application Specific Integrated Circuit (ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. Among them, the general-purpose processor may be a microprocessor or the processor may also be any conventional processor.
在本申请的另一实施例中提供计算机可读存储介质。该计算机可读存储介质可以为非易失性的计算机可读存储介质。该计算机可读存储介质存储有计算机程序,其中计算机程序被处理器执行时实现本申请实施例的服务器测试方法。In another embodiment of the present application, a computer-readable storage medium is provided. The computer-readable storage medium may be a non-volatile computer-readable storage medium. The computer-readable storage medium stores a computer program, where the computer program is executed by a processor to implement the server testing method of the embodiment of the present application.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本申请实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the solutions of the embodiments of the present application.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以是两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, the functional units in the various embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or software functional unit.
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分,或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个计算机可读存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。所述计算机可读存储介质为实体的、非瞬时性的存储介质,所述计算机可读存储介质可以是前述设备的内部存储单元,例如设备的硬盘或内存等实体存储介质。所述存储介质也可以是所述设备的外部存储设备,例如所述设备上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等实体存储介质。If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application is essentially or the part that contributes to the existing technology, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a computer. The read storage medium includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The computer-readable storage medium is a tangible, non-transitory storage medium, and the computer-readable storage medium may be an internal storage unit of the aforementioned device, such as a physical storage medium such as a hard disk or a memory of the device. The storage medium may also be an external storage device of the device, for example, a plug-in hard disk equipped on the device, a smart memory card (Smart Media Card, SMC), a Secure Digital (SD) card, a flash memory card (Flash Card) and other physical storage media.
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以权利要求的保护范围为准。The above are only specific implementations of this application, but the protection scope of this application is not limited to this. Anyone familiar with the technical field can easily think of various equivalents within the technical scope disclosed in this application. Modifications or replacements, these modifications or replacements shall be covered within the protection scope of this application. Therefore, the protection scope of this application shall be subject to the protection scope of the claims.

Claims (20)

  1. 一种服务器测试方法,包括:A server testing method, including:
    若接收到用户所输入的缓存刷新任务,根据所述缓存刷新任务及预设的刷新数据库对每一台测试服务器中的缓存数据进行刷新;If the cache refresh task input by the user is received, refresh the cache data in each test server according to the cache refresh task and the preset refresh database;
    若检测到所述缓存刷新任务执行完毕,批量执行预设的测试任务以对所有所述测试服务器进行随机访问并获取测试任务执行结果,其中,所述测试任务执行结果包括批量测试日志及测试返回数据;If it is detected that the execution of the cache refresh task is completed, the preset test tasks are executed in batches to perform random access to all the test servers and obtain test task execution results, where the test task execution results include batch test logs and test returns data;
    根据所述批量测试日志判断每一台所述测试服务器是否均被访问以得到访问判断结果;Judging whether each of the test servers is accessed according to the batch test log to obtain an access judgment result;
    若所述访问判断结果为每一台所述测试服务器均被访问,对所述刷新数据库中的最新刷新数据是否与所述测试返回数据相匹配的进行判断以得到测试是否通过的测试结果。If the access judgment result is that each test server is accessed, it is judged whether the latest refresh data in the refresh database matches the test return data to obtain a test result of whether the test passes.
  2. 根据权利要求1所述的服务器测试方法,其中,所述根据所述缓存刷新任务及预设的刷新数据库对每一台测试服务器中的缓存数据进行刷新,包括:The server testing method according to claim 1, wherein the refreshing the cache data in each test server according to the cache refresh task and a preset refresh database comprises:
    判断所述缓存刷新任务的任务状态是否为空闲;Judging whether the task status of the cache refreshing task is idle;
    若所述缓存刷新任务的任务状态为空闲,在每一台测试服务器中依次执行所述缓存刷新任务,以获取所述刷新数据库中的刷新数据对所有所述测试服务器中的缓存数据进行刷新;If the task status of the cache refresh task is idle, execute the cache refresh task sequentially in each test server to obtain the refresh data in the refresh database and refresh the cache data in all the test servers;
    若所述缓存刷新任务的任务状态不是空闲,获取所述缓存刷新任务的休眠时间,休眠时间结束后在每一台测试服务器中依次执行所述缓存刷新任务以获取所述刷新数据库中的刷新数据对所有所述测试服务器中的缓存数据进行刷新。If the task status of the cache refresh task is not idle, obtain the sleep time of the cache refresh task, and after the sleep time expires, execute the cache refresh task in sequence on each test server to obtain the refresh data in the refresh database Refresh the cached data in all the test servers.
  3. 根据权利要求1所述的服务器测试方法,其中,所述批量执行预设的测试任务以对所有所述测试服务器进行随机访问并获取测试任务执行结果,包括:The server testing method according to claim 1, wherein the batch execution of preset test tasks to perform random access to all the test servers and obtain test task execution results includes:
    对所述测试任务批量执行的过程进行监控以得到批量测试日志;Monitoring the batch execution process of the test tasks to obtain batch test logs;
    获取被访问的每一所述测试服务器根据所述测试任务所反馈的返回数据以得到测试返回数据。Obtain the return data of each of the accessed test servers according to the test task to obtain test return data.
  4. 根据权利要求1所述的服务器测试方法,其中,所述根据所述批量测试日志判断每一台所述测试服务器是否均被访问以得到访问判断结果,包括:The server testing method according to claim 1, wherein the judging whether each of the test servers is accessed to obtain the access judgment result according to the batch test log comprises:
    获取所述批量测试日志中所包含的访问地址信息;Acquiring access address information contained in the batch test log;
    对所述访问地址信息是否包含所有所述测试服务器的地址信息进行判断以得到访问判断结果。It is judged whether the access address information includes all the address information of the test server to obtain an access judgment result.
  5. 根据权利要求2所述的服务器测试方法,其中,所述对所述刷新数据库中的最新刷新数据是否与所述测试返回数据相匹配的进行判断以得到测试是否通过的测试结果,包括:The server testing method according to claim 2, wherein the determining whether the latest refresh data in the refresh database matches the test return data to obtain a test result of whether the test passes or not includes:
    将所述刷新数据库中与所述缓存刷新任务对应的刷新数据确定为最新刷新数据;Determining the refresh data corresponding to the cache refresh task in the refresh database as the latest refresh data;
    对所述测试返回数据中每一测试服务器的返回数据是否均与所述最新刷新数据匹配进行判断以得到测试是否通过的测试结果。It is judged whether the returned data of each test server in the test return data matches the latest refresh data to obtain a test result of whether the test passes.
  6. 根据权利要求5所述的服务器测试方法,其中,所述刷新数据包括新旧识别信息,所述将所述刷新数据库中与所述缓存刷新任务对应的刷新数据确定为最新刷新数据,包括:The server testing method according to claim 5, wherein the refresh data includes new and old identification information, and the determining the refresh data corresponding to the cache refresh task in the refresh database as the latest refresh data comprises:
    若与所述缓存刷新任务对应的刷新数据为一条,将所述刷新数据作为与所述缓存刷新任务对应的最新刷新数据;If the refresh data corresponding to the cache refresh task is one piece, use the refresh data as the latest refresh data corresponding to the cache refresh task;
    若与所述缓存刷新任务对应的刷新数据为多条,根据所述刷新数据的新旧识别信息获取一条与所述缓存刷新任务对应的最新刷新数据。If there are multiple pieces of refresh data corresponding to the cache refresh task, one piece of the latest refresh data corresponding to the cache refresh task is acquired according to the new and old identification information of the refresh data.
  7. 根据权利要求2所述的服务器测试方法,其中,所述在每一台测试服务器中依次执行所述缓存刷新任务,以获取所述刷新数据库中的刷新数据对所有所述测试服务器中的缓存数据进行刷新,包括:The server testing method according to claim 2, wherein the cache refresh task is executed sequentially in each test server to obtain the refresh data in the refresh database and the cache data in all the test servers Refresh, including:
    将所述缓存刷新任务的任务名称与所述刷新数据库中刷新数据的任务数据名称进行匹配;Matching the task name of the cache refresh task with the task data name of the refresh data in the refresh database;
    若所述刷新数据的任务数据名称与所述任务名称相匹配,将所述刷新数据输入执行所述缓存刷新任务的测试服务器中,以对所述测试服务器中的缓存数据进行刷新。If the task data name of the refresh data matches the task name, the refresh data is input into the test server that executes the cache refresh task to refresh the cache data in the test server.
  8. 一种服务器测试装置,包括:A server testing device, including:
    缓存数据刷新单元,用于若接收到用户所输入的缓存刷新任务,根据所述缓存刷新任务及预设的刷新数据库对每一台测试服务器中的缓存数据进行刷新;The cache data refresh unit is configured to refresh the cache data in each test server according to the cache refresh task and the preset refresh database if the cache refresh task input by the user is received;
    测试任务执行单元,用于若检测到所述缓存刷新任务执行完毕,批量执行预设的测试任务以对所有所述测试服务器进行随机访问并获取测试任务执行结果,其中,所述测试任务执行结果包括批量测试日志及测试返回数据;The test task execution unit is configured to execute preset test tasks in batches to perform random access to all the test servers and obtain test task execution results if it is detected that the cache refresh task has been executed, wherein the test task execution results Including batch test log and test return data;
    访问判断单元,用于根据所述批量测试日志判断每一台所述测试服务器是 否均被访问以得到访问判断结果;The access judgment unit is configured to judge whether each of the test servers is accessed according to the batch test log to obtain the access judgment result;
    测试结果获取单元,用于若所述访问判断结果为每一台所述测试服务器均被访问,对所述刷新数据库中的最新刷新数据是否与所述测试返回数据相匹配的进行判断以得到测试是否通过的测试结果。The test result obtaining unit is configured to determine whether the latest refresh data in the refresh database matches the test return data if the access judgment result is that each of the test servers is accessed to obtain a test The result of the test passed.
  9. 根据权利要求8所述的服务器测试装置,其中,所述缓存数据刷新单元,包括:The server testing device according to claim 8, wherein the cache data refreshing unit comprises:
    任务状态判断单元,用于判断所述缓存刷新任务的任务状态是否为空闲;The task status judgment unit is used to judge whether the task status of the cache refresh task is idle;
    第一缓存数据刷新单元,用于若所述缓存刷新任务的任务状态为空闲,在每一台测试服务器中依次执行所述缓存刷新任务,以获取所述刷新数据库中的刷新数据对所有所述测试服务器中的缓存数据进行刷新;The first cache data refresh unit is configured to, if the task status of the cache refresh task is idle, execute the cache refresh task in turn on each test server to obtain the refresh data in the refresh database for all the Refresh the cached data in the test server;
    第二缓存数据刷新单元,用于若所述缓存刷新任务的任务状态不是空闲,获取所述缓存刷新任务的休眠时间,休眠时间结束后在每一台测试服务器中依次执行所述缓存刷新任务以获取所述刷新数据库中的刷新数据对所有所述测试服务器中的缓存数据进行刷新。The second cache data refreshing unit is configured to obtain the sleep time of the cache refresh task if the task status of the cache refresh task is not idle, and execute the cache refresh task in sequence in each test server after the sleep time ends. Obtain refresh data in the refresh database to refresh all cache data in the test server.
  10. 根据权利要求8所述的服务器测试装置,其中,所述测试任务执行单元,包括:8. The server testing device according to claim 8, wherein the test task execution unit comprises:
    批量测试日志获取单元,用于对所述测试任务批量执行的过程进行监控以得到批量测试日志;The batch test log obtaining unit is used to monitor the batch execution process of the test tasks to obtain batch test logs;
    测试返回数据获取单元,用于获取被访问的每一所述测试服务器根据所述测试任务所反馈的返回数据以得到测试返回数据。The test return data acquisition unit is configured to acquire the return data fed back by each of the accessed test servers according to the test task to obtain test return data.
  11. 一种计算机设备,包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机程序,其中,所述处理器执行所述计算机程序时实现以下步骤:A computer device includes a memory, a processor, and a computer program stored on the memory and capable of running on the processor, wherein the processor implements the following steps when the processor executes the computer program:
    若接收到用户所输入的缓存刷新任务,根据所述缓存刷新任务及预设的刷新数据库对每一台测试服务器中的缓存数据进行刷新;If the cache refresh task input by the user is received, refresh the cache data in each test server according to the cache refresh task and the preset refresh database;
    若检测到所述缓存刷新任务执行完毕,批量执行预设的测试任务以对所有所述测试服务器进行随机访问并获取测试任务执行结果,其中,所述测试任务执行结果包括批量测试日志及测试返回数据;If it is detected that the execution of the cache refresh task is completed, the preset test tasks are executed in batches to perform random access to all the test servers and obtain test task execution results, where the test task execution results include batch test logs and test returns data;
    根据所述批量测试日志判断每一台所述测试服务器是否均被访问以得到访问判断结果;Judging whether each of the test servers is accessed according to the batch test log to obtain an access judgment result;
    若所述访问判断结果为每一台所述测试服务器均被访问,对所述刷新数据 库中的最新刷新数据是否与所述测试返回数据相匹配的进行判断以得到测试是否通过的测试结果。If the access judgment result is that every test server is accessed, it is judged whether the latest refresh data in the refresh database matches the test return data to obtain a test result of whether the test passes.
  12. 根据权利要求11所述的计算机设备,其中,所述根据所述缓存刷新任务及预设的刷新数据库对每一台测试服务器中的缓存数据进行刷新,包括:The computer device according to claim 11, wherein the refreshing the cache data in each test server according to the cache refresh task and a preset refresh database comprises:
    判断所述缓存刷新任务的任务状态是否为空闲;Judging whether the task status of the cache refreshing task is idle;
    若所述缓存刷新任务的任务状态为空闲,在每一台测试服务器中依次执行所述缓存刷新任务,以获取所述刷新数据库中的刷新数据对所有所述测试服务器中的缓存数据进行刷新;If the task status of the cache refresh task is idle, execute the cache refresh task sequentially in each test server to obtain the refresh data in the refresh database and refresh the cache data in all the test servers;
    若所述缓存刷新任务的任务状态不是空闲,获取所述缓存刷新任务的休眠时间,休眠时间结束后在每一台测试服务器中依次执行所述缓存刷新任务以获取所述刷新数据库中的刷新数据对所有所述测试服务器中的缓存数据进行刷新。If the task status of the cache refresh task is not idle, obtain the sleep time of the cache refresh task, and after the sleep time expires, execute the cache refresh task in sequence on each test server to obtain the refresh data in the refresh database Refresh the cached data in all the test servers.
  13. 根据权利要求11所述的计算机设备,其中,所述批量执行预设的测试任务以对所有所述测试服务器进行随机访问并获取测试任务执行结果,包括:11. The computer device according to claim 11, wherein the batch execution of preset test tasks to perform random access to all the test servers and obtain test task execution results comprises:
    对所述测试任务批量执行的过程进行监控以得到批量测试日志;Monitoring the batch execution process of the test tasks to obtain batch test logs;
    获取被访问的每一所述测试服务器根据所述测试任务所反馈的返回数据以得到测试返回数据。Obtain the return data of each of the accessed test servers according to the test task to obtain test return data.
  14. 根据权利要求11所述的计算机设备,其中,所述根据所述批量测试日志判断每一台所述测试服务器是否均被访问以得到访问判断结果,包括:11. The computer device according to claim 11, wherein the judging whether each of the test servers is accessed to obtain the access judgment result according to the batch test log comprises:
    获取所述批量测试日志中所包含的访问地址信息;Acquiring access address information contained in the batch test log;
    对所述访问地址信息是否包含所有所述测试服务器的地址信息进行判断以得到访问判断结果。It is judged whether the access address information includes all the address information of the test server to obtain an access judgment result.
  15. 根据权利要求12所述的计算机设备,其中,所述对所述刷新数据库中的最新刷新数据是否与所述测试返回数据相匹配的进行判断以得到测试是否通过的测试结果,包括:11. The computer device according to claim 12, wherein the determining whether the latest refresh data in the refresh database matches the test return data to obtain a test result of whether the test passes or not comprises:
    将所述刷新数据库中与所述缓存刷新任务对应的刷新数据确定为最新刷新数据;Determining the refresh data corresponding to the cache refresh task in the refresh database as the latest refresh data;
    对所述测试返回数据中每一测试服务器的返回数据是否均与所述最新刷新数据匹配进行判断以得到测试是否通过的测试结果。It is judged whether the returned data of each test server in the test return data matches the latest refresh data to obtain a test result of whether the test passes.
  16. 根据权利要求15所述的计算机设备,其中,所述刷新数据包括新旧识别信息,所述将所述刷新数据库中与所述缓存刷新任务对应的刷新数据确定为最新刷新数据,包括:The computer device according to claim 15, wherein the refresh data includes new and old identification information, and the determining the refresh data corresponding to the cache refresh task in the refresh database as the latest refresh data comprises:
    若与所述缓存刷新任务对应的刷新数据为一条,将所述刷新数据作为与所述缓存刷新任务对应的最新刷新数据;If the refresh data corresponding to the cache refresh task is one piece, use the refresh data as the latest refresh data corresponding to the cache refresh task;
    若与所述缓存刷新任务对应的刷新数据为多条,根据所述刷新数据的新旧识别信息获取一条与所述缓存刷新任务对应的最新刷新数据。If there are multiple pieces of refresh data corresponding to the cache refresh task, one piece of the latest refresh data corresponding to the cache refresh task is acquired according to the new and old identification information of the refresh data.
  17. 根据权利要求12所述的服务器测试方法,其中,所述在每一台测试服务器中依次执行所述缓存刷新任务,以获取所述刷新数据库中的刷新数据对所有所述测试服务器中的缓存数据进行刷新,包括:The server testing method according to claim 12, wherein the cache refresh task is executed sequentially in each test server to obtain the refresh data in the refresh database and the cache data in all the test servers Refresh, including:
    将所述缓存刷新任务的任务名称与所述刷新数据库中刷新数据的任务数据名称进行匹配;Matching the task name of the cache refresh task with the task data name of the refresh data in the refresh database;
    若所述刷新数据的任务数据名称与所述任务名称相匹配,将所述刷新数据输入执行所述缓存刷新任务的测试服务器中,以对所述测试服务器中的缓存数据进行刷新。If the task data name of the refresh data matches the task name, the refresh data is input into the test server that executes the cache refresh task to refresh the cache data in the test server.
  18. 一种计算机可读存储介质,其中,所述计算机可读存储介质存储有计算机程序,所述计算机程序当被处理器执行时使所述处理器执行以下操作:A computer-readable storage medium, wherein the computer-readable storage medium stores a computer program that, when executed by a processor, causes the processor to perform the following operations:
    若接收到用户所输入的缓存刷新任务,根据所述缓存刷新任务及预设的刷新数据库对每一台测试服务器中的缓存数据进行刷新;If the cache refresh task input by the user is received, refresh the cache data in each test server according to the cache refresh task and the preset refresh database;
    若检测到所述缓存刷新任务执行完毕,批量执行预设的测试任务以对所有所述测试服务器进行随机访问并获取测试任务执行结果,其中,所述测试任务执行结果包括批量测试日志及测试返回数据;If it is detected that the execution of the cache refresh task is completed, the preset test tasks are executed in batches to perform random access to all the test servers and obtain test task execution results, where the test task execution results include batch test logs and test returns data;
    根据所述批量测试日志判断每一台所述测试服务器是否均被访问以得到访问判断结果;Judging whether each of the test servers is accessed according to the batch test log to obtain an access judgment result;
    若所述访问判断结果为每一台所述测试服务器均被访问,对所述刷新数据库中的最新刷新数据是否与所述测试返回数据相匹配的进行判断以得到测试是否通过的测试结果。If the access judgment result is that each test server is accessed, it is judged whether the latest refresh data in the refresh database matches the test return data to obtain a test result of whether the test passes.
  19. 根据权利要求18所述的计算机可读存储介质,其中,所述根据所述缓存刷新任务及预设的刷新数据库对每一台测试服务器中的缓存数据进行刷新,包括:18. The computer-readable storage medium according to claim 18, wherein said refreshing the cache data in each test server according to the cache refresh task and a preset refresh database comprises:
    判断所述缓存刷新任务的任务状态是否为空闲;Judging whether the task status of the cache refreshing task is idle;
    若所述缓存刷新任务的任务状态为空闲,在每一台测试服务器中依次执行所述缓存刷新任务,以获取所述刷新数据库中的刷新数据对所有所述测试服务器中的缓存数据进行刷新;If the task status of the cache refresh task is idle, execute the cache refresh task sequentially in each test server to obtain the refresh data in the refresh database and refresh the cache data in all the test servers;
    若所述缓存刷新任务的任务状态不是空闲,获取所述缓存刷新任务的休眠时间,休眠时间结束后在每一台测试服务器中依次执行所述缓存刷新任务以获取所述刷新数据库中的刷新数据对所有所述测试服务器中的缓存数据进行刷新。If the task status of the cache refresh task is not idle, obtain the sleep time of the cache refresh task, and after the sleep time expires, execute the cache refresh task in sequence on each test server to obtain the refresh data in the refresh database Refresh the cached data in all the test servers.
  20. 根据权利要求18所述的计算机可读存储介质,其中,所述批量执行预设的测试任务以对所有所述测试服务器进行随机访问并获取测试任务执行结果,包括:18. The computer-readable storage medium according to claim 18, wherein the batch execution of preset test tasks to perform random access to all the test servers and obtain test task execution results includes:
    对所述测试任务批量执行的过程进行监控以得到批量测试日志;Monitoring the batch execution process of the test tasks to obtain batch test logs;
    获取被访问的每一所述测试服务器根据所述测试任务所反馈的返回数据以得到测试返回数据。Obtain the return data of each of the accessed test servers according to the test task to obtain test return data.
PCT/CN2019/117751 2019-03-06 2019-11-13 Method and device for server testing, computer equipment, and storage medium WO2020177381A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910168070.0 2019-03-06
CN201910168070.0A CN110032486B (en) 2019-03-06 2019-03-06 Server testing method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
WO2020177381A1 true WO2020177381A1 (en) 2020-09-10

Family

ID=67235072

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/117751 WO2020177381A1 (en) 2019-03-06 2019-11-13 Method and device for server testing, computer equipment, and storage medium

Country Status (2)

Country Link
CN (1) CN110032486B (en)
WO (1) WO2020177381A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110032486B (en) * 2019-03-06 2022-08-09 平安科技(深圳)有限公司 Server testing method and device, computer equipment and storage medium
CN110430082B (en) * 2019-08-15 2021-06-15 浙江万朋教育科技股份有限公司 Method for managing test server and application program

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106294033A (en) * 2015-05-13 2017-01-04 阿里巴巴集团控股有限公司 The method of testing of a kind of many machine rooms cache synchronization function and device
CN107302475A (en) * 2017-07-06 2017-10-27 郑州云海信息技术有限公司 The method of testing and device of a kind of Based on Distributed storage cluster
CN109361540A (en) * 2018-10-19 2019-02-19 郑州云海信息技术有限公司 A kind of test method and relevant apparatus for simplifying function certainly
CN110032486A (en) * 2019-03-06 2019-07-19 平安科技(深圳)有限公司 Server test method, device, computer equipment and storage medium

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2012060995A2 (en) * 2010-11-01 2012-05-10 Michael Luna Distributed caching in a wireless network of content delivered for a mobile application over a long-held request
US8788239B2 (en) * 2011-02-11 2014-07-22 Fisher-Rosemount Systems, Inc. Methods, apparatus and articles of manufacture to test batch configurations
CN103970661A (en) * 2014-05-19 2014-08-06 浪潮电子信息产业股份有限公司 Method for batched server memory fault detection through IPMI tool
CN104123238A (en) * 2014-06-30 2014-10-29 海视云(北京)科技有限公司 Data storage method and device
CN105630812A (en) * 2014-10-30 2016-06-01 阿里巴巴集团控股有限公司 Refreshing method and device of cluster application cache
CN105335265A (en) * 2015-12-10 2016-02-17 浪潮电子信息产业股份有限公司 LINUX platform-based BMC upgrading and downgrading automatic testing method
CN105955876B (en) * 2016-05-13 2020-08-14 腾讯科技(深圳)有限公司 Data monitoring processing method and device
CN106445754A (en) * 2016-09-13 2017-02-22 郑州云海信息技术有限公司 Method and system for inspecting cluster health status and cluster server
CN108874659B (en) * 2018-04-19 2023-03-28 北京嘉楠捷思信息技术有限公司 Test method, test system and server of digital currency computing equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106294033A (en) * 2015-05-13 2017-01-04 阿里巴巴集团控股有限公司 The method of testing of a kind of many machine rooms cache synchronization function and device
CN107302475A (en) * 2017-07-06 2017-10-27 郑州云海信息技术有限公司 The method of testing and device of a kind of Based on Distributed storage cluster
CN109361540A (en) * 2018-10-19 2019-02-19 郑州云海信息技术有限公司 A kind of test method and relevant apparatus for simplifying function certainly
CN110032486A (en) * 2019-03-06 2019-07-19 平安科技(深圳)有限公司 Server test method, device, computer equipment and storage medium

Also Published As

Publication number Publication date
CN110032486A (en) 2019-07-19
CN110032486B (en) 2022-08-09

Similar Documents

Publication Publication Date Title
US8086838B2 (en) Methods and systems for providing manufacturing mode detection and functionality in a UEFI BIOS
CN109885786B (en) Data caching processing method and device, electronic equipment and readable storage medium
CN111221743A (en) Automatic testing method and system
JP7405773B2 (en) How to verify access to level 2 cache on a multi-core interconnect
US11422916B2 (en) Usage amount monitoring method and monitoring unit of electronic control unit for vehicle
CN109218407B (en) Code management and control method based on log monitoring technology and terminal equipment
CN107633016A (en) Data processing method and device and electronic equipment
WO2020177381A1 (en) Method and device for server testing, computer equipment, and storage medium
CN109995612B (en) Service inspection method and device and electronic equipment
WO2020037753A1 (en) Log printing method and system, server
US20100218043A1 (en) System and method for testing a serial attached small computer system interface
US12001315B2 (en) Provisioning and debugging system in a cloud environment
CN110958161A (en) Block link point monitoring method and device
WO2017172051A1 (en) Method and apparatus to coordinate and authenticate requests for data
CN110995851A (en) Message processing method, device, storage medium and equipment
CN112835885B (en) Processing method, device and system for distributed form storage
CN110430070B (en) Service state analysis method, device, server, data analysis equipment and medium
WO2019169771A1 (en) Electronic device, access instruction information acquisition method and storage medium
CN109302433A (en) Detection method, device, equipment and the storage medium of remote command execution loophole
WO2015067171A1 (en) Debug debug method and apparatus
US8718978B2 (en) Performance logging framework
CN117131545A (en) Data processing method and device, storage medium and terminal
CN115599668A (en) Interface test case generation method and device and electronic equipment
CN114785677A (en) Log management method, apparatus, computer device, storage medium, and program product
CN106844188A (en) A kind of test agent method, device and test system

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19918050

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19918050

Country of ref document: EP

Kind code of ref document: A1