High-availability database service scheduling method and device and computer equipment

By establishing a consistent mapping structure between the central node and the edge nodes, the complexity of scaling and maintaining a high-availability database architecture in high-concurrency scenarios is solved, achieving efficient database service scheduling and resource utilization, and improving the system's availability and scalability.

CN121579201APending Publication Date: 2026-02-27CHINA TELECOM CLOUD TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Existing high-availability database architectures are difficult to meet the needs of user growth and dynamic expansion of resource pools in high-concurrency scenarios, and are also highly complex to maintain.

Method used

By establishing a consistent mapping structure between central nodes and edge nodes, the resource pool identifier is mapped to a deterministic value using consistent operations to determine the target edge node. When edge nodes are dynamically added or removed, only local request allocation is affected, supporting differentiated scheduling between key and non-key resource pools.

Benefits of technology

It achieves precise routing of database service requests, ensures contextual consistency in task processing, reduces system disturbances, improves high availability and elastic scalability, and balances high-concurrency processing performance with efficient utilization of computing resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121579201A_ABST
    Figure CN121579201A_ABST
Patent Text Reader

Abstract

The invention relates to a high-availability database service scheduling method and device and computer equipment. The method comprises the steps that a database service request carrying a resource pool identifier is received, the resource pool identifier is mapped into a first mapping value, a target edge node is determined based on the first mapping value and a pre-constructed consistency mapping structure, the consistency mapping structure is composed of second mapping values of a plurality of edge nodes, and the second mapping values of the edge nodes correspond to the first mapping value. Each second mapping value is obtained by performing consistency operation on a node identifier of the edge node and a resource pool identifier associated with the edge node, and forwarding the database service request to a target edge node, so that the target edge node executes a database task associated with the resource pool identifier. By adopting the method, accurate and deterministic routing from the database service request to the target edge node can be realized, and high concurrent processing performance and efficient utilization of computing resources can be considered.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of edge computing, and in particular to a high-availability database service scheduling method and device, a computer device, a computer readable storage medium and a computer program product. BACKGROUND

[0002] A high-availability database architecture includes at least two roles, a manager and a plurality of workers. The manager maintains worker state information, performance indicators and other monitoring data. Through unified analysis, commands are issued to the workers, thereby providing external monitoring and alarm, separation function, master-slave switching, high-availability recovery and high-reliability recovery applications. In cloud computing, a set of high-availability database architecture is generally deployed in a resource pool. Cloud computing requires dynamic allocation of resources. If the scale needs to be expanded or a new resource pool needs to be deployed, the high-availability database architecture can be horizontally expanded to the new resource pool, thereby achieving dynamic allocation.

[0003] However, to horizontally expand the high-availability database architecture to the new resource pool and achieve dynamic allocation, it is difficult to meet the growing number of users, that is, it is difficult to adapt to high-concurrency scenarios. SUMMARY

[0004] Therefore, it is necessary to provide a high-availability database service scheduling method and device, a computer device, a computer readable storage medium and a computer program product that can be applied to high-concurrency scenarios.

[0005] In a first aspect, the present application provides a high-availability database service scheduling method applied to a center node, wherein the center node is in communication connection with a plurality of edge nodes, and the method comprises:

[0006] receiving a database service request carrying a resource pool identifier;

[0007] mapping the resource pool identifier into a first mapping value;

[0008] determining a target edge node based on the first mapping value and a pre-constructed consistency mapping structure, wherein the consistency mapping structure is composed of a plurality of second mapping values of the edge nodes, and each second mapping value is obtained by performing a consistency operation on a node identifier of the edge node and a resource pool identifier associated with the edge node;

[0009] forwarding the database service request to the target edge node, so that the target edge node executes a database task associated with the resource pool identifier.

[0010] In some exemplary embodiments, the edge nodes include key edge nodes and non-key edge nodes, and the method further comprises:

[0011] In a case where the load status of the key edge node meets preset expansion conditions, a new edge node is added in the consistent mapping structure, or mapping values of a plurality of virtual nodes corresponding to the new edge node, and positions of remaining edge nodes in the consistent mapping structure remain unchanged.

[0012] In some example embodiments, before the receiving the database service request carrying the resource pool identifier, the method further comprises:

[0013] Obtaining node identifiers of the registered edge nodes and resource pool identifiers served by the edge nodes;

[0014] Grouping the plurality of node identifiers and the resource pool identifiers;

[0015] Performing a consistent operation on each group of node identifiers and resource pool identifiers to obtain a second mapping value;

[0016] Arranging the second mapping values to obtain the consistent mapping structure.

[0017] In some example embodiments, the performing a consistent operation on each group of node identifiers and resource pool identifiers to obtain a second mapping value comprises:

[0018] Performing a consistent hash operation on each group of node identifiers and resource pool identifiers to obtain a second hash value;

[0019] The arranging the second mapping values to obtain the consistent mapping structure comprises:

[0020] Arranging the second hash values in ascending order to obtain a hash ring;

[0021] The second mapping value is the second hash value, and the consistent mapping structure is the hash ring.

[0022] In some example embodiments, the first mapping value is a first hash value, and the determining the target edge node based on the first mapping value and a pre-constructed consistent mapping structure comprises:

[0023] Finding, in the hash ring, a second hash value that is the first greater than or equal to the first hash value;

[0024] Determining an edge node corresponding to the found second hash value as the target edge node.

[0025] In some example embodiments, the method further comprises:

[0026] In a case where the edge node offline notification is received or it is detected that there is a faulty edge node, the edge node and a second mapping value corresponding to a virtual node corresponding to the edge node are removed from the consistency mapping structure.

[0027] In a second aspect, the present application provides a high-availability database service scheduling apparatus deployed in a center node, wherein the center node is in communication connection with a plurality of edge nodes, and the apparatus comprises:

[0028] a data receiving module configured to receive a database service request carrying a resource pool identifier;

[0029] a data mapping module configured to map the resource pool identifier into a first mapping value;

[0030] a data searching module configured to determine a target edge node based on the first mapping value and a pre-constructed consistency mapping structure, wherein the consistency mapping structure is composed of second mapping values of a plurality of edge nodes, and each second mapping value is obtained by performing a consistency operation on a node identifier of the edge node and a resource pool identifier associated with the edge node;

[0031] a data forwarding module configured to forward the database service request to the target edge node, so that the target edge node performs a database task associated with the resource pool identifier.

[0032] In a third aspect, the present application provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps in any one of the above high-availability database service scheduling method embodiments when executing the computer program.

[0033] In a fourth aspect, the present application provides a computer readable storage medium, which stores a computer program, and the computer program implements the steps in any one of the above high-availability database service scheduling method embodiments when executed by a processor.

[0034] In a fifth aspect, the present application provides a computer program product, which comprises a computer program, and the computer program implements the steps in any one of the above high-availability database service scheduling method embodiments when executed by a processor.

[0035] The high-availability database service scheduling method, device, computer device, computer readable storage medium and computer program product can map the resource pool identifier to the first mapping value, and determine the target edge node for processing the request by using the consistency mapping structure constructed by the second mapping value generated by the consistency operation of the edge node and the associated resource pool identifier of the edge node, so that the database service request can be accurately and deterministically routed to the target edge node. The above mechanism ensures that requests with the same resource pool identifier are always directed to the same edge node, thereby ensuring the context consistency of task processing. Meanwhile, when the edge nodes are dynamically added or reduced, only the request distribution in the local interval of the mapping structure is affected, and the rest of the request routing remains unchanged, thereby significantly reducing the system disturbance and improving the high availability and elastic expansion capability. In addition, since the edge nodes are mapped and bound according to the resource pool they serve, the differential scheduling of key and non-key resource pools can be supported, and the high-concurrency processing performance and efficient use of computing resources can be considered. BRIEF DESCRIPTION OF DRAWINGS

[0036] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related art, the drawings needed to be used in the description of the embodiments of the present application or the related art will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other related drawings can be obtained by those skilled in the art without creative labor.

[0037] Figure 1 An application environment diagram of the high-availability database service scheduling method in an embodiment;

[0038] Figure 2 A flowchart of the high-availability database service scheduling method in an embodiment;

[0039] Figure 3 A flowchart of the high-availability database service scheduling method in another embodiment;

[0040] Figure 4 A process diagram of forwarding the request to the target edge node in an embodiment;

[0041] Figure 5 A flowchart of the step of constructing the consistency mapping structure in an embodiment;

[0042] Figure 6 A flowchart of the step of constructing the consistency mapping structure in another embodiment;

[0043] Figure 7 A detailed flowchart of the high-availability database service scheduling method in an embodiment;

[0044] Figure 8Fig. 1 is a schematic diagram of dynamic expansion for an overload node in one embodiment;

[0045] Figure 9 Fig. 2 is a detailed flowchart of a high-availability database service scheduling method in another embodiment;

[0046] Figure 10 Fig. 3 is a structural block diagram of a high-availability database service scheduling apparatus in one embodiment;

[0047] Figure 11 Fig. 4 is a structural block diagram of a high-availability database service scheduling apparatus in another embodiment;

[0048] Figure 12 Fig. 5 is an internal structural diagram of a computer device in one embodiment. DETAILED DESCRIPTION

[0049] In order to make the purposes, technical solutions and advantages of the present application clearer, the present application is further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and do not limit the present application.

[0050] It should be noted that the terms "first", "second", and the like used in the present application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "include" and "have" used in the present application and any variations thereof are intended to cover non-exclusive inclusion. The term "multiple" used in the present application refers to two or more. The term "and / or" used in the present application refers to one of the options or any combination of multiple options.

[0051] A conventional high-availability database architecture includes at least two roles, a manager and multiple workers. The manager is used to maintain state information, performance indicators and other monitoring data of the workers. The manager issues commands to the workers through unified analysis, thereby providing external monitoring and alarm, separation function, master-slave switching, high-availability recovery and high-reliability recovery and other applications. In cloud computing, such a high-availability database architecture is generally deployed in a resource pool. Cloud computing requires dynamic allocation of resources, and if it is necessary to expand the scale or deploy a new resource pool, such an architecture can be horizontally expanded to a new resource pool to achieve dynamic allocation. However, this architecture has two limitations.

[0052] Limitation one: unable to meet the growing number of users. When the number of users of a resource pool exceeds the pressure that a server can withstand, the server resources can be dynamically expanded based on the underlying capabilities of cloud computing. However, this implementation has a disadvantage, which is difficult to cope with a large number of concurrent timed tasks or a large number of concurrent task scenarios.

[0053] Limit two: difficult to maintain. When the resource pool is horizontally expanded, a set of managers and workers need to be deployed repeatedly, which brings complexity to the operation of post-maintenance and operation version.

[0054] Therefore, in order to solve the above technical problems, the application provides a high-availability database service scheduling scheme.

[0055] The high-availability database service scheduling method provided by the embodiments of the application can be applied to an application environment as shown in Figure 1 The edge node 102 communicates with the center node 104 through a network. The data storage system can store data required to be processed by the center node 104. The data storage system can be integrated on the center node 104, or placed on a cloud or other network server.

[0056] Specifically, the client can initiate a database service request carrying a resource pool identifier. The center node maps the resource pool identifier to a first mapping value, and determines a target edge node based on the first mapping value and a pre-constructed consistency mapping structure. The consistency mapping structure is composed of second mapping values of multiple edge nodes, and each second mapping value is obtained by performing consistency operation on the node identifier of the edge node and the resource pool identifier associated with the edge node. Then, the database service request is forwarded to the target edge node, so that the target edge node executes a database task associated with the resource pool identifier.

[0057] The edge node 102 can be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, unmanned aerial vehicles, low-altitude aircraft, Internet of Things devices, and portable wearable devices. The Internet of Things device can be a smart speaker, a smart television, a smart air conditioner, a smart vehicle device, a projection device, etc. The portable wearable device can be a smart watch, a smart bracelet, a head-mounted device, etc. The head-mounted device can be a virtual reality (VR) device, an augmented reality (AR) device, smart glasses, etc. The center node 104 can be a standalone physical server, a server cluster or a distributed system composed of multiple physical servers, or a cloud server providing cloud computing services.

[0058] In an exemplary embodiment, as shown in Figure 2 A high-availability database service scheduling method is provided. Taking the center node 104 in Figure 1 as an example, the method includes the following steps 200 to 800. Wherein:

[0059] Step 200, receiving a database service request carrying a resource pool identifier.

[0060] In the available database architecture of the embodiment, the system adopts a "center-edge" two-level collaborative mode: the center node is responsible for global coordination and lightweight control tasks (such as metadata maintenance, instruction issuance, and routing scheduling), and the edge node is deployed close to the physical location of the database instance to reduce the network delay of long-time transmission. The edge node is responsible for performing heavy tasks (such as state collection, traffic access, backup recovery, and timing task scheduling) with large resource consumption. This separation of responsibilities enables the center node to efficiently complete request distribution and system control, while complex business logic is sunk to the edge, realizing the nearby use of computing resources and load decoupling. Based on the underlying architecture of the edge network, the center node communicates with the edge node through Nginx distribution. The edge nodes are connected through VPN and can be considered as being in one network plane.

[0061] The resource pool refers to a collection of computing resources, network resources, and other types of resources. The resource pool identifier is an identifier for uniquely identifying the resource pool, usually represented by regionId. The database service request refers to various operation instructions that need to access or operate the database, which may come from user terminals, operation and maintenance systems, or internal scheduling modules.

[0062] In specific implementation, the center node can receive the database service request transmitted by the user terminal through its network listening interface (such as Nginx gateway), then parse the resource pool identifier regionId carried in the database service request, and temporarily store the request in the scheduling queue, preparing for subsequent mapping and routing processes.

[0063] Step 400, mapping the resource pool identifier to a first mapping value.

[0064] The first mapping value is a numerical representation of the resource pool identifier generated by a consistent mapping mechanism, which is used to locate the corresponding service node in the consistent mapping structure. The mapping has determinacy, that is, the same resource pool identifier always generates the same mapping value.

[0065] After the center node extracts the resource pool identifier regionId, it can call a built-in consistent mapping algorithm to parse the obtained resource pool identifier as input and perform a deterministic mapping operation to obtain a first mapping value within a predetermined numerical range. The core requirement of the mapping is that the same input always produces the same output, and different inputs are as dispersed as possible to avoid hotspots. The output is an integer within a fixed range, which is convenient for comparison and lookup in an ordered structure.

[0066] Exemplarily, the resource pool identifier can be summarized to generate a fixed-length byte sequence, and then mapped to a value in the range of 0~2^32-1. Alternatively, the resource pool identifier can be encoded into an integer according to a predefined rule (such as a lookup table, ASCII accumulation, Base36 conversion, etc.), and then taken modulo 2^32. In some other embodiments, a unique mapping value can be pre-allocated for each known resource pool identifier and stored in a memory mapping table, and in specific implementation, the mapping value corresponding to the resource identifier can be determined by looking up the table.

[0067] At step 600, the target edge node is determined based on the first mapping value and a pre-constructed consistency mapping structure.

[0068] The consistency mapping structure is a logical structure pre-constructed by a plurality of mapping values corresponding to a plurality of registered edge nodes in numerical order, and is used to determine the target edge node according to the identifier (such as the resource pool ID) carried by the request. In the embodiment, the consistency mapping structure is composed of a plurality of second mapping values of the edge nodes, each second mapping value is a value obtained by performing a consistent operation on the node identifier of the edge node and the resource pool identifier associated with the edge node, and represents the position of the edge node in the consistency mapping structure. The target edge node refers to the edge node selected to process the database service request.

[0069] After obtaining the first mapping value, the center node can load the pre-constructed consistency mapping structure, perform a matching operation in the consistency mapping structure with the first mapping value as the query key, find the first second mapping value greater than or equal to the first mapping value, and determine the edge node corresponding to the second mapping value as the target edge node and obtain its network address information.

[0070] At step 800, the database service request is forwarded to the target edge node, so that the target edge node performs the database task associated with the resource pool identifier.

[0071] The database task refers to a specific business operation related to a specific resource pool. In the embodiment, the database task belongs to the category of heavy tasks.

[0072] Specifically, the center node can forward the database service request to the target edge node through an internal communication channel (such as a VPN tunnel) based on the address of the target edge node. After that, the request is taken over by the target edge node, triggering the heavy task processing engine locally deployed by the target edge node to perform corresponding operations, such as accessing customer traffic, analyzing worker status, performing backup, etc.

[0073] In the high-availability database service scheduling method, the resource pool identifier is mapped to a first mapping value, and a consistent mapping structure is constructed by combining a second mapping value generated by consistent operation of the edge node and its associated resource pool identifier, so that the target edge node processing the request is determined, and accurate and deterministic routing of the database service request to the target edge node is realized. The above mechanism ensures that requests with the same resource pool identifier are always directed to the same edge node, ensuring the consistency of task processing context. At the same time, when the edge node is dynamically added or reduced, only the request distribution in the local interval of the mapping structure is affected, and the rest of the request routing remains unchanged, significantly reducing system disturbance and improving high availability and elastic expansion capability. In addition, since the edge node is mapped and bound according to the resource pool it serves, it can support differentiated scheduling of key and non-key resource pools, balancing high concurrency processing performance and efficient use of computing resources.

[0074] In one exemplary embodiment, as shown in Figure 3 The edge node includes a key edge node and a non-key edge node, and the method further includes:

[0075] Step 900, in the case where the load state of the key edge node meets the preset expansion condition, a new edge node is added in the consistent mapping structure, or the mapping value of the plurality of virtual nodes corresponding to the new edge node, and the positions of the remaining edge nodes in the consistent mapping structure remain unchanged.

[0076] In this embodiment, the key edge node refers to an edge node currently undertaking a key resource pool database task. Conversely, an edge node undertaking a non-key resource pool database task is a non-key edge node. The preset expansion condition is a preconfigured threshold rule (such as CPU continuously exceeding 85% for 5 minutes), which is used to trigger the expansion mechanism. The new edge node can be a newly started physical or virtual server, or a logical extension of an existing node. The mapping value of the virtual node refers to the mapping representation of the same physical edge node existing in the consistent mapping structure with multiple logical identities.

[0077] In actual application, for the key edge node, the server can use high-specification CPU resources, high-specification network io resources, and high-specification memory / disk resources to cope with high concurrency scenarios. For the non-key resource pool, the specification can be appropriately reduced to achieve cost savings.

[0078] In a specific implementation, the central node can continuously receive real-time load status data reported by each edge node and perform special monitoring on the key edge nodes. For example, in a scenario of a service peak, if the load of a key edge node is too high and the load indicator meets the preset expansion condition, the central node triggers an expansion decision process: first, a new edge server can be deployed in the target region (or a standby instance ready for use can be reused), and the node identifier thereof is obtained; then, the central node generates one or more mapping values based on the node identifier of the new edge node and the resource pool identifier associated therewith through a consistent mapping mechanism (if a virtual node strategy is adopted, multiple mapping values are generated); finally, the central node inserts the new mapping values into the consistent mapping structure maintained locally, so that the edge node in the service peak is adjacent. The mapping values and the relative order of the remaining existing edge nodes remain unchanged. The entire process does not require reconstruction of the mapping structure and does not affect the request routing relationship in the unaffected interval.

[0079] Exemplarily, as shown in Figure 4 , taking a hash ring as an example for illustration by using a consistent mapping mechanism, the core database instance of a certain platform is deployed in the availability zone az3. With the surge of user access, a large amount of user traffic (request a) enters the system through the central node and carries the resource pool identifier regionId=az3. At the same time, the central node continuously initiates health checks, slow log analysis and other operation and maintenance tasks (request b) to az3 to ensure service stability. Since all requests are mapped to the same location in the hash ring according to the same regionId, both user traffic and central node tasks are ultimately routed to the edge node corresponding to az3. Under long-term high-load operation, the CPU usage of the edge node continuously exceeds 90%, the memory pressure increases significantly, and the system status is marked as “overloaded”. Although the current request can still be responded to, the delay increases, the connection timeout problem begins to appear, and there is a risk of service interruption. When the system detects that az3 is overloaded, a new edge node az3 (located between the overloaded az3 and az2 in the figure) can be automatically added in the hash ring, and the mapping value thereof is inserted into the ring, so as to divert part of the requests to the new node, realize smooth expansion and load balancing, and ensure the high availability of the overall service.

[0080] In this embodiment, for high-load key edge nodes, on the one hand, by adding new nodes or virtual nodes to share traffic, the overload risk is effectively alleviated, and the high availability and service quality of key services are ensured; on the other hand, since only new mapping values are locally inserted in the consistent mapping structure, the request routing paths of most original resource pools are not affected, avoiding large-scale connection migration or state loss, and significantly improving the system flexibility and stability. At the same time, combined with the differentiated resource configuration of key / non-key edge nodes, the overall architecture not only responds to high-concurrency scenarios, but also takes into account the efficient use of computing resources and operation and maintenance cost control, forming a high-availability database service system that balances performance, reliability and economy.

[0081] As shown in FIG. 1, in one exemplary embodiment, before step 200, the method further comprises: Figure 5

[0082] Step 120, obtaining the node identifier of each registered edge node and the resource pool identifier served by each edge node.

[0083] The node identifier is used to uniquely identify an edge node, and usually includes but is not limited to IP address, host name or system assigned unique ID. Registered means that the edge node actively reports its own information to the center node after startup and completes registration.

[0084] In specific implementation, the center node can continuously listen to the registration request from the edge node through its registration management module, extract and store the node identifier of each edge node and one or more resource pool identifiers declared by it, and form an initial node-resource pool association list.

[0085] Step 140, grouping a plurality of node identifiers and resource pool identifiers.

[0086] After obtaining the node-resource pool association list, the center node can traverse the obtained association list, pair the node identifier of each edge node with each resource pool identifier it serves respectively, form a plurality of independent combination items, and ensure that the service relationship of each resource pool is modeled separately.

[0087] Step 160, performing a consistent operation on each group of node identifiers and resource pool identifiers to obtain a second mapping value.

[0088] The consistent operation refers to a deterministic mapping mechanism, the input of which is the combination of (node identifier + resource pool identifier), and the output is a value in a fixed range.

[0089] ​Following the steps above, the central node can call the consistency mapping module for each composite item, concatenate or encode the node identifier and resource pool identifier as input, perform a deterministic mapping operation, generate the corresponding second mapping value, and bind and store this value with the original composite item.

[0090] Step 180: Arrange the second mapping values ​​to obtain a consistent mapping structure.

[0091] The central node calculates the second mapping value of all combined items, collects all second mapping values ​​and their corresponding edge node information, sorts them by numerical value from smallest to largest or from largest to smallest, and constructs a consistent mapping structure that is connected end to end and can be queried efficiently for subsequent routing decisions.

[0092] In this embodiment, the central node can construct a consistent mapping structure that accurately reflects the "node-resource pool" binding relationship based on the actual service range of the edge nodes. This structure not only ensures that requests from the same resource pool are always routed to the same edge node, guaranteeing contextual consistency in task processing, but also only affects local mapping intervals when nodes are added or removed, greatly reducing system disturbances. Furthermore, since the mapping is performed on a "node + resource pool" basis, it supports flexible deployment modes where one edge node serves multiple resource pools, or key resource pools are carried by dedicated high-configuration nodes. This achieves the triple goals of high concurrency processing capability, efficient resource utilization, and simplified operation and maintenance within a unified scheduling framework, significantly improving the availability, elasticity, and economy of the database system.

[0093] like Figure 6 As shown, in an exemplary embodiment, step 160 includes:

[0094] Step 162: Perform a consistent hash operation on each set of node identifiers and resource pool identifiers to obtain the second hash value.

[0095] In this embodiment, consistent hashing is a deterministic mapping method where the same input always produces the same output, and the output values ​​are evenly distributed. The second hash value, which is the result of the consistent hashing operation, is an integer within a fixed numerical range (e.g., 0 to 2³²−1), representing the position of the edge node in the consistent mapping structure.

[0096] In practice, the central node can traverse all grouped (node ​​identifier, resource pool identifier) ​​combinations, standardize and concatenate each node identifier and resource pool identifier to obtain a concatenated string, and then call the consistent hashing algorithm to perform a consistent hashing operation on the string to generate the corresponding second hash value. This value is then associated with the original combination and stored to form a mapping record.

[0097] Step 180 comprises: step 182, arranging the second hash values in ascending order to obtain a hash ring.

[0098] The ascending order arrangement refers to sorting all the second hash values from small to large in value. The hash ring is a ring structure formed by logically connecting the first and last of the sorted second hash value sequence, which is used to support the clockwise (or counterclockwise) nearest node lookup.

[0099] In specific implementation, the center node collects all the second hash values and the corresponding edge node information, loads them into the memory and sorts them by value size to construct an ordered data structure (such as an array or a balanced tree); the structure is logically regarded as a ring, that is, the maximum value returns to the minimum value, thereby supporting the ring lookup semantics.

[0100] In this embodiment, the center node constructs a hash ring that accurately reflects the service relationship between the edge node and the resource pool. This structure ensures that requests from the same resource pool can always be located to the fixed edge node on the ring after the same hash operation, thereby guaranteeing the state continuity and context consistency of task processing; at the same time, since the hash ring is constructed based on the consistent hashing principle, when an edge node is added or removed, only a small number of resource pool routes in the adjacent interval are affected, and the remaining request paths remain unchanged, which significantly reduces the system disturbance and fault recovery cost.

[0101] As shown in FIG. 4, in an exemplary embodiment, step 400 comprises step 420 of mapping the resource pool identifier to a first hash value. Figure 7

[0102] Step 600 comprises: step 620, finding a first second hash value greater than or equal to the first hash value in the hash ring, and determining the edge node corresponding to the found second hash value as the target edge node.

[0103] The first hash value is a value generated by consistent hashing operation on the resource pool identifier (such as regionId).

[0104] In specific implementation, the center node can first perform consistent hashing operation on the resource pool identifier to obtain the corresponding first hash value after receiving the request carrying the resource pool identifier. Then, the hash ring data structure maintained in the memory is accessed, and the first hash value is used as the query key to perform matching lookup in the ordered hash ring. Once the first second hash value greater than or equal to the first hash value is found, the edge node identifier corresponding to the second hash value is extracted, and the edge node is determined as the target edge node for processing the request for subsequent forwarding decision.

[0105] Exemplarily, as shown in FIG. 6, step 600 comprises step 610 of performing consistent hashing operation on the resource pool identifier to obtain the first hash value. Figure 8 ​As shown, the center node needs to perform active-standby switchover or health check on the database instance deployed in the resource pool az3. The task is sent in the form of "request a" and carries the target resource pool identifier (i.e. regionId = az3). According to the consistency mapping mechanism, the center node maps the identifier to the first mapping value and performs a lookup in the pre-built "edge node Hash ring" (i.e. Hash ring). The nodes in the edge node Hash ring represent an edge node. Since az3 is the only edge node associated with the identifier, request a is deterministically routed to the edge node corresponding to az3.

[0106] In this embodiment, the lookup mechanism ensures that requests with the same resource pool identifier are always routed to the same edge node, thereby guaranteeing the state consistency, session affinity and context continuity of database task processing, and avoiding state loss or repeated initialization due to node switching. At the same time, since the lookup is based on an ordered Hash ring and only relies on deterministic hash value comparison, the entire process is efficient, stable and stateless, suitable for real-time scheduling in high-concurrency scenarios. More importantly, the mechanism is deeply coupled with the construction logic of the Hash ring. When the number of edge nodes changes dynamically, only the request routing in the local interval changes, and most of the request paths remain unchanged, significantly reducing system disturbance and improving overall availability and elastic expansion capability. Combined with the differentiated deployment of key / non-key edge nodes, this method ensures the quality of service of key business while achieving fine scheduling and efficient utilization of computing resources, providing a scheduling foundation with high performance, high reliability and low cost for cloud-native database systems.

[0107] As shown in FIG. 10, in one exemplary embodiment, the method further includes: Figure 9

[0108] Step 920, in the case of receiving an edge node offline notification or detecting a faulty edge node, removing the edge node and the second mapping value corresponding to the virtual node corresponding to the edge node from the consistency mapping structure.

[0109] The edge node offline notification refers to the exit service signal (such as shutdown request) sent by the edge node to the center node. The faulty edge node refers to the edge node that is determined to be unavailable by the center node due to network interruption, process crash, heartbeat timeout, etc. The virtual node is a plurality of logical representations of the same physical edge node in the consistency mapping structure, which is used to improve the load balancing capability.

[0110] ​In actual implementation, the central node continuously monitors the health status of the edge nodes, for example, whether the nodes are offline or malfunctioned can be determined through a heartbeat mechanism, a registration state or an external alarm system. Once it is confirmed that an edge node is malfunctioned, the central node immediately locates and deletes all associated second mapping values of the node in the consistency mapping structure maintained locally, including one or more mapping items corresponding to the physical edge node of the node. After the deletion operation is completed, the mapping structure is automatically updated, and subsequent requests for the resource pool identifier originally processed by the node will be automatically postponed to the next valid node in the structure during routing.

[0111] In the embodiment, in the case of edge node offline notification or detection of a malfunctioning edge node, the fast, accurate and residue-free cleaning of the malfunctioning edge node is achieved by deleting the node, so that the consistency mapping structure always reflects the current available service capability of the system. Since only the mapping items related to the malfunctioning node are removed, the location and routing relationship of the remaining nodes are completely unaffected, so that the service interruption range is controlled within the minimum local interval. The next time the request originally processed by the node is accessed, it can be automatically and seamlessly redirected to the next healthy node in the hash ring, without the need for manual intervention or global reconstruction, thereby significantly improving the self-healing capability, high availability and elastic robustness of the system. At the same time, the synchronous cleaning of the virtual node avoids the residue of invalid routing points, ensures the effectiveness of load balancing, and further enhances the stable operation capability of the entire database service architecture in a complex cloud environment.

[0112] In order to make the high-availability database service scheduling method provided by the present application more clearly, a specific embodiment will be described below, which includes the following contents:

[0113] A large-scale cloud database service platform provides high-availability database services for global users, and its underlying architecture adopts a "center-edge" collaborative architecture. The platform divides the computing resources into multiple isolated resource pools (i.e. availability zones, such as az1, az2, az3), and each resource pool carries database instances of different regions or business lines. In order to achieve efficient scheduling and elastic operation, the system deploys a central node and multiple edge nodes: the central node is located in the core control area and is responsible for global coordination and processing of light tasks; each edge node is physically deployed near the corresponding resource pool and processes heavy tasks.

[0114] In the system initialization stage, the central node collects information of all registered edge nodes and the resource pool identifiers (such as regionId=az3) served by the edge nodes, performs consistency hashing on each set of "node IP + resource pool identifier", generates corresponding second hash values, and organizes these mapping values in numerical order to construct a hash ring. Thereafter, when a user initiates a database operation request or the central node needs to perform an operation and maintenance task, the request carries an explicit resource pool identifier.

[0115] For example, the database instance of a certain e-commerce platform is deployed in the az3 availability zone. A user initiates a query request (request a) which is routed to the center node through the gateway; at the same time, the center node needs to perform slow log analysis on the instance due to a timing task (request b). Both of them carry regionId=az3. The center node maps this identifier to a first hash value, and finds the first edge node corresponding to a second hash value greater than or equal to the first hash value in the hash ring, and determines it as the target edge node for processing the request. Subsequently, the center node forwards the two requests to the target edge node respectively. The target edge node serves as a heavy task execution unit, and uniformly processes the traffic from the user and the center node, completes high-overhead operations such as SQL parsing, state collection, and log analysis, while the center node only undertakes the responsibilities of light scheduling and metadata management.

[0116] As the business peak arrives, the number of users in the az3 region increases dramatically, and a large number of requests continue to converge on the same edge node, causing its CPU and network load to be at a high level for a long time. The system monitoring module marks it as "overloaded". At this time, the center node triggers the dynamic expansion mechanism: a high-spec edge server is added near az3, which is associated with az3, and a new mapping value is generated and inserted into the hash ring. Due to the minimum disturbance feature of the hash ring, only part of the requests originally routed to the original az3 node are redistributed to the new node, and the rest of the request paths remain unchanged. After the expansion is completed, the load pressure is effectively dispersed, and the service returns to stability.

[0117] If the subsequent business falls back, the system can also automatically shrink the capacity, remove the redundant edge node, and its mapping value is deleted from the structure, and the related requests are automatically postponed to the adjacent node, without the need for manual intervention. Throughout the process, requests with the same resource pool identifier are always processed by a determined edge node, ensuring session continuity and state consistency; at the same time, the mechanisms of light and heavy task separation, edge proximity calculation, dynamic elastic expansion and contraction, etc. work together to achieve the unification of high-concurrency support, efficient resource utilization, and reduced operation and maintenance costs.

[0118] It should be understood that although each step in the flowchart involved in the above-described embodiments is shown in sequence according to the arrow, these steps are not necessarily executed in the order indicated by the arrow. Unless otherwise specified herein, the execution of these steps is not strictly limited in sequence, and these steps can be executed in other orders. Moreover, at least some of the steps in the flowchart involved in the above-described embodiments can include multiple steps or multiple stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily sequential, but can be alternately or alternately executed with at least some of the other steps or steps or stages in other steps. It can be understood that the steps in different embodiments can be freely combined as needed, and various non-contradictory schemes formed by the combination are within the scope of protection of the present application.

[0119] Based on the same inventive concept, the embodiments of the present application also provide a high-availability database service scheduling apparatus for implementing the above-mentioned high-availability database service scheduling method. The implementation scheme for solving the problem provided by the apparatus is similar to the implementation scheme described in the above-mentioned method, so the specific limitations in one or more high-availability database service scheduling apparatus embodiments provided below can refer to the limitations of the high-availability database service scheduling method described above, which will not be repeated here.

[0120] In one exemplary embodiment, as shown in Figure 10 A high-availability database service scheduling apparatus 800 is provided, deployed in a center node, the center node being in communication connection with a plurality of edge nodes, and the apparatus comprising: a data receiving module 810, a data mapping module 820, a data searching module 830 and a data forwarding module 840, wherein:

[0121] The data receiving module 810 is configured to receive a database service request carrying a resource pool identifier.

[0122] The data mapping module 820 is configured to map the resource pool identifier to a first mapping value.

[0123] The data searching module 830 is configured to determine a target edge node based on the first mapping value and a pre-constructed consistency mapping structure, wherein the consistency mapping structure is composed of a plurality of second mapping values of the edge nodes, each second mapping value being obtained by performing a consistency operation on a node identifier of an edge node and a resource pool identifier associated with the edge node.

[0124] The data forwarding module 840 is configured to forward the database service request to the target edge node, so that the target edge node performs a database task associated with the resource pool identifier.

[0125] As Figure 11As shown, the edge nodes include a key edge node and a non-key edge node, and the apparatus further includes a data adjustment module 850 configured to add a new edge node in the consistent mapping structure, or a mapping value of a plurality of virtual nodes corresponding to the new edge node, when it is detected that the load state of the key edge node meets the preset expansion condition, and the positions of the remaining edge nodes in the consistent mapping structure remain unchanged.

[0126] As shown, in some example embodiments, the apparatus further includes a data construction module 860 configured to obtain node identifiers of the registered edge nodes and resource pool identifiers served by the edge nodes, group the plurality of node identifiers and resource pool identifiers, perform a consistent operation on each group of node identifiers and resource pool identifiers to obtain a second mapping value, and arrange the second mapping values to obtain the consistent mapping structure. Figure 11

[0127] In some example embodiments, the data construction module 860 is further configured to perform a consistent hash operation on each group of node identifiers and resource pool identifiers to obtain a second hash value, and arrange the second hash values in ascending order to obtain a hash ring; the second mapping value is the second hash value, and the consistent mapping structure is the hash ring.

[0128] In some example embodiments, the first mapping value is a first hash value, and the data searching module 830 is further configured to search for, in the hash ring, a second hash value that is the first or the second greater than or equal to the first hash value, and determine the edge node corresponding to the searched second hash value as the target edge node.

[0129] In some example embodiments, the data adjustment module 850 is further configured to remove, from the consistent mapping structure, an edge node and a second mapping value corresponding to a virtual node corresponding to the edge node, when receiving an offline notification of the edge node or detecting that there is a faulty edge node.

[0130] The above various modules in the high-availability database service scheduling apparatus can be all or partially implemented by software, hardware, and combinations thereof. The above various modules can be embedded in or independent of a processor in a computer device in hardware form, or stored in a memory in the computer device in software form, so as to be called and executed by a processor to perform operations corresponding to the above various modules.

[0131] In one example embodiment, a computer device is provided, which can be a server, and an internal structure diagram of the computer device can be as shown in Figure 12 ​As shown in the figure. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. Among them, the processor, the memory and the input / output interface are connected through the system bus, and the communication interface is connected to the system bus through the input / output interface. Among them, the processor of the computer device is used to provide computing and control capability. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data such as consistency mapping structure. The input / output interface of the computer device is used to exchange information between the processor and the external device. The communication interface of the computer device is used to communicate with the terminal outside through the network connection. The computer program is executed by the processor to realize a high-availability database service scheduling method.

[0132] Those skilled in the art can understand that, Figure 12 The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different component arrangement.

[0133] In one exemplary embodiment, a computer device is provided, including a memory and a processor, the memory storing a computer program, and the processor executing the computer program to realize the steps in any one of the high-availability database service scheduling method embodiments described above.

[0134] In one embodiment, a computer readable storage medium is provided, which stores a computer program, and the computer program is executed by the processor to realize the steps in any one of the high-availability database service scheduling method embodiments described above.

[0135] In one embodiment, a computer program product is provided, including a computer program, and the computer program is executed by the processor to realize the steps in any one of the high-availability database service scheduling method embodiments described above.

[0136] It should be noted that the user information (including but not limited to user equipment information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties, and the collection, use and processing of related data need to comply with relevant regulations.

[0137] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when executed, can include the processes of the above-mentioned embodiment methods. Any reference to memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile memory and volatile memory. The non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical storage, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. The volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration but not limitation, the RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The database involved in the embodiments provided in the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in the embodiments provided in the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, an artificial intelligence (AI) processor, etc., without being limited thereto.

[0138] The technical features of the above embodiments can be combined in any manner. To make the description concise, not all possible combinations of the technical features in the above embodiments are described, but as long as the combinations of the technical features do not exist contradictions, they should be considered as the scope of the present application.

[0139] The above-described embodiments are merely illustrative of several embodiments of the present application, and the description is relatively specific and detailed, but should not be understood as a limitation on the scope of the patent. It should be noted that for those skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are all within the scope of the present application. Therefore, the scope of protection of the present application should be subject to the appended claims.

Claims

1. A high-availability database service dispatching method, characterized in that, The application is applied to a center node, which is in communication connection with multiple edge nodes, and the method comprises the following steps: receiving a database service request carrying a resource pool identifier; mapping the resource pool identifier into a first mapping value; determining a target edge node based on the first mapping value and a pre-constructed consistency mapping structure, wherein the consistency mapping structure is composed of second mapping values of the multiple edge nodes, and each second mapping value is obtained by performing consistency operation on a node identifier of the edge node and a resource pool identifier associated with the edge node; forwarding the database service request to the target edge node, so that the target edge node performs a database task associated with the resource pool identifier.

2. The method of claim 1, wherein, The edge nodes include key edge nodes and non-key edge nodes, and the method further comprises the following steps: in the case that the load state of the key edge node meets a preset expansion condition, adding a new edge node in the consistency mapping structure or mapping values of multiple virtual nodes corresponding to the new edge node, and the positions of the remaining edge nodes in the consistency mapping structure remain unchanged.

3. The method of claim 1, wherein, Before the step of receiving the database service request carrying the resource pool identifier, the method further comprises the following steps: obtaining node identifiers of the registered edge nodes and resource pool identifiers served by the edge nodes; grouping the multiple node identifiers and the resource pool identifiers; performing consistency operation on each group of node identifiers and resource pool identifiers to obtain second mapping values; arranging the second mapping values to obtain the consistency mapping structure.

4. The method of claim 3, wherein, The step of performing consistency operation on each group of node identifiers and resource pool identifiers to obtain second mapping values comprises the following steps: performing consistency hash operation on each group of node identifiers and resource pool identifiers to obtain second hash values; The step of arranging the second mapping values to obtain the consistency mapping structure comprises the following steps: arranging the second hash values in ascending order to obtain a hash ring; wherein the second mapping values are the second hash values, and the consistency mapping structure is the hash ring.

5. The method of claim 4, wherein, The first mapping value is a first hash value, and the step of determining a target edge node based on the first mapping value and a pre-constructed consistency mapping structure comprises the following steps: finding a first second hash value greater than or equal to the first hash value in the hash ring; determining the edge node corresponding to the found second hash value as the target edge node.

6. The method according to any one of claims 1 to 5, characterized in that, The method further comprises the following steps: in the case that an edge node offline notification is received or a faulty edge node is detected, removing the edge node and second mapping values corresponding to virtual nodes corresponding to the edge node from the consistency mapping structure.

7. A high-availability database service dispatching apparatus characterized by comprising: The application is applied to a center node, which is in communication connection with multiple edge nodes, and the method comprises the following steps: a data receiving module, configured to receive a database service request carrying a resource pool identifier; a data mapping module, configured to map the resource pool identifier into a first mapping value; A data searching module is configured to determine a target edge node based on the first mapping value and a consistency mapping structure constructed in advance, wherein the consistency mapping structure is composed of second mapping values of a plurality of edge nodes, and each second mapping value is obtained by performing consistency operation on a node identifier of the edge node and a resource pool identifier associated with the edge node. A data forwarding module is configured to forward the database service request to the target edge node, so that the target edge node performs a database task associated with the resource pool identifier.

8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that, The processor implements the steps of the method of any one of claims 1 to 6 when executing the computer program.

9. A computer readable storage medium having stored thereon a computer program, characterized in that, The computer program, when executed by the processor, implements the steps of the method of any one of claims 1 to 6.

10. A computer program product comprising a computer program, characterized in that, The computer program, when executed by the processor, implements the steps of the method of any one of claims 1 to 6. The computer program, when executed by the processor, implements the steps of the method of any one of claims 1 to 6.