CN110032486B - Server testing method and device, computer equipment and storage medium - Google Patents

Server testing method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN110032486B
CN110032486B CN201910168070.0A CN201910168070A CN110032486B CN 110032486 B CN110032486 B CN 110032486B CN 201910168070 A CN201910168070 A CN 201910168070A CN 110032486 B CN110032486 B CN 110032486B
Authority
CN
China
Prior art keywords
test
refreshing
task
data
cache
Prior art date
Legal status (The legal status 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 status listed.)
Active
Application number
CN201910168070.0A
Other languages
Chinese (zh)
Other versions
CN110032486A (en
Inventor
吴启
张慧
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
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 Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201910168070.0A priority Critical patent/CN110032486B/en
Publication of CN110032486A publication Critical patent/CN110032486A/en
Priority to PCT/CN2019/117751 priority patent/WO2020177381A1/en
Application granted granted Critical
Publication of CN110032486B publication Critical patent/CN110032486B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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

Abstract

The invention discloses a server testing method, a server testing device, computer equipment and a storage medium. The method comprises the following steps: if a cache refreshing task input by a user is received, refreshing the cache data in each test server according to the cache refreshing task and a preset refreshing database; if the cache refreshing task is detected to be completely executed, executing preset test tasks in batch to randomly access all test servers and acquiring test task execution results; judging whether each test server is accessed according to the batch test logs to obtain an access judgment result; and if the access judgment result is that each test server is accessed, judging whether the latest refreshing data in the refreshing database is matched with the test return data to obtain a test result. The invention is based on the system integration test technology, can realize full coverage test, avoids the deviation of the test result and obtains good technical effect in the practical application process.

Description

Server testing method and device, computer equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a server testing method and apparatus, a computer device, and a storage medium.
Background
In the process of executing the deployment task on the plurality of test servers included in the cluster server, the cache data in the plurality of test servers are refreshed. Because the update of the data in the cluster server is missed due to the untimely cache refreshing in one or more test servers, in order to ensure the timely update of the data in the cluster server, the cache refreshing test needs to be carried out on the cluster server, a plurality of test servers in the cluster server need to be randomly accessed in the test process, and the traditional test method cannot completely cover all the test servers contained in the cluster server, so that the test result has deviation. Therefore, the existing test method has the problem of inaccurate test results.
Disclosure of Invention
The embodiment of the invention provides a server testing method, a server testing device, computer equipment and a storage medium, and aims to solve the problem that a testing result is inaccurate in the prior art.
In a first aspect, an embodiment of the present invention provides a server testing method, which includes:
if a cache refreshing task input by a user is received, refreshing the cache data in each test server according to the cache refreshing task and a preset refreshing database;
if the cache refreshing task is detected to be completely executed, executing preset test tasks in batches to randomly access all the test servers and obtain test task execution results, wherein the test task execution results comprise batch test logs and test return data;
judging whether each test server is accessed according to the batch test logs to obtain an access judgment result;
and if the access judgment result indicates that each test server is accessed, judging whether the latest refreshing data in the refreshing database is matched with the test return data so as to obtain a test result of whether the test is passed.
In a second aspect, an embodiment of the present invention provides a server testing apparatus, which includes:
the cache data refreshing unit is used for refreshing the cache data in each test server according to the cache refreshing task and a preset refreshing database if the cache refreshing task input by a user is received;
the test task execution unit is used for executing preset test tasks in batches to randomly access all the test servers and obtain test task execution results if the cache refreshing task is detected to be executed completely, wherein the test task execution results comprise batch test logs and test return data;
the access judging unit is used for judging whether each test server is accessed according to the batch test logs to obtain an access judging result;
and the test result acquisition unit is used for judging whether the latest refreshing data in the refreshing database is matched with the test return data or not if the access judgment result indicates that each test server is accessed so as to obtain a test result of whether the test is passed or not.
In a third aspect, an embodiment of the present invention further provides a computer device, which includes a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the computer program, the server testing method according to the first aspect is implemented.
In a fourth aspect, the present invention further provides a computer-readable storage medium, where the computer-readable storage medium stores a computer program, and the computer program, when executed by a processor, causes the processor to execute the server testing method according to the first aspect.
The embodiment of the invention provides a server testing method, a server testing device, computer equipment and a storage medium. The method comprises the steps of refreshing cache data in a test server by executing a cache refreshing task, obtaining batch test logs and test return data by executing the test tasks in batch, and judging whether the test return data is matched with a refreshing database or not to obtain a test result if each test server is judged to be accessed through the batch test logs. The server testing method can realize full coverage testing, avoids deviation of testing results, and achieves good technical effect in the practical application process.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a schematic flowchart of a server testing method according to an embodiment of the present invention;
fig. 2 is a schematic view of an application scenario of a server testing method according to an embodiment of the present invention;
fig. 3 is a schematic sub-flow chart of a server testing method according to an embodiment of the present invention;
FIG. 4 is a schematic view of another sub-flow of a server testing method according to an embodiment of the present invention;
FIG. 5 is a schematic view of another sub-flow of a server testing method according to an embodiment of the present invention;
FIG. 6 is a schematic view of another sub-flow of a server testing method according to an embodiment of the present invention;
FIG. 7 is a schematic block diagram of a server testing device provided by an embodiment of the present invention;
FIG. 8 is a schematic block diagram of a sub-unit of a server testing apparatus according to an embodiment of the present invention;
FIG. 9 is a schematic block diagram of another sub-unit of a server testing apparatus according to an embodiment of the present invention;
FIG. 10 is a schematic block diagram of another sub-unit of a server testing apparatus according to an embodiment of the present invention;
FIG. 11 is a schematic block diagram of another sub-unit of a server testing apparatus according to an embodiment of the present invention;
FIG. 12 is a schematic block diagram of a computer device provided by an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
It is also to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the specification of the present invention and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should be further understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
Referring to fig. 1-2, fig. 1 is a schematic flowchart of a server testing method according to an embodiment of the present invention, and fig. 2 is a schematic application scenario diagram of the server testing method according to the embodiment of the present invention. The server testing method is applied to the management server 10, the method is executed through application software installed in the management server 10, a plurality of testing servers 20 form a cluster server and are connected with the management server 10 through a network, and therefore data information transmission between the plurality of testing servers 20 and the management server 10 is achieved. The management server 10 is an enterprise terminal for executing a server test method to manage and test the test server 20, and the test server 20 is a server side to be tested.
As shown in fig. 1, the method includes steps S110 to S140.
And S110, if a cache refreshing task input by a user is received, refreshing the cache data in each test server according to the cache refreshing task and a preset refreshing database.
And if a cache refreshing task input by a user is received, refreshing the cache data in each test server according to the cache refreshing task and a preset refreshing database. The user (the user of the management server) refreshes the cache data in each test server connected with the management server by inputting the cache refreshing task. Specifically, the cluster server includes a plurality of test servers, the management server is connected to each test server in the cluster server through a network to transmit data information, each test server includes a storage medium (RAM) for storing cache data, a cache refresh task is task information for being executed in the server to refresh the cache data in the test server, a preset refresh database is a database for performing data interaction with the test servers, and a plurality of pieces of refresh data are stored in the refresh database. The cache refreshing task comprises information such as a task name, a task state and dormancy time, refreshing data stored in a refreshing database comprises a task data name, a data identification code, new and old identification information and the like, and the task name is in one-to-one correspondence with the task data name in the corresponding refreshing data.
For example, a certain cache flush task is shown in table 1.
Task name Task state Sleep time
target Free up 60 seconds
TABLE 1
In an embodiment, as shown in fig. 3, step S110 includes sub-steps S111, S112 and S113.
And S111, judging whether the task state of the cache refreshing task is idle or not.
And judging whether the task state of the cache refreshing task is idle or not. Specifically, the task state is information for identifying the state of the cache refresh task, and if the task state is idle, it indicates that the cache refresh task is not executed by the test server at this time; if the task state is not idle, the task is executed by a certain test server at the moment, and other test servers cannot execute the cache refreshing task at the moment.
And S112, if the task state of the cache refreshing task is idle, sequentially executing the cache refreshing task in each test server to obtain the refreshing data in the refreshing database to refresh the cache data in all the test servers.
And if the task state of the cache refreshing task is idle, indicating that the cache refreshing task is not executed by the test server, sequentially executing the cache refreshing task in each test server to obtain refreshing data corresponding to the cache refreshing task in a preset refreshing database, and refreshing the cache data in the test server. Specifically, by obtaining the task name in the cache refreshing task and matching the task name with the task data name of the refreshing data in the refreshing database, the refreshing data corresponding to the cache refreshing task can be obtained and input into the test server executing the cache refreshing task, so as to refresh the cache data in the corresponding test server.
S113, if the task state of the cache refreshing task is not idle, acquiring the sleep time of the cache refreshing task, and after the sleep time is over, sequentially executing the cache refreshing task in each test server to acquire the refreshing data in the refreshing database to refresh the cache data in all the test servers.
If the task state of the cache refreshing task is not idle, acquiring the sleep time in the cache refreshing task, and after the sleep time is finished, sequentially executing the cache refreshing task in each test server to refresh the cache data in the test server. Specifically, the sleep time is time information for waiting for the cache refreshing task to be executed in other test servers, and after the sleep time is over, the cache refreshing task is executed in other test servers, so that the cache refreshing task can be sequentially executed in each of the remaining test servers, and the cache data of each test server can be refreshed.
The sleep time may be preset by a user (user of the management server), for example, the sleep time of the cache refresh task in table 1 is set to 60 seconds.
And S120, if the cache refreshing task is detected to be completely executed, executing preset test tasks in batch to randomly access all the test servers and obtain test task execution results.
If the cache refreshing task is detected to be completed, that is, the cache data of each test server is refreshed, executing a preset test task in the management server in batch to obtain a test task execution result, wherein the specific test task execution result includes a batch test log and test return data, the batch test log is log information used for recording the batch execution process of the test task, and the test return data includes return data fed back by each test server according to the test task, that is, the test return data includes multiple pieces of return data.
The test task is task information used for testing the cache data refreshed in the test server, and the test task includes execution times, which is time information used for executing the test task in batch. Because the access to each test server in the cluster server is random when the test tasks are executed in the management server, the test tasks need to be executed in batch to realize full coverage access to all the test servers in the cluster server.
For example, the execution time may be set to 100 times, and the test task is executed 100 times in the management server to perform 100 random accesses to all the test servers.
In an embodiment, as shown in fig. 4, step S120 includes substeps S121 and S122.
S121, monitoring the batch execution process of the test tasks to obtain a batch test log.
And monitoring the batch execution process of the test tasks to obtain a batch test log. The method comprises the steps of monitoring the process of executing a test task each time to obtain a batch test log containing test information each time, wherein the process of executing the test task each time is to randomly access one test server in a cluster server, and the process of accessing the test server is to call an interface to obtain return data returned by the corresponding test server. The batch test log comprises access address information and access time information of the test server accessed in each test task execution process, the access address information and the access time corresponding to the accessed test server are added in the batch test log every time the test task is executed, and if a certain test server is accessed for multiple times, the access address information corresponding to the test server in the batch test log correspondingly comprises multiple access times.
For example, a certain batch test log is shown in table 2.
Accessing address information Time of access
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
TABLE 2
And S122, obtaining the returned data fed back by each accessed test server according to the test task to obtain test returned data.
And obtaining the returned data fed back by each accessed test server according to the test task to obtain the test returned data. The test server can feed back a piece of data information to the management server once being accessed, the fed back data information is the cache data stored in the test server, and the test servers accessed for many times are identical in data information fed back according to the test tasks, so that any piece of data information fed back by the test server can be used as the return data of the test server, and the return data of each accessed test server can be obtained through the method, so that the test return data can be obtained.
S130, judging whether each test server is accessed according to the batch test logs to obtain an access judgment result.
And judging whether each test server is accessed according to the batch test logs to obtain an access judgment result. The batch test logs comprise access address information and access time information of the test servers corresponding to each test task, so that whether each test server is accessed can be judged according to the information contained in the batch test logs, and finally an access judgment result can be obtained.
In one embodiment, as shown in fig. 5, step S130 includes sub-steps S131 and S132.
S131, obtaining access address information contained in the batch test logs.
And obtaining access address information contained in the batch test log. For example, the network address information included in the batch test log shown in table 2 is obtained as 30.5.160.215 and 30.5.160.214.
S132, judging whether the access address information contains the address information of all the test servers to obtain an access judgment result.
And judging whether the access address information contains the address information of all the test servers to obtain an access judgment result. Each test server in the cluster server is correspondingly applied to one address information, the address information can be used for identifying the test server, and an access judgment result can be obtained by judging whether the access address information contains the address information of all the test servers.
For example, if the address information of the test server a is 30.5.160.215 and the address information of the test server B is 30.5.160.214, the access address information includes the address information of all the test servers, and the access determination result indicates that each test server is accessed.
If the access judgment result is that each test server is not accessed, the fact that the execution times in the test task are low is indicated, and alarm prompt information with low execution times can be generated and sent to the management server.
And S140, if the access judgment result indicates that each test server is accessed, judging whether the latest refreshing data in the refreshing database is matched with the test return data to obtain a test result indicating whether the test is passed.
If the access judgment result indicates that each test server is accessed, the returned data fed back by each test server in the cluster server is indicated, whether the latest refreshing data in the refreshing database is matched with the test returned data or not can be judged to obtain a test result whether the test is passed or not, and the obtained test result is fed back to the user. The refresh data stored in the refresh database includes a task data name, a data identification code, new and old identification information, and the like. The data identification code is encoding information for identifying each piece of refresh data stored in the refresh database, and the old and new identification information is information for identifying the old and new of the refresh data.
For example, the refresh data stored in the refresh database is shown in table 3.
Task data name Data identification code Old and new identification information
target f9b4648d-XXXXXXX 1
target f305ae76-XXXXXXX 0
TABLE 3
In an embodiment, as shown in fig. 6, step S140 includes sub-steps S141 and S142.
S141, determining the refresh data corresponding to the cache refresh task in the refresh database as the latest refresh data.
And determining the refresh data corresponding to the cache refresh task in the refresh database as 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, the latest refresh data corresponding to the cache refresh task can be determined by refreshing the new and old identification information in the database, and if the new and old identification information in the refresh database is '0', the refresh data is indicated to be old data; if the new and old identification information is "1", it indicates that the piece of refresh data is new data. One or more pieces of refresh data corresponding to a certain cache refresh task in the refresh database have new and old identification information of only one piece of refresh data, which is '1'.
The number of the refresh data corresponding to the cache refresh task may be one or more, and if the number of the refresh data corresponding to the cache refresh task is one, the refresh data is directly acquired as the latest refresh data corresponding to the cache refresh task; if the number of the refresh data corresponding to the cache refresh task is multiple, a piece of latest refresh data corresponding to the cache refresh task can be obtained through the old and new identification information in the refresh database.
S142, judging whether the returned data of each test server in the test returned data are matched with the latest refreshed data so as to obtain a test result whether the test is passed.
And judging whether the returned data of each test platform server in the test returned data are matched with the latest refreshed data or not so as to obtain a test result of whether the test is passed or not. In order to ensure that the cache data of each test server in the cluster server is refreshed and the refreshed cache data is the latest refreshed data, whether the returned data of each test server is matched with the latest refreshed data or not needs to be judged, if the returned data of each test server is matched with the latest data, the obtained test result is that the test is passed, otherwise, the obtained test result is that the test is not passed. After the test result is obtained, the user can view the test result through the management server.
The method comprises the steps of refreshing cache data in a test server by executing a cache refreshing task, obtaining batch test logs and test return data by executing the test tasks in batch, and judging whether the test return data is matched with a refreshing database or not to obtain a test result if each test server is judged to be accessed through the batch test logs. The server testing method can realize full coverage testing, avoids deviation of testing results, and achieves good technical effect in the practical application process.
The embodiment of the invention also provides a server testing device, which is used for executing any embodiment of the server testing method. Specifically, referring to fig. 7, fig. 7 is a schematic block diagram of a server testing apparatus according to an embodiment of the present invention. The server test apparatus may be disposed in the management server 10.
As shown in fig. 7, the server test apparatus 100 includes a cache data refreshing unit 110, a test task performing unit 120, an access judging unit 130, and a test result acquiring unit 140.
And the cache data refreshing unit 110 is configured to, if a cache refreshing task input by a user is received, refresh the cache data in each test server according to the cache refreshing task and a preset refreshing database.
And if a cache refreshing task input by a user is received, refreshing the cache data in each test server according to the cache refreshing task and a preset refreshing database. The user (the user of the management server) refreshes the cache data in each test server connected with the management server by inputting the cache refreshing task. Specifically, the cluster server includes a plurality of test servers, the management server is connected to each test server in the cluster server through a network to transmit data information, each test server includes a storage medium (RAM) for storing cache data, a cache refresh task is task information for being executed in the server to refresh the cache data in the test server, a preset refresh database is a database for performing data interaction with the test servers, and a plurality of pieces of refresh data are stored in the refresh database. The cache refreshing task comprises information such as a task name, a task state and dormancy time, refreshing data stored in a refreshing database comprises a task data name, a data identification code, new and old identification information and the like, and the task name is in one-to-one correspondence with the task data name in the corresponding refreshing data.
In other embodiments of the present invention, as shown in fig. 8, the cache data refreshing unit 110 includes a sub-unit: a task state judgment unit 111, a first buffer data refresh unit 112, and a second buffer data refresh unit 113.
And a task state determining unit 111, configured to determine whether a task state of the cache refresh task is idle.
And judging whether the task state of the cache refreshing task is idle or not. Specifically, the task state is information for identifying the state of the cache refresh task, and if the task state is idle, it indicates that the cache refresh task is not executed by the test server at this time; if the task state is not idle, the task is executed by a certain test server at the moment, and other test servers cannot execute the cache refreshing task at the moment.
A first cache data refreshing unit 112, configured to, if the task state of the cache refreshing task is idle, sequentially execute the cache refreshing task 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 state of the cache refreshing task is idle, the cache refreshing task is not executed by the test server, and the cache refreshing task is sequentially executed in each test server to obtain refreshing data corresponding to the cache refreshing task in a preset refreshing database and refresh the cache data in the test server. Specifically, by obtaining the task name in the cache refreshing task and matching the task name with the task data name of the refreshing data in the refreshing database, the refreshing data corresponding to the cache refreshing task can be obtained and input into the test server executing the cache refreshing task, so as to refresh the cache data in the corresponding test server.
And a second cache data refreshing unit 113, configured to, if the task state of the cache refreshing task is not idle, obtain sleep time of the cache refreshing task, and after the sleep time is over, sequentially execute the cache refreshing task in each test server to obtain the refresh data in the refresh database, so as to refresh the cache data in all the test servers.
If the task state of the cache refreshing task is not idle, acquiring the sleep time in the cache refreshing task, and after the sleep time is finished, sequentially executing the cache refreshing task in each test server to refresh the cache data in the test server. Specifically, the sleep time is time information for waiting for the cache refreshing task to be executed in other test servers, and after the sleep time is over, the cache refreshing task is executed in other test servers, so that the cache refreshing task can be sequentially executed in each of the remaining test servers, and the cache data of each test server can be refreshed.
And the test task execution unit 120 is configured to execute preset test tasks in batch to perform random access on all the test servers and obtain a test task execution result if it is detected that the cache refresh task is executed completely.
If the cache refreshing task is detected to be completed, that is, the cache data of each test server is refreshed, executing a preset test task in the management server in batch to obtain a test task execution result, wherein the specific test task execution result includes a batch test log and test return data, the batch test log is log information used for recording the batch execution process of the test task, and the test return data includes return data fed back by each test server according to the test task, that is, the test return data includes multiple pieces of return data.
The test task is task information used for testing the cache data refreshed in the test server, and the test task includes execution times, which is time information used for executing the test task in batch. Because the access to each test server in the cluster server is random when the test tasks are executed in the management server, the test tasks need to be executed in batch to realize full coverage access to all the test servers in the cluster server.
In other embodiments of the present invention, as shown in fig. 9, the test task execution unit 120 includes sub-units: a batch test log obtaining unit 121 and a test return data obtaining unit 122.
A batch test log obtaining unit 121, configured to monitor a process of batch execution of the test tasks to obtain a batch test log.
And monitoring the batch execution process of the test tasks to obtain a batch test log. The method comprises the steps of monitoring the process of executing a test task each time to obtain a batch test log containing test information each time, wherein the process of executing the test task each time is to randomly access one test server in a cluster server, and the process of accessing the test server is to call an interface to obtain return data returned by the corresponding test server. The batch test log comprises access address information and access time information of the test server accessed in each test task execution process, the access address information and the access time corresponding to the accessed test server are added in the batch test log every time the test task is executed, and if a certain test server is accessed for multiple times, the access address information corresponding to the test server in the batch test log correspondingly comprises multiple access times.
And the test return data acquiring unit 122 is configured to acquire return data fed back by each accessed test server according to the test task to obtain test return data.
And obtaining the returned data fed back by each accessed test server according to the test task to obtain the test returned data. The test server can feed back a piece of data information to the management server once being accessed, the fed back data information is the cache data stored in the test server, and the test servers accessed for many times are identical in data information fed back according to the test tasks, so that any piece of data information fed back by the test server can be used as the return data of the test server, and the return data of each accessed test server can be obtained through the method, so that the test return data can be obtained.
And an access determining unit 130, configured to determine, according to the batch test log, whether each of the test servers is accessed to obtain an access determination result.
And judging whether each test server is accessed according to the batch test logs to obtain an access judgment result. The batch test logs comprise access address information and access time information of the test servers corresponding to each test task, so that whether each test server is accessed can be judged according to the information contained in the batch test logs, and finally an access judgment result can be obtained.
In another embodiment of the present invention, as shown in fig. 10, the access determining unit 130 includes sub-units: an access address information acquisition unit 131 and an access determination result acquisition unit 132.
An access address information obtaining unit 131, configured to obtain the access address information included in the batch test log.
And obtaining access address information contained in the batch test log.
An access judgment result obtaining unit 132, configured to judge whether the access address information includes address information of all the test servers to obtain an access judgment result.
And judging whether the access address information contains the address information of all the test servers to obtain an access judgment result. Each test server in the cluster server is correspondingly applied to one address information, the address information can be used for identifying the test server, and an access judgment result can be obtained by judging whether the access address information contains the address information of all the test servers.
If the access judgment result is that each test server is not accessed, the fact that the execution times in the test task are low is indicated, and alarm prompt information with low execution times can be generated and sent to the management server.
A test result obtaining unit 140, configured to, if the access determination result indicates that each test server is accessed, determine whether the latest refresh data in the refresh database matches the test return data to obtain a test result indicating whether the test is passed.
If the access judgment result indicates that each test server is accessed, the returned data fed back by each test server in the cluster server is indicated, whether the latest refreshing data in the refreshing database is matched with the test returned data or not can be judged to obtain a test result whether the test is passed or not, and the obtained test result is fed back to the user. The refresh data stored in the refresh database includes a task data name, a data identification code, new and old identification information, and the like. The data identification code is coding information for identifying each piece of refresh data stored in the refresh database, and the old-new identification information is information for identifying the old-new of the refresh data.
In other embodiments of the present invention, as shown in fig. 11, the test result obtaining unit 140 includes sub-units: a latest refresh data acquisition unit 141 and a test judgment unit 142.
And a latest refresh data obtaining unit 141, configured to determine the refresh data in the refresh database corresponding to the cache refresh task as the latest refresh data.
And determining the refresh data corresponding to the cache refresh task in the refresh database as 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, the latest refresh data corresponding to the cache refresh task can be determined by refreshing the new and old identification information in the database, and if the new and old identification information in the refresh database is '0', the refresh data is indicated to be old data; if the new and old identification information is "1", it indicates that the piece of refresh data is new data. One or more pieces of refresh data corresponding to a certain cache refresh task in the refresh database have new and old identification information of only one piece of refresh data, which is '1'.
The number of the refresh data corresponding to the cache refresh task may be one or more, and if the number of the refresh data corresponding to the cache refresh task is one, the refresh data is directly acquired as the latest refresh data corresponding to the cache refresh task; if the number of the refresh data corresponding to the cache refresh task is multiple, a piece of latest refresh data corresponding to the cache refresh task can be obtained through the old and new identification information in the refresh database.
And a test judgment unit 142, configured to judge whether the return data of each test server in the test return data matches the latest refresh data to obtain a test result indicating whether the test is passed.
And judging whether the returned data of each test platform server in the test returned data are matched with the latest refreshed data or not so as to obtain a test result of whether the test is passed or not. In order to ensure that the cache data of each test server in the cluster server is refreshed and the refreshed cache data is the latest refreshed data, whether the returned data of each test server is matched with the latest refreshed data or not needs to be judged, if the returned data of each test server is matched with the latest data, the obtained test result is that the test is passed, otherwise, the obtained test result is that the test is not passed. After the test result is obtained, the user can view the test result through the management server.
The method comprises the steps of refreshing cache data in a test server by executing a cache refreshing task, obtaining batch test logs and test return data by executing the test tasks in batch, and judging whether the test return data is matched with a refreshing database or not to obtain a test result if each test server is judged to be accessed through the batch test logs. The server testing method can realize full coverage testing, avoids deviation of testing results, and achieves good technical effect in the practical application process.
The above-described server test apparatus may be implemented in the form of a computer program which may be run on a computer device as shown in fig. 12.
Referring to fig. 12, fig. 12 is a schematic block diagram of a computer device according to an embodiment of the present invention.
Referring to fig. 12, the computer device 500 includes a processor 502, memory, and a network interface 505 connected by 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 may store an operating system 5031 and a computer program 5032. The computer program 5032, when executed, may cause the processor 502 to perform a server test method.
The processor 502 is used to provide computing and control capabilities that support the operation of the overall 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, and when the computer program 5032 is executed by the processor 502, the processor 502 can be enabled to execute the server test method.
The network interface 505 is used for network communication, such as providing transmission of data information. Those skilled in the art will appreciate that the configuration shown in fig. 12 is a block diagram of only a portion of the configuration associated with aspects of the present invention and is not intended to limit the computing device 500 to which aspects of the present invention may be applied, and that a particular computing device 500 may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
Wherein the processor 502 is configured to run the computer program 5032 stored in the memory to implement the following functions: if a cache refreshing task input by a user is received, refreshing the cache data in each test server according to the cache refreshing task and a preset refreshing database; if the cache refreshing task is detected to be completely executed, executing preset test tasks in batches to randomly access all the test servers and obtain test task execution results, wherein the test task execution results comprise batch test logs and test return data; judging whether each test server is accessed according to the batch test logs to obtain an access judgment result; and if the access judgment result indicates that each test server is accessed, judging whether the latest refreshing data in the refreshing database is matched with the test return data so as to obtain a test result of whether the test is passed.
In an embodiment, when the processor 502 executes the step of refreshing the cache data in each test server according to the cache refresh task and the preset refresh database if receiving the cache refresh task input by the user, the following operations are executed: judging whether the task state of the cache refreshing task is idle or not; if the task state of the cache refreshing task is idle, sequentially executing the cache refreshing task in each test server to obtain refreshing data in the refreshing database to refresh the cache data in all the test servers; if the task state of the cache refreshing task is not idle, acquiring the sleep time of the cache refreshing task, and after the sleep time is over, sequentially executing the cache refreshing task in each test server to acquire the refreshing data in the refreshing database to refresh the cache data in all the test servers.
In an embodiment, when the processor 502 executes the steps of executing a preset test task in batch to randomly access all the test servers and obtain the test task execution result if it is detected that the cache refresh task is executed, the following operations are executed: monitoring the batch execution process of the test tasks to obtain batch test logs; and obtaining the returned data fed back by each accessed test server according to the test task to obtain the test returned data.
In an embodiment, when the processor 502 performs the step of determining whether each of the test servers is accessed according to the batch test log to obtain the access determination result, the following operations are performed: obtaining access address information contained in the batch test logs; and judging whether the access address information contains the address information of all the test servers to obtain an access judgment result.
In an embodiment, when executing the step of determining whether the latest refresh data in the refresh database matches the test return data to obtain a test result indicating whether the test is passed or not, if the access determination result indicates that each of the test servers is accessed, the processor 502 performs the following operations: determining the refresh data corresponding to the cache refresh task in the refresh database as the latest refresh data; and judging whether the returned data of each test server in the test returned data are matched with the latest refreshed data so as to obtain a test result of whether the test is passed.
Those skilled in the art will appreciate that the embodiment of a computer device illustrated in fig. 12 does not constitute a limitation on the specific construction of the computer device, and that in other embodiments a computer device may include more or fewer components than those illustrated, or some components may be combined, or a different arrangement of components. For example, in some embodiments, the computer device may only include a memory and a processor, and in such embodiments, the structures and functions of the memory and the processor are consistent with those of the embodiment shown in fig. 12, and are not described herein again.
It should be understood that, in the embodiment of the present invention, the Processor 502 may be a Central Processing Unit (CPU), and the Processor 502 may also be other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, and the like. Wherein a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
In another embodiment of the invention, 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, wherein the computer program when executed by a processor implements the steps of: if a cache refreshing task input by a user is received, refreshing the cache data in each test server according to the cache refreshing task and a preset refreshing database; if the cache refreshing task is detected to be completely executed, executing preset test tasks in batches to randomly access all the test servers and obtain test task execution results, wherein the test task execution results comprise batch test logs and test return data; judging whether each test server is accessed according to the batch test logs to obtain an access judgment result; and if the access judgment result indicates that each test server is accessed, judging whether the latest refreshing data in the refreshing database is matched with the test return data so as to obtain a test result of whether the test is passed.
In an embodiment, the step of refreshing the cache data in each test server according to the cache refresh task and a preset refresh database if the cache refresh task input by the user is received includes: judging whether the task state of the cache refreshing task is idle or not; if the task state of the cache refreshing task is idle, sequentially executing the cache refreshing task in each test server to obtain refreshing data in the refreshing database and refresh the cache data in all the test servers; if the task state of the cache refreshing task is not idle, acquiring the sleep time of the cache refreshing task, and after the sleep time is over, sequentially executing the cache refreshing task in each test server to acquire the refreshing data in the refreshing database to refresh the cache data in all the test servers.
In an embodiment, the step of executing a preset test task in batch to randomly access all the test servers and obtain a test task execution result if it is detected that the execution of the cache refresh task is completed includes: monitoring the batch execution process of the test tasks to obtain batch test logs; and obtaining the returned data fed back by each accessed test server according to the test task to obtain the test returned data.
In an embodiment, the step of determining whether each of the test servers is accessed according to the batch test log to obtain an access determination result includes: obtaining access address information contained in the batch test logs; and judging whether the access address information contains the address information of all the test servers to obtain an access judgment result.
In an embodiment, if the access determination result indicates that each of the test servers is accessed, the step of determining whether the latest refresh data in the refresh database matches the test return data to obtain a test result indicating whether the test is passed includes: determining the refresh data corresponding to the cache refresh task in the refresh database as the latest refresh data; and judging whether the returned data of each test server in the test returned data are matched with the latest refreshed data so as to obtain a test result of whether the test is passed.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described apparatuses, devices and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again. Those of ordinary skill in the art will appreciate that the elements and algorithm steps of the examples described in connection with the embodiments disclosed herein may be embodied in electronic hardware, computer software, or combinations of both, and that the components and steps of the examples have been described in a functional general in the foregoing description for the purpose of illustrating clearly the interchangeability of hardware and software. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present invention.
In the embodiments provided by the present invention, it should be understood that the disclosed apparatus, device and method can be implemented in other ways. For example, the above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only a logical division, and there may be other divisions when the actual implementation is performed, or units having the same function may be grouped into one unit, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may also be an electric, mechanical or other form of connection.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment of the present invention.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention essentially contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product stored in a computer-readable storage medium, which includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned computer-readable storage media comprise: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a magnetic disk, or an optical disk.
While the invention has been described with reference to specific embodiments, the invention is not limited thereto, and various equivalent modifications and substitutions can be easily made by those skilled in the art within the technical scope of the invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (8)

1. A server testing method is characterized by comprising the following steps:
if a cache refreshing task input by a user is received, refreshing the cache data in each test server according to the cache refreshing task and a preset refreshing database;
if the cache refreshing task is detected to be completely executed, executing preset test tasks in batches to randomly access all the test servers and obtain test task execution results, wherein the test task execution results comprise batch test logs and test return data;
judging whether each test server is accessed according to the batch test logs to obtain an access judgment result;
if the access judgment result indicates that each test server is accessed, judging whether the latest refreshing data in the refreshing database is matched with the test return data to obtain a test result of whether the test is passed;
the refreshing the cache data in each test server according to the cache refreshing task and a preset refreshing database comprises the following steps:
judging whether the task state of the cache refreshing task is idle or not;
if the task state of the cache refreshing task is idle, sequentially executing the cache refreshing task in each test server to obtain refreshing data in the refreshing database to refresh the cache data in all the test servers;
if the task state of the cache refreshing task is not idle, acquiring the sleep time of the cache refreshing task, and after the sleep time is over, sequentially executing the cache refreshing task in each test server to acquire the refreshing data in the refreshing database to refresh the cache data in all the test servers.
2. The server test method according to claim 1, wherein the batch execution of the preset test tasks to randomly access all the test servers and obtain the test task execution result comprises:
monitoring the batch execution process of the test tasks to obtain batch test logs;
and obtaining the returned data fed back by each accessed test server according to the test task to obtain the test returned data.
3. The method for testing the server according to claim 1, wherein the determining whether each of the test servers is accessed according to the batch test log to obtain an access determination result comprises:
obtaining access address information contained in the batch test logs;
and judging whether the access address information contains the address information of all the test servers to obtain an access judgment result.
4. The server test method according to claim 1, wherein the determining whether the latest refresh data in the refresh database matches the test return data to obtain a test result indicating whether the test is passed includes:
determining the refreshing data corresponding to the cache refreshing task in the refreshing database as the latest refreshing data;
and judging whether the returned data of each test server in the test returned data are matched with the latest refreshed data so as to obtain a test result of whether the test is passed.
5. A server testing apparatus, comprising:
the cache data refreshing unit is used for refreshing the cache data in each test server according to the cache refreshing task and a preset refreshing database if the cache refreshing task input by a user is received;
the test task execution unit is used for executing preset test tasks in batches to randomly access all the test servers and obtain test task execution results if the cache refreshing task is detected to be executed completely, wherein the test task execution results comprise batch test logs and test return data;
the access judging unit is used for judging whether each test server is accessed according to the batch test logs to obtain an access judging result;
a test result obtaining unit, configured to, if the access determination result indicates that each test server is accessed, determine whether the latest refresh data in the refresh database matches the test return data to obtain a test result indicating whether the test is passed;
the cache data refreshing unit comprises:
the task state judging unit is used for judging whether the task state of the cache refreshing task is idle or not;
the first cache data refreshing unit is used for sequentially executing the cache refreshing tasks in each test server if the task state of the cache refreshing tasks is idle so as to obtain the refreshing data in the refreshing database and refresh the cache data in all the test servers;
and the second cache data refreshing unit is used for acquiring the sleep time of the cache refreshing task if the task state of the cache refreshing task is not idle, and sequentially executing the cache refreshing task in each test server after the sleep time is finished so as to acquire the refreshing data in the refreshing database and refresh the cache data in all the test servers.
6. The server test apparatus according to claim 5, wherein the test task execution unit includes:
the batch test log obtaining unit is used for monitoring the batch execution process of the test tasks to obtain batch test logs;
and the test return data acquisition unit is used for acquiring return data fed back by each accessed test server according to the test task to obtain test return data.
7. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the processor implements the server testing method according to any one of claims 1 to 4 when executing the computer program.
8. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program which, when executed by a processor, causes the processor to carry out the server testing method according to any one of claims 1 to 4.
CN201910168070.0A 2019-03-06 2019-03-06 Server testing method and device, computer equipment and storage medium Active CN110032486B (en)

Priority Applications (2)

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

Applications Claiming Priority (1)

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

Publications (2)

Publication Number Publication Date
CN110032486A CN110032486A (en) 2019-07-19
CN110032486B true CN110032486B (en) 2022-08-09

Family

ID=67235072

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910168070.0A Active CN110032486B (en) 2019-03-06 2019-03-06 Server testing method and device, 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 (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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
CN105335265A (en) * 2015-12-10 2016-02-17 浪潮电子信息产业股份有限公司 Automatic BMC upgrading and downgrading testing method based on LINUX platform
CN105630812A (en) * 2014-10-30 2016-06-01 阿里巴巴集团控股有限公司 Refreshing method and device of cluster application cache
CN105955876A (en) * 2016-05-13 2016-09-21 腾讯科技(深圳)有限公司 Data monitoring processing method and apparatus
CN106445754A (en) * 2016-09-13 2017-02-22 郑州云海信息技术有限公司 Method and system for inspecting cluster health status and cluster server
CN108874659A (en) * 2018-04-19 2018-11-23 杭州嘉楠耘智信息科技有限公司 Test method, test system and server of digital currency computing equipment

Family Cites Families (6)

* 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
CN106294033B (en) * 2015-05-13 2019-06-21 阿里巴巴集团控股有限公司 A kind of test method and device of multimachine room cache synchronization function
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
CN110032486B (en) * 2019-03-06 2022-08-09 平安科技(深圳)有限公司 Server testing method and device, computer equipment and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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 浪潮电子信息产业股份有限公司 Automatic BMC upgrading and downgrading testing method based on LINUX platform
CN105955876A (en) * 2016-05-13 2016-09-21 腾讯科技(深圳)有限公司 Data monitoring processing method and apparatus
CN106445754A (en) * 2016-09-13 2017-02-22 郑州云海信息技术有限公司 Method and system for inspecting cluster health status and cluster server
CN108874659A (en) * 2018-04-19 2018-11-23 杭州嘉楠耘智信息科技有限公司 Test method, test system and server of digital currency computing equipment

Also Published As

Publication number Publication date
CN110032486A (en) 2019-07-19
WO2020177381A1 (en) 2020-09-10

Similar Documents

Publication Publication Date Title
CN110830577B (en) Service request call tracking method and device, computer equipment and storage medium
US9405662B2 (en) Process for displaying test coverage data during code reviews
CN107329894B (en) Application program system testing method and device and electronic equipment
CN109885786B (en) Data caching processing method and device, electronic equipment and readable storage medium
CN109284220B (en) Cluster fault recovery time length estimation method, device, equipment and storage medium
CN110032486B (en) Server testing method and device, computer equipment and storage medium
CN108255620B (en) Service logic processing method, device, service server and system
CN111679968A (en) Interface calling abnormity detection method and device, computer equipment and storage medium
CN111400294A (en) Data anomaly monitoring method, device and system
CN110580220A (en) method for measuring execution time of code segment and terminal equipment
CN114185900A (en) Service data processing method and device, computer equipment and storage medium
CN116562715B (en) Index data monitoring method, device, computer equipment and storage medium
US20200183809A1 (en) Usage amount monitoring method and monitoring unit of electronic control unit for vehicle
US8718978B2 (en) Performance logging framework
CN116701191A (en) Optimization method, device, equipment, storage medium and program product for quantization loop
CN111147441A (en) Method and device for automatically detecting fraud behaviors of online ticket purchasing and readable storage medium
CN116303320A (en) Real-time task management method, device, equipment and medium based on log file
CN107807885B (en) Task information display method and device
US9201771B2 (en) Method for evaluating a production rule for a memory management analysis
CN114490716A (en) Device detection method and device, computer device and storage medium
CN110147379B (en) Information acquisition method and device based on data lock and computer equipment
CN112631905A (en) Execution process data management method and device, computer equipment and storage medium
CN113849133B (en) Processing method and device of privacy data, electronic equipment and storage medium
CN111752786A (en) Data storage method, data summarization method, equipment and medium in pressure test process
CN117573172B (en) Client updating method, device, equipment and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant