Database optimization method and device, computer equipment and storage medium

By injecting failure scenarios with chaos engineering tools in the TIDB database, evaluating impacts and analyzing performance indicators, identifying and optimizing problem points in the database, the problem of low stability of the TIDB database is solved, and the stability and reliability of the database are improved.

CN119474049APending Publication Date: 2025-02-18CHINA PING AN LIFE INSURANCE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411485941.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-22
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

While TIDB databases pursue high performance and high availability, they have low stability, mainly due to potential problems such as network latency and node failure in distributed systems.

Method used

By obtaining preset fault scenario information and corresponding implementation plans, use chaos engineering tools to inject faults into the distributed database, monitor the performance indicators of the database, evaluate the impact of the fault scenario, and judge whether it is in a preset fault based on the impact assessment results. Within the scope of the scene. If so, analyze the performance indicator data to identify the target problem points, obtain the corresponding optimization strategy from the preset emergency plan, and optimize the database.

Benefits of technology

By introducing fault scenarios to discover weaknesses in distributed databases and optimize them based on emergency plans, the stability and reliability of the database are effectively improved, thereby improving the user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119474049A_ABST
    Figure CN119474049A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of data processing, and relates to a database optimization method and device, computer equipment and a storage medium, and the method comprises the steps: obtaining fault scene information corresponding to a distributed database, and obtaining an implementation scheme corresponding to the fault scene information; based on the fault scene information and the implementation scheme, calling a chaos engineering tool to inject a fault into a distributed database; based on the first performance index data of the distributed database after the fault is injected, the influence of the fault scene on the distributed database is evaluated, and an influence evaluation result is obtained; judging whether the influence evaluation result is within a fault scene influence range or not; if yes, performing problem analysis on performance index data of the distributed database before and after fault injection to obtain a target problem point; and performing optimization processing on the distributed database based on a target optimization strategy obtained from the emergency plan. In addition, the target problem point can be stored in the block chain. According to the invention, the stability and reliability of the distributed database can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the fields of data processing technology and financial technology, and in particular to database optimization methods, devices, computer equipment and storage media. Background Art

[0002] With the rapid development of information technology, the financial industry's demand for database management systems is becoming increasingly diversified and rigorous. Against this background, the TIDB database came into being as a de-IOE database management system designed specifically for the financial industry. TIDB not only inherits the core advantages of the relational database management system (RDBMS), such as clear data model and strong transaction processing capabilities, but also achieves high availability of the database system, rapid computing power improvement and horizontal expansion of capacity through its unique distributed architecture design, effectively responding to the financial industry's needs for big data processing and high concurrent access.

[0003] The TIDB database achieves storage and computing separation in its architectural design. This innovative design allows the database's computing power and storage capacity to be expanded independently, further improving the system's flexibility and scalability. At the same time, the TIDB database also maintains strong consistency, ensuring the accuracy and reliability of data in a distributed environment, which is crucial for the financial industry because any data inconsistency may lead to serious business risks.

[0004] However, as a distributed, storage-computing-separated, highly available, and highly consistent real-time relational database system, TIDB's design also brings architectural complexity. This complexity is not only reflected in the construction and maintenance of the system, but also in how to ensure the stability of data in a distributed environment. Due to potential problems such as network latency and node failures in the distributed system itself, the TIDB database has a low stability problem while pursuing high performance and high availability. Summary of the invention

[0005] The purpose of the embodiments of the present application is to propose a database optimization method, apparatus, computer equipment and storage medium to solve the technical problem of low stability of the existing TIDB database.

[0006] In order to solve the above technical problems, the present application embodiment provides a database optimization method, which adopts the following technical solution:

[0007] Obtaining preset fault scenario information corresponding to the distributed database, and obtaining an implementation plan corresponding to the fault scenario information;

[0008] Based on the fault scenario information and the implementation plan, calling a preset chaos engineering tool to inject a fault into the distributed database;

[0009] Obtaining first performance indicator data of the distributed database after the fault is injected based on a preset monitoring tool;

[0010] Evaluate the impact of the fault scenario on the distributed database based on the first performance indicator data, and obtain a corresponding impact assessment result;

[0011] Determine whether the impact assessment result is within the preset fault scenario impact range;

[0012] If yes, perform problem analysis on the performance indicator data of the distributed database before and after the fault is injected to obtain the corresponding target problem point;

[0013] A target optimization strategy corresponding to the target problem point is obtained from a preset emergency plan, and the distributed database is optimized based on the target optimization strategy.

[0014] Furthermore, the step of obtaining preset fault scenario information corresponding to the distributed database specifically includes:

[0015] Acquire first fault scenario information corresponding to the access computing layer in the distributed database;

[0016] Acquire second fault scenario information corresponding to the storage and computing layer in the distributed database;

[0017] Obtaining third fault scenario information corresponding to the clock layer in the distributed database;

[0018] The fault scenario information is generated based on the first fault scenario information, the second fault scenario information and the third fault scenario information.

[0019] Furthermore, the step of performing problem analysis on the performance indicator data of the distributed database before and after the fault is injected to obtain the corresponding target problem point specifically includes:

[0020] Acquire second performance indicator data of the distributed database before fault injection;

[0021] Comparatively analyzing the first performance indicator data and the second performance indicator data to obtain corresponding comparative analysis results;

[0022] Based on the comparative analysis results, a problem location process corresponding to the distributed database is performed to obtain corresponding problem points;

[0023] The problem points are classified to obtain the target problem points.

[0024] Furthermore, before the step of determining whether the impact assessment result is within the preset fault scenario impact range, the step further includes:

[0025] Obtaining a first fault scenario impact range corresponding to an access computing layer in the distributed database;

[0026] Obtaining a second fault scenario impact scope corresponding to the storage and computing layer in the distributed database;

[0027] Obtaining a third fault scenario impact range corresponding to the clock layer in the distributed database;

[0028] The fault scenario impact range is generated based on the first fault scenario impact range, the second fault scenario impact range, and the third fault scenario impact range.

[0029] Furthermore, after the step of determining whether the impact assessment result is within the preset fault scenario impact range, the method further includes:

[0030] If the impact assessment result is not within the impact range of the fault scenario, obtaining a preset fuse strategy;

[0031] Performing a circuit breaker process on the distributed database based on the circuit breaker strategy;

[0032] Get the preset fuse reminder information;

[0033] The fuse reminder information is sent to relevant personnel.

[0034] Furthermore, after the step of obtaining the target optimization strategy corresponding to the target problem point from the preset emergency plan and optimizing the distributed database based on the target optimization strategy, the method further includes:

[0035] Acquire optimization result data corresponding to the distributed database;

[0036] Generate a corresponding optimization processing report based on the target problem point, the optimization result data and the optimization strategy;

[0037] Get the communication information of the designated person;

[0038] Based on the communication information, the optimization processing report is sent to the designated person.

[0039] Furthermore, after the step of obtaining the target optimization strategy corresponding to the target problem point from the preset emergency plan and optimizing the distributed database based on the target optimization strategy, the method further includes:

[0040] Get the preset plan update strategy;

[0041] The emergency plan is updated based on the plan update strategy.

[0042] In order to solve the above technical problems, the embodiment of the present application also provides a database optimization device, which adopts the following technical solution:

[0043] A first acquisition module is used to acquire preset fault scenario information corresponding to the distributed database, and acquire an implementation plan corresponding to the fault scenario information;

[0044] An injection module, used to call a preset chaos engineering tool to inject faults into the distributed database based on the fault scenario information and the implementation plan;

[0045] A second acquisition module, used to acquire first performance indicator data of the distributed database after a fault is injected based on a preset monitoring tool;

[0046] An evaluation module, configured to evaluate the impact of a fault scenario on the distributed database based on the first performance indicator data, and obtain a corresponding impact evaluation result;

[0047] A judgment module is used to judge whether the impact assessment result is within the preset fault scenario impact range;

[0048] An analysis module is used to analyze the performance indicator data of the distributed database before and after the fault is injected to obtain the corresponding target problem points;

[0049] The optimization module is used to obtain a target optimization strategy corresponding to the target problem point from a preset emergency plan, and optimize the distributed database based on the target optimization strategy.

[0050] In order to solve the above technical problems, the embodiment of the present application further provides a computer device, which adopts the following technical solution:

[0051] Obtaining preset fault scenario information corresponding to the distributed database, and obtaining an implementation plan corresponding to the fault scenario information;

[0052] Based on the fault scenario information and the implementation plan, calling a preset chaos engineering tool to inject a fault into the distributed database;

[0053] Obtaining first performance indicator data of the distributed database after the fault is injected based on a preset monitoring tool;

[0054] Evaluate the impact of the fault scenario on the distributed database based on the first performance indicator data, and obtain a corresponding impact assessment result;

[0055] Determine whether the impact assessment result is within the preset fault scenario impact range;

[0056] If yes, perform problem analysis on the performance indicator data of the distributed database before and after the fault is injected to obtain the corresponding target problem point;

[0057] A target optimization strategy corresponding to the target problem point is obtained from a preset emergency plan, and the distributed database is optimized based on the target optimization strategy.

[0058] In order to solve the above technical problems, the embodiment of the present application further provides a computer-readable storage medium, which adopts the following technical solution:

[0059] Obtaining preset fault scenario information corresponding to the distributed database, and obtaining an implementation plan corresponding to the fault scenario information;

[0060] Based on the fault scenario information and the implementation plan, calling a preset chaos engineering tool to inject a fault into the distributed database;

[0061] Obtaining first performance indicator data of the distributed database after the fault is injected based on a preset monitoring tool;

[0062] Evaluate the impact of the fault scenario on the distributed database based on the first performance indicator data, and obtain a corresponding impact assessment result;

[0063] Determine whether the impact assessment result is within the preset fault scenario impact range;

[0064] If yes, perform problem analysis on the performance indicator data of the distributed database before and after the fault is injected to obtain the corresponding target problem point;

[0065] A target optimization strategy corresponding to the target problem point is obtained from a preset emergency plan, and the distributed database is optimized based on the target optimization strategy.

[0066] Compared with the prior art, the embodiments of the present application have the following beneficial effects:

[0067] The present application first obtains preset fault scenario information corresponding to a distributed database, and obtains an implementation plan corresponding to the fault scenario information; then, based on the fault scenario information and the implementation plan, calls a preset chaos engineering tool to inject a fault into the distributed database; then, based on a preset monitoring tool, obtains first performance indicator data of the distributed database after the fault is injected; subsequently, based on the first performance indicator data, evaluates the impact of the fault scenario on the distributed database to obtain a corresponding impact assessment result; and determines whether the impact assessment result is within the preset fault scenario impact range; if so, performs a problem analysis on the performance indicator data of the distributed database before and after the fault is injected to obtain a corresponding target problem point; finally, obtains a target optimization strategy corresponding to the target problem point from a preset emergency plan, and optimizes the distributed database based on the target optimization strategy. This application introduces failure scenarios in distributed databases based on the use of chaos engineering tools to discover target problem points in distributed databases, then obtains target optimization strategies corresponding to target problem points from preset emergency plans, and optimizes the distributed database based on the target optimization strategies, thereby achieving targeted reinforcement and preventive treatment of weak points in distributed databases, thereby effectively improving the stability and reliability of distributed databases, and facilitating the subsequent provision of highly reliable database services to users based on the optimized distributed database, thereby improving user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0068] In order to more clearly illustrate the scheme in the present application, a brief introduction is given below to the drawings required for use in the description of the embodiments of the present application. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0069] Figure 1 is an exemplary system architecture diagram to which the present application may be applied;

[0070] Figure 2 A flowchart of an embodiment of a database optimization method according to the present application;

[0071] Figure 3 is a structural schematic diagram of an embodiment of a database optimization device according to the present application;

[0072] Figure 4 It is a structural diagram of an embodiment of a computer device according to the present application. DETAILED DESCRIPTION

[0073] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by technicians in the technical field of the present application; the terms used in the specification of the application herein are only for the purpose of describing specific embodiments and are not intended to limit the present application; the terms "including" and "having" and any variations thereof in the specification and claims of the present application and the above-mentioned drawings are intended to cover non-exclusive inclusions. The terms "first", "second", etc. in the specification and claims of the present application or the above-mentioned drawings are used to distinguish different objects, not to describe a specific order.

[0074] Reference to "embodiments" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiments may be included in at least one embodiment of the present application. The appearance of the phrase in various locations in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0075] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the accompanying drawings.

[0076] like Figure 1 As shown, the system architecture 100 may include a terminal device 101, a network 102 and a server 103. The terminal device 101 may be a laptop 1011, a tablet computer 1012 or a mobile phone 1013. The network 102 is used to provide a medium for a communication link between the terminal device 101 and the server 103. The network 102 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0077] The user can use the terminal device 101 to interact with the server 103 through the network 102 to receive or send messages, etc. Various communication client applications can be installed on the terminal device 101, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.

[0078] The terminal device 101 can be any electronic device with a display screen and supporting web browsing. In addition to the laptop computer 1011, tablet computer 1012 or mobile phone 1013, the terminal device 101 can also be an e-book reader, an MP3 player (Moving Picture Experts Group Audio Layer III), an MP4 (Moving Picture Experts Group Audio Layer IV), a laptop computer, a desktop computer, etc.

[0079] The server 103 may be a server that provides various services, such as a background server that provides support for a web page displayed on the terminal device 101 .

[0080] It should be noted that the database optimization method provided in the embodiment of the present application is generally executed by a server / terminal device, and accordingly, the database optimization device is generally arranged in the server / terminal device.

[0081] It should be understood that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0082] Continue to refer Figure 2 , shows a flow chart of an embodiment of the database optimization method according to the present application. According to different requirements, the order of the steps in the flow chart can be changed, and some steps can be omitted. The database optimization method provided in the embodiment of the present application can be applied to any scenario where product recommendations are required, and the database optimization method can be applied to products in these scenarios, for example, product recommendations in the financial insurance field. The database optimization method comprises the following steps:

[0083] Step S201, obtaining preset fault scenario information corresponding to the distributed database, and obtaining an implementation plan corresponding to the fault scenario information.

[0084] In this embodiment, the database optimization method is executed on the electronic device (eg Figure 1The server / terminal device shown in the figure) can obtain the fault scenario information through a wired connection or a wireless connection. It should be pointed out that the above wireless connection method may include but is not limited to 3G / 4G / 5G connection, WiFi connection, Bluetooth connection, WiMAX connection, Zigbee connection, UWB (ultra wideband) connection, and other wireless connection methods currently known or to be developed in the future. The execution subject of this application may be a database management system, or simply referred to as a system. The above distributed database may specifically be a TIDB database. TIDB belongs to a relational database (RDBMS), and at the same time it supports strong consistency. The architecture is designed through a distributed architecture to ensure the high availability of the database, as well as the rapid horizontal expansion of computing power and capacity. At the same time, the database itself is compatible with the MySQL protocol, which is very friendly to the transformation of the stock system, and the learning cost is relatively low. At present, TIDB has begun to be widely used in the financial industry. Among them, the specific implementation process of obtaining the preset fault scenario information corresponding to the distributed database will be further described in detail in the subsequent specific embodiments of this application, and will not be elaborated on here. In addition, for each type of fault scenario information, an implementation plan corresponding to the fault scenario information will be pre-built according to the actual implementation requirements. Specifically, for each type of fault scenario information, a detailed fault introduction plan is formulated, which may include, for example, the fault type (such as network delay, node failure, resource exhaustion, etc.), fault duration, fault triggering conditions, etc.

[0085] Step S202: Based on the fault scenario information and the implementation plan, a preset chaos engineering tool is called to inject a fault into the distributed database.

[0086] In this embodiment, the selection of the above chaos engineering tools is not specifically limited, and a chaos engineering tool with the function of simulating fault scenarios can be randomly selected. Section 2 uses the chaos engineering tool to gradually inject faults into the distributed database according to the above implementation plan. Specifically, the injected faults can be processed by modifying the system configuration, simulating network anomalies, stopping or restarting services, etc.

[0087] Step S203: obtaining first performance indicator data of the distributed database after the fault is injected based on a preset monitoring tool.

[0088] In this embodiment, the monitoring tool is a tool that has the function of monitoring the running status and log information of the distributed database. The monitoring tool can be used to record key indicators such as response time, throughput, error rate, etc. during the distributed database fault injection process, as well as the recovery status and recovery time of the distributed database, and then integrate to obtain the corresponding first performance indicator data.

[0089] Step S204: evaluating the impact of the fault scenario on the distributed database based on the first performance indicator data to obtain a corresponding impact evaluation result.

[0090] In this embodiment, the first performance indicator data can be analyzed to compare the changes in the performance indicators and stability indicators of the distributed database system before and after the fault injection to obtain data analysis results, and then the impact of the fault scenario on the system can be evaluated based on the obtained data analysis results, including performance degradation, service interruption, data loss, etc., so as to obtain corresponding impact assessment results. Among them, key performance indicators and stability indicators can be pre-set according to the characteristics and business requirements of the distributed database to evaluate the impact of the fault scenario.

[0091] Step S205: determine whether the impact assessment result is within the preset fault scenario impact range.

[0092] In this embodiment, the generation process of the above-mentioned fault scenario impact range will be described in further detail in subsequent specific embodiments, and will not be elaborated in detail here.

[0093] Step S206: If yes, perform problem analysis on the performance indicator data of the distributed database before and after the fault is injected to obtain corresponding target problem points.

[0094] In this embodiment, the above-mentioned problem analysis is performed on the performance indicator data of the distributed database before and after the fault is injected to obtain the specific implementation process of the corresponding target problem point. This application will provide further detailed descriptions of this in subsequent specific embodiments and will not be elaborated on here.

[0095] Step S207, obtaining a target optimization strategy corresponding to the target problem point from a preset emergency plan, and optimizing the distributed database based on the target optimization strategy.

[0096] In this embodiment, various emergency plans are pre-set according to various possible problems of the distributed database, such as troubleshooting process, recovery strategy, data backup and recovery plan, etc., and corresponding one-to-one mapping relationships between various problem points and various emergency plans are set. After obtaining the above-mentioned target problem point, the designated emergency plan corresponding to the target problem point can be obtained from the above-mentioned emergency plan according to the above-mentioned one-to-one mapping relationship, and the designated emergency plan is used as the above-mentioned target optimization strategy. Thus, the target optimization strategy is used to optimize the distributed database later.

[0097] The present application first obtains preset fault scenario information corresponding to a distributed database, and obtains an implementation plan corresponding to the fault scenario information; then, based on the fault scenario information and the implementation plan, calls a preset chaos engineering tool to inject a fault into the distributed database; then, based on a preset monitoring tool, obtains first performance indicator data of the distributed database after the fault is injected; subsequently, based on the first performance indicator data, evaluates the impact of the fault scenario on the distributed database to obtain a corresponding impact assessment result; and determines whether the impact assessment result is within the preset fault scenario impact range; if so, performs a problem analysis on the performance indicator data of the distributed database before and after the fault is injected to obtain a corresponding target problem point; finally, obtains a target optimization strategy corresponding to the target problem point from a preset emergency plan, and optimizes the distributed database based on the target optimization strategy. This application introduces failure scenarios in distributed databases based on the use of chaos engineering tools to discover target problem points in distributed databases, then obtains target optimization strategies corresponding to target problem points from preset emergency plans, and optimizes the distributed database based on the target optimization strategies, thereby achieving targeted reinforcement and preventive treatment of weak points in distributed databases, thereby effectively improving the stability and reliability of distributed databases, and facilitating the subsequent provision of highly reliable database services to users based on the optimized distributed database, thereby improving user experience.

[0098] In some optional implementations, the obtaining of preset fault scenario information corresponding to the distributed database in step S201 includes the following steps:

[0099] Acquire first fault scenario information corresponding to the access computing layer in the distributed database.

[0100] In this embodiment, the above-mentioned distributed database may be specifically TIDB. As a distributed database, TIDB, from the perspective of architecture, consists of three independent and interdependent parts in the entire TIDB service, which correspond to the access computing layer (TidbServer), the storage computing layer (TiKV), and the clock layer (PDservice). In the design of TIDB, the access computing layer is used to manage and respond to SQL requests and perform SQL operations. Each TiDBserver node is independent, and this layer does not store data locally, and is a stateless node. Therefore, there is no difference in sending SQL requests to any node, and the design can be horizontally expanded. From these two characteristics, it can be analyzed that the general abnormal scenario is the failure of a certain node, and the services of the TIDBserver node are generally provided through a unified export through load balancing. Specifically, the explosion point corresponding to the access computing layer, that is, the first fault scenario information, can be designed to simulate the node failure and unavailability. The specific implementation plan is: a certain node can be temporarily stopped from being distributed from the load balancing to simulate the scenario, which is also conducive to rapid recovery.

[0101] Obtain second fault scenario information corresponding to the storage and computing layer in the distributed database.

[0102] In this embodiment, in the design of TIDB, the storage and computing layer is used to store data, cluster status, and perform some auxiliary computing tasks. The data in a table is split into multiple TiKV nodes. A part of the data in each node is called a region. Each region has a leader and multiple replicas. There can only be one leader on each node. The leader is responsible for providing read and write. In an ideal state, the architecture can achieve high performance through concurrent read and write of multiple regions through a similar table-splitting design to cope with large-scale data. However, when the data itself or the table is so small that it only exists in one region, all requests and some auxiliary computing will be concentrated on one TiKV node, which is the so-called hot spot problem. In actual use and maintenance, it is found that when a hot spot occurs, as the requests are concentrated, the auxiliary computing is also concentrated on a single node at the same time, and the computing consumption is prone to increase sharply. Generally, the computing resources allocated to the storage and computing layer are often not as rich as those of the access computing layer, and then all core resources (CPU, IO) will be in contention. Therefore, it is found that the hot spot problem of TIDB will cause the node where the region is located to respond abnormally, affecting all the leader region tables on the node, so the hot spot will directly affect the TIDB service. In summary, two explosion points can be designed for the storage and computing layer, namely the second failure scenario information, including: scenario one, node unavailable; scenario two, hotspot.

[0103] Obtain third fault scenario information corresponding to the clock layer in the distributed database.

[0104] In this embodiment, in the distributed architecture of TIDB, the role of the clock layer is to provide global consistency services for the cluster, such as global timestamps, storage of globally unique data, etc. If the PD as a whole is unavailable, the database service must be unavailable, and there is no need to explode. The PD itself guarantees high availability through the cluster + raft protocol, and the general number is around 3 to 7. Therefore, the explosion point of the clock layer design, that is, the third fault scenario information, is that for a PD cluster of N nodes, at most (N / 2 rounded down) nodes are unavailable. The purpose is to evaluate the reliability of core components and recovery plans.

[0105] The fault scenario information is generated based on the first fault scenario information, the second fault scenario information and the third fault scenario information.

[0106] In this embodiment, integrated information may be obtained by integrating the first fault scenario information, the second fault scenario information, and the third fault scenario information, and the obtained integrated information may be used as the fault scenario information.

[0107] The present application obtains the first fault scenario information corresponding to the access computing layer in the distributed database; obtains the second fault scenario information corresponding to the storage computing layer in the distributed database; and obtains the third fault scenario information corresponding to the clock layer in the distributed database; and subsequently generates the fault scenario information based on the first fault scenario information, the second fault scenario information, and the third fault scenario information. The present application can quickly and accurately generate fault scenario information corresponding to the distributed database by obtaining the first fault scenario information, the second fault scenario information, and the third fault scenario information corresponding to the access computing layer, the storage computing layer, and the clock layer in the distributed database, respectively, thereby ensuring the data diversity and accuracy of the generated fault scenario information.

[0108] In some optional implementations of this embodiment, step S206 includes the following steps:

[0109] Acquire second performance indicator data of the distributed database before fault injection.

[0110] In this embodiment, the second performance indicator data of the distributed database before the fault injection may be collected in advance by using a monitoring tool.

[0111] A comparative analysis is performed on the first performance indicator data and the second performance indicator data to obtain a corresponding comparative analysis result.

[0112] In this embodiment, the system performance data of the distributed database before and after fault injection can be compared and analyzed to analyze changes in the performance indicators, stability indicators, and user experience of the distributed database, identify which indicators have experienced abnormal fluctuations or significant declines, and then integrate them to obtain corresponding comparative analysis results.

[0113] Based on the comparative analysis results, problem location processing corresponding to the distributed database is performed to obtain corresponding problem points.

[0114] In this embodiment, based on the above comparison and analysis results, the problem points in the specific system components, service interfaces or data processing flow in the above distributed database can be located. These problem points may be the weak points or potential risk sources of the distributed database.

[0115] The problem points are classified to obtain the target problem points.

[0116] In this embodiment, all identified problem points can be classified into categories, such as performance bottlenecks, resource leakage, service unavailability, etc., to obtain classified target problem points, and further record detailed descriptions of the problem points, impact scope, urgency, and other information.

[0117] The present application obtains the second performance indicator data of the distributed database before fault injection; then compares and analyzes the first performance indicator data with the second performance indicator data to obtain the corresponding comparative analysis results; then based on the comparative analysis results, the problem location processing corresponding to the distributed database is performed to obtain the corresponding problem points; and then the problem points are classified to obtain the target problem points. The present application obtains the second performance indicator data of the distributed database before fault injection; then compares and analyzes the first performance indicator data with the second performance indicator data to obtain the comparative analysis results; then based on the comparative analysis results, the problem location processing corresponding to the distributed database is performed to obtain the problem points; and finally the obtained problem points are classified, so that the target problem points of the distributed database can be obtained quickly and accurately, the generation efficiency of the target problem points is improved, and the data accuracy of the obtained target problem points is guaranteed.

[0118] In some optional implementations, before step S205, the electronic device may further perform the following steps:

[0119] Obtain a first fault scenario impact range corresponding to an access computing layer in the distributed database.

[0120] In this embodiment, after completing the design of the explosion point (fault scenario information) of the distributed database, it is necessary to further analyze and construct the explosion radius (fault scenario impact range) corresponding to the explosion point. The purpose is to make the explosion controllable while evaluating the impact of the fault scenario of the distributed database and exposing the weak points, so that the introduced fault scenario is limited to the controllable range and will not overflow and affect the actual business. Among them, the explosion radius actually refers to the upper limit of the explosion impact, which is composed of a set of indicators. When the threshold represented by this set of indicators is reached, the chaos engineering needs to be terminated immediately to control the impact.

[0121] A burst point is designed in advance in the access computing layer: node failure. By simulating a scenario where a TIDB server node cannot provide services, two points of the TiDB server are checked: horizontal expansion, rapid storage capacity, and compensation mechanism. The impact is that the SQL currently being executed by the failed node fails to execute or the link resources are insufficient. So when executing this burst, it is necessary to evaluate in advance whether the affected functions have retry and compensation mechanisms within the time period; as well as the peak link capacity of all TiDB nodes in the historical business cycle, and the amount of redundancy. Since the reduction of link resources caused by the burst cannot affect the amount of links required for normal business, two indicators are abstracted: the amount of redundant connections and the amount of abnormal SQL. Specifically, the impact range of the first fault scenario corresponding to the access computing layer, that is, the burst radius, includes: the amount of redundant links cannot affect normal business, and the amount of abnormal SQL is within the SLA tolerance range. In addition, in practice, it is necessary to prepare a TiDB server node that can be accessed at any time, as a standby node to access the load balancing, and can be turned available at any time.

[0122] Obtain the impact scope of the second fault scenario corresponding to the storage and computing layer in the distributed database.

[0123] In this embodiment, two explosion points are designed in the storage and computing layer: node anomalies and hot spots. Among them, for node anomalies, based on TiDB's own high availability, for the TiKV region cluster composed of 2n+1 replicas, n data replica anomalies can be tolerated. In theory, it is imperceptible to users. Therefore, two indicators are observed here, and the number of explosion nodes must not be greater than n. By setting two indicators, the average SQL execution time and the average TIKV load. And further set the impact range of the first specified fault scenario corresponding to the storage and computing layer, that is, the explosion radius includes: the average SQL time is less than the SLA indicator of the core function. The average TIKV load shall not be greater than 80%.

[0124] In addition, for hotspot scenarios, the impact of hotspots on the overall SQL execution time is simulated by simulating hotspots (constructing specific small tables so that they cannot be dispersed to multiple regions or closed and scattered). By setting two indicators, the CPU of the TIKV node and the SQL execution time of the node. And further set the impact range of the second specified fault scenario corresponding to the storage and computing layer, that is, the explosion radius includes: the average SQL time is less than the SLA indicator of the core function. The node CPU usage rate shall not exceed 80%.

[0125] Subsequently, the impact range of the first specified fault scenario is integrated with the impact range of the second specified fault scenario, thereby obtaining the impact range of the second fault scenario corresponding to the storage and computing layer in the distributed database.

[0126] Obtain an impact range of a third fault scenario corresponding to the clock layer in the distributed database.

[0127] In this embodiment, an explosion point is designed in the clock layer, and its only function is to evaluate the high availability of PD itself. Because of the PD's raft protocol mechanism (majority voting), it is determined that the number of PD available nodes must be greater than half of all nodes (maintaining the majority). Two indicators are pre-set: the number of PD surviving nodes and the time required for PD request response. The impact range of the third fault scenario corresponding to the clock layer is further set, that is, the explosion radius includes: the number of PD surviving nodes must be greater than half, and the time required for PD request response must be less than the threshold (the threshold is recommended to be obtained by stress testing).

[0128] The fault scenario impact range is generated based on the first fault scenario impact range, the second fault scenario impact range, and the third fault scenario impact range.

[0129] In this embodiment, corresponding integrated data may be obtained by integrating the first fault scenario impact range, the second fault scenario impact range, and the third fault scenario impact range, and the integrated data may be used as the fault scenario impact range.

[0130] The present application obtains the first fault scenario impact range corresponding to the access computing layer in the distributed database; obtains the second fault scenario impact range corresponding to the storage computing layer in the distributed database; and obtains the third fault scenario impact range corresponding to the clock layer in the distributed database; and subsequently generates the fault scenario impact range based on the first fault scenario impact range, the second fault scenario impact range, and the third fault scenario impact range. The present application can quickly and accurately generate the fault scenario impact range corresponding to the distributed database based on the first fault scenario impact range, the second fault scenario impact range, and the third fault scenario impact range that respectively correspond to the access computing layer, the storage computing layer, and the clock layer in the distributed database, thereby ensuring the data diversity and accuracy of the generated fault scenario impact range.

[0131] In some optional implementations, after step S205, the electronic device may further perform the following steps:

[0132] If the impact assessment result is not within the impact range of the fault scenario, a preset fuse strategy is obtained.

[0133] In this embodiment, before using the chaos engineering tool to perform fault testing on the distributed database, a circuit breaker strategy is pre-formulated, and the circuit breaker strategy clearly specifies the circuit breaker measures to be taken under certain circumstances.

[0134] Performing a fuse process on the distributed database based on the fuse policy.

[0135] In this embodiment, when it is detected that the impact assessment result is not within the control of the fault scenario impact range, that is, it exceeds the above fault scenario impact range, the fuse measures corresponding to the fuse strategy will be immediately triggered to stop fault injection and thus restore the normal operation of the distributed database.

[0136] Get the preset fuse reminder information.

[0137] In this embodiment, a reminder information template for fuse reminder is pre-constructed. The database identifier of the above-mentioned distributed database can be obtained, and then the database identifier is filled into the corresponding position in the above-mentioned reminder information template, so as to generate the corresponding fuse reminder information. Among them, the information content of the above-mentioned reminder information template can be constructed according to the actual fuse reminder requirements.

[0138] The fuse reminder information is sent to relevant personnel.

[0139] In this embodiment, the above-mentioned relevant personnel may be personnel responsible for the management of the distributed database. The fuse reminder information may be sent to the relevant personnel by using a short message, an email, an instant message, or the like.

[0140] In addition, the explosion point radius and fuse measures can be fine-tuned according to actual conditions. As the application system being served changes, the above indicators can be adjusted or increased or decreased according to actual conditions to control the appropriate explosion radius. The core guiding principle is to expose the weak points and hidden problems of the system through chaos engineering, test emergency plans, and thus improve the stability of the system and services while ensuring that the business is not affected.

[0141] If the present application detects that the impact assessment result is not within the control range of the fault scenario impact, the preset fuse strategy is obtained; then the distributed database is subjected to fuse processing based on the fuse strategy; thereafter, preset fuse reminder information is obtained; and the fuse reminder information is subsequently sent to relevant personnel. If the present application detects that the impact assessment result is not within the impact range of the fault scenario, the distributed database will be automatically subjected to fuse processing based on the obtained fuse strategy, thereby stopping the fault injection of the distributed database and restoring the normal operation of the distributed database, thereby ensuring the stable operation of the distributed database. In addition, the corresponding fuse reminder information will be intelligently sent to relevant personnel so that the relevant personnel can promptly understand the current fuse processing situation of the distributed database, and then be able to carry out corresponding processing plans for the distributed database to improve the stability and reliability of the distributed database.

[0142] In some optional implementations of this embodiment, after step S207, the electronic device may further perform the following steps:

[0143] Obtain optimization result data corresponding to the distributed database.

[0144] In this embodiment, the above-mentioned optimization result data may include an optimization result obtained by optimizing the distributed database based on the target optimization strategy.

[0145] A corresponding optimization processing report is generated based on the target problem point, the optimization result data and the optimization strategy.

[0146] In this embodiment, the target problem point, the optimization result data and the optimization strategy can be filled into the corresponding areas of the pre-built report template to generate a corresponding optimization processing report. The report template is a pre-built template file containing a problem point area, a result area and a strategy area.

[0147] Get the communication information of the specified person.

[0148] In this embodiment, the designated personnel may be personnel responsible for the development and operation and maintenance of the distributed database. The communication information may include emails, mobile phone numbers, and the like.

[0149] Based on the communication information, the optimization processing report is sent to the designated person.

[0150] In this embodiment, the generated optimization processing report can be sent to the communication terminal corresponding to the communication information, thereby completing the process of sending the optimization processing report to the designated person.

[0151] This application obtains the optimization result data corresponding to the distributed database; then generates a corresponding optimization processing report based on the target problem point, the optimization result data and the optimization strategy; then obtains the communication information of the designated person; and subsequently sends the optimization processing report to the designated person based on the communication information. After optimizing the distributed database based on the target optimization strategy, this application will also automatically and intelligently obtain the optimization result data corresponding to the distributed database, and generate a corresponding optimization processing report based on the target problem point, the optimization result data and the optimization strategy, thereby realizing the automatic generation of the optimization processing report and improving the generation efficiency of the optimization processing report. The optimization processing report will be sent to the designated person based on the communication information of the designated person obtained, so that the designated person can be guided to continuously optimize and improve the distributed database based on the optimization processing report, which is beneficial to improving the work efficiency of the designated person and the stability of the distributed database.

[0152] In some optional implementations of this embodiment, after step S207, the electronic device may further perform the following steps:

[0153] Get the preset plan update strategy.

[0154] In this embodiment, the strategy content of the above-mentioned plan update strategy includes: incorporating new problems and corresponding solutions found in chaos engineering testing into the existing emergency plan related to distributed databases, updating relevant operation steps and recovery processes. And supplementing corresponding emergency response and recovery strategies for the fault scenarios simulated in chaos engineering testing. Among them, the above-mentioned new problems refer to problems that are not recorded in the above-mentioned emergency plan.

[0155] The emergency plan is updated based on the plan update strategy.

[0156] In this embodiment, the update process of the emergency plan can be executed according to the policy content of the above-mentioned plan update policy.

[0157] This application obtains a preset plan update strategy; and then updates the emergency plan based on the plan update strategy. This application can achieve automatic update processing of the emergency plan based on the use of the plan update strategy, thereby ensuring that the emergency plan can be consistent with the current status and business needs of the distributed database, and that the emergency plan can cover the potential risks that new technologies bring to the distributed database.

[0158] In some optional implementations, the user information obtained is subject to the user's consent and complies with relevant laws and policies.

[0159] In addition, the non-Company software tools or components that appear in the embodiments of the present application are merely examples and do not represent actual use.

[0160] This application introduces chaos engineering, a new operation and maintenance concept and tool, into the operation and maintenance of TIDB. At the same time, a new chaos engineering practice plan is designed based on the characteristics of TIDB, and the existing daily operation and maintenance experience is integrated into it, and the design and implementation are layered. The explosion radius is evaluated through indicators to increase the reliability of chaos engineering. Through the following plans and processes, the weaknesses and emergency plans of TIDB are checked and verified, thereby improving the stability and reliability of TIDB and enhancing the confidence of maintenance personnel.

[0161] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.

[0162] It should be emphasized that in order to further ensure the privacy and security of the above-mentioned target problem points, the above-mentioned target problem points can also be stored in a node of a blockchain.

[0163] The blockchain referred to in this application is a new application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanism, encryption algorithm, etc. Blockchain is essentially a decentralized database, a string of data blocks generated by cryptographic methods. Each data block contains a batch of network transaction information, which is used to verify the validity of its information (anti-counterfeiting) and generate the next block. Blockchain can include the underlying blockchain platform, platform product service layer, and application service layer.

[0164] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Among them, artificial intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.

[0165] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0166] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through computer-readable instructions, and the computer-readable instructions can be stored in a computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, the aforementioned storage medium can be a non-volatile storage medium such as a disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

[0167] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.

[0168] Further references Figure 3 , as a response to the above Figure 2 The present application provides an embodiment of a database optimization device, and the device embodiment is similar to Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.

[0169] like Figure 3As shown, the database optimization device 300 described in this embodiment includes: a first acquisition module 301, an injection module 302, a second acquisition module 303, an evaluation module 304, a judgment module 305, an analysis module 306 and an optimization module 307. Among them:

[0170] The first acquisition module 301 is used to acquire preset fault scenario information corresponding to the distributed database, and acquire an implementation plan corresponding to the fault scenario information;

[0171] An injection module 302 is used to call a preset chaos engineering tool to inject a fault into the distributed database based on the fault scenario information and the implementation plan;

[0172] A second acquisition module 303 is used to acquire first performance indicator data of the distributed database after a fault is injected based on a preset monitoring tool;

[0173] An evaluation module 304 is used to evaluate the impact of the fault scenario on the distributed database based on the first performance indicator data to obtain a corresponding impact evaluation result;

[0174] A judgment module 305 is used to judge whether the impact assessment result is within the preset fault scenario impact range;

[0175] Analysis module 306, for performing problem analysis on the performance indicator data of the distributed database before and after the fault is injected to obtain corresponding target problem points;

[0176] The optimization module 307 is used to obtain a target optimization strategy corresponding to the target problem point from a preset emergency plan, and optimize the distributed database based on the target optimization strategy.

[0177] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the database optimization method in the aforementioned implementation mode, and are not described in detail here.

[0178] In some optional implementations of this embodiment, the first acquisition module 301 includes:

[0179] A first acquisition submodule, used to acquire first fault scenario information corresponding to the access computing layer in the distributed database;

[0180] A second acquisition submodule is used to acquire second fault scenario information corresponding to the storage and computing layer in the distributed database;

[0181] A third acquisition submodule, used to acquire third fault scenario information corresponding to the clock layer in the distributed database;

[0182] A generation submodule is used to generate the fault scenario information based on the first fault scenario information, the second fault scenario information and the third fault scenario information.

[0183] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the database optimization method in the aforementioned implementation mode, and are not described in detail here.

[0184] In some optional implementations of this embodiment, the analysis module 306 includes:

[0185] A fourth acquisition submodule, used to acquire second performance indicator data of the distributed database before fault injection;

[0186] An analysis submodule, used to compare and analyze the first performance indicator data with the second performance indicator data to obtain corresponding comparative analysis results;

[0187] A positioning submodule, used for performing problem positioning processing corresponding to the distributed database based on the comparison and analysis results to obtain corresponding problem points;

[0188] The classification submodule is used to classify the problem points to obtain the target problem points.

[0189] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the database optimization method in the aforementioned implementation mode, and are not described in detail here.

[0190] In some optional implementations of this embodiment, the database optimization device further includes:

[0191] A third acquisition module is used to obtain a first fault scenario impact range corresponding to the access computing layer in the distributed database;

[0192] A fourth acquisition module, configured to acquire an impact range of a second fault scenario corresponding to the storage and computing layer in the distributed database;

[0193] A fifth acquisition module, used to acquire an impact range of a third fault scenario corresponding to a clock layer in the distributed database;

[0194] The first generating module is used to generate the fault scenario impact range based on the first fault scenario impact range, the second fault scenario impact range and the third fault scenario impact range.

[0195] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the database optimization method in the aforementioned implementation mode, and are not described in detail here.

[0196] In some optional implementations of this embodiment, the database optimization device further includes:

[0197] A sixth acquisition module, configured to acquire a preset fuse strategy if the impact assessment result is not within the impact range of the fault scenario;

[0198] A fusing module, configured to perform fusing processing on the distributed database based on the fusing strategy;

[0199] A seventh acquisition module, used to obtain preset fuse reminder information;

[0200] The first sending module is used to send the fuse reminder information to relevant personnel.

[0201] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the database optimization method in the aforementioned implementation mode, and are not described in detail here.

[0202] In some optional implementations of this embodiment, the database optimization device further includes:

[0203] An eighth acquisition module, used to acquire optimization result data corresponding to the distributed database;

[0204] A second generating module, configured to generate a corresponding optimization processing report based on the target problem point, the optimization result data and the optimization strategy;

[0205] The ninth acquisition module is used to acquire the communication information of the designated person;

[0206] The second sending module is used to send the optimization processing report to the designated person based on the communication information.

[0207] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the database optimization method in the aforementioned implementation mode, and are not described in detail here.

[0208] In some optional implementations of this embodiment, the database optimization device further includes:

[0209] The tenth acquisition module is used to obtain the preset plan update strategy;

[0210] An updating module is used to update the emergency plan based on the plan updating strategy.

[0211] In this embodiment, the operations performed by the above modules or units correspond one-to-one to the steps of the database optimization method in the aforementioned implementation mode, and are not described in detail here.

[0212] To solve the above technical problems, the present application also provides a computer device. Figure 4 , Figure 4 This is a basic structural block diagram of the computer device in this embodiment.

[0213] The computer device 4 includes a memory 41, a processor 42, and a network interface 43 that are interconnected through a system bus. It should be noted that the figure only shows a computer device 4 with components 41-43, but it should be understood that it is not required to implement all the components shown, and more or fewer components can be implemented instead. Among them, those skilled in the art can understand that the computer device here is a device that can automatically perform numerical calculations and / or information processing according to pre-set or stored instructions, and its hardware includes but is not limited to microprocessors, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), programmable gate arrays (Field-Programmable Gate Array, FPGA), digital processors (Digital Signal Processor, DSP), embedded devices, etc.

[0214] The computer device may be a computing device such as a desktop computer, a notebook, a PDA, a cloud server, etc. The computer device may interact with a user through a keyboard, a mouse, a remote controller, a touch pad, or a voice control device.

[0215] The memory 41 includes at least one type of readable storage medium, and the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, disk, optical disk, etc. In some embodiments, the memory 41 can be an internal storage unit of the computer device 4, such as a hard disk or memory of the computer device 4. In other embodiments, the memory 41 can also be an external storage device of the computer device 4, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (FlashCard), etc. equipped on the computer device 4. Of course, the memory 41 can also include both the internal storage unit of the computer device 4 and its external storage device. In this embodiment, the memory 41 is generally used to store the operating system and various application software installed on the computer device 4, such as computer-readable instructions of the database optimization method, etc. In addition, the memory 41 can also be used to temporarily store various types of data that have been output or are to be output.

[0216] The processor 42 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments. The processor 42 is generally used to control the overall operation of the computer device 4. In this embodiment, the processor 42 is used to run computer-readable instructions stored in the memory 41 or process data, such as computer-readable instructions for running the database optimization method.

[0217] The network interface 43 may include a wireless network interface or a wired network interface. The network interface 43 is generally used to establish a communication connection between the computer device 4 and other electronic devices.

[0218] The present application also provides another implementation, namely, providing a computer-readable storage medium, wherein the computer-readable storage medium stores computer-readable instructions, and the computer-readable instructions can be executed by at least one processor to enable the at least one processor to perform the steps of the database optimization method as described above.

[0219] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, computer, server, air conditioner, or network device, etc.) to execute the methods described in each embodiment of the present application.

[0220] Obviously, the embodiments described above are only some embodiments of the present application, rather than all embodiments. The preferred embodiments of the present application are given in the accompanying drawings, but they do not limit the patent scope of the present application. The present application can be implemented in many different forms. On the contrary, the purpose of providing these embodiments is to make the understanding of the disclosure of the present application more thorough and comprehensive. Although the present application is described in detail with reference to the aforementioned embodiments, for those skilled in the art, it is still possible to modify the technical solutions recorded in the aforementioned specific implementation methods, or to perform equivalent replacement of some of the technical features therein. Any equivalent structure made using the contents of the specification and drawings of this application, directly or indirectly used in other related technical fields, is similarly within the scope of patent protection of this application.

Claims

1. A database optimization method, characterized in that: The steps include: Obtaining preset fault scenario information corresponding to the distributed database, and obtaining an implementation plan corresponding to the fault scenario information; Based on the fault scenario information and the implementation plan, calling a preset chaos engineering tool to inject a fault into the distributed database; Obtaining first performance indicator data of the distributed database after the fault is injected based on a preset monitoring tool; Evaluate the impact of the fault scenario on the distributed database based on the first performance indicator data, and obtain a corresponding impact assessment result; Determine whether the impact assessment result is within the preset fault scenario impact range; If yes, perform problem analysis on the performance indicator data of the distributed database before and after the fault is injected to obtain the corresponding target problem point; A target optimization strategy corresponding to the target problem point is obtained from a preset emergency plan, and the distributed database is optimized based on the target optimization strategy.

2. The database optimization method according to claim 1, characterized in that: The step of obtaining preset fault scenario information corresponding to the distributed database specifically includes: Acquire first fault scenario information corresponding to the access computing layer in the distributed database; Acquire second fault scenario information corresponding to the storage and computing layer in the distributed database; Obtaining third fault scenario information corresponding to the clock layer in the distributed database; The fault scenario information is generated based on the first fault scenario information, the second fault scenario information and the third fault scenario information.

3. The database optimization method according to claim 1, characterized in that: The step of analyzing the performance indicator data of the distributed database before and after the fault is injected to obtain the corresponding target problem point specifically includes: Acquire second performance indicator data of the distributed database before fault injection; Comparatively analyzing the first performance indicator data and the second performance indicator data to obtain corresponding comparative analysis results; Based on the comparative analysis results, a problem location process corresponding to the distributed database is performed to obtain corresponding problem points; The problem points are classified to obtain the target problem points.

4. The database optimization method according to claim 1, characterized in that: Before the step of determining whether the impact assessment result is within the preset fault scenario impact range, the method further includes: Obtaining a first fault scenario impact range corresponding to an access computing layer in the distributed database; Obtaining a second fault scenario impact scope corresponding to the storage and computing layer in the distributed database; Obtaining a third fault scenario impact range corresponding to the clock layer in the distributed database; The fault scenario impact range is generated based on the first fault scenario impact range, the second fault scenario impact range, and the third fault scenario impact range.

5. The database optimization method according to claim 1, characterized in that: After the step of determining whether the impact assessment result is within the preset fault scenario impact range, the method further includes: If the impact assessment result is not within the impact range of the fault scenario, obtaining a preset fuse strategy; Performing a circuit breaker process on the distributed database based on the circuit breaker strategy; Get the preset fuse reminder information; The fuse reminder information is sent to relevant personnel.

6. The database optimization method according to claim 1, characterized in that: After the step of obtaining the target optimization strategy corresponding to the target problem point from the preset emergency plan and optimizing the distributed database based on the target optimization strategy, the method further includes: Acquire optimization result data corresponding to the distributed database; Generate a corresponding optimization processing report based on the target problem point, the optimization result data and the optimization strategy; Get the communication information of the designated person; Based on the communication information, the optimization processing report is sent to the designated person.

7. The database optimization method according to claim 1, characterized in that: After the step of obtaining the target optimization strategy corresponding to the target problem point from the preset emergency plan and optimizing the distributed database based on the target optimization strategy, the method further includes: Get the preset plan update strategy; The emergency plan is updated based on the plan update strategy.

8. A database optimization device, characterized in that: include: A first acquisition module is used to acquire preset fault scenario information corresponding to the distributed database, and acquire an implementation plan corresponding to the fault scenario information; An injection module, used to call a preset chaos engineering tool to inject faults into the distributed database based on the fault scenario information and the implementation plan; A second acquisition module, used to acquire first performance indicator data of the distributed database after a fault is injected based on a preset monitoring tool; An evaluation module, configured to evaluate the impact of a fault scenario on the distributed database based on the first performance indicator data, and obtain a corresponding impact evaluation result; A judgment module is used to judge whether the impact assessment result is within the preset fault scenario impact range; An analysis module is used to analyze the performance indicator data of the distributed database before and after the fault is injected to obtain the corresponding target problem points; The optimization module is used to obtain a target optimization strategy corresponding to the target problem point from a preset emergency plan, and optimize the distributed database based on the target optimization strategy.

9. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores computer-readable instructions, and the processor implements the steps of the database optimization method according to any one of claims 1 to 7 when executing the computer-readable instructions.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the steps of the database optimization method according to any one of claims 1 to 7 are implemented.