Automatic upgrading method applied to distributed database and related equipment
By building the version difference matrix and obtaining cluster scale parameters, combining preset configuration templates and topology files, the optimal upgrade path is calculated and the upgrade operation is performed, which solves the problems of large human resources loss and low testing efficiency in traditional automation upgrade methods, and realizes the Efficient and reliable distributed database upgrade.
Patent Information
- Application Number
- CN202411068740.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-05
- Publication Date
- 2025-02-11
AI Technical Summary
The traditional distributed database automation upgrade method has problems such as large human resources loss, low testing efficiency and accuracy.
An automated upgrade method is proposed, by receiving database upgrade requests input by users, building a version difference matrix, obtaining cluster scale parameters, calling preset configuration template library and topology file library, calculating the best upgrade path, and gradually performing the upgrade operation.
This method can intelligently formulate optimal upgrade strategies, improve the efficiency and reliability of distributed database upgrades, and reduce risks during the upgrade process.
Smart Images

Figure CN119415126A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of artificial intelligence technology, and in particular to an automatic upgrade method and related equipment applied to a distributed database. Background Art
[0002] Distributed database upgrade is a complex and critical task involving multiple nodes and a large amount of data, which contains huge technical challenges and potential risks. Traditional manual upgrade methods are often time-consuming, labor-intensive, and error-prone, especially in large-scale cluster environments. Any mistakes in the upgrade process may lead to data loss, service interruption, or performance degradation, causing serious losses to the enterprise. In addition, the differences between different versions, various hardware configurations, and complex network topologies further increase the difficulty of upgrading. How to efficiently complete the upgrade of distributed databases while ensuring data security and service continuity has become a technical problem that needs to be solved urgently.
[0003] However, the applicant has found that traditional automated upgrade methods applied to distributed databases generally require testers to perform manual operations and full-process monitoring, which leads to a serious loss of human resources. In addition, the test efficiency and accuracy cannot be effectively guaranteed. Summary of the invention
[0004] The purpose of the embodiments of the present application is to propose an automated upgrade method and related equipment for distributed databases, so as to solve the problems of large loss of human resources, low testing efficiency and accuracy in traditional automated upgrade methods.
[0005] In order to solve the above technical problems, the present application embodiment provides an automatic upgrade method applied to a distributed database, which adopts the following technical solution:
[0006] Receiving a database upgrade request input by a user terminal, wherein the database upgrade request includes current version information and target version information;
[0007] Constructing a version difference matrix according to the current version information and the target version information;
[0008] Get the cluster size parameters of the current distributed database;
[0009] Calling a preset configuration template library, and screening out a cluster configuration solution that meets the cluster scale parameters from the preset configuration template library;
[0010] Calling a topology file library, and calling an optimal topology file matching the cluster configuration solution from the topology file library;
[0011] Calculating an optimal upgrade path according to the optimal topology file and the version difference matrix;
[0012] The upgrade operation is performed step by step according to the optimal upgrade path to complete the automated upgrade operation.
[0013] Furthermore, after the step of obtaining the cluster scale parameters of the current distributed database and before the step of calling the preset configuration template library and screening out the cluster configuration scheme that meets the cluster scale parameters from the preset configuration template library, the following steps are also included:
[0014] Dynamically adjust the number of cluster nodes according to the cluster scale parameter to obtain a node number configuration;
[0015] Obtaining the load condition of the current cluster according to the node quantity configuration, and determining whether node adjustment is required according to the load condition;
[0016] If no node adjustment is required, the node quantity configuration is used as the optimal node quantity configuration;
[0017] If node adjustment is required, the number of cluster nodes is dynamically adjusted according to the load conditions to obtain the optimal node number configuration;
[0018] The step of selecting a cluster configuration solution that meets the cluster scale parameter from the preset configuration template library specifically includes the following steps:
[0019] A cluster configuration solution that meets the optimal node quantity configuration is selected from the preset configuration template library.
[0020] Furthermore, after the step of calling the preset configuration template library and selecting the cluster configuration scheme that meets the cluster scale parameter from the preset configuration template library, and before the step of calling the topology file library and calling the best topology file that matches the cluster configuration scheme from the topology file library, the following steps are also included:
[0021] If the number of the cluster configuration schemes is greater than one, obtaining the load monitoring data of the current distributed database according to the load monitoring system;
[0022] Screening the cluster configuration scheme according to the decision tree algorithm and the load monitoring data to obtain the best cluster configuration scheme;
[0023] The step of calling a topology file library and calling the best topology file matching the cluster configuration solution from the topology file library specifically includes the following steps:
[0024] A topology file library is called, and an optimal topology file matching the optimal cluster configuration solution is called from the topology file library.
[0025] Further, after the step of calculating the best upgrade path according to the best topology file and the version difference matrix, and before the step of gradually performing the upgrade operation according to the best upgrade path to complete the automated upgrade operation, the following steps are also included:
[0026] Use the network connectivity detection tool to detect the network connectivity between the nodes in the cluster and obtain the network connectivity detection result;
[0027] Determining the installation and upgrade mode of the optimal upgrade path according to the network connectivity detection result;
[0028] Acquire resource indicator data of each node in the cluster according to the resource acquisition agent program;
[0029] Determining whether the cluster node meets the resource conditions required for the upgrade operation according to the resource indicator data;
[0030] If all the cluster nodes meet the resource conditions required for the upgrade operation, the upgrade operation is performed;
[0031] If there are cluster nodes that do not meet the resource conditions required for the upgrade operation, adjust resource allocation or expand the capacity of the cluster nodes that do not meet the resource conditions.
[0032] Furthermore, after the step of gradually performing the upgrade operation according to the optimal upgrade path to complete the automated upgrade operation, the following step is also included:
[0033] Obtaining the task type of the optimal upgrade path;
[0034] Reading a test case library, and acquiring a test case corresponding to the task type in the test case library to obtain a preliminary test case set;
[0035] Optimizing the preliminary test case set according to a genetic algorithm to obtain an optimal test case combination;
[0036] Starting the distributed resource monitoring system according to the optimal test case combination and obtaining performance indicators of each node in the cluster;
[0037] Deploy a log collector, and perform log collection operations according to the log collector to obtain system operation logs;
[0038] Comprehensively analyzing and processing the performance indicators of each node in the cluster and the system operation log to obtain the test health status;
[0039] Generate an installation and upgrade report based on the test health status and test coverage results;
[0040] Output the installation and upgrade report to the user terminal.
[0041] In order to solve the above technical problems, the embodiment of the present application further provides an automatic upgrade device applied to a distributed database, which adopts the following technical solution:
[0042] A request acquisition module, used to receive a database upgrade request input by a user terminal, wherein the database upgrade request includes current version information and target version information;
[0043] A difference matrix acquisition module, used to construct a version difference matrix according to the current version information and the target version information;
[0044] The scale parameter acquisition module is used to obtain the cluster scale parameters of the current distributed database;
[0045] A configuration scheme acquisition module is used to call a preset configuration template library and filter out a cluster configuration scheme that meets the cluster scale parameters from the preset configuration template library;
[0046] A topology file acquisition module is used to call a topology file library and call the best topology file matching the cluster configuration solution from the topology file library;
[0047] An upgrade path acquisition module, used to calculate the best upgrade path according to the best topology file and the version difference matrix;
[0048] The upgrade operation module is used to gradually perform the upgrade operation according to the optimal upgrade path to complete the automated upgrade operation.
[0049] Furthermore, the device further comprises: a node quantity configuration submodule, a node adjustment judgment submodule, a first node quantity confirmation submodule and a second node quantity confirmation submodule, and the configuration scheme acquisition module comprises: a configuration scheme acquisition submodule, wherein:
[0050] The node quantity configuration submodule is used to dynamically adjust the number of cluster nodes according to the cluster scale parameter to obtain the node quantity configuration;
[0051] The node adjustment judgment submodule is used to obtain the load condition of the current cluster according to the node quantity configuration, and judge whether node adjustment is required according to the load condition;
[0052] The first node quantity confirmation submodule is used for taking the node quantity configuration as the optimal node quantity configuration if no node adjustment is required;
[0053] The second node quantity confirmation submodule is used to dynamically adjust the number of cluster nodes according to the load conditions to obtain an optimal node quantity configuration if node adjustment is required;
[0054] The configuration scheme acquisition submodule is used to filter out a cluster configuration scheme that meets the optimal node quantity configuration from the preset configuration template library.
[0055] Furthermore, the device further comprises: a load data acquisition module and a cluster configuration screening module, and the topology file acquisition module comprises: a topology file acquisition submodule, wherein:
[0056] A load data acquisition module, used for acquiring the load monitoring data of the current distributed database according to the load monitoring system if the number of the cluster configuration schemes is greater than one;
[0057] A cluster configuration screening module, used to screen the cluster configuration scheme according to the decision tree algorithm and the load monitoring data to obtain the best cluster configuration scheme;
[0058] The topology file acquisition submodule is used to call a topology file library and call the best topology file matching the best cluster configuration solution from the topology file library.
[0059] 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:
[0060] It comprises a memory and a processor, wherein the memory stores computer-readable instructions, and when the processor executes the computer-readable instructions, the steps of the automatic upgrade method applied to a distributed database as described above are implemented.
[0061] 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:
[0062] The computer-readable storage medium stores computer-readable instructions, and when the computer-readable instructions are executed by a processor, the steps of the automatic upgrade method applied to a distributed database as described above are implemented.
[0063] The present application provides an automated upgrade method for a distributed database, comprising: receiving a database upgrade request input by a user terminal, wherein the database upgrade request includes current version information and target version information; constructing a version difference matrix according to the current version information and the target version information; obtaining the cluster scale parameter of the current distributed database; calling a preset configuration template library, and filtering out a cluster configuration scheme that meets the cluster scale parameter from the preset configuration template library; calling a topology file library, and calling the best topology file that matches the cluster configuration scheme from the topology file library; calculating the best upgrade path according to the best topology file and the version difference matrix; and performing the upgrade operation step by step according to the best upgrade path to complete the automated upgrade operation. Compared with the prior art, the present application not only takes into account version differences and cluster scale, but also utilizes preset configuration templates and topology files, so that the optimal upgrade strategy can be intelligently formulated, which greatly improves the efficiency and reliability of distributed database upgrades and reduces the risks during the upgrade process. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] 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.
[0065] Figure 1 is an exemplary system architecture diagram to which the present application may be applied;
[0066] Figure 2 This is a flowchart of an implementation of an automated upgrade method for a distributed database provided in Example 1 of the present application;
[0067] Figure 3 It is a structural diagram of an automatic upgrade device applied to a distributed database provided in Embodiment 2 of the present application;
[0068] Figure 4 It is a structural diagram of an embodiment of a computer device according to the present application. DETAILED DESCRIPTION
[0069] 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.
[0070] 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.
[0071] 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.
[0072] like Figure 1 As shown, the system architecture 100 may include terminal devices 101, 102, 103, a network 104 and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.
[0073] Users can use terminal devices 101, 102, 103 to interact with server 105 through network 104 to receive or send messages, etc. Various communication client applications can be installed on terminal devices 101, 102, 103, such as web browser applications, shopping applications, search applications, instant messaging tools, email clients, social platform software, etc.
[0074] The terminal devices 101, 102, and 103 can be various electronic devices with display screens and supporting web browsing, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture Experts Group Audio Layer III), MP4 (Moving Picture Experts Group Audio Layer IV) players, laptop computers, desktop computers, etc.
[0075] The server 105 may be a server that provides various services, such as a background server that provides support for web pages displayed on the terminal devices 101 , 102 , and 103 .
[0076] It should be noted that the automatic upgrade method for a distributed database provided in the embodiment of the present application is generally executed by a server / terminal device, and accordingly, the automatic upgrade device for a distributed database is generally arranged in a server / terminal device.
[0077] 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.
[0078] Embodiment 1
[0079] Continue to refer Figure 2 , shows a flow chart of an embodiment of an automatic upgrade method for a distributed database according to the present application. The automatic upgrade method for a distributed database comprises: step S201, step S202, step S203, step S204, step S205, step S206 and step S207.
[0080] In step S201, a database upgrade request input by a user terminal is received, wherein the database upgrade request includes current version information and target version information.
[0081] In the embodiments of the present application, the user terminal refers to a terminal device used to execute the image processing method for preventing document abuse provided by the present application. The user terminal can be a mobile terminal such as a mobile phone, a smart phone, a laptop computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a navigation device, etc., as well as a fixed terminal such as a digital TV, a desktop computer, etc. It should be understood that the examples of user terminals here are only for the convenience of understanding and are not used to limit the present application.
[0082] In step S202, a version difference matrix is constructed according to the current version information and the target version information.
[0083] In an embodiment of the present application, a version difference matrix is constructed based on the input base version number and target version number to obtain the difference information between the versions. As an example, assuming that the present application has a cluster, the current base version number is 1, and the target version number is 5, the present application first needs to construct a version difference matrix to list the changes between versions 1 to 5, such as new features, bug fixes, security improvements, etc.
[0084] In step S203, the cluster scale parameter of the current distributed database is obtained.
[0085] In step S204, a preset configuration template library is called, and a cluster configuration solution that meets the cluster scale parameters is screened out from the preset configuration template library.
[0086] In an embodiment of the present application, a preset configuration template library is pre-set with configuration templates that meet various cluster scale parameters. As an example, assuming that the cluster scale parameter of the current distributed database is 15 nodes, it is necessary to obtain a cluster configuration solution that meets the 15-node scale in the preset configuration template library to meet the needs of version upgrade.
[0087] In step S205, a topology file library is called, and the best topology file matching the cluster configuration solution is called from the topology file library.
[0088] In the embodiment of the present application, after the selected cluster configuration scheme is selected, a retrieval algorithm can be written to quickly filter the installation and upgrade configuration topology file with the highest matching degree with the required configuration from the topology file library. Assuming that there are one hundred files in the topology file library, the cosine similarity algorithm can be used to calculate the matching degree of each file with the selected configuration, and the file with the highest matching degree is selected.
[0089] In step S206, the best upgrade path is calculated according to the best topology file and the version difference matrix.
[0090] In the embodiment of the present application, it is assumed that after the optimal topology file is selected, its content can be parsed, and combined with the version difference matrix, all possible upgrade paths from the current version to the target version can be calculated by the Dijkstra algorithm, and all feasible path options are listed. As an example, if there are three paths: A→B→C, A→D→C, and A→E→C, by analyzing factors such as resource requirements and time consumption of each path, we get:
[0091] (1) The path A→B→C requires the CPU usage to be no more than 50%, the memory usage to be no more than 60%, and takes 2 hours;
[0092] (2) Path A→D→C requires the CPU usage to be no more than 60% and the memory usage to be no more than 70%, and takes 5 hours;
[0093] (3) The path A→E→C requires the CPU usage to be no more than 55%, the memory usage to be no more than 65%, and takes 1 hour;
[0094] Through comprehensive analysis, it can be determined that path A→E→C is the optimal upgrade path.
[0095] In step S207, the upgrade operation is performed step by step according to the optimal upgrade path to complete the automated upgrade operation.
[0096] In the embodiment of the present application, after the optimal upgrade path is determined, the upgrade operation can be performed step by step according to the optimal upgrade path.
[0097] In actual applications, assuming the upgrade path is A→E→C, first upgrade to version E, use the version difference matrix to verify version compatibility, ensure there is no conflict, and then continue to upgrade to version C.
[0098] In an embodiment of the present application, during the upgrade process, the resource usage of each node can be checked in real time through a resource monitoring tool to ensure that it is within a safe range.
[0099] In an embodiment of the present application, after the upgrade is completed, the resource acquisition agent can be used again to obtain resource indicator data of each node. By comparing the resource data before and after the upgrade, it is confirmed that the impact of the upgrade process on system resources is within a controllable range to complete the entire upgrade process.
[0100] In an embodiment of the present application, an automated upgrade method for a distributed database is provided, including: receiving a database upgrade request input by a user terminal, wherein the database upgrade request includes current version information and target version information; constructing a version difference matrix according to the current version information and the target version information; obtaining the cluster scale parameter of the current distributed database; calling a preset configuration template library, and filtering out a cluster configuration scheme that meets the cluster scale parameter from the preset configuration template library; calling a topology file library, and calling the best topology file that matches the cluster configuration scheme from the topology file library; calculating the best upgrade path according to the best topology file and the version difference matrix; and gradually executing the upgrade operation according to the best upgrade path to complete the automated upgrade operation. Compared with the prior art, the present application not only takes into account the version difference and cluster scale, but also utilizes the preset configuration template and topology file, so that the optimal upgrade strategy can be intelligently formulated, which greatly improves the efficiency and reliability of the distributed database upgrade and reduces the risk during the upgrade process.
[0101] In some optional implementations of the embodiments of the present application, after step S203 and before step 204, the following steps are further included:
[0102] Dynamically adjust the number of cluster nodes according to cluster scale parameters to obtain node number configuration;
[0103] Get the current cluster load according to the node quantity configuration, and determine whether node adjustment is needed based on the load situation;
[0104] If no node adjustment is required, the node quantity configuration is taken as the optimal node quantity configuration;
[0105] If node adjustment is required, the number of cluster nodes is dynamically adjusted according to the load conditions to obtain the optimal node number configuration;
[0106] Step S204 specifically includes the following steps:
[0107] Filter out the cluster configuration solution that meets the optimal node quantity configuration from the preset configuration template library.
[0108] In an embodiment of the present application, it is assumed that through the load monitoring system, the present application finds that the CPU utilization rate of the current 10 nodes is 85%, and the I / O load is 80%. In order to reduce the load, the present application decides to increase the number of nodes to 15; the present application obtains the load status of the current cluster and finds that after increasing to 15 nodes, the CPU utilization rate drops to 60%, and the I / O load drops to 65%; based on this situation, the present application determines that 15 nodes is a more reasonable configuration.
[0109] In some optional implementations of the embodiments of the present application, after step S204 and before step 205, the following steps are further included:
[0110] If the number of cluster configuration schemes is greater than 1, the load monitoring data of the current distributed database is obtained according to the load monitoring system;
[0111] The cluster configuration scheme is screened and processed according to the decision tree algorithm and load monitoring data to obtain the best cluster configuration scheme;
[0112] Step S205 specifically includes the following steps:
[0113] The topology file library is called, and the best topology file matching the best cluster configuration solution is called from the topology file library.
[0114] In an embodiment of the present application, the present application selects a configuration template suitable for the cluster scale parameters from a preset configuration template library. Assuming that the selected candidate templates are template A and template B, the decision tree algorithm is used to analyze these two templates, and the optimal matching cluster configuration solution is finally selected based on indicators such as CPU usage and I / O load.
[0115] In some optional implementations of the embodiments of the present application, after step S205 and before step S206, the following steps are further included:
[0118] Use the network connectivity detection tool to detect the network connectivity between the nodes in the cluster and obtain the network connectivity detection result;
[0119] An installation and upgrade mode that determines the best upgrade path based on the network connectivity test results;
[0120] Obtain resource indicator data of each node in the cluster according to the resource collection agent;
[0121] Determine whether the cluster nodes meet the resource conditions required for the upgrade operation based on the resource indicator data;
[0122] If all cluster nodes meet the resource conditions required for the upgrade operation, the upgrade operation is performed;
[0123] If there are cluster nodes that do not meet the resource conditions required for the upgrade operation, adjust resource allocation or expand the capacity of the cluster nodes that do not meet the resource conditions.
[0124] In an embodiment of the present application, network connectivity detection tools such as ping, trace route, etc. are used to detect the network connectivity between the nodes of the cluster. As an example, it is assumed that the detection results show that the average delay between nodes is 5ms and the packet loss rate is 1%, which meets the requirements of online installation and upgrade.
[0125] In an embodiment of the present application, a resource acquisition agent is started to obtain resource indicator data of each node. As an example, it is assumed that the CPU utilization rate of node 1 is 40%, the memory occupancy is 50%, and the disk space is 200GB; the CPU utilization rate of node 2 is 30%, the memory occupancy is 45%, and the disk space is 250GB. The resources of all nodes meet the conditions required for upgrading.
[0126] In some optional implementations of the embodiments of the present application, after step S206, the following steps are further included:
[0127] The type of missions that get the best upgrade path;
[0128] Read the test case library, and obtain the test case corresponding to the task type in the test case library to obtain a preliminary test case set;
[0129] Optimize the preliminary test case set according to the genetic algorithm to obtain the best test case combination;
[0130] Start the distributed resource monitoring system based on the best test case combination and obtain the performance indicators of each node in the cluster;
[0131] Deploy the log collector and perform log collection operations based on the log collector to obtain system operation logs;
[0132] Comprehensively analyze and process the performance indicators of each node in the cluster and the system operation log to obtain the test health status;
[0133] Generate installation and upgrade reports based on test health status and test coverage results;
[0134] Output the installation upgrade report to the user terminal.
[0135] In an embodiment of the present application, according to the installation and upgrade task type, a corresponding test case library is obtained, and test cases that preliminarily meet the installation and upgrade strategy are screened out to obtain a preliminary test case set.
[0136] In an embodiment of the present application, a genetic algorithm is used to optimize the preliminary test case set, select the optimal test case combination, and determine whether the test coverage meets the expected standard. If not, the test case combination is readjusted and optimized again.
[0137] In an embodiment of the present application, based on the optimal test case combination, the distributed resource monitoring system is started to obtain the performance indicators of each node to determine whether the node performance is within a normal range.
[0138] In an embodiment of the present application, if the node performance indicator is not within the normal range, the specific performance problem is analyzed, and the load distribution or resource allocation strategy is adjusted to reacquire the node performance indicator until the performance of all nodes meets the requirements.
[0139] In an embodiment of the present application, a log collector is deployed to collect system operation logs in real time. The log content is parsed by a log analysis tool to determine whether there is abnormal information in the log. If so, exception handling is performed and the log is collected again.
[0140] In an embodiment of the present application, a health check probe is used to regularly perform availability checks on each component of the cluster, obtain the availability status of each component, and determine whether there are unavailable components. If so, a recovery operation is performed and the availability is rechecked.
[0141] In some optional implementations of the embodiments of the present application, a health check probe may be used to regularly perform consistency checks on the components of the cluster, obtain the consistency status, determine whether there are inconsistent components, and if so, perform repair operations and recheck the consistency.
[0142] In an embodiment of the present application, through a comprehensive analysis of the system operation log and node performance indicators, the current overall health status of the system is determined, and it is judged whether the test cases or system configuration need to be further optimized. If necessary, the optimization is restarted.
[0143] In an embodiment of the present application, an installation and upgrade task completion report is generated based on the final health status report and test coverage results, and output to the user terminal for subsequent processing.
[0144] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. 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.
[0145] 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.
[0146] 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).
[0147] 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.
[0148] Embodiment 2
[0149] Further references Figure 3 , as a response to the above Figure 2 The present application provides an embodiment of an automatic upgrade device for a distributed database. Figure 2 Corresponding to the method embodiment shown, the device can be specifically applied to various electronic devices.
[0150] like Figure 3 As shown, the automatic upgrade device 200 applied to a distributed database in an embodiment of the present application includes:
[0151] The request acquisition module 210 is used to receive a database upgrade request input by a user terminal, wherein the database upgrade request includes current version information and target version information;
[0152] A difference matrix acquisition module 220 is used to construct a version difference matrix according to the current version information and the target version information;
[0153] The scale parameter acquisition module 230 is used to obtain the cluster scale parameters of the current distributed database;
[0154] The configuration scheme acquisition module 240 is used to call the preset configuration template library and filter out the cluster configuration scheme that meets the cluster scale parameters from the preset configuration template library;
[0155] A topology file acquisition module 250 is used to call a topology file library and call the best topology file matching the cluster configuration solution from the topology file library;
[0156] An upgrade path acquisition module 260 is used to calculate the best upgrade path according to the best topology file and the version difference matrix;
[0157] The upgrade operation module 270 is used to perform the upgrade operation step by step according to the best upgrade path to complete the automatic upgrade operation.
[0158] In an embodiment of the present application, an automated upgrade device 200 for a distributed database is provided, including: a request acquisition module 210, for receiving a database upgrade request input by a user terminal, wherein the database upgrade request includes current version information and target version information; a difference matrix acquisition module 220, for constructing a version difference matrix according to the current version information and the target version information; a scale parameter acquisition module 230, for acquiring cluster scale parameters of the current distributed database; a configuration scheme acquisition module 240, for calling a preset configuration template library, and filtering out a cluster configuration scheme that meets the cluster scale parameters from the preset configuration template library; a topology file acquisition module 250, for calling a topology file library, and calling an optimal topology file that matches the cluster configuration scheme from the topology file library; an upgrade path acquisition module 260, for calculating an optimal upgrade path according to the optimal topology file and the version difference matrix; an upgrade operation module 270, for gradually performing upgrade operations according to the optimal upgrade path to complete the automated upgrade operation. Compared with the existing technology, this application not only takes into account version differences and cluster size, but also utilizes preset configuration templates and topology files, so that the optimal upgrade strategy can be intelligently formulated, which greatly improves the efficiency and reliability of distributed database upgrades and reduces the risks during the upgrade process.
[0159] In some optional implementations of the embodiments of the present application, the device further includes: a node quantity configuration submodule, a node adjustment judgment submodule, a first node quantity confirmation submodule, and a second node quantity confirmation submodule, and the configuration scheme acquisition module includes: a configuration scheme acquisition submodule, wherein:
[0160] The node quantity configuration submodule is used to dynamically adjust the number of cluster nodes according to the cluster scale parameters to obtain the node quantity configuration;
[0161] The node adjustment judgment submodule is used to obtain the current cluster load according to the node quantity configuration, and determine whether node adjustment is needed according to the load condition;
[0162] A first node quantity confirmation submodule, configured to use the node quantity configuration as the optimal node quantity configuration if no node adjustment is required;
[0163] The second node quantity confirmation submodule is used to dynamically adjust the number of cluster nodes according to the load conditions if node adjustment is required to obtain the optimal node quantity configuration;
[0164] The configuration scheme acquisition submodule is used to filter out the cluster configuration scheme that meets the optimal node number configuration from the preset configuration template library.
[0165] In some optional implementations of the embodiments of the present application, the device further includes: a load data acquisition module and a cluster configuration screening module, and the topology file acquisition module includes: a topology file acquisition submodule, wherein:
[0166] A load data acquisition module, used to obtain the load monitoring data of the current distributed database according to the load monitoring system if the number of cluster configuration schemes is greater than one;
[0167] The cluster configuration screening module is used to screen the cluster configuration schemes according to the decision tree algorithm and load monitoring data to obtain the best cluster configuration scheme;
[0168] The topology file acquisition submodule is used to call the topology file library and call the best topology file matching the best cluster configuration solution from the topology file library.
[0169] 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 a computer device according to an embodiment of the present application.
[0170] The computer device 300 includes a memory 310, a processor 320, and a network interface 330 that are interconnected and communicated through a system bus. It should be noted that the figure only shows a computer device 300 having components 310-330, 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 (ASICs), field-programmable gate arrays (FPGAs), digital processors (DSPs), embedded devices, etc.
[0171] 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.
[0172] The memory 310 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, magnetic disk, optical disk, etc. In some embodiments, the memory 310 can be an internal storage unit of the computer device 300, such as a hard disk or memory of the computer device 300. In other embodiments, the memory 310 can also be an external storage device of the computer device 300, such as a plug-in hard disk equipped on the computer device 300, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card, etc. Of course, the memory 310 can also include both the internal storage unit of the computer device 300 and its external storage device. In the embodiment of the present application, the memory 310 is generally used to store the operating system and various application software installed on the computer device 300, such as computer-readable instructions for the automatic upgrade method of the distributed database, etc. In addition, the memory 310 can also be used to temporarily store various data that have been output or are to be output.
[0173] The processor 320 may be a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip in some embodiments. The processor 320 is generally used to control the overall operation of the computer device 300. In the embodiment of the present application, the processor 320 is used to run the computer-readable instructions stored in the memory 310 or process data, such as running the computer-readable instructions of the automatic upgrade method applied to the distributed database.
[0174] The network interface 330 may include a wireless network interface or a wired network interface. The network interface 330 is generally used to establish a communication connection between the computer device 300 and other electronic devices.
[0175] The computer device provided in this application not only takes into account version differences and cluster size, but also utilizes preset configuration templates and topology files, so that it can intelligently formulate the optimal upgrade strategy, greatly improving the efficiency and reliability of distributed database upgrades and reducing the risks during the upgrade process.
[0176] The present application also provides another embodiment, namely, providing a computer-readable storage medium, which 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 automatic upgrade method applied to a distributed database as described above.
[0177] The computer-readable storage medium provided in this application not only takes into account version differences and cluster size, but also utilizes preset configuration templates and topology files, so as to intelligently formulate the optimal upgrade strategy, greatly improve the efficiency and reliability of distributed database upgrades, and reduce the risks during the upgrade process.
[0178] 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.
[0179] 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. An automatic upgrade method applied to a distributed database, characterized in that: The steps include: Receiving a database upgrade request input by a user terminal, wherein the database upgrade request includes current version information and target version information; Constructing a version difference matrix according to the current version information and the target version information; Get the cluster size parameters of the current distributed database; Calling a preset configuration template library, and screening out a cluster configuration solution that meets the cluster scale parameters from the preset configuration template library; Calling a topology file library, and calling an optimal topology file matching the cluster configuration solution from the topology file library; Calculating an optimal upgrade path according to the optimal topology file and the version difference matrix; The upgrade operation is performed step by step according to the optimal upgrade path to complete the automated upgrade operation.
2. The automatic upgrade method applied to a distributed database according to claim 1, characterized in that: After the step of obtaining the cluster scale parameters of the current distributed database and before the step of calling the preset configuration template library and screening out the cluster configuration scheme that meets the cluster scale parameters from the preset configuration template library, the following steps are also included: Dynamically adjust the number of cluster nodes according to the cluster scale parameter to obtain a node number configuration; Obtaining the load condition of the current cluster according to the node quantity configuration, and determining whether node adjustment is required according to the load condition; If no node adjustment is required, the node quantity configuration is used as the optimal node quantity configuration; If node adjustment is required, the number of cluster nodes is dynamically adjusted according to the load conditions to obtain the optimal node number configuration; The step of selecting a cluster configuration solution that meets the cluster scale parameter from the preset configuration template library specifically includes the following steps: A cluster configuration solution that meets the optimal node quantity configuration is selected from the preset configuration template library.
3. The automatic upgrade method applied to a distributed database according to claim 1, characterized in that: After the step of calling the preset configuration template library and selecting a cluster configuration solution that meets the cluster scale parameter from the preset configuration template library, and before the step of calling the topology file library and calling the best topology file that matches the cluster configuration solution from the topology file library, the following steps are also included: If the number of the cluster configuration schemes is greater than one, obtaining the load monitoring data of the current distributed database according to the load monitoring system; Screening the cluster configuration scheme according to the decision tree algorithm and the load monitoring data to obtain the best cluster configuration scheme; The step of calling a topology file library and calling the best topology file matching the cluster configuration solution from the topology file library specifically includes the following steps: A topology file library is called, and an optimal topology file matching the optimal cluster configuration solution is called from the topology file library.
4. The automatic upgrade method applied to a distributed database according to claim 1, characterized in that: After the step of calculating the best upgrade path according to the best topology file and the version difference matrix, and before the step of gradually performing the upgrade operation according to the best upgrade path to complete the automated upgrade operation, the following steps are also included: Use the network connectivity detection tool to detect the network connectivity between the nodes in the cluster and obtain the network connectivity detection result; Determining the installation and upgrade mode of the optimal upgrade path according to the network connectivity detection result; Acquire resource indicator data of each node in the cluster according to the resource acquisition agent program; Determining whether the cluster node meets the resource conditions required for the upgrade operation according to the resource indicator data; If all the cluster nodes meet the resource conditions required for the upgrade operation, the upgrade operation is performed; If there are cluster nodes that do not meet the resource conditions required for the upgrade operation, adjust resource allocation or expand the capacity of the cluster nodes that do not meet the resource conditions.
5. The automatic upgrade method applied to a distributed database according to claim 1, characterized in that: After the step of gradually performing the upgrade operation according to the optimal upgrade path to complete the automated upgrade operation, the following steps are also included: Obtaining the task type of the optimal upgrade path; Reading a test case library, and acquiring a test case corresponding to the task type in the test case library to obtain a preliminary test case set; Optimizing the preliminary test case set according to a genetic algorithm to obtain an optimal test case combination; Starting the distributed resource monitoring system according to the optimal test case combination and obtaining performance indicators of each node in the cluster; Deploy a log collector, and perform log collection operations according to the log collector to obtain system operation logs; Comprehensively analyzing and processing the performance indicators of each node in the cluster and the system operation log to obtain the test health status; Generate an installation and upgrade report based on the test health status and test coverage results; Output the installation and upgrade report to the user terminal.
6. An automatic upgrade device applied to a distributed database, characterized in that: include: A request acquisition module, used to receive a database upgrade request input by a user terminal, wherein the database upgrade request includes current version information and target version information; A difference matrix acquisition module, used to construct a version difference matrix according to the current version information and the target version information; The scale parameter acquisition module is used to obtain the cluster scale parameters of the current distributed database; A configuration scheme acquisition module is used to call a preset configuration template library and filter out a cluster configuration scheme that meets the cluster scale parameters from the preset configuration template library; A topology file acquisition module is used to call a topology file library and call the best topology file matching the cluster configuration solution from the topology file library; An upgrade path acquisition module, used to calculate the best upgrade path according to the best topology file and the version difference matrix; The upgrade operation module is used to gradually perform the upgrade operation according to the optimal upgrade path to complete the automated upgrade operation.
7. The automatic upgrade device for distributed database according to claim 6, characterized in that: The device further includes: a node quantity configuration submodule, a node adjustment judgment submodule, a first node quantity confirmation submodule and a second node quantity confirmation submodule, and the configuration scheme acquisition module includes: a configuration scheme acquisition submodule, wherein: The node quantity configuration submodule is used to dynamically adjust the number of cluster nodes according to the cluster scale parameter to obtain the node quantity configuration; The node adjustment judgment submodule is used to obtain the load condition of the current cluster according to the node quantity configuration, and judge whether node adjustment is required according to the load condition; The first node quantity confirmation submodule is used for taking the node quantity configuration as the optimal node quantity configuration if no node adjustment is required; The second node quantity confirmation submodule is used to dynamically adjust the number of cluster nodes according to the load conditions to obtain an optimal node quantity configuration if node adjustment is required; The configuration scheme acquisition submodule is used to filter out a cluster configuration scheme that meets the optimal node quantity configuration from the preset configuration template library.
8. The automatic upgrade device for distributed database according to claim 6, characterized in that: The device further comprises: a load data acquisition module and a cluster configuration screening module, and the topology file acquisition module comprises: a topology file acquisition submodule, wherein: A load data acquisition module, used for acquiring the load monitoring data of the current distributed database according to the load monitoring system if the number of the cluster configuration schemes is greater than one; A cluster configuration screening module, used to screen the cluster configuration scheme according to the decision tree algorithm and the load monitoring data to obtain the best cluster configuration scheme; The topology file acquisition submodule is used to call a topology file library and call the best topology file matching the best cluster configuration solution from the topology file library.
9. A computer device, comprising a memory and a processor, wherein the memory stores computer-readable instructions, and when the processor executes the computer-readable instructions, the steps of the automatic upgrade method applied to a distributed database as described in any one of claims 1 to 5 are implemented.
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 automatic upgrade method applied to a distributed database as described in any one of claims 1 to 5 are implemented.