Database cluster capacity expansion and shrinkage method and device, computer equipment and storage medium

By introducing a database proxy component into the database cluster, automated parsing and execution of scaling tasks are achieved, solving the complexity and instability issues associated with the introduction of management components in existing technologies. This improves the efficiency and accuracy of scaling, and enhances the reliability and user-friendliness of the system.

CN121560451APending Publication Date: 2026-02-24JINZHUAN INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511703278.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-19
Publication Date
2026-02-24

AI Technical Summary

Technical Problem

Existing database cluster scaling solutions rely on management components, which increases system complexity and maintenance workload. Furthermore, malfunctions in management components may affect the accuracy and availability of scaling.

Method used

By introducing a database proxy component into the database cluster, a two-way communication link is established, which automatically parses scaling tasks, generates strategies, and performs scaling operations between database nodes, while monitoring and providing feedback on the results in real time.

Benefits of technology

It improves the efficiency and accuracy of database cluster scaling, reduces operational risks, and enhances system reliability and user-friendliness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121560451A_ABST
    Figure CN121560451A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of database clusters, and discloses a database cluster capacity expansion and contraction method and device, computer equipment and a storage medium. A capacity expansion and contraction task processing request of a database cluster is received; the database cluster is composed of a plurality of database nodes, each database node is provided with a database agent component, the database agent components are in bidirectional communication link interconnection, and the processing request comprises capacity expansion and contraction nodes; the capacity expansion and contraction node analyzes the processing request to generate a capacity expansion and contraction strategy; the capacity expansion and contraction node comprises a node to be newly added and a node to be deleted; and executing a capacity expansion strategy by utilizing the to-be-added node and the database agent components of the other database nodes, performing capacity expansion operation on the to-be-added node, and / or executing a capacity reduction strategy by utilizing the to-be-deleted node and the database agent components of the other database nodes, performing capacity reduction operation on the to-be-deleted node, generating a processing result, and returning the processing result. According to the method, dependence on the management component can be removed, and the capacity expansion and shrinkage efficiency and accuracy of the database cluster are effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of database cluster technology, and specifically to a method, apparatus, computer equipment, and computer-readable storage medium for scaling up and down a database cluster. Background Technology

[0002] In the digital age, database systems, as core components of information storage and processing, play a crucial role in various fields, especially in key industries such as finance and government. These industries have extremely high requirements for data integrity and service availability; data loss or service interruption can lead to serious economic losses and a crisis of trust. Therefore, database systems must possess high availability to ensure that data is not lost and can respond quickly to service requests.

[0003] Currently, to meet high availability requirements, the industry commonly adopts a multi-node database cluster with one master and multiple backups across multiple machines. This architecture improves the system's fault tolerance through redundancy, ensuring that the system can still operate normally when some nodes fail. However, the cluster nodes of a database system are not static but need to be adjusted for various reasons. For example, aging nodes may cause performance degradation and require replacement, or new nodes may need to be planned and cluster data synchronized to meet business growth needs. These scenarios require the database system to have reliable scaling capabilities. Although existing database cluster scaling solutions meet these requirements to some extent, most rely on introducing additional management components to manage the cluster. These management components drive node addition and deletion operations through centralized management nodes. However, this approach has significant limitations. On the one hand, the introduction of management components increases system complexity, making maintenance more cumbersome, prone to errors, and affecting scaling efficiency. On the other hand, malfunctions in the management components themselves may affect the accuracy of scaling, or even cause the entire scaling function to fail, thus affecting system availability and stability.

[0004] Therefore, how to provide a database cluster scaling method, apparatus, computer equipment, and computer-readable storage medium that can effectively improve the efficiency and accuracy of database cluster scaling is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention

[0005] In view of the shortcomings of the prior art, the purpose of this invention is to provide a database cluster scaling method, apparatus, computer equipment, and computer-readable storage medium, aiming to solve the problem of how to effectively improve the efficiency and accuracy of database cluster scaling.

[0006] To achieve the above objectives, the present invention adopts the following technical solution: In a first aspect, the present invention provides a method for scaling up and down a database cluster, comprising: The system obtains a processing request sent by a target user for a scaling task of a database cluster; wherein the database cluster consists of multiple database nodes, each database node contains a database proxy component, and the database proxy components of each database node are connected by a bidirectional communication link; and the processing request includes the scaling node of the scaling task. The scaling nodes are used to parse the processing request and generate a scaling strategy for the scaling task; wherein, the scaling nodes include nodes to be added and nodes to be deleted in the database cluster, and the scaling strategy includes a scaling strategy and a shrinking strategy. The expansion strategy is executed using the database proxy components of the node to be added and other database nodes to perform an expansion operation on the node to be added, and / or the shrinking strategy is executed using the database proxy components of the node to be deleted and other database nodes to perform a shrinking operation on the node to be deleted, generating the processing result of the expansion and shrinking task, and returning the processing result to the target user.

[0007] Secondly, the present invention provides a database cluster scaling device, comprising: The request acquisition module is used to acquire the processing request for the scaling task of the database cluster sent by the target user; wherein the database cluster consists of multiple database nodes, the database nodes contain database proxy components, and the database proxy components of each database node are connected by a bidirectional communication link, and the processing request includes the scaling node of the scaling task. The content parsing module is used to parse the processing request using the scaling nodes and generate the scaling strategy for the scaling task; wherein, the scaling nodes include nodes to be added and nodes to be deleted in the database cluster, and the scaling strategy includes a scaling strategy and a shrinking strategy. The result generation module is used to execute the expansion strategy using the database proxy components of the node to be added and other database nodes to perform expansion operations on the node to be added, and / or to execute the shrinking strategy using the database proxy components of the node to be deleted and other database nodes to perform shrinking operations on the node to be deleted, generate the processing result of the expansion and shrinking task, and return the processing result to the target user.

[0008] Thirdly, the present invention provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the database cluster scaling method as described above.

[0009] Fourthly, the present invention provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the database cluster scaling method described above.

[0010] Compared to existing technologies, this invention provides a database cluster scaling method, apparatus, computer device, and computer-readable storage medium. The method includes: acquiring a processing request for a scaling task of a database cluster sent by a target user; wherein the database cluster consists of multiple database nodes, each database node includes a database proxy component, and the database proxy components of each database node are connected by a bidirectional communication link; the processing request includes the scaling node for the scaling task; parsing the processing request using the scaling node to generate a scaling strategy for the scaling task; wherein the scaling node includes nodes to be added and nodes to be deleted in the database cluster, and the scaling strategy includes a scaling strategy and a shrinking strategy; executing the scaling strategy using the nodes to be added and the database proxy components of other database nodes to perform a scaling operation on the nodes to be added, and / or executing the shrinking strategy using the nodes to be deleted and the database proxy components of other database nodes to perform a shrinking operation on the nodes to be deleted, generating a processing result for the scaling task, and returning the processing result to the target user. Thus, this invention can effectively improve the efficiency and accuracy of database cluster scaling. Attached Figure Description

[0011] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0012] Figure 1 This is a schematic diagram illustrating the application environment of a database cluster scaling method according to an embodiment of the present invention.

[0013] Figure 2 This is a flowchart illustrating a database cluster scaling method according to an embodiment of the present invention.

[0014] Figure 3 This is a schematic diagram of the program modules of a database cluster scaling device provided in an embodiment of the present invention.

[0015] Figure 4 This is a schematic diagram of the structure of a computer device provided in an embodiment of the present invention.

[0016] Figure 5 This is another structural schematic diagram of a computer device provided in an embodiment of the present invention. Detailed Implementation

[0017] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0018] It should be understood that, when used in this specification and the appended claims, the term "comprising" indicates the presence of the described features, integrals, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.

[0019] It should also be understood that the term “and / or” as used in this specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0020] As used in this specification and the appended claims, the term "if" may be interpreted, depending on the context, as "when," "once," "in response to determination," or "in response to detection." Similarly, the phrase "if determined" or "if [the described condition or event] is detected" may be interpreted, depending on the context, as meaning "once determined," "in response to determination," "once [the described condition or event] is detected," or "in response to detection of [the described condition or event]."

[0021] Furthermore, in the description of this invention and the appended claims, the terms "first," "second," "third," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0022] References to "one embodiment" or "some embodiments" as described in this specification mean that one or more embodiments of the invention include a specific feature, structure, or characteristic described in connection with that embodiment. Therefore, the phrases "in one embodiment," "in some embodiments," "in other embodiments," "in still other embodiments," etc., appearing in different parts of this specification do not necessarily refer to the same embodiment, but rather mean "one or more, but not all, embodiments," unless otherwise specifically emphasized. The terms "comprising," "including," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0023] It should be understood that the sequence number of each step in the following embodiments does not imply 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 embodiments of the present invention.

[0024] To illustrate the technical solution of the present invention, specific embodiments are described below.

[0025] An embodiment of the present invention provides a database cluster scaling method, which can be applied to, for example... Figure 1 In the application environment shown, the client and server communicate via a network. The client includes, but is not limited to, handheld computers, desktop computers, laptops, ultra-mobile personal computers (UMPCs), netbooks, cloud computing devices, and personal digital assistants (PDAs). The server can be a standalone server or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (CDNs), and big data and artificial intelligence platforms.

[0026] Please see Figure 2 An embodiment of the present invention provides a method for scaling up and down a database cluster, wherein the method includes the following steps: S100. Obtain a processing request sent by the target user for a scaling task of a database cluster; wherein the database cluster consists of multiple database nodes, each database node contains a database proxy component, and the database proxy components of each database node are connected by a bidirectional communication link, and the processing request includes the scaling node of the scaling task. S200. The scaling nodes are used to parse the processing request and generate a scaling strategy for the scaling task; wherein, the scaling nodes include nodes to be added and nodes to be deleted in the database cluster, and the scaling strategy includes a scaling strategy and a shrinking strategy. S300. Execute the expansion strategy using the database proxy components of the node to be added and other database nodes to expand the node to be added, and / or execute the shrinking strategy using the database proxy components of the node to be deleted and other database nodes to shrink the node to be deleted, generate the processing result of the expansion / shrinking task, and return the processing result to the target user.

[0027] In practical implementation, the database cluster scaling method of this embodiment achieves efficient and accurate scaling operations on the database cluster through a series of systematic steps. Specifically, the method first obtains the processing request sent by the target user through their client, ensuring that the initiation of the scaling operation is based on explicit user instructions. This not only improves the targeting of the operation but also enhances the interactivity and user-friendliness of the system. Subsequently, the scaling node parses the processing request to accurately extract the scaling strategy. This process reduces manual intervention through automated parsing, improving the accuracy of the operation. Most importantly, based on the parsed scaling strategy, the scaling node and the database proxy components corresponding to other database nodes are used to execute the corresponding scaling operation on the specified node, and the operation results are fed back to the client for display to the target user. This step not only automates the execution of the scaling operation but also allows operators to understand the operation status in a timely manner through a real-time feedback mechanism, facilitating rapid response and handling of potential problems, further improving the efficiency and reliability of the operation. Overall, this method effectively improves the efficiency and accuracy of database cluster scaling through automated and precise operation processes, reduces operational risks, and improves the overall performance and stability of the system. This embodiment, through the above method, not only makes the scaling up and down operations of the database cluster more efficient and accurate, but also enhances the system's reliability and user-friendliness. This method is particularly suitable for the financial and government sectors, which have high requirements for high availability and data consistency, and can significantly improve the overall performance and stability of the database system.

[0028] Furthermore, in one embodiment, the database cluster scaling method, wherein the step of using the scaling node to parse the processing request and generate a scaling strategy for the scaling task specifically includes the following steps: The obtained processing request is subjected to format validation and integrity checks; When both format validation and integrity checks pass, the scaling node is used to parse the processing request according to the preset request parsing strategy to generate the scaling strategy for the scaling task. If the format validation and / or integrity check fails, an error message for the processing request is sent to the target user.

[0029] In practice, the specific implementation process of the steps in this embodiment is roughly as follows: 1. Receive and process requests: Receive scaling task processing requests sent by the target user through their client. These requests are typically sent in a specific data format (such as JSON, XML, etc.) and contain information related to the scaling task, such as the node information to be operated on and the scaling strategy.

[0030] 2. Format validation: The received processing request undergoes format validation to check if it conforms to predefined format specifications. For example, if the request is in JSON format, it verifies whether it has a valid JSON structure and contains necessary fields. If the format validation fails, an error message is directly returned to the target user's client, indicating that the request format does not meet the requirements.

[0031] 3. Integrity check: After the format validation passes, an integrity check is performed to verify that the request contains all the necessary information required to perform the scaling task. This includes checking whether detailed information about the nodes to be added or deleted (such as IP address, port number, etc.) and the scaling strategy (such as data synchronization method, backup strategy, etc.) are provided. If the integrity check fails, an error message is returned to the target user's client, explaining which necessary information is missing.

[0032] 4. Content Analysis: If both format validation and integrity checks pass, the database proxy component of the scaling node uses a preset request parsing strategy to parse the request content. The parsing strategy defines how to extract key information about the scaling task, such as the scaling policy, from the request. The parsing process may involve parsing the request data layer by layer, extracting specific policy parameters, and converting them into an internally processable data structure for use in subsequent scaling operations.

[0033] 5. Return an error message or continue execution: If any issues are found during the format validation and / or integrity check phase, detailed error messages are generated and returned to the target user's client. The error messages should contain sufficient information to help the target user understand the problem and make corrections. If the request passes all validation checks, subsequent scaling operations continue.

[0034] By following the steps above, we can ensure that the request is formatted correctly, contains complete information, and conforms to the preset specifications. This provides accurate and reliable input for subsequent scaling operations, improving the efficiency and accuracy of the entire scaling process.

[0035] Further, in one embodiment, the database cluster scaling method, wherein the scaling-up strategy is executed using the database proxy components of the node to be added and other database nodes to perform a scaling-up operation on the node to be added, and / or the scaling-down strategy is executed using the database proxy components of the node to be deleted and other database nodes to perform a scaling-down operation on the node to be deleted, generating the processing result of the scaling-up / scaling task, specifically includes the following steps: Based on the scaling strategy, construct the scaling environment required for the scaling node; In the scaling up / down environment, the scaling up strategy is executed using the database proxy components of the node to be added and other database nodes to perform scaling up operations on the node to be added, and / or the scaling down strategy is executed using the database proxy components of the node to be deleted and other database nodes to perform scaling down operations on the node to be deleted, and the operation status corresponding to the node to be added and / or the node to be deleted is monitored in real time. The operation status is analyzed in real time, and the processing result of the scaling up and down task is generated based on the analysis results.

[0036] Furthermore, in the aforementioned database cluster scaling method, the step of constructing the scaling environment required for the scaling node according to the scaling strategy specifically includes the following steps: Based on the scaling-up and scaling-down strategy, determine the hardware, software, and network resources required for the scaling-up and scaling-down nodes, and generate an environmental requirement report for the scaling-up and scaling-down nodes. Based on the environmental requirements report, construct the scaling environment required for the scaling node.

[0037] Furthermore, the database cluster scaling method, wherein the step of performing real-time analysis of the operation status and generating the processing result of the scaling task based on the analysis result specifically includes the following steps: The operation status is analyzed in real time to obtain the analysis results of the operation status; Based on the analysis results and preset task processing result judgment indicators, the processing status of the scaling up and down tasks is evaluated, and evaluation results are generated. Based on the evaluation results, the processing results of the scaling up / down task are generated.

[0038] Furthermore, in the aforementioned database cluster scaling method, the database node further includes a data storage component; The database proxy component is responsible for managing communication between nodes and performing scaling operations, while the data storage component is responsible for storing and managing database data.

[0039] In practice, the specific implementation process of the steps in this embodiment is roughly as follows: 1. Construct a scaling environment 1) Determine resource requirements: Based on the scaling-up and scaling-down strategy, determine the hardware resources (such as CPU, memory, storage capacity, etc.), software resources (such as operating system, database management system, middleware, etc.), and network resources (such as network bandwidth, IP address, subnet mask, etc.) required for the scaling-up and scaling-down nodes.

[0040] An environment requirements report for the scaling nodes is generated, detailing the specific configuration requirements and dependencies of the required resources. The report supports multiple formats (such as JSON, XML, and HTML) and provides a visual interface for easy understanding and processing by administrators.

[0041] 2) Constructing a scaling environment: Based on the environmental requirements report, the resources required for the scaling up and down nodes are automatically allocated and configured. This resource allocation includes, but is not limited to, allocating hardware resources from the resource pool, installing and configuring the operating system, and deploying the database management system and middleware.

[0042] For the nodes to be added, initialize the node's hardware and software environment to ensure it meets the requirements of the scaling strategy. Initialization includes, but is not limited to, formatting storage devices, configuring network interfaces, and installing necessary software packages.

[0043] For the node to be deleted, key data and configuration information on the backup node are backed up to ensure data security and recoverability. The backup information is stored in a secure storage medium and a backup verification mechanism is provided to ensure the integrity and consistency of the backup data.

[0044] 2. Perform capacity expansion / contraction operations and monitor in real time. 1) Perform expansion / shrinkage operations: In the scaling-up / scaling environment, the scaling-up strategy is executed using the database proxy components of the node to be added and other database nodes to perform a scaling-up operation on the node to be added, and / or, the scaling-down strategy is executed using the database proxy components of the node to be deleted and other database nodes to perform a scaling-down operation on the node to be deleted. The operations include, but are not limited to, installing and configuring new nodes, synchronizing data, updating cluster configuration, and disconnecting node connections.

[0045] Using pre-set monitoring tools and sensors, operational status data is collected in real time. This data includes, but is not limited to, node startup status, data synchronization progress, link establishment status, and resource usage (CPU, memory, disk I / O, etc.).

[0046] 2) Real-time monitoring of operational status: The operation status of the nodes to be added and / or deleted is monitored in real time to ensure smooth operation. Real-time monitoring is performed using preset monitoring tools and indicators to ensure timely detection and handling of anomalies.

[0047] If any anomalies are detected during monitoring, such as data synchronization failure or node failure to start normally, take immediate action, such as resynchronizing data or checking node configuration.

[0048] 3. Analyze the operation status in real time and generate processing results. 1) Real-time analysis of operation status: The operation status is analyzed in real time using preset analysis models and algorithms to assess the progress and health of the operation. The analysis models include, but are not limited to, machine learning algorithms, statistical analysis methods, and anomaly detection algorithms.

[0049] Based on the analysis results, a detailed diagnostic report is generated, including the success status of the operation, the reasons for failure, performance bottlenecks, and abnormal situations. The diagnostic report supports multiple formats (such as JSON, XML, and HTML) and provides a visual interface for administrators to quickly understand and handle the issues.

[0050] 2) Assess the handling of scaling up and down tasks: The processing status of the scaling up / down tasks is evaluated based on the analysis results and preset task processing result evaluation indicators. These preset task processing result evaluation indicators include, but are not limited to, operation completion time, resource usage thresholds, and data consistency check results.

[0051] Generate evaluation results to determine whether the operation was successful. If the operation fails, provide detailed error information and repair suggestions.

[0052] 3) Generate processing results: Based on the evaluation results, the processing results of the scaling up / down task are generated. The processing results include the success or failure status of the operation, detailed information, execution time, and suggestions for subsequent operations.

[0053] The processing results are returned to the client, along with detailed error information and repair suggestions. The results support multiple return formats (such as JSON, XML, etc.) and provide detailed explanations and suggestions for subsequent operations.

[0054] Using the methods described above, the scaling up and down operations of the database cluster are not only more efficient and accurate, but also enhance the system's reliability and user-friendliness.

[0055] In this specific implementation, the database agent component (hereinafter referred to as DBAgent) and the data storage component (hereinafter referred to as DN) together form a node in the cluster. Between the nodes, the DBAgent establishes bidirectional communication links, acting as both a client (initiator) and a server (responder). The cluster node information is configured in the DBAgent configuration file. After each DBAgent starts, it actively establishes links with other nodes according to the configuration information. Once the links are complete, the DBAgent controls the DN to establish a primary-slave relationship with multiple backups.

[0056] The DBAgents are interconnected via bidirectional links, each with its own specific function. These bidirectional links enable online, non-disruptive operation and one-to-many concurrent scaling, improving scaling efficiency. The link from the client to the server (for example only, from the initiator to the responder) handles tasks initiated by its own node, i.e., sending requests. The link from the server to the client (for example only, from the responder to the initiator) handles the responses to tasks sent by other nodes, i.e., sending responses. This ensures that during scaling, tasks can be driven by nodes to be added or deleted, according to the scaling strategy.

[0057] The expansion process involves installing a new node based on the current cluster configuration and configuring the cluster information to match all nodes after the expansion. Once the new node's DBAgent starts, it establishes client-to-server connections (for example only, from the initiator to the responder) for all nodes and initiates expansion tasks to other nodes. Other nodes handle the task in two steps: first, they actively establish client-to-server connections with the new node; second, they modify the dynamic cluster configuration information to match all nodes after the expansion. After all nodes have completed their tasks, the DBAgent automatically repairs the primary / backup relationship, and the new node connects to the primary DN as the backup DN; the expansion is then successful.

[0058] The scaling-down process begins with the DBAgent of the node to be deleted initiating a scaling-down task to other nodes. These other nodes handle the task in two steps: first, they disconnect the client-to-server link from the node to be deleted (this is just an example, referring to the link from the initiator to the responder); second, they modify the dynamic cluster configuration information to reflect the remaining nodes after scaling down. Once the other nodes have finished processing, the node to be deleted disconnects the client-to-server link from these other nodes (this is just an example, referring to the link from the initiator to the responder) and breaks its own primary / backup relationship with its DN. The scaling-down is then successful.

[0059] Furthermore, in one embodiment, the database cluster scaling method, wherein returning the processing result to the target user specifically includes the following steps: The processing result is formatted according to the preset supported format of the client corresponding to the target user; The formatted processing result is transmitted to the client according to a preset processing result display strategy for display to the target user.

[0060] In practice, the specific implementation process of the steps in this embodiment is roughly as follows: 1. Determine the formats supported by the client. Extract the data format (such as JSON, XML, HTML, etc.) supported by the target user's client from the processing request or obtain it through preset configuration. This step ensures that the system knows the data format the client expects to receive, so as to perform the appropriate formatting processing.

[0061] If the client does not explicitly specify a format, the system can use a default general format (such as JSON) or select the most appropriate format based on the client's historical interaction records.

[0062] 2. Result Formatting Processing Based on the determined client-supported formats, the processing results are converted into the corresponding data format. For example, if the client supports JSON format, the system converts the processing results into a JSON object; if it supports XML format, it converts them into an XML document.

[0063] During the conversion process, ensure the integrity and accuracy of the data to avoid data loss or errors caused by format conversion.

[0064] 3. Result Transmission The formatted processing results are sent to the client via the selected transport protocol. During transmission, data integrity and consistency are ensured.

[0065] 4. Client Display After receiving the processing result, the client displays it on the client according to a preset result display strategy. For example, in the client's graphical interface, a success or failure message box can be displayed, and detailed information can be viewed by clicking on the message box.

[0066] Through the above steps, the system can efficiently and securely transmit the processing results to the client according to the preset processing result display strategy for display to the user, and can ensure that the format of the processing results meets the client's requirements.

[0067] As can be seen from the above method embodiments, the database cluster scaling method provided by the present invention includes: obtaining a processing request for a scaling task of a database cluster sent by a target user; wherein the database cluster consists of multiple database nodes, each database node includes a database proxy component, and the database proxy components of each database node are connected by a bidirectional communication link; the processing request includes the scaling node of the scaling task; parsing the processing request using the scaling node to generate a scaling strategy for the scaling task; wherein the scaling node includes nodes to be added and nodes to be deleted in the database cluster, and the scaling strategy includes a scaling strategy and a shrinking strategy; executing the scaling strategy using the nodes to be added and the database proxy components of other database nodes to perform a scaling operation on the nodes to be added, and / or executing the shrinking strategy using the nodes to be deleted and the database proxy components of other database nodes to perform a shrinking operation on the nodes to be deleted, generating a processing result for the scaling task, and returning the processing result to the target user. Thus, this invention can effectively improve the efficiency and accuracy of database cluster scaling.

[0068] It should be understood that although this application provides the method operation steps as described in the embodiments or flowcharts, conventional or non-inventive labor may include more or fewer operation steps, and these operation steps are not necessarily executed sequentially according to the order of the embodiments or flowcharts. The order of steps listed in the embodiments or flowcharts is merely one way of executing many steps and does not represent the only execution order. It should be noted that there is no necessary sequential order between the above steps. Those skilled in the art can understand from the description of the embodiments of the present invention that the above steps may have different execution orders in different embodiments, that is, they may be executed in parallel or in exchange, etc. Moreover, at least some steps in the embodiments or flowcharts may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but may be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but may be executed in turn, alternately, or synchronously with other steps or at least a part of the sub-steps or stages of other steps.

[0069] Based on the above method embodiments, please refer to Figure 3 Another embodiment of the present invention also provides a database cluster scaling device, wherein the device includes: The request acquisition module 11 is used to acquire the processing request for the scaling task of the database cluster sent by the target user; wherein the database cluster consists of multiple database nodes, the database nodes include database proxy components, and the database proxy components of each database node are connected by a bidirectional communication link, and the processing request includes the scaling node of the scaling task. The content parsing module 12 is used to parse the processing request using the scaling nodes and generate the scaling strategy for the scaling task; wherein, the scaling nodes include nodes to be added and nodes to be deleted in the database cluster, and the scaling strategy includes a scaling strategy and a shrinking strategy. The result generation module 13 is used to execute the expansion strategy using the database proxy components of the node to be added and other database nodes to perform expansion operations on the node to be added, and / or to execute the shrinking strategy using the database proxy components of the node to be deleted and other database nodes to perform shrinking operations on the node to be deleted, generate the processing result of the expansion and shrinking task, and return the processing result to the target user.

[0070] Furthermore, in one embodiment, the database cluster scaling device, wherein the step of using the scaling node to parse the processing request and generate a scaling strategy for the scaling task specifically includes: The obtained processing request is subjected to format validation and integrity checks; When both format validation and integrity checks pass, the scaling node is used to parse the processing request according to the preset request parsing strategy to generate the scaling strategy for the scaling task. If the format validation and / or integrity check fails, an error message for the processing request is sent to the target user.

[0071] Further, in one embodiment, the database cluster scaling up / down device, wherein the scaling up strategy is executed using the database proxy components of the node to be added and other database nodes to perform a scaling up operation on the node to be added, and / or the scaling down strategy is executed using the database proxy components of the node to be deleted and other database nodes to perform a scaling down operation on the node to be deleted, generating the processing result of the scaling up / down task, specifically includes: Based on the scaling strategy, construct the scaling environment required for the scaling node; In the scaling up / down environment, the scaling up strategy is executed using the database proxy components of the node to be added and other database nodes to perform scaling up operations on the node to be added, and / or the scaling down strategy is executed using the database proxy components of the node to be deleted and other database nodes to perform scaling down operations on the node to be deleted, and the operation status corresponding to the node to be added and / or the node to be deleted is monitored in real time. The operation status is analyzed in real time, and the processing result of the scaling up and down task is generated based on the analysis results.

[0072] Furthermore, in the aforementioned database cluster scaling device, the step of constructing the scaling environment required for the scaling node according to the scaling strategy specifically includes: Based on the scaling-up and scaling-down strategy, determine the hardware, software, and network resources required for the scaling-up and scaling-down nodes, and generate an environmental requirement report for the scaling-up and scaling-down nodes. Based on the environmental requirements report, construct the scaling environment required for the scaling node.

[0073] Furthermore, in the aforementioned database cluster scaling device, the step of performing real-time analysis of the operation status and generating the processing result of the scaling task based on the analysis results specifically includes: The operation status is analyzed in real time to obtain the analysis results of the operation status; Based on the analysis results and preset task processing result judgment indicators, the processing status of the scaling up and down tasks is evaluated, and evaluation results are generated. Based on the evaluation results, the processing results of the scaling up / down task are generated.

[0074] Furthermore, in the aforementioned database cluster scaling device, the database node further includes a data storage component; The database proxy component is responsible for managing communication between nodes and performing scaling operations, while the data storage component is responsible for storing and managing database data.

[0075] Furthermore, in one embodiment, the database cluster scaling device, wherein returning the processing result to the target user specifically includes: The processing result is formatted according to the preset supported format of the client corresponding to the target user; The formatted processing result is transmitted to the client according to a preset processing result display strategy for display to the target user.

[0076] It should be noted that, in the device embodiments of the present invention, the information interaction and execution process between the above modules are based on the same concept as in the method embodiments of the present invention. For details on their specific functions and the resulting technical effects, please refer to the aforementioned method embodiments section, which will not be repeated here.

[0077] Based on the above method embodiments, another embodiment of the present invention also provides a computer device, which can be a server, and its internal structure diagram can be as follows. Figure 4 As shown. The computer device includes a processor, memory, network interface, and database connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The network interface is used to communicate with external terminals via a network connection. When the computer program is executed by the processor, it implements the functions or steps of the database cluster scaling method on the server side as described in any of the above method embodiments.

[0078] Based on the above method embodiments, another embodiment of the present invention also provides a computer device, which can be a client, and its internal structure diagram can be as follows. Figure 5 As shown, the computer device includes a processor, memory, network interface, display screen, and input device connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The network interface is used to communicate with external terminals via a network connection. When executed by the processor, the computer program implements the client-side functions or steps of the database cluster scaling method as described in any of the above method embodiments.

[0079] Those skilled in the art will understand that Figure 4 and Figure 5 The structural schematic diagram shown is only a schematic diagram of a part of the structure related to the present invention and does not constitute a limitation on the computer device on which the present invention is applied. The specific computer device may include more components than shown in the figure, or combine certain components, or have different component arrangements.

[0080] The processor referred to herein can be a CPU, but it can also be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor.

[0081] The memory includes readable storage media, internal memory, etc., where internal memory can be the RAM of a computer device. Internal memory provides an environment for the operation of the operating system and computer-readable instructions stored in the readable storage media. The readable storage media can be the hard drive of the computer device, or in other embodiments, it can be an external storage device of the computer device, such as a plug-in hard drive, Smart Media Card (SMC), Secure Digital (SD) card, or Flash Card. Furthermore, the memory can include both internal storage units and external storage devices of the computer device. The memory is used to store the operating system, applications, bootloader, data, and other programs, such as program code for computer programs. The memory can also be used to temporarily store data that has been output or will be output.

[0082] Based on the above method embodiments, another embodiment of the present invention provides a computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the database cluster scaling method as described in any of the above method embodiments. The computer-readable storage medium may be non-volatile or volatile.

[0083] It should be noted that the functions or steps that can be achieved by the computer-readable storage medium or computer device, and the technical effects brought about by the functions / steps, can be referred to the relevant descriptions in the foregoing method embodiments. To avoid repetition, they will not be described one by one here.

[0084] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc. The disclosed memory components or memories of the operating environment described herein are intended to include one or more of these and / or any other suitable types of memory.

[0085] Those skilled in the art will understand that, for the sake of convenience and brevity, the embodiments of the device of the present invention are only illustrated by the division of the above-mentioned functional units and modules. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of the present invention. The specific working process of the units and modules in the above device can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here. If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium.

[0086] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0087] In the embodiments provided by this invention, it should be understood that the disclosed apparatus / computer devices and methods can be implemented in other ways. For example, the apparatus / computer device embodiments described above are merely illustrative. For instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or units may be electrical, mechanical, or other forms.

[0088] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0089] It should be noted that if any software tools or components not belonging to this company appear in the embodiments of this application, they are merely illustrative examples and do not represent actual use. The above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.

Claims

1. A method for scaling up and down a database cluster, characterized in that, include: The system obtains a processing request sent by a target user for a scaling task of a database cluster; wherein the database cluster consists of multiple database nodes, each database node contains a database proxy component, and the database proxy components of each database node are connected by a bidirectional communication link; and the processing request includes the scaling node of the scaling task. The scaling nodes are used to parse the processing request and generate a scaling strategy for the scaling task; wherein, the scaling nodes include nodes to be added and nodes to be deleted in the database cluster, and the scaling strategy includes a scaling strategy and a shrinking strategy. The expansion strategy is executed using the database proxy components of the node to be added and other database nodes to perform an expansion operation on the node to be added, and / or the shrinking strategy is executed using the database proxy components of the node to be deleted and other database nodes to perform a shrinking operation on the node to be deleted, generating the processing result of the expansion and shrinking task, and returning the processing result to the target user.

2. The database cluster scaling method according to claim 1, characterized in that, The step of using the scaling nodes to parse the processing request and generate the scaling strategy for the scaling task includes: The obtained processing request is subjected to format validation and integrity checks; When both format validation and integrity checks pass, the scaling node is used to parse the processing request according to the preset request parsing strategy to generate the scaling strategy for the scaling task. If the format validation and / or integrity check fails, an error message for the processing request is sent to the target user.

3. The database cluster scaling method according to claim 1, characterized in that, The process of executing the scaling-up strategy using the database proxy components of the node to be added and other database nodes to scale up the node to be added, and / or executing the scaling-down strategy using the database proxy components of the node to be deleted and other database nodes to scale down the node to be deleted, generating the processing result of the scaling-up / scaling-down task, includes: Based on the scaling strategy, construct the scaling environment required for the scaling node; In the scaling up / down environment, the scaling up strategy is executed using the database proxy components of the node to be added and other database nodes to perform scaling up operations on the node to be added, and / or the scaling down strategy is executed using the database proxy components of the node to be deleted and other database nodes to perform scaling down operations on the node to be deleted, and the operation status corresponding to the node to be added and / or the node to be deleted is monitored in real time. The operation status is analyzed in real time, and the processing result of the scaling up and down task is generated based on the analysis results.

4. The database cluster scaling method according to claim 3, characterized in that, The step of constructing the scaling environment required for the scaling node according to the scaling strategy includes: Based on the scaling-up and scaling-down strategy, determine the hardware, software, and network resources required for the scaling-up and scaling-down nodes, and generate an environmental requirement report for the scaling-up and scaling-down nodes. Based on the environmental requirements report, construct the scaling environment required for the scaling node.

5. The database cluster scaling method according to claim 3, characterized in that, The step of performing real-time analysis of the operation status and generating the processing result of the scaling up / down task based on the analysis results includes: The operation status is analyzed in real time to obtain the analysis results of the operation status; Based on the analysis results and preset task processing result judgment indicators, the processing status of the scaling up and down tasks is evaluated, and evaluation results are generated. Based on the evaluation results, the processing results of the scaling up / down task are generated.

6. The database cluster scaling method according to claim 1, characterized in that, Returning the processing result to the target user includes: The processing result is formatted according to the preset supported format of the client corresponding to the target user; The formatted processing result is transmitted to the client according to a preset processing result display strategy for display to the target user.

7. The database cluster scaling method according to any one of claims 1-6, characterized in that, The database node also includes a data storage component; The database proxy component is responsible for managing communication between nodes and performing scaling operations, while the data storage component is responsible for storing and managing database data.

8. A database cluster scaling device, characterized in that, include: The request acquisition module is used to acquire the processing request for the scaling task of the database cluster sent by the target user; wherein the database cluster consists of multiple database nodes, the database nodes contain database proxy components, and the database proxy components of each database node are connected by a bidirectional communication link, and the processing request includes the scaling node of the scaling task. The content parsing module is used to parse the processing request using the scaling nodes and generate the scaling strategy for the scaling task; wherein, the scaling nodes include nodes to be added and nodes to be deleted in the database cluster, and the scaling strategy includes a scaling strategy and a shrinking strategy. The result generation module is used to execute the expansion strategy using the database proxy components of the node to be added and other database nodes to perform expansion operations on the node to be added, and / or to execute the shrinking strategy using the database proxy components of the node to be deleted and other database nodes to perform shrinking operations on the node to be deleted, generate the processing result of the expansion and shrinking task, and return the processing result to the target user.

9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the database cluster scaling method as described in any one of claims 1-7.

10. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the database cluster scaling method as described in any one of claims 1-7.