Time sequence database testing method and system based on registration center
Through the time-series database testing method and system based on the registration center, the problems of clumsy and inefficiency of traditional database testing methods are solved, and the automated management and real-time monitoring of database server resources are realized, and the testing efficiency and resource utilization are improved.
Patent Information
- Application Number
- CN202411074923.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-07
- Publication Date
- 2024-12-10
AI Technical Summary
Traditional database testing methods are bulky and have poor usability, especially in distributed multi-node testing, which requires manual deployment of nodes and writing a large number of scripts, which is inefficient, and it is difficult to realize automatic overall planning and real-time monitoring of server resources in a time series database.
The time-series database testing method and system based on the registration center is adopted, and the available servers are selected for initialization and resource management through load balancing, database indicators are monitored in real time, and relevant personnel are notified in abnormal situations to achieve automated testing and horizontal expansion of resources.
It simplifies the operation process of testers, improves testing efficiency, reduces communication costs, and enables managers, R&D personnel and testers to intuitively understand the real-time situation of the database server and make full use of server resources.
Smart Images

Figure CN119105956A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of database testing, in particular to a registration center-based time series database testing method and system. Background Art
[0002] A time series database (TSDB) is a type of database that specializes in processing time series data. Since the timeliness of time series data is very important and the value of time series data decreases as the distance from the current time increases, compared with conventional relational databases, time series databases have the characteristics of real-time high concurrency, high throughput, and large data volume. At the same time, historical data is usually read-only and not written, and has a relatively high compression ratio. Moreover, as the scenarios and requirements increase, time series databases are usually required to have good horizontal expansion and distribution capabilities.
[0003] Therefore, it is very important to perform various tests on time series databases. This requires testers to prepare a complete test environment with the following features:
[0004] 1. Simple deployment, support for dynamic horizontal expansion, server plug-and-play, high utilization rate, and support for load balancing;
[0005] 2. Powerful monitoring and real-time alarm capabilities, support simultaneous query of multiple cluster details, relevant management, R&D, and testing personnel can easily query various monitoring indicators of all servers at any time; support regular log migration and backup; have audit functions, when the server / database has an abnormality, it can report to relevant personnel in time, realizing full automation of the test;
[0006] 3. Support various types of database testing, such as unit testing, performance testing, stress testing, distributed testing, data accuracy testing, stability testing, etc.; and support fast switching of the above test types.
[0007] In traditional manual or devops pipeline-based database testing, testers often need to manually deploy services, execute test commands, or orchestrate devops test plans and execute scheduled pipelines to perform tests. The above testing methods are too cumbersome and difficult to use; distributed multi-node testing often requires manual deployment of multiple nodes or writing a large number of additional test scripts, which is inefficient; occasional downtime, abnormal performance fluctuations, or abnormal data errors during testing require testers to follow up 24 / 7 to respond in real time, wasting a lot of manpower.
[0008] The existing registration center mainly refers to the registration center of the microservice cluster. Although the distributed database has the concept of distribution, R&D testers only support the maintenance and follow-up of one cluster per unit time. Therefore, in the time series database test, it is very important to coordinate and plan all server and database resources in a higher dimension or even automatically by the server. Summary of the invention
[0009] In view of the needs and shortcomings of current technological development, the present invention provides a time series database testing method and system based on a registration center, so that database managers, R&D personnel, and testers can intuitively understand the real-time status of each database server, reduce communication costs, and improve labor efficiency.
[0010] In the first aspect, the present invention provides a time series database testing method based on a registration center, and the technical solution adopted to solve the above technical problems is as follows:
[0011] A time series database testing method based on a registration center comprises the following steps:
[0012] S1. The registration center determines the required resources according to the test specifications, selects a server in the "available" state from the resource pool through load balancing, sets the selected server state to "initialize", and performs initialization operations;
[0013] S2. The initialized server starts the database cluster service. The server registers its database information with the registration center. The registration center updates the server status to "running" and pushes the database connection information to the load end to start the test.
[0014] S3. The registration center adds monitoring of database indicators when shaking hands with the server. In case of abnormal situations, the registration center sets the server status to "abnormal" and notifies relevant personnel. Testers and R&D personnel decide whether to suspend or stop the test and resume the test manually.
[0015] S4. After the test is completed, the load end notifies the server through the registration center that the test is over, the selected server stops the database service, and sends an exit completion signal to the registration center.
[0016] Optionally, the registration center can be used to centrally manage the testing services and resource pools;
[0017] Before starting the test, the resource pool configures the server information to the registration center. After receiving the message, the registration center stores the server configuration information, sets the server status to "available", and starts to establish a long connection with the server to detect the server's survival status and real-time information.
[0018] Further optionally, the servers in the resource pool involved include the following six states:
[0019] Available: The database service or load is not started and the system is in an idle state.
[0020] Initialization: Initialize the enabled server in the available state, including configuring the network, configuring related runtime parameters, and downloading the installation package;
[0021] Running: The database or load is running normally;
[0022] Abnormal: The database is down or running abnormally, and manual intervention is required to determine whether to continue the test; or wait for the database to recover to the running state;
[0023] Pause: When the database is abnormal, the state is entered after manual judgment that the test needs to be suspended. When entering this state, the registration center sends a message to the load end to suspend the test; the state is entered directly manually when in the running state, and is used to collect data and reports on the running status;
[0024] Stop: The state after the test is completed or manually switched from the pause state. At this time, the load end and the database stop service and transmit the generated logs and test reports to the log server. After the transmission is completed, the state changes to available.
[0025] Optionally, during the test, when online capacity expansion / reduction is required, the registration center selects a new server from the resource pool and sets its status to "initializing". After the initialized new server joins the database cluster, the status of the new server is updated to "running".
[0026] Optionally, execute step S4. After the selected server sends an exit completion signal to the registration center, the registration center instructs the server to transmit log and report files to the designated log server. After completing the log transmission and environment cleanup, the server status is updated to "available".
[0027] In a second aspect, the present invention provides a time series database testing system based on a registration center, and the technical solution adopted to solve the above technical problems is as follows:
[0028] A time series database testing system based on a registration center, comprising:
[0029] The test preparation module is deployed in the registration center and is used to determine the required resources according to the test specifications, select a server in the "available" state from the resource pool through load balancing, set the selected server state to "initialize", and perform initialization operations;
[0030] The registration startup module is deployed in the resource pool and is used to start the database cluster service and register the information of the database to which the selected and initialized server belongs with the registration center;
[0031] The status change module is deployed in the registration center to update the server status to "running" and push the database connection information to the load end to start the test;
[0032] The indicator monitoring module is deployed in the registration center and is used to add database indicator monitoring when handshaking with the server. When an abnormal situation occurs, the server status is set to "abnormal" and the relevant personnel are notified. The testers and R&D personnel decide whether to suspend or stop the test and resume the test manually.
[0033] The test completion module is deployed in the registration center and is used to receive the server test completion notification sent by the load end after the test is completed, so that the selected server stops the database service and sends an exit completion signal to the registration center.
[0034] Optionally, the involved registration centers centrally manage the test services and resource pools;
[0035] Before starting the test, the resource pool configures the server information to the registration center through the information configuration module. After receiving the message, the registration center stores the server configuration information, calls the test preparation module to set the server status to "available", and starts to establish a long connection with the server to detect the server's survival status and real-time information.
[0036] Further optionally, the servers in the resource pool involved include the following six states:
[0037] Available: The database service or load is not started and the system is in an idle state.
[0038] Initialization: Initialize the enabled server in the available state, including configuring the network, configuring related runtime parameters, and downloading the installation package;
[0039] Running: The database or load is running normally;
[0040] Abnormal: The database is down or running abnormally, and manual intervention is required to determine whether to continue the test; or wait for the database to recover to the running state;
[0041] Pause: When the database is abnormal, the state is entered after manual judgment that the test needs to be suspended. When entering this state, the registration center sends a message to the load end to suspend the test; the state is entered directly manually when in the running state, and is used to collect data and reports on the running status;
[0042] Stop: The state after the test is completed or manually switched from the pause state. At this time, the load end and the database stop service and transmit the generated logs and test reports to the log server. After the transmission is completed, the state changes to available.
[0043] Optionally, the time series database test system involved also includes an online change module deployed in a registration center;
[0044] During the test, when online capacity expansion / reduction is required, the online change module selects a new server from the resource pool and sets its status to "initializing". After the initialized new server joins the database cluster, the status of the new server is updated to "running".
[0045] Optionally, the time series database test system involved also includes a test recording module deployed in a registration center;
[0046] After the called server sends an exit completion signal to the registration center, the test recording module instructs the server to transfer log and report files to the designated log server. After completing log transmission and environment cleanup, the server status is updated to "available".
[0047] Compared with the prior art, the time series database testing method and system based on the registration center of the present invention have the following beneficial effects:
[0048] 1. The present invention introduces a registration center and supports database services and horizontal expansion functions at the registration center level, so that server resources can be fully utilized, and database managers, R&D personnel, and testers can intuitively understand the real-time status of each database server, reduce communication costs, and simplify manual operation processes;
[0049] 2. The present invention only requires the tester to perform initialization configuration once when the registration center is initialized. When the test plan is subsequently executed, the running server is automatically specified by the registration center, thereby improving the test efficiency. BRIEF DESCRIPTION OF THE DRAWINGS
[0050] Attached Figure 1 is a flow chart of a method according to Embodiment 1 of the present invention;
[0051] Attached Figure 2 is a module connection block diagram of the second embodiment of the present invention;
[0052] Attached Figure 3 It is a state transition diagram of the server in an embodiment of the present invention. DETAILED DESCRIPTION
[0053] In order to make the technical solution, the technical problem solved and the technical effect of the present invention more clearly understood, the technical solution of the present invention is clearly and completely described below in conjunction with specific embodiments.
[0054] The terms involved in the following embodiments are now explained.
[0055] Registration center: specifically refers to the registration center of the microservice cluster, which is the carrier of all related services and server data, and also the platform for managing all related servers, services and tasks;
[0056] Resource pool: a collection of all servers registered with the registration center;
[0057] Service discovery: The process by which servers registered with a registry discover each other through the registry;
[0058] Load balancing: Various operations sent from the upstream are transferred and distributed to the downstream according to certain rules to increase the concurrency, throughput and availability of the service cluster. Common load balancing algorithms include polling, weighted polling, Hash, minimum connection, etc.
[0059] Publish and subscribe: The way the registry communicates and interacts with related services is one of the core functions of the registry;
[0060] Capacity expansion and reduction: refers to both the online (commissioning) and offline (retiring) nodes of the registration center, and the increase and decrease of nodes in the distributed database.
[0061] Embodiment 1:
[0062] Combined with Figure 1 This embodiment proposes a time series database testing method based on a registration center, which includes the following steps:
[0063] S1. Centrally manage test services and resource pools through the registration center;
[0064] The registration center determines the required resources based on the test specifications, selects a server in the "available" state from the resource pool through load balancing, sets the selected server state to "initializing", and performs initialization operations.
[0065] Combined with Figure 3 , the servers in the resource pool include the following six states:
[0066] Available: The database service or load is not started and the system is in an idle state.
[0067] Initialization: Initialize the enabled server in the available state, including configuring the network, configuring related runtime parameters, and downloading the installation package;
[0068] Running: The database or load is running normally;
[0069] Abnormal: The database is down or running abnormally, and manual intervention is required to determine whether to continue the test; or wait for the database to recover to the running state;
[0070] Pause: When the database is abnormal, the state is entered after manual judgment that the test needs to be suspended. When entering this state, the registration center sends a message to the load end to suspend the test; the state is entered directly manually when in the running state, and is used to collect data and reports on the running status;
[0071] Stop: The state after the test is completed or manually switched from the pause state. At this time, the load end and the database stop service and transmit the generated logs and test reports to the log server. After the transmission is completed, the state changes to available.
[0072] S2. The initialized server starts the database cluster service. The server registers its database information with the registration center. The registration center updates the server status to "running" and pushes the database connection information to the load end to start the test.
[0073] Before starting the test, the resource pool configures the server information to the registration center. After receiving the message, the registration center stores the server configuration information, sets the server status to "available", and starts to establish a long connection with the server to detect the server's survival status and real-time information.
[0074] During the test, when online capacity expansion / reduction is required, the registration center selects a new server from the resource pool and sets its status to "initializing". After the initialized new server joins the database cluster, the status of the new server is updated to "running".
[0075] S3. The registration center adds monitoring of database indicators when shaking hands with the server. When encountering an abnormal situation, the registration center sets the server status to "abnormal" and notifies relevant personnel. Testers and R&D personnel decide whether to suspend or stop the test. The suspended test can be manually converted to "running".
[0076] S4. After the test is completed, the load end notifies the server of the end of the test through the registration center. The selected server stops the database service and sends an exit completion signal to the registration center. Subsequently, the registration center instructs the server to transfer log and report files to the designated log server. After completing the log transmission and environment cleanup, the server status is updated to "available".
[0077] Embodiment 2:
[0078] Combined with Figure 2 This embodiment proposes a time series database testing system based on a registration center, which includes:
[0079] The test preparation module is deployed in the registration center and is used to determine the required resources according to the test specifications, select a server in the "available" state from the resource pool through load balancing, set the selected server state to "initialize", and perform initialization operations;
[0080] The registration startup module is deployed in the resource pool and is used to start the database cluster service and register the information of the database to which the selected and initialized server belongs with the registration center;
[0081] The status change module is deployed in the registration center to update the server status to "running" and push the database connection information to the load end to start the test;
[0082] The indicator monitoring module is deployed in the registration center and is used to add database indicator monitoring when handshaking with the server. When an abnormal situation occurs, the server status is set to "abnormal" and the relevant personnel are notified. The testers and R&D personnel decide whether to suspend or stop the test and resume the test manually.
[0083] The test completion module is deployed in the registration center and is used to receive the server test completion notification sent by the load end after the test is completed, so that the selected server stops the database service and sends an exit completion signal to the registration center.
[0084] In this embodiment, the registration center manages the test service and resource pool in a unified manner.
[0085] Combined with Figure 3 , the servers in the resource pool include the following six states:
[0086] Available: The database service or load is not started and the system is in an idle state.
[0087] Initialization: Initialize the enabled server in the available state, including configuring the network, configuring related runtime parameters, and downloading the installation package;
[0088] Running: The database or load is running normally;
[0089] Abnormal: The database is down or running abnormally, and manual intervention is required to determine whether to continue the test; or wait for the database to recover to the running state;
[0090] Pause: When the database is abnormal, the state is entered after manual judgment that the test needs to be suspended. When entering this state, the registration center sends a message to the load end to suspend the test; the state is entered directly manually when in the running state, and is used to collect data and reports on the running status;
[0091] Stop: The state after the test is completed or manually switched from the pause state. At this time, the load end and the database stop service and transmit the generated logs and test reports to the log server. After the transmission is completed, the state changes to available.
[0092] Before starting the test, the resource pool configures the server information to the registration center through the information configuration module. After receiving the message, the registration center stores the server configuration information, calls the test preparation module to set the server status to "available", and starts to establish a long connection with the server to detect the server's survival status and real-time information.
[0093] It is necessary to add that:
[0094] The time series database test system involved also includes an online change module deployed in the registration center. During the test, when online expansion / contraction is required, the online change module selects a new server from the resource pool and sets its status to "initialization". After the initialized new server joins the database cluster, the status of the new server is updated to "running".
[0095] The time series database test system involved also includes a test recording module deployed in the registration center. After the called server sends an exit completion signal to the registration center, the test recording module instructs the server to transmit log and report files to the designated log server. After completing log transmission and environment cleanup, the server status is updated to "available".
[0096] In summary, the use of a registration center-based time series database testing method and system of the present invention can enable database managers, R&D personnel, and testers to intuitively understand the real-time status of each database server, reduce communication costs, improve testing efficiency, and make full use of server resources.
[0097] The above specific examples are used to explain the principles and implementation methods of the present invention in detail. These examples are only used to help understand the core technical content of the present invention. Based on the above specific embodiments of the present invention, any improvements and modifications made by technicians in this technical field without departing from the principles of the present invention should fall within the scope of patent protection of the present invention.
Claims
1. A time series database testing method based on a registration center, characterized in that: The steps include: S1. The registration center determines the required resources according to the test specifications, selects a server in the "available" state from the resource pool through load balancing, sets the selected server state to "initialize", and performs initialization operations; S2. The initialized server starts the database cluster service. The server registers its database information with the registration center. The registration center updates the server status to "running" and pushes the database connection information to the load end to start the test. S3. The registration center adds monitoring of database indicators when shaking hands with the server. In case of abnormal situations, the registration center sets the server status to "abnormal" and notifies relevant personnel. Testers and R&D personnel decide whether to suspend or stop the test and resume the test manually. S4. After the test is completed, the load end notifies the server through the registration center that the test is over, the selected server stops the database service, and sends an exit completion signal to the registration center.
2. According to the time series database testing method based on the registration center of claim 1, it is characterized in that: Centrally manage testing services and resource pools through the registration center; Before starting the test, the resource pool configures the server information to the registration center. After receiving the message, the registration center stores the server configuration information, sets the server status to "available", and starts to establish a long connection with the server to detect the server's survival status and real-time information.
3. According to the time series database testing method based on the registration center of claim 2, it is characterized in that: The servers in the resource pool include the following six states: Available: The database service or load is not started and the system is in an idle state. Initialization: Initialize the enabled server in the available state, including configuring the network, configuring related runtime parameters, and downloading the installation package; Running: The database or load is running normally; Abnormal: The database is down or running abnormally, and manual intervention is required to determine whether to continue the test; or wait for the database to recover to the running state; Pause: When the database is abnormal, the state is entered after manual judgment that the test needs to be suspended. When entering this state, the registration center sends a message to the load end to suspend the test; the state is entered directly manually when in the running state, and is used to collect data and reports on the running status; Stop: The state after the test is completed or manually switched from the pause state. At this time, the load end and the database stop service and transmit the generated logs and test reports to the log server. After the transmission is completed, the state changes to available.
4. According to the time series database testing method based on the registration center of claim 1, it is characterized in that: During the test, when online capacity expansion / reduction is required, the registration center selects a new server from the resource pool and sets its status to "initializing". After the initialized new server joins the database cluster, the status of the new server is updated to "running".
5. According to the time series database testing method based on the registration center of claim 1, it is characterized in that: Execute step S4. After the selected server sends an exit completion signal to the registration center, the registration center instructs the server to transmit log and report files to the designated log server. After completing log transmission and environment cleanup, the server status is updated to "available".
6. A time series database testing system based on a registration center, characterized in that: It includes: The test preparation module is deployed in the registration center and is used to determine the required resources according to the test specifications, select a server in the "available" state from the resource pool through load balancing, set the selected server state to "initialize", and perform initialization operations; The registration startup module is deployed in the resource pool and is used to start the database cluster service and register the information of the database to which the selected and initialized server belongs with the registration center; The status change module is deployed in the registration center to update the server status to "running" and push the database connection information to the load end to start the test; The indicator monitoring module is deployed in the registration center and is used to add database indicator monitoring when handshaking with the server. When an abnormal situation occurs, the server status is set to "abnormal" and the relevant personnel are notified. The testers and R&D personnel decide whether to suspend or stop the test and resume the test manually. The test completion module is deployed in the registration center and is used to receive the server test completion notification sent by the load end after the test is completed, so that the selected server stops the database service and sends an exit completion signal to the registration center.
7. A time series database testing system based on a registration center according to claim 6, characterized in that: The registration center centrally manages the testing services and resource pool; Before starting the test, the resource pool configures the server information to the registration center through the information configuration module. After receiving the message, the registration center stores the server configuration information, calls the test preparation module to set the server status to "available", and starts to establish a long connection with the server to detect the server's survival status and real-time information.
8. A time series database testing system based on a registration center according to claim 7, characterized in that: The servers in the resource pool include the following six states: Available: The database service or load is not started and the system is in an idle state. Initialization: Initialize the enabled server in the available state, including configuring the network, configuring related runtime parameters, and downloading the installation package; Running: The database or load is running normally; Abnormal: The database is down or running abnormally, and manual intervention is required to determine whether to continue the test; or wait for the database to recover to the running state; Pause: When the database is abnormal, the state is entered after manual judgment that the test needs to be suspended. When entering this state, the registration center sends a message to the load end to suspend the test; the state is entered directly manually when in the running state, and is used to collect data and reports on the running status; Stop: The state after the test is completed or manually switched from the pause state. At this time, the load end and the database stop service and transmit the generated logs and test reports to the log server. After the transmission is completed, the state changes to available.
9. The time series database testing system based on the registration center according to claim 6 is characterized in that: The system also includes an online change module deployed in the registration center; During the test, when online expansion / contraction is required, the online change module selects a new server from the resource pool and sets its status to "initializing". After the initialized new server joins the database cluster, the status of the new server is updated to "running".
10. The time series database testing system based on the registration center according to claim 6 is characterized in that: The system also includes a test recording module deployed in the registration center; After the called server sends an exit completion signal to the registration center, the test recording module instructs the server to transfer log and report files to the designated log server. After completing log transmission and environment cleanup, the server status is updated to "available".
