Distributed database resource configuration method and device, equipment and medium
By obtaining and analyzing the data cluster and server distribution information in the distributed database, determining the target resource configuration, and performing resource configuration, the problem of resource imbalance after the distributed database is solved, and the high availability of the system is improved.
Patent Information
- Application Number
- CN202411877278.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-19
- Publication Date
- 2025-04-01
AI Technical Summary
The existing distributed database high availability technology cannot guarantee the reasonable allocation and use of resources after switching, resulting in unbalanced resources and affecting the high availability of the system.
By obtaining the data cluster information and server distribution information corresponding to the server switching task in the current distributed database, determining the target resource configuration information of the target server, and configuring the target server based on the current resource configuration information and target resource configuration information to achieve balanced resource configuration.
When the server switching action occurs, balanced resource configuration is achieved, high availability of distributed databases is improved, and problems of unanticipated resource contention and occupation are avoided.
Smart Images

Figure CN119743388A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention relate to the field of computer technology, and in particular to a distributed database resource configuration method, device, equipment and medium. Background Art
[0002] With the development of technology, financial-grade distributed databases usually adopt a multi-site and multi-center networking architecture to ensure the stability and reliability of their services and the high availability of each component. When a failure or abnormality occurs in the local main computer room, the business is required to be normally migrated to the same city or another place. For example, the main computer room (equivalent to the server) of a bank or financial institution is in Beijing, and the backup computer room is in Nanjing. Under normal circumstances, the Nanjing computer room is used as a copy to synchronize the business data of the Beijing main computer room. When a failure or abnormality occurs in the Beijing main computer room, the Nanjing backup computer room can smoothly take over the business of the Beijing main computer room.
[0003] At present, the industry's existing focus on distributed database high availability technology is usually concentrated on networking architecture, data consistency, etc. For example, by setting up a two-site three-center network to achieve computer room-level high availability, or by quickly synchronizing and replicating data between computer rooms to ensure that data is not lost before and after switching. However, the existing distributed database high availability technology cannot guarantee the reasonable configuration and use of resources after switching. Summary of the invention
[0004] The embodiments of the present invention provide a distributed database resource configuration method, device, equipment and medium, so as to realize balanced resource configuration under the premise that the switching is carried out normally when a server switching action occurs, thereby improving the high availability of the distributed database.
[0005] In a first aspect, an embodiment of the present invention provides a distributed database resource configuration method, comprising:
[0006] Obtain the data cluster information and server distribution information corresponding to the server switching task in the current distributed database;
[0007] Based on the data cluster information and the server distribution information, determine the target resource configuration information corresponding to the target server in the current distributed database;
[0008] Based on the current resource configuration information corresponding to the target server and the target resource configuration information, resource configuration is performed on the target server to obtain a target distributed database with balanced configuration of the target server.
[0009] Optionally, the method further includes: acquiring a server switching task of the current distributed database, and establishing a connection relationship with a metadata database in the network; and acquiring data cluster information and server distribution information corresponding to the current distributed database from the metadata database through the connection relationship.
[0010] Optionally, the method also includes: determining the ratio and ratio remainder between the data cluster information and the server distribution information; if the ratio remainder is zero, determining the ratio as the target resource configuration information corresponding to the target server in the current distributed database; if the ratio remainder is not zero, determining the target resource configuration information corresponding to the target server in the current distributed database based on the ratio and a preset quantity threshold.
[0011] Optionally, the method further includes: the current resource configuration information is resource configuration information corresponding to the target server when executing the server switching task.
[0012] Optionally, the method further includes: adjusting current resource configuration information corresponding to the target server to the target resource configuration information, so as to obtain a target distributed database with a balanced configuration of the target server.
[0013] Optionally, the method also includes: obtaining reference resource configuration information corresponding to the target server in the target distributed database; verifying the reference resource configuration information based on the target resource configuration information to obtain a verification result; if the verification result is a configuration failure, giving a prompt based on the verification result.
[0014] In a second aspect, an embodiment of the present invention further provides a distributed database resource configuration device, the device comprising:
[0015] An information acquisition module is used to obtain data cluster information and server distribution information corresponding to the server switching task in the current distributed database;
[0016] A target resource configuration information determination module, used to determine the target resource configuration information corresponding to the target server in the current distributed database based on the data cluster information and the server distribution information;
[0017] The target server configuration module is used to perform resource configuration on the target server based on the current resource configuration information corresponding to the target server and the target resource configuration information, so as to obtain a target distributed database with a balanced configuration of the target server.
[0018] In a third aspect, an embodiment of the present invention further provides an electronic device, the electronic device comprising:
[0019] one or more processors;
[0020] A memory for storing one or more programs;
[0021] When the one or more programs are executed by the one or more processors, the one or more processors implement the distributed database resource configuration method provided by any embodiment of the present invention.
[0022] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements a distributed database resource configuration method as provided in any embodiment of the present invention.
[0023] In a fifth aspect, an embodiment of the present invention provides a computer program product, including a computer program, which, when executed by a processor, implements a distributed database resource configuration method as provided in any embodiment of the present invention.
[0024] The technical solution of the embodiment of the present invention obtains the data cluster information and server distribution information corresponding to the server switching task in the current distributed database; determines the target resource configuration information corresponding to the target server in the current distributed database based on the data cluster information and the server distribution information; and performs resource configuration on the target server based on the current resource configuration information and the target resource configuration information corresponding to the target server, thereby obtaining a target distributed database with a balanced target server configuration. When a server switching action occurs, balanced resource configuration is achieved under the premise that the switching is carried out normally, thereby improving the high availability of the distributed database.
[0025] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0027] Figure 1 is a flow chart of a distributed database resource configuration method provided by Embodiment 1 of the present invention;
[0028] Figure 2 is a flow chart of a distributed database resource configuration method provided by Embodiment 2 of the present invention;
[0029] Figure 3 It is a structural diagram of a distributed database resource configuration device provided by Embodiment 3 of the present invention;
[0030] Figure 4 It is a structural diagram of an electronic device for implementing the distributed database resource configuration method according to an embodiment of the present invention. DETAILED DESCRIPTION
[0031] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0032] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0033] Embodiment 1
[0034] Figure 1 A flowchart of a distributed database resource configuration method is provided for the first embodiment of the present invention. This embodiment is applicable to the case of balanced configuration of distributed database resources. The method can be executed by a distributed database resource configuration device. The distributed database resource configuration device can be implemented in the form of hardware and / or software. The distributed database resource configuration device can be configured in an electronic device. Figure 1 As shown, the method includes:
[0035] S110: Obtain data cluster information and server distribution information corresponding to the server switching task in the current distributed database.
[0036] Among them, the server switching task may refer to the task of switching the business data in a server to another server. Networking in a distributed database may refer to connecting multiple computers, servers, network devices, etc. into a network system so that they can communicate with each other and share resources. There are several data clusters and several servers distributed in the networking. Each data cluster requires a corresponding resource, such as a main component. Data cluster information may refer to the number of data clusters. Server distribution information may refer to the number of available servers. The core of the networking is the metadata database. Each library table in the metadata database records the master-slave relationship of each component in the networking, the role location information of each component, the operating status of each component, etc. In the present invention, all information related to the networking can be obtained by connecting to the metadata database.
[0037] Specifically, before executing the server switching task, the data cluster information and server distribution information corresponding to the current distributed database are obtained through the metadata database. For example, before the first switching, the obtained data cluster information and server distribution information are the initial installation information of the cluster.
[0038] Based on the above technical solution, "obtaining data cluster information and server distribution information corresponding to the server switching task in the current distributed database" may include: obtaining the server switching task of the current distributed database and establishing a connection relationship with the metadata database in the networking; obtaining the data cluster information and server distribution information corresponding to the current distributed database from the metadata database through the connection relationship.
[0039] Specifically, the server switching task of the current distributed database is obtained, and a connection relationship is established with the metadata database in the network before executing the server switching task. The number of data clusters in the network is obtained by querying the db_info table in the metadata database through the connection relationship, and recorded as m. The device_info table in the metadata database is queried through the connection relationship to obtain the IP list information of all servers, so as to confirm how many servers all data clusters are distributed on, and the number of servers in the network obtained is recorded as n.
[0040] S120: Determine target resource configuration information corresponding to the target server in the current distributed database based on the data cluster information and the server distribution information.
[0041] The target server may refer to an available server in the network. The target server may refer to a server distributed in all data clusters. The resource to be configured in the embodiment of the present invention may refer to a main component. The target resource configuration information may refer to the number of main components that should be on the target server in a balanced configuration.
[0042] Specifically, the ratio between the number of data clusters and the number of servers is determined as the target resource configuration information corresponding to the target server in the current distributed database.
[0043] For example, before obtaining the current resource configuration information, the existing switching interface is called to perform the first random master selection to execute the server switching task. This setting is to obtain the current resource configuration information after the switching operation, so that when the server switching action occurs, the balanced regulation of resources is achieved under the premise that the switching is carried out normally.
[0044] S130. Based on the current resource configuration information and the target resource configuration information corresponding to the target server, the target server is configured with resources to obtain a target distributed database with a balanced configuration of the target server.
[0045] Specifically, the current resource configuration information corresponding to the target server is limited within the range of the target resource configuration information, thereby achieving resource balanced configuration of the target server and obtaining a target distributed database with balanced target server configuration, thereby ensuring the same processing power of the target server and a balanced cluster distribution in the network.
[0046] It should be noted that, compared with the traditional switching solution, the technical solution of the embodiment of the present invention can ensure balanced distribution of resources after switching, avoid resource contention, and make resource occupancy predictable.
[0047] On the basis of the above technical solution, "configuring resources for the target server based on the current resource configuration information and target resource configuration information corresponding to the target server to obtain a target distributed database with a balanced configuration of the target server" may include: adjusting the current resource configuration information corresponding to the target server to the target resource configuration information to obtain a target distributed database with a balanced configuration of the target server.
[0048] The current resource configuration information is the resource configuration information corresponding to the target server when executing the server switching task.
[0049] Specifically, the current resource configuration information corresponding to the target server is compared with the target resource configuration information. If the current resource configuration information is greater than the target resource configuration information, the redundant main components are migrated. If the current resource configuration information is less than the required number of main components, that is, the target resource configuration information, the redundant main components on the remaining servers are migrated to this server. In this way, resource configuration is performed on the target server, and a target distributed database with a balanced configuration of the target server is obtained.
[0050] The technical solution of the embodiment of the present invention obtains the data cluster information and server distribution information corresponding to the server switching task in the current distributed database; determines the target resource configuration information corresponding to the target server in the current distributed database based on the data cluster information and the server distribution information; and configures the resources of the target server based on the current resource configuration information and the target resource configuration information corresponding to the target server, thereby obtaining a target distributed database with a balanced configuration of the target server. When the server switching action occurs, balanced configuration of resources is achieved under the premise that the switching is carried out normally, thereby improving the high availability of the distributed database.
[0051] Based on the above technical solution, the method also includes: obtaining reference resource configuration information corresponding to the target server in the target distributed database; verifying the reference resource configuration information based on the target resource configuration information to obtain a verification result; if the verification result is a configuration failure, prompting based on the verification result.
[0052] The reference resource configuration information may refer to the resource configuration information after the target server resource configuration. For example, the reference resource configuration information may refer to the number of main components after the target server resource configuration. The verification result may include configuration success and configuration failure.
[0053] Specifically, the reference resource configuration information corresponding to the target server in the target distributed database is obtained. If the reference resource configuration information and the target resource configuration information are the same, the verification result is a successful configuration. If the reference resource configuration information and the target resource configuration information are different, the verification result is a configuration failure, and a prompt is given based on the verification result so as to perform a secondary configuration, thereby improving the accuracy of resource configuration and further improving the high availability of the distributed database.
[0054] Embodiment 2
[0055] Figure 2 This is a flowchart of a distributed database resource configuration method provided in Embodiment 2 of the present invention. Based on the above embodiments, this embodiment describes in detail the process of determining target resource configuration information and resource configuration. The explanations of the terms that are the same or corresponding to the above embodiments are not repeated here. Figure 2 As shown, the method includes:
[0056] S210: Obtain data cluster information and server distribution information corresponding to the server switching task in the current distributed database.
[0057] S220: Determine a ratio and a remainder of the ratio between the data cluster information and the server distribution information.
[0058] Specifically, the number m of data clusters is divided by the number n of servers to obtain a ratio (m / n) and a remainder of the ratio (m%n).
[0059] S230: If the remainder of the ratio is zero, the ratio is determined as the target resource configuration information corresponding to the target server in the current distributed database.
[0060] Specifically, if the ratio remainder (m%n) is zero, the ratio (m / n) is determined as the number of main components that should exist on the target server in the current distributed database, that is, the target resource configuration information corresponding to the target server.
[0061] S240: If the remainder of the ratio is not zero, determine the target resource configuration information corresponding to the target server in the current distributed database based on the ratio and a preset quantity threshold.
[0062] Among them, the preset quantity threshold is plus or minus one.
[0063] Specifically, if the ratio remainder (m%n) is not zero, there should be at most (m / n+1) main components and at least (m / n-1) main components on the target server.
[0064] S250: Based on the current resource configuration information and target resource configuration information corresponding to the target server, resources are configured for the target server to obtain a target distributed database with a balanced configuration of the target server.
[0065] Exemplarily, the switching module is called to perform the first switching to execute the server switching task, and then a connection with the metadata database is established to query the db_info table to obtain the number of main components currently existing on the target server, that is, the current resource configuration information. Sort the IP addresses of each target server from high to low according to the number of existing main components to obtain a server list. Traverse the server list of existing main components in positive order, and for the target server, if the number of existing main components is greater than the number of main components that should be on the target server, the redundant main components are migrated to the redundant main component list. If the number of existing main components traversed is exactly the number of main components that should be on the target server, stop traversing. Traverse the server list of existing main components in reverse order, and for the target server, if the number of existing main components is less than the number of main components that should be on the target server, select the main components with the difference in quantity from the redundant main component list and migrate them to this target server IP. If the number of existing main components traversed is exactly the number of main components that should be on the target server, stop traversing.
[0066] It should be noted that the technical solution of the embodiment of the present invention can also be applied to the switching process of various primary and standby data nodes in the database, and has universal applicability.
[0067] The technical solution of the embodiment of the present invention determines the ratio and the remainder of the ratio between the data cluster information and the server distribution information, and determines the targeted target resource configuration information for different situations, so as to accurately configure resources using the targeted target resource configuration information. In addition, the difference between the current resource configuration information and the target resource configuration information is used for sorting to obtain a server list, so as to traverse in forward and reverse order without traversing all servers, thereby improving the efficiency and accuracy of resource configuration and further improving the high availability of the distributed database.
[0068] The following is an embodiment of a distributed database resource configuration device provided in an embodiment of the present invention. The device and the distributed database resource configuration methods of the above-mentioned embodiments belong to the same inventive concept. For details not described in detail in the embodiment of the distributed database resource configuration device, reference can be made to the embodiment of the above-mentioned distributed database resource configuration method.
[0069] Embodiment 3
[0070] Figure 3 This is a schematic diagram of the structure of a distributed database resource configuration device provided by Embodiment 3 of the present invention. Figure 3 As shown, the device includes: an information acquisition module 310, a target resource configuration information determination module 320 and a target server configuration module 330.
[0071] Among them, the information acquisition module 310 is used to obtain the data cluster information and server distribution information corresponding to the server switching task in the current distributed database; the target resource configuration information determination module 320 is used to determine the target resource configuration information corresponding to the target server in the current distributed database based on the data cluster information and the server distribution information; the target server configuration module 330 is used to perform resource configuration on the target server based on the current resource configuration information and the target resource configuration information corresponding to the target server, so as to obtain a target distributed database with a balanced target server configuration.
[0072] The technical solution of the embodiment of the present invention obtains the data cluster information and server distribution information corresponding to the server switching task in the current distributed database; determines the target resource configuration information corresponding to the target server in the current distributed database based on the data cluster information and the server distribution information; and configures the resources of the target server based on the current resource configuration information and the target resource configuration information corresponding to the target server, thereby obtaining a target distributed database with a balanced configuration of the target server. When the server switching action occurs, balanced configuration of resources is achieved under the premise that the switching is carried out normally, thereby improving the high availability of the distributed database.
[0073] Based on the above technical solution, the information acquisition module 310 is specifically used to: obtain the server switching task of the current distributed database and establish a connection relationship with the metadata database in the network; obtain the data cluster information and server distribution information corresponding to the current distributed database from the metadata database through the connection relationship.
[0074] Based on the above technical solution, the target resource configuration information determination module 320 is specifically used to: determine the ratio and ratio remainder between the data cluster information and the server distribution information; if the ratio remainder is zero, the ratio is determined as the target resource configuration information corresponding to the target server in the current distributed database; if the ratio remainder is not zero, the target resource configuration information corresponding to the target server in the current distributed database is determined based on the ratio and a preset quantity threshold.
[0075] On the basis of the above technical solution, the current resource configuration information is the resource configuration information corresponding to the target server when executing the server switching task.
[0076] On the basis of the above technical solution, the target server configuration module 330 is specifically used to: adjust the current resource configuration information corresponding to the target server to the target resource configuration information, and obtain a target distributed database with a balanced configuration of the target server.
[0077] On the basis of the above technical solution, the device also includes:
[0078] A reference resource configuration information acquisition module is used to acquire reference resource configuration information corresponding to a target server in a target distributed database;
[0079] A verification result determination module is used to verify the reference resource configuration information based on the target resource configuration information to obtain a verification result;
[0080] The verification result prompt module is used to give a prompt based on the verification result if the verification result is configuration failure.
[0081] The distributed database resource configuration device provided in the embodiment of the present invention can execute the distributed database resource configuration method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the distributed database resource configuration method.
[0082] It is worth noting that in the above-mentioned embodiment of distributed database resource configuration, the various units and modules included are only divided according to functional logic, but are not limited to the above-mentioned division, as long as the corresponding functions can be achieved; in addition, the specific names of the functional units are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of the present invention.
[0083] Embodiment 4
[0084] Figure 4 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.
[0085] like Figure 4 As shown, the electronic device 10 includes at least one processor 11, and a memory connected to the at least one processor 11, such as a read-only memory (ROM) 12, a random access memory (RAM) 13, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 11 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 12 or the computer program loaded from the storage unit 18 to the random access memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 can also be stored. The processor 11, the ROM 12, and the RAM 13 are connected to each other through a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0086] A number of components in the electronic device 10 are connected to the I / O interface 15, including: an input unit 16, such as a keyboard, a mouse, etc.; an output unit 17, such as various types of displays, speakers, etc.; a storage unit 18, such as a disk, an optical disk, etc.; and a communication unit 19, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0087] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any appropriate processor, controller, microcontroller, etc. The processor 11 executes the various methods and processes described above, such as a distributed database resource configuration method.
[0088] In some embodiments, the distributed database resource configuration method may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 10 via the ROM 12 and / or the communication unit 19. When the computer program is loaded into the RAM 13 and executed by the processor 11, one or more steps of the distributed database resource configuration method described above may be performed. Alternatively, in other embodiments, the processor 11 may be configured to execute the distributed database resource configuration method in any other appropriate manner (e.g., by means of firmware).
[0089] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0090] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0091] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in combination with an instruction execution system, device or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0092] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0093] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.
[0094] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0095] An embodiment of the present invention further provides a computer program product, including a computer program, which, when executed by a processor, implements the distributed database resource configuration method provided in any embodiment of the present application.
[0096] In the process of implementation, the computer program product can be written in one or more programming languages or a combination thereof to perform the computer program code of the present invention, and the programming language includes an object-oriented programming language, such as Java, Smalltalk, C++, and also includes a conventional procedural programming language, such as "C" language or similar programming language. The program code can be executed completely on the user's computer, partially on the user's computer, as an independent software package, partially on the user's computer, partially on the remote computer, or completely on the remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external computer (for example, using an Internet service provider to connect through the Internet). The program product belongs to the same inventive concept as the distributed database resource configuration method disclosed in each embodiment of the present application, so it is not repeated here.
[0097] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.
[0098] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.
Claims
1. A distributed database resource configuration method, characterized in that: include: Obtain the data cluster information and server distribution information corresponding to the server switching task in the current distributed database; Based on the data cluster information and the server distribution information, determine the target resource configuration information corresponding to the target server in the current distributed database; Based on the current resource configuration information corresponding to the target server and the target resource configuration information, resource configuration is performed on the target server to obtain a target distributed database with balanced configuration of the target server.
2. The method according to claim 1, characterized in that The step of obtaining data cluster information and server distribution information corresponding to the server switching task in the current distributed database includes: Obtain the server switching task of the current distributed database and establish a connection relationship with the metadata database in the network; The data cluster information and server distribution information corresponding to the current distributed database are obtained from the metadata database through the connection relationship.
3. The method according to claim 1, characterized in that: The determining, based on the data cluster information and the server distribution information, target resource configuration information corresponding to the target server in the current distributed database includes: Determining a ratio and a remainder of the ratio between the data cluster information and the server distribution information; If the remainder of the ratio is zero, the ratio is determined as the target resource configuration information corresponding to the target server in the current distributed database; If the ratio remainder is not zero, the target resource configuration information corresponding to the target server in the current distributed database is determined based on the ratio and a preset quantity threshold.
4. The method according to claim 1, characterized in that: The current resource configuration information is the resource configuration information corresponding to the target server when executing the server switching task.
5. The method according to claim 4, characterized in that The performing resource configuration on the target server based on the current resource configuration information corresponding to the target server and the target resource configuration information to obtain a target distributed database with a balanced target server configuration includes: The current resource configuration information corresponding to the target server is adjusted to the target resource configuration information, so as to obtain a target distributed database with a balanced configuration of the target server.
6. The method according to claim 1, characterized in that The method further comprises: Obtain reference resource configuration information corresponding to the target server in the target distributed database; Verifying the reference resource configuration information based on the target resource configuration information to obtain a verification result; If the verification result is configuration failure, a prompt is given based on the verification result.
7. A distributed database resource configuration device, characterized in that: The device comprises: An information acquisition module is used to obtain data cluster information and server distribution information corresponding to the server switching task in the current distributed database; A target resource configuration information determination module, used to determine the target resource configuration information corresponding to the target server in the current distributed database based on the data cluster information and the server distribution information; The target server configuration module is used to perform resource configuration on the target server based on the current resource configuration information corresponding to the target server and the target resource configuration information, so as to obtain a target distributed database with a balanced configuration of the target server.
8. An electronic device, characterized in that: The electronic device comprises: one or more processors; A memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the distributed database resource configuration method as described in any one of claims 1-6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the distributed database resource configuration method as described in any one of claims 1 to 6 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the distributed database resource configuration method according to any one of claims 1 to 6 is implemented.