Data access method and device, medium, electronic equipment and program product

By using a hybrid routing strategy and a consistent hashing algorithm, the contradiction between cache hit rate and request throughput limit in the single service node scheduling method is resolved, achieving efficient distribution of hotspot routing keys and performance improvement.

CN119336839BActive Publication Date: 2026-03-31BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-18
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

In existing technologies, single-service-node scheduling methods cannot simultaneously consider the local cache hit rate of service nodes and the request throughput limit of hotspot routing keys, resulting in CPU saturation for hotspot table access requests and limited remote call performance.

Method used

A hybrid routing strategy is adopted, which uses a consistent hashing algorithm to determine the service node group and combines random or load information to select the target node, thereby distributing business requests for hot routing keys, ensuring cache hit rate while increasing the request throughput limit.

Benefits of technology

While ensuring cache hit rate, the request throughput limit of hot routing keys was increased, thereby improving the performance of remote API calls.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119336839B_ABST
    Figure CN119336839B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a data access method, device, medium, electronic equipment and program product. The method comprises: in response to receiving a first service request, extracting a target routing key in the first service request; determining whether the target routing key is a hot routing key; if the target routing key is a hot routing key, determining a service node group corresponding to the target routing key from a service node cluster; determining a first target node for responding to the first service request from the service node group; and sending the first service request to the first target node. In this way, the service request of the hot routing key can be dispersed to the fixed service group corresponding to the target routing key, the request throughput upper limit of the hot routing key can be improved while the cache hit rate is guaranteed as much as possible, and the performance of the remote call interface is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer network technology, and more specifically, to a data access method, apparatus, medium, electronic device, and program product. Background Technology

[0002] Tabular data is stored in a database, and upstream services typically use a Software Development Kit (SDK) deployed on top of it to schedule corresponding service nodes in a service node cluster to access the tabular data. If a consistent hashing method is used for service node scheduling based on the table's route key, local caching on service nodes can be effectively utilized to improve the performance of remote API calls. However, when a hot table is present, a single request to that hot table can saturate the CPU of the corresponding service node, limiting the request throughput of that hot table to the CPU performance of that service node. Conversely, if a random or round-robin scheduling method is used to distribute the table across multiple service nodes, local caching cannot be effectively utilized, and the performance of remote API calls will be affected. Therefore, the commonly used single-service-node scheduling method in related technologies cannot simultaneously balance the local cache hit rate of service nodes and the request throughput limit supporting hot route keys. Summary of the Invention

[0003] This summary section is provided to briefly introduce the concepts, which will be described in detail in the detailed description section below. This summary section is not intended to identify key or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.

[0004] In a first aspect, this disclosure provides a data access method applied to a first service node, comprising:

[0005] In response to receiving a first service request, extract the target routing key from the first service request;

[0006] Determine whether the target routing key is a hotspot routing key;

[0007] If the target routing key is a hotspot routing key, then the service node group corresponding to the target routing key is determined from the service node cluster;

[0008] A first target node for responding to the first service request is determined from the group of service nodes;

[0009] Send the first service request to the first target node.

[0010] Secondly, this disclosure provides a data access device applied to a first service node, comprising:

[0011] The extraction module is used to extract the target routing key from the first service request in response to receiving the first service request;

[0012] The first determining module is used to determine whether the target routing key is a hotspot routing key;

[0013] The second determining module is used to determine the service node group corresponding to the target routing key from the service node cluster if the target routing key is a hotspot routing key.

[0014] The third determining module is used to determine from the service node group a first target node for responding to the first service request;

[0015] The sending module is used to send the first service request to the first target node.

[0016] Thirdly, this disclosure provides a computer-readable medium having a computer program stored thereon, which, when executed by a processing device, implements the steps of the data access method provided in the first aspect of this disclosure.

[0017] Fourthly, this disclosure provides an electronic device, comprising:

[0018] A storage device on which computer programs are stored;

[0019] A processing device is configured to execute the computer program in the storage device to implement the steps of the data access method provided in the first aspect of this disclosure.

[0020] Fifthly, this disclosure provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the data access method provided in the first aspect of this disclosure.

[0021] In the above technical solution, upon receiving a first business request, the target routing key is first extracted from the request. Then, it is determined whether the target routing key is a hotspot routing key. If it is, the service node group corresponding to the target routing key is determined from the service node cluster. Next, the first target node for responding to the first business request is determined from the service node group corresponding to the target routing key, and the first business request is sent to the first target node. This distributes business requests for hotspot routing keys to fixed service groups corresponding to the target routing key, maximizing cache hit rate while increasing the request throughput limit for hotspot routing keys, thereby improving the performance of remote API calls.

[0022] Other features and advantages of this disclosure will be described in detail in the following detailed description section. Attached Figure Description

[0023] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale. In the drawings:

[0024] Figure 1 This is a schematic diagram of the structure of a distributed system according to an exemplary embodiment.

[0025] Figure 2 This is a flowchart illustrating a data access method according to an exemplary embodiment.

[0026] Figure 3 This is a timing diagram illustrating the determination of a second service node for responding to a first service request, according to an exemplary embodiment.

[0027] Figure 4 This is a timing diagram illustrating a consistent hashing construction according to an exemplary embodiment.

[0028] Figure 5 This is a schematic diagram illustrating the determination of a second service node for responding to a first service request, according to an exemplary embodiment.

[0029] Figure 6 This is a flowchart illustrating a method for determining a first target node from a group of service nodes, according to an exemplary embodiment.

[0030] Figure 7 This is a timing diagram illustrating the execution of a business request according to an exemplary embodiment.

[0031] Figure 8 This is a block diagram illustrating a data access device according to an exemplary embodiment.

[0032] Figure 9 This is a schematic diagram of the structure of an electronic device according to an exemplary embodiment. Detailed Implementation

[0033] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.

[0034] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.

[0035] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the description below.

[0036] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.

[0037] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".

[0038] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.

[0039] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.

[0040] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the software or hardware, such as the electronic device, application, server, or storage medium performing the operations of this disclosed technical solution, based on the prompt message.

[0041] As an optional but non-limiting implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0042] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.

[0043] Meanwhile, it is understood that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and related provisions.

[0044] Figure 1 This is a schematic diagram illustrating the structure of a distributed system according to an exemplary embodiment. For example... Figure 1 As shown, the distributed system may include at least one client, a first service node, and a cluster of service nodes.

[0045] The service node cluster includes multiple second service nodes. Each client connects to a first service node, and each first service node connects to each of the second service nodes in the service node cluster. Users can initiate service requests through the client, and the client responds by receiving the service request and sending it to the first service node.

[0046] There are two different types of service nodes: the first service node and the second service node, each with different functions and roles. The first service node is responsible for determining the path of business requests from source to destination. It typically does not handle business logic but focuses on routing decisions. For example, a first service node might be a routing server. The second service node handles client business requests and executes corresponding business logic, such as querying the database, generating reports, and processing transactions. For example, a second service node might be a business server.

[0047] Figure 2 This is a flowchart illustrating a data access method according to an exemplary embodiment. The method can be applied to a first service node in a distributed system. For example... Figure 2 As shown, the data access method applied to the first service node may include the following S101~S105.

[0048] In S101, in response to receiving the first service request, the target routing key in the first service request is extracted.

[0049] In this disclosure, a user can initiate a first service request through a client. After receiving the first service request, the client sends it to a first service node. The first service request contains a target routing key. After receiving the first service request, the first service node can extract the target routing key by parsing the first service request.

[0050] In load balancing, a route key is an identifier or key-value pair used to determine how requests or messages are distributed to backend service nodes. A route key is a distinctive string used to uniquely identify something. For example, in tabular data processing, a route key can identify a document, while in e-commerce, it can identify a product.

[0051] In S102, determine whether the target routing key is a hotspot routing key.

[0052] Specifically, you can first obtain a list of hotspot routing keys; if the target routing key exists in the list of hotspot routing keys, then the target routing key is determined to be a hotspot routing key; if the target routing key does not exist in the list of hotspot routing keys, then the target routing key is determined to be a non-hotspot routing key.

[0053] In S103, if the target routing key is a hotspot routing key, the service node group corresponding to the target routing key is determined from the service node cluster.

[0054] In S104, the first target node for responding to the first service request is determined from the service node group.

[0055] In this disclosure, such as Figure 3 As shown, when the target routing key is a hotspot routing key, a hybrid routing strategy can be adopted to determine the first target node for responding to the first business request from the service node cluster. In other words, Hybrid routing is enabled. Specifically, the service node group corresponding to the target routing key can be determined from the service node cluster first, and then the first target node for responding to the first business request can be determined from the service node group.

[0056] In S105, the first service request is sent to the first target node.

[0057] After identifying the first target node to respond to the first service request, the first service node can send the request to that first target node, which will then respond to the first service request. Upon receiving the first service request, the first target node can directly execute the first service request.

[0058] In the above technical solution, upon receiving a first business request, the target routing key is first extracted from the request. Then, it is determined whether the target routing key is a hotspot routing key. If it is, the service node group corresponding to the target routing key is determined from the service node cluster. Next, the first target node for responding to the first business request is determined from the service node group corresponding to the target routing key, and the first business request is sent to the first target node. This distributes business requests for hotspot routing keys to fixed service groups corresponding to the target routing key, maximizing cache hit rate while increasing the request throughput limit for hotspot routing keys, thereby improving the performance of remote API calls.

[0059] In one possible implementation, the data access method applied to the first service node described above can be executed via an SDK on the first service node; in this case, as Figure 4 As shown, prior to S101 above, the data access method applied to the first service node may further include the following four steps:

[0060] The SDK is initialized when the first service node starts.

[0061] Obtain the connection information of each second service node in the service node cluster;

[0062] Based on the virtual nodes corresponding to each second service node in the service node cluster, a hash ring is constructed using the consistent hashing algorithm.

[0063] Based on connection information, long-lived connections are established and maintained between the software development kit and each second service node in the service node cluster within the connection pool.

[0064] In this disclosure, in order to use the SDK, the first service node, after startup, first pulls the SDK code and then actively calls the Init method provided by the SDK to complete the SDK initialization.

[0065] After SDK initialization, service discovery can be performed using the SDK. This involves retrieving connection information for each secondary service node in the service node cluster from the service registry. This connection information includes the IP address, data center information, and cluster information of each secondary service node in the cluster. The service registry is a common component in distributed systems. Each secondary service node in the service node cluster reports its connection information to the service registry. By querying the service registry, the SDK can determine which secondary service nodes are present in the cluster, and then proceed with subsequent hash ring construction and connection pool maintenance.

[0066] After obtaining the connection information of each second service node in the service node cluster, the SDK can map each second service node to 64 virtual nodes. Then, through the virtual nodes corresponding to each second service node, a hash ring is constructed using a consistent hashing algorithm to alleviate the problem of uneven distribution on the hash ring and make the load more balanced.

[0067] For example, the service node cluster includes two second service nodes (real physical service nodes), node1 and node2. When constructing a hash ring using the consistent hashing algorithm, node1 and node2 are first mapped to 64 times the number of virtual nodes, resulting in 128 virtual nodes: {node1_1, node1_2, ..., node1_64, node2_1, node2_2, ..., node2_64}. These 128 virtual nodes are then used to construct the hash ring.

[0068] After obtaining the connection information of each second service node in the service node cluster, the SDK can establish a long connection between the SDK and the second service node in the connection pool based on the IP address information of the second service node in the service node cluster. The SDK will periodically check whether the long connection is disconnected. If the connection is disconnected, the connection will be re-established, i.e., connection keep-alive, in order to maintain the long connections in the connection pool.

[0069] At this point, S105 may include: sending the first service request to the first target node through a long-lived connection between the software development kit and the first target node. This allows the first service request to be sent directly to the first target node using the existing long-lived connection in the connection pool, without needing to establish a connection after determining the first target node, thereby improving the response efficiency of the service request.

[0070] like Figure 5 As shown, the above Hybrid routing strategy can employ two layers of routing. The first layer of routing maps the target routing key to a service node group using a consistent hashing algorithm, where the size of the service node group can be adjusted at runtime. The second layer of routing can combine a random algorithm and the load information of each second service node in the service node group to select the first target node from the service nodes corresponding to the target routing key to respond to the first business request.

[0071] For example, the service node group selected by the consistent hashing algorithm is service node group F2. At this time, the first target node for responding to the first business request can be determined from the second service node 4, the second service node 5 and the second service node 6 by combining the random algorithm and the load information of each second service node in service node group F2.

[0072] For example, if the service node group selected by the consistent hashing algorithm is service node group F1, then the first target node for responding to the first business request can be determined from the second service node 1, the second service node 2, and the second service node 3 by combining the random algorithm and the load information of each second service node in service node group F1.

[0073] Specifically, determining the service node group corresponding to the target routing key from the service node cluster in S103 above may include the following steps (a1) to (a3):

[0074] Step (a1): Based on the consistent hashing algorithm, determine the virtual node that matches the target routing key from the pre-built hash ring.

[0075] Specifically, you can first calculate the hash value of the target routing key; then, pair this hash value with 2 32 The process involves performing a modulo operation. Next, based on the position of the modulo value on a pre-constructed hash ring, a clockwise search is performed along the hash ring. The first virtual node encountered is the one that matches the target routing key. This hash ring is constructed using a consistent hashing algorithm, based on the virtual nodes corresponding to each second service node in the service node cluster.

[0076] Step (a2): Determine the second target node corresponding to the matching virtual node from the service node cluster.

[0077] In this disclosure, there is a correspondence between the second service node and the 64 virtual nodes it maps to, that is, one second service node corresponds to 64 virtual nodes mapped based on the second service node. Based on this, the second target node corresponding to the matching virtual node can be determined.

[0078] Step (a3): In the service node cluster, starting from the second target node, traverse a preset number of second service nodes in a preset direction to obtain the service node group corresponding to the target routing key.

[0079] In this disclosure, each second service node in the service node cluster can be stored in the form of a list. Starting from the second target node, a preset number (N) of second service nodes can be traversed forward or backward from this list, and the N traversed second service nodes are determined as the service node group corresponding to the target routing key. Here, N can be a default value or a value set by the developers.

[0080] For example, N is 4, and the service node cluster includes node1, node2, node3, node4, node5, node6, node7, and node8. The second target node is node3. Starting from node3, we traverse the four second service nodes backward to obtain the service node group corresponding to the target routing key, which includes node3, node4, node5, and node6.

[0081] Specifically, when traversing in the preset direction, if the last second service node in the service node cluster is reached, the traversal continues from the first second service node in the service node cluster.

[0082] For example, N is 4, and the service node cluster includes node1, node2, node3, node4, node5, node6, node7, and node8. The second target node is node7. At this time, starting from node7, we traverse two second service nodes backward, and then starting from node1, we traverse two more second service nodes backward. The service node group corresponding to the target routing key includes node7, node8, node1, and node2.

[0083] The following is a detailed description of the specific implementation method for determining the first target node from the service node group to respond to the first service request in S104 above. Specifically, it can be implemented through various implementation methods. In one implementation method, a second service node is randomly selected from the service node group as the first target node.

[0084] In another implementation, a polling strategy can be used to select a second service node from the group of service nodes as the first target node.

[0085] In another implementation, the first target node can be determined from the service node group based on the first load information of each second service node in the service node group.

[0086] like Figure 3 As shown, the first service node can periodically obtain the first load information of each second service node in the service node cluster and update the first load information of each second service node stored locally. The first load information may include CPU utilization, memory utilization, etc.

[0087] In this implementation, when determining the first target node for responding to the first service request from the service node cluster, the first load information of each second service node in the service node group is taken into account. In this way, the problem of delay in the response to the first service request caused by the high load of the selected second service node can be avoided, thereby improving the response efficiency of the service request.

[0088] The following is a detailed description of the specific implementation method for determining the first target node from the service node group based on the first load information of each second service node in the service node group. Specifically, this can be implemented through various methods. In one implementation, the second service node with the lowest CPU utilization or memory utilization in the service group can be determined as the first target node.

[0089] In another implementation, a second service node in a low-load state is determined from the service node group; then, a second service node in a low-load state is randomly selected from these second service nodes as the first target node.

[0090] In this disclosure, if the CPU utilization of the second service node is greater than the second preset utilization threshold or the memory utilization is greater than the third preset utilization threshold, the second service node is determined to be in a high-load state; if the CPU utilization of the second service node is less than or equal to the second preset utilization threshold and the memory utilization is less than or equal to the third preset utilization threshold, the second service node is determined to be in a low-load state.

[0091] In another implementation, the first load information of each second service node in the service node group can be used to... Figure 6 The steps S201~S205 shown illustrate the determination of the first target node from the service node group:

[0092] In S201, a second service node is randomly selected from the service node group as a candidate service node.

[0093] In S202, based on the first load information of the candidate service node, it is determined whether the candidate service node is in a high load state.

[0094] In this disclosure, if the candidate service node is not in a high-load state, that is, the candidate service node is in a low-load state, it indicates that the candidate service node has idle resources to process the first service request. At this time, the candidate service node can be determined as the first target node for responding to the first service request, that is, the following S205 is executed; if the candidate service node is in a high-load state, it indicates that the candidate service node does not have idle resources to process the first service request. At this time, the second service node can be reselected from the service group, that is, the following S203 is executed.

[0095] In S203, it is determined whether the number of iterations has reached the preset number.

[0096] In this disclosure, if the number of iterations does not reach the preset number, the process returns to S201 above; if the number of iterations reaches the preset number, the process executes S204 below.

[0097] The preset number of times can be a default value or a value set by the R&D personnel. Preferably, the preset number of times is equal to the preset quantity N mentioned above, so that each second service node in the service node group can be randomly selected as much as possible.

[0098] In S204, the most recently selected candidate service node is determined as the first target node.

[0099] In S205, the candidate service node is determined as the first target node.

[0100] In this implementation, a second service node is first randomly selected from the service node group, and then it is determined whether the selected second service node meets the low load requirement. In this way, the first randomly selected candidate service node may meet the low load requirement, thereby quickly determining the first target node.

[0101] In one possible implementation, the data access method applied to the first service node described above may include the following steps:

[0102] If the target routing key is a non-hotspot routing key, then determine the third target node corresponding to the target routing key from the service node cluster;

[0103] The first service request is sent to the third target node.

[0104] When the target routing key is a non-hotspot routing key, a third target node corresponding to the target routing key is determined from the service node cluster, and this third target node is designated as the second service node to respond to the first business request. In this way, for a non-hotspot routing key, it is always routed to the same second service node corresponding to that non-hotspot routing key, thereby effectively utilizing the local cache of the service node to improve the performance of remote API calls.

[0105] The following is a detailed description of the specific implementation method for determining the third target node corresponding to the target routing key from the service node cluster. Specifically, it can be achieved through the following steps (b1) and (b2).

[0106] Step (b1): Based on the consistent hashing algorithm, determine the virtual node that matches the target routing key from the pre-built hash ring.

[0107] Step (b2): Identify the second service node in the service node cluster that matches the virtual node as the third target node.

[0108] In one possible implementation, the data access method applied to the first service node described above may further include the following steps:

[0109] In response to receiving the retry instruction sent by the fourth target node, the hotspot routing key list is updated according to the target routing key. Then, the process returns to the step of determining the service node group corresponding to the target routing key from the service node cluster, that is, returning to S103 above.

[0110] In this disclosure, the fourth target node is the second service node in the service node cluster that receives the first service request, and it can be either the first target node or the third target node. The retry instruction is used to instruct the first service node to reallocate the second service node for the first service request. The retry instruction includes the target routing key, and the retry instruction is sent by the fourth target node when it determines that the target routing key is a hotspot routing key based on its own second load information.

[0111] Specifically, such as Figure 7 As shown, after receiving the first service request, the fourth target node first extracts the target routing key from the first service request. Then, based on the second load information of the fourth target node, it determines whether the target routing key is a hotspot routing key, that is, whether the target routing key is a hotspot routing key relative to the fourth target node. If the target routing key is a non-hotspot routing key, it indicates that the fourth target node has idle resources to process the first service request. In this case, the fourth service can directly execute the first service request, thereby ensuring the local cache hit rate of the service node. If the target routing key is a hotspot routing key, it indicates that the fourth target node does not have idle resources to process the first service request. In this case, it can send a retry instruction containing the target routing key to the first service node. After receiving the retry instruction, the first service node parses the retry instruction, extracts the target routing key from the retry instruction, updates the hotspot routing key list based on the target routing key, and re-determines the second service node to respond to the first service request through a hybrid routing strategy. That is, it determines the service node group corresponding to the target routing key from the service node cluster, determines the first target node to respond to the first service request from the service node group, and sends the first service request to the first target node.

[0112] In the above implementation, if the target routing key is a hotspot routing key relative to the fourth target node, the second service node is reselected from the service group to distribute the first service request to other second service nodes for execution. This can make the load more balanced and also prevent the fourth target node from running under overload.

[0113] Additionally, the aforementioned second load information may include CPU utilization and the number of second service requests being executed by the fourth target node, wherein the second service request is a service request carrying a target routing key. In this case, the fourth target node may determine the target routing key as a hotspot when the number of second service requests being executed reaches a preset threshold and the CPU utilization of the fourth target node is greater than a first preset utilization threshold; conversely, the fourth target node may determine the target routing key as a non-hotspot routing key when the number of second service requests being executed does not reach the preset threshold, or when the CPU utilization of the fourth target node is less than or equal to the first preset utilization threshold.

[0114] In this way, when the number of second business requests being executed reaches the preset threshold, but the CPU utilization of the fourth target node is not high, it indicates that the fourth target node can still handle the current task requests without distributing the requests to other second service nodes, thus ensuring the local cache hit rate of the fourth target node.

[0115] Researchers can configure the aforementioned preset quantity thresholds and the first preset utilization rate threshold through the dynamic configuration center (a general component of distributed systems), and can modify them at any time. To ensure the accuracy of the hotspot routing key configuration (including the aforementioned preset quantity thresholds and the first preset utilization rate threshold), such as... Figure 7 As shown, the fourth target node can periodically obtain hotspot routing key configurations from the dynamic configuration center to refresh its local hotspot routing key configurations.

[0116] The following is a detailed description of the specific implementation method for updating the hotspot routing key list based on the target routing key.

[0117] Specifically, if the target route key exists in the hotspot route key list, the time to live (TTL) of the target route key in the hotspot route key list is updated to 0, that is, the time to live of the target route key is recalculated; if the target route key does not exist in the hotspot route key list, the target route key is added to the hotspot route key list.

[0118] The lifetime refers to the duration that the target routing key exists in the hotspot routing key list.

[0119] Since hotspot routing keys typically have a time limit, each hotspot routing key in the hotspot routing key list has a lifespan. If the lifespan reaches a preset duration, it will no longer be used as a hotspot routing key. Specifically, this can be implemented in various ways. In one implementation, the data access method applied to the first service node described above may include the following steps:

[0120] Remove hotspot routing keys from the list of hotspot routing keys that have reached the preset lifespan.

[0121] In another implementation, the data access method applied to the first service node described above may include the following steps:

[0122] Set hotspot routing keys in the hotspot routing key list that have reached a preset lifespan to invalid routing keys.

[0123] At this point, determining the target route key as a hotspot route key if the hotspot route key list contains a target route key can include: determining the target route key as a hotspot route key if the target route key exists among the other route keys in the hotspot route key list (excluding invalid route keys).

[0124] In addition to being updated based on the retry command sent by the fourth target node, the aforementioned hotspot routing keys can also include some manually configured hotspot routing keys, thereby increasing the diversity of the hotspot routing key list and making the data access method more flexible and user-friendly. Specifically, the data access method applied to the first service node may also include the following steps:

[0125] Periodically retrieve manually configured hotspot routing keys (such as...) from the dynamic configuration center. Figure 3 (See step 3 shown), and add the obtained manually configured hotspot routing key to the hotspot routing key list.

[0126] Figure 8 This is a block diagram illustrating a data access device 300 according to an exemplary embodiment. The data access device 300 can be applied to a first service node. For example... Figure 8 As shown, the data access device 300 may include:

[0127] Extraction module 301 is used to extract the target routing key from the first service request in response to receiving the first service request;

[0128] The first determining module 302 is used to determine whether the target routing key is a hotspot routing key;

[0129] The second determining module 303 is used to determine the service node group corresponding to the target routing key from the service node cluster if the target routing key is a hotspot routing key.

[0130] The third determining module 304 is used to determine from the service node group a first target node for responding to the first service request;

[0131] The sending module 305 is used to send the first service request to the first target node.

[0132] In the above technical solution, upon receiving a first business request, the target routing key is first extracted from the request. Then, it is determined whether the target routing key is a hotspot routing key. If it is, the service node group corresponding to the target routing key is determined from the service node cluster. Next, the first target node for responding to the first business request is determined from the service node group corresponding to the target routing key, and the first business request is sent to the first target node. This distributes business requests for hotspot routing keys to fixed service groups corresponding to the target routing key, maximizing cache hit rate while increasing the request throughput limit for hotspot routing keys, thereby improving the performance of remote API calls.

[0133] Optionally, the third determining module 304 is used to determine the first target node from the service node group based on the first load information of each second service node in the service node group.

[0134] Optionally, the third determining module 304 includes:

[0135] The random selection submodule is used to randomly select a second service node from the group of service nodes as a candidate service node.

[0136] The first determining submodule is used to determine whether the candidate service node is in a high-load state based on the first load information of the candidate service node.

[0137] The triggering submodule is used to trigger the random selection submodule to randomly select a second service node from the service node group as a candidate service node if the candidate service node is in the high load state, until the number of loops reaches a preset number.

[0138] The second determining submodule is used to determine the most recently selected candidate service node as the first target node if the number of iterations reaches the preset number.

[0139] Optionally, the third determining module 304 further includes:

[0140] The third determining submodule is used to determine the candidate service node as the first target node if the candidate service node is not in the high load state.

[0141] Optionally, the second determining module 303 includes:

[0142] The fourth determination submodule is used to determine the virtual node that matches the target routing key from a pre-constructed hash ring based on the consistent hashing algorithm, wherein the hash ring is constructed using the consistent hashing algorithm based on the virtual nodes corresponding to each second service node in the service node cluster.

[0143] The fifth determining submodule is used to determine the second target node corresponding to the matching virtual node from the service node cluster;

[0144] The traversal submodule is used to traverse a preset number of second service nodes in the service node cluster, starting from the second target node, in a preset direction, to obtain the service node group corresponding to the target routing key.

[0145] Optionally, the data access device 300 further includes:

[0146] The fourth determining module is used to determine a third target node corresponding to the target routing key from the service node cluster if the target routing key is a non-hotspot routing key;

[0147] The sending module 305 is also used to send the first service request to the third target node.

[0148] Optionally, the fourth determining module includes:

[0149] The sixth determination submodule is used to determine the virtual node that matches the target routing key from a pre-constructed hash ring based on the consistent hashing algorithm, wherein the hash ring is constructed using the consistent hashing algorithm based on the virtual nodes corresponding to each second service node in the service node cluster;

[0150] The seventh determination submodule is used to determine the second service node corresponding to the matching virtual node in the service node cluster as the third target node.

[0151] Optionally, the first determining module 302 includes:

[0152] Get submodule, used to retrieve the list of hotspot routing keys;

[0153] The eighth determination submodule is used to determine the target routing key as a hotspot routing key if the target routing key exists in the hotspot routing key list.

[0154] Optionally, the data access device 300 further includes:

[0155] An update module is used to update the hotspot routing key list according to the target routing key in response to receiving a retry instruction sent by a fourth target node. The retry instruction is used to instruct the first service node to reassign a second service node for the first service request. The retry instruction includes the target routing key. The retry instruction is sent by the fourth target node when it determines that the target routing key is a hotspot routing key based on its own second load information. The fourth target node is the second service node in the service node cluster that received the first service request.

[0156] The triggering module is used to trigger the second determining module 303 to determine the service node group corresponding to the target routing key from the service node cluster.

[0157] Optionally, the second load information includes CPU utilization and the number of second service requests being executed by the fourth target node, wherein the second service request is a service request carrying the target routing key;

[0158] When the number of targets reaches a preset threshold and the CPU utilization of the fourth target node is greater than a first preset utilization threshold, the target routing key is determined to be a hotspot.

[0159] Optionally, the update module includes:

[0160] The first update submodule is used to update the time-to-live (TTL) of the target route key in the hotspot route key list to 0 if the target route key exists in the hotspot route key list. The TTL is the duration of the target route key in the hotspot route key list.

[0161] The second update submodule is used to add the target route key to the hotspot route key list if the target route key is not present in the hotspot route key list.

[0162] Optionally, the data access device 300 further includes:

[0163] The deletion module is used to delete hotspot routing keys that have reached a preset lifespan from the hotspot routing key list.

[0164] Optionally, the data access device 300 further includes:

[0165] Invalid module, which one to use to set the hotspot routing key in the hotspot routing key list that has reached the preset time of life as an invalid routing key;

[0166] The eighth determining submodule is used to determine the target routing key as a hotspot routing key if the target routing key exists in the hotspot routing key list other than the invalid routing key.

[0167] Optionally, the data access device 300 further includes:

[0168] The first acquisition module is used to periodically acquire manually configured hotspot routing keys from the dynamic configuration center and add the acquired manually configured hotspot routing keys to the hotspot routing key list.

[0169] Optionally, the data access device 300 is executed via a software development kit on the first service node;

[0170] The data access device 300 further includes:

[0171] An initialization module is used to initialize the software development kit when the first service node starts.

[0172] The second acquisition module is used to acquire the connection information of each second service node in the service node cluster.

[0173] The hash ring construction module is used to construct a hash ring based on the virtual nodes corresponding to each second service node in the service node cluster, using a consistent hashing algorithm.

[0174] The connection pool maintenance module is used to establish and maintain long-lived connections between the software development kit and each second service node in the service node cluster based on the connection information.

[0175] The sending module 305 is used to send the first service request to the first target node through a long connection between the software development kit and the first target node.

[0176] This disclosure also provides a computer-readable medium having a computer program stored thereon, which, when executed by a processing device, implements the steps of the data access method described above.

[0177] This disclosure also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the data access method described above.

[0178] The following is for reference. Figure 9 It illustrates an electronic device suitable for implementing embodiments of the present disclosure (e.g., Figure 1The diagram shows the structure of the first service node (600) in this embodiment. The terminal devices in this disclosure may include, but are not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), and in-vehicle terminals (e.g., in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Figure 9 The electronic device shown is merely an example and should not be construed as limiting the functionality and scope of the embodiments disclosed herein.

[0179] like Figure 9 As shown, electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processor, etc.) 601, which can perform various appropriate actions and processes according to a program stored in read-only memory (ROM) 602 or a program loaded from storage device 608 into random access memory (RAM) 603. RAM 603 also stores various programs and data required for the operation of electronic device 600. Processing device 601, ROM 602, and RAM 603 are interconnected via bus 604. Input / output (I / O) interface 605 is also connected to bus 604.

[0180] Typically, the following devices can be connected to I / O interface 605: input devices 606 including, for example, touchscreens, touchpads, keyboards, mice, cameras, microphones, accelerometers, gyroscopes, etc.; output devices 607 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 608 including, for example, magnetic tapes, hard disks, etc.; and communication devices 609. Communication device 609 allows electronic device 600 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 9 An electronic device 600 with various devices is shown; however, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.

[0181] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 609, or installed from a storage device 608, or installed from a ROM 602. When the computer program is executed by the processing device 601, it performs the functions defined in the methods of embodiments of this disclosure.

[0182] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.

[0183] In some implementations, the first service node may communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol) and may interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future-developed networks.

[0184] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.

[0185] The aforementioned computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to: in response to receiving a first service request, extract a target routing key from the first service request; determine whether the target routing key is a hotspot routing key; if the target routing key is a hotspot routing key, determine a service node group corresponding to the target routing key from the service node cluster; determine a first target node from the service node group for responding to the first service request; and send the first service request to the first target node. Computer program code for performing the operations of this disclosure can be written in one or more programming languages ​​or a combination thereof, including but not limited to object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on a user's computer, partially on a user's computer, as a standalone software package, partially on a user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0186] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0187] The modules described in the embodiments of this disclosure can be implemented in software or in hardware. The names of the modules are not necessarily limiting in certain circumstances; for example, a sending module can also be described as "a module that sends the first service request to the first target node".

[0188] The functions described above in this document can be performed at least in part by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), system-on-a-chip (SoCs), complex programmable logic devices (CPLDs), and so on.

[0189] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0190] According to one or more embodiments of this disclosure, Example 1 provides a data access method applied to a first service node, comprising: in response to receiving a first service request, extracting a target routing key from the first service request; determining whether the target routing key is a hotspot routing key; if the target routing key is a hotspot routing key, determining a service node group corresponding to the target routing key from a service node cluster; determining a first target node from the service node group for responding to the first service request; and sending the first service request to the first target node.

[0191] According to one or more embodiments of this disclosure, Example 2 provides the method of Example 1, wherein determining a first target node for responding to the first service request from the service node group includes: determining the first target node from the service node group based on first load information of each second service node in the service node group.

[0192] According to one or more embodiments of this disclosure, Example 3 provides the method of Example 2, wherein determining the first target node from the service node group based on the first load information of each second service node in the service node group includes: randomly selecting a second service node from the service node group as a candidate service node; determining whether the candidate service node is in a high load state based on the first load information of the candidate service node; if the candidate service node is in the high load state, returning to the step of randomly selecting a second service node from the service node group as a candidate service node, until the number of iterations reaches a preset number; if the number of iterations reaches the preset number, determining the most recently selected candidate service node as the first target node.

[0193] According to one or more embodiments of this disclosure, Example 4 provides the method of Example 3, wherein determining the first target node from the service node group based on the first load information of each second service node in the service node group further includes: if the candidate service node is not in the high load state, then determining the candidate service node as the first target node.

[0194] According to one or more embodiments of this disclosure, Example 5 provides the method of Example 1, wherein determining the service node group corresponding to the target routing key from the service node cluster includes: determining a virtual node matching the target routing key from a pre-constructed hash ring based on a consistent hashing algorithm, wherein the hash ring is constructed using a consistent hashing algorithm based on the virtual nodes corresponding to each second service node in the service node cluster; determining a second target node corresponding to the matching virtual node from the service node cluster; and traversing a preset number of second service nodes in the service node cluster, starting from the second target node, in a preset direction to obtain the service node group corresponding to the target routing key.

[0195] According to one or more embodiments of this disclosure, Example 6 provides the method of Example 1, the method further comprising: if the target routing key is a non-hotspot routing key, determining a third target node corresponding to the target routing key from the service node cluster; and sending the first service request to the third target node.

[0196] According to one or more embodiments of this disclosure, Example 7 provides the method of Example 6, wherein determining the third target node corresponding to the target routing key from the service node cluster includes: determining a virtual node matching the target routing key from a pre-constructed hash ring based on a consistent hashing algorithm, wherein the hash ring is constructed using a consistent hashing algorithm based on the virtual nodes corresponding to each second service node in the service node cluster; and determining the second service node in the service node cluster corresponding to the matching virtual node as the third target node.

[0197] According to one or more embodiments of this disclosure, Example 8 provides a method of any one of Examples 1-7, wherein determining whether the target routing key is a hotspot routing key includes: obtaining a list of hotspot routing keys; if the target routing key exists in the list of hotspot routing keys, then determining that the target routing key is a hotspot routing key.

[0198] According to one or more embodiments of this disclosure, Example 9 provides the method of Example 8, the method further comprising: in response to receiving a retry instruction sent by a fourth target node, updating the hotspot routing key list according to the target routing key, wherein the retry instruction is used to instruct the first service node to reallocate a second service node for the first service request, the retry instruction includes the target routing key, the retry instruction is sent by the fourth target node when it determines that the target routing key is a hotspot routing key based on its own second load information, the fourth target node being the second service node in the service node cluster that received the first service request; and returning to the step of determining the service node group corresponding to the target routing key from the service node cluster.

[0199] According to one or more embodiments of this disclosure, Example 10 provides the method of Example 9, wherein the second load information includes CPU utilization and the number of second service requests being executed by the fourth target node, wherein the second service request is a service request carrying the target routing key; when the number reaches a preset number threshold and the CPU utilization of the fourth target node is greater than a first preset utilization threshold, the fourth target node determines that the target routing key is a hotspot.

[0200] According to one or more embodiments of this disclosure, Example 11 provides the method of Example 9, wherein updating the hotspot routing key list according to the target routing key includes: if the target routing key exists in the hotspot routing key list, then updating the time-to-live (TTL) of the target routing key in the hotspot routing key list to 0, wherein the TTL is the duration of the target routing key in the hotspot routing key list; if the target routing key does not exist in the hotspot routing key list, then adding the target routing key to the hotspot routing key list.

[0201] According to one or more embodiments of this disclosure, Example 12 provides the method of Example 11, the method further comprising: deleting hotspot routing keys whose time-to-live has reached a preset duration from the hotspot routing key list.

[0202] According to one or more embodiments of this disclosure, Example 13 provides the method of Example 11, the method further comprising: setting hotspot routing keys in the hotspot routing key list whose lifespan reaches a preset duration as invalid routing keys; the step of determining the target routing key as a hotspot routing key if the target routing key exists in the hotspot routing key list comprises: if the target routing key exists among other routing keys in the hotspot routing key list besides the invalid routing key, then determining the target routing key as a hotspot routing key.

[0203] According to one or more embodiments of this disclosure, Example 14 provides the method of Example 8, the method further comprising: periodically obtaining manually configured hotspot routing keys from a dynamic configuration center, and adding the obtained manually configured hotspot routing keys to the hotspot routing key list.

[0204] According to one or more embodiments of this disclosure, Example 15 provides a method of any one of Examples 1-7, the method being executed via a software development kit (SDK) on a first service node; the method further includes: initializing the SSD when the first service node starts; obtaining connection information of each second service node in the service node cluster; constructing a hash ring using a consistent hashing algorithm based on the virtual nodes corresponding to each second service node in the service node cluster; establishing and maintaining a long connection between the SSD and each second service node in the service node cluster in a connection pool based on the connection information; the step of sending the first service request to the first target node includes: sending the first service request to the first target node through the long connection between the SSD and the first target node.

[0205] According to one or more embodiments of this disclosure, Example 16 provides a data access apparatus applied to a first service node, comprising: an extraction module, configured to extract a target routing key from the first service request in response to receiving a first service request; a first determining module, configured to determine whether the target routing key is a hotspot routing key; a second determining module, configured to determine a service node group corresponding to the target routing key from a service node cluster if the target routing key is a hotspot routing key; a third determining module, configured to determine a first target node for responding to the first service request from the service node group; and a sending module, configured to send the first service request to the first target node.

[0206] According to one or more embodiments of the present disclosure, Example 17 provides a computer-readable medium having a computer program stored thereon that, when executed by a processing device, implements the steps of the method described in any one of Examples 1-15.

[0207] According to one or more embodiments of this disclosure, Example 18 provides an electronic device including: a storage device having a computer program stored thereon; and a processing device for executing the computer program in the storage device to implement the steps of any one of Examples 1-15.

[0208] According to one or more embodiments of the present disclosure, Example 19 provides a computer program product including a computer program that, when executed by a processor, implements the steps of the method described in any one of Examples 1-15.

[0209] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.

[0210] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.

[0211] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative forms of implementing the claims. Regarding the apparatus in the above embodiments, the specific manner in which the various modules perform their operations has been described in detail in the embodiments relating to the method, and will not be elaborated upon here.

Claims

1. A data access method, characterized by, The method is applied to a first service node, and comprises: in response to receiving a first service request, extracting a target routing key in the first service request; determining whether the target routing key is a hot routing key; if the target routing key is a hot routing key, determining a service node group corresponding to the target routing key from a service node cluster, wherein the service node cluster comprises a plurality of second service nodes; determining a first target node for responding to the first service request from the service node group; sending the first service request to the first target node. The method further comprises: if the target routing key is a non-hot routing key, determining a third target node corresponding to the target routing key from the service node cluster; sending the first service request to the third target node. The method further comprises:

2. The method of claim 1, wherein, if the target routing key is a non-hot routing key, determining a third target node corresponding to the target routing key from the service node cluster; sending the first service request to the third target node.

3. The method of claim 2, wherein, The method further comprises: if the target routing key is a non-hot routing key, determining a third target node corresponding to the target routing key from the service node cluster; sending the first service request to the third target node. The method further comprises: if the target routing key is a non-hot routing key, determining a third target node corresponding to the target routing key from the service node cluster; 4. The method of claim 3, wherein, sending the first service request to the third target node. The method further comprises:

5. The method of claim 1, wherein, if the target routing key is a non-hot routing key, determining a third target node corresponding to the target routing key from the service node cluster; sending the first service request to the third target node. The method further comprises:

6. The method of claim 5, wherein, if the target routing key is a non-hot routing key, determining a third target node corresponding to the target routing key from the service node cluster; sending the first service request to the third target node. The method further comprises: if the target routing key is a non-hot routing key, determining a third target node corresponding to the target routing key from the service node cluster; sending the first service request to the third target node. The method further comprises: if the target routing key is a non-hot routing key, determining a third target node corresponding to the target routing key from the service node cluster; sending the first service request to the third target node. The method further comprises: if the target routing key is a non-hot routing key, determining a third target node corresponding to the target routing key from the service node cluster; sending the first service request to the third target node. The method further comprises: if the target routing key is a non-hot routing key, determining a third target node corresponding to the target routing key from the service node cluster; sending the first service request to the third target node. The method further comprises: if the target routing key is a non-hot routing key, determining a third target node corresponding to the target routing key from the service node cluster; sending the first service request to the third target node. The method further comprises: if the target routing key is a non-hot routing key, determining a third target node corresponding to the target routing key from the service node cluster; sending the first service request to the third target node. The method further comprises: if the target routing key is a non-hot routing key, determining a third target node corresponding to the target routing key from the service node cluster; sending the first service request to the third target node. The method further comprises: if the target routing key is a non-hot routing key, determining a third target node corresponding to the target routing key from the service node cluster; sending the first service request to the third target node. The method further comprises: if the target routing key is a non-hot routing key, determining a third target node corresponding to the target routing key from the service node cluster; sending the first service request to the third target node. The method further comprises: if the target routing key is a non-hot routing key, determining a third target node corresponding to the target routing key from the service node cluster; sending the first service request to the third target node. The method further comprises: if the target routing key is a non-hot routing key, determining a third target node corresponding to the target routing key from the service node cluster; sending the first service request to the third target node. The method further comprises: if the target routing key is a non-hot routing key, determining a third target node corresponding to the target routing key from the service node cluster; sending the first service request to the third target node. The method further comprises: if the target routing key is a non-hot routing key, determining a third target node corresponding to the target routing key from the service node cluster; sending the first service request to the third target node. The method further comprises: if the target routing key is a non-hot routing key, determining a third target node corresponding to the target routing key from the service node cluster; sending the first service request to the third target node. The method further comprises: if the target routing key is a non-hot routing key, determining a third target node corresponding to the target routing key from the service node cluster; sending the first service request to the third target node. The method further comprises: if the target routing key is a non-hot routing key, determining a third target node corresponding to the target routing key from the service node cluster; sending the first service request to the third target node. The method further comprises: if the target routing key is a non-hot routing key, determining a third target node corresponding to the target routing key from the service node cluster; sending the first service request to the third target node. The method further comprises: if the target routing key is a non-hot routing key, determining a third target node corresponding to the target routing key from the service node cluster; sending the first service request to the third target node. The method further comprises: if the target routing key is a non-hot routing key, determining a third target node corresponding to the target routing key from the service node cluster; sending the first service request to the third target node. The method further comprises: if the target routing key is a non-hot routing key, determining a third target node corresponding to the target routing key from the service node cluster; sending the first service request to the third target node. The method further comprises: if the target routing key is a non-hot routing key, determining a third target node corresponding to the target routing key from the service node cluster; sending the first service request to the third target node. The method further comprises: if the target routing key is a non-hot routing key, determining a third target node corresponding to the target routing key from the service node cluster; sending the first service request to the third target node. The method further comprises: if the target routing key is a non-hot routing key, determining a third target node corresponding to the target routing key from the service node cluster; sending the first service request to the third target node. The method further comprises: if the target routing key is a non-hot routing key, determining a third target node corresponding to the target routing key from the service node cluster; sending the first service request to the third target node. The method further comprises: if the target routing key is a non-hot routing key, determining a third target node corresponding to the target routing key from the service node cluster; sending the first service request to the third target node. The method further comprises: if the target routing key is a non-hot routing key, determining a third target node corresponding to the target routing key from the service node cluster; sending the first service request to the third target node. The method further comprises: if the target routing key is a non-hot routing key, determining a third target node corresponding to the target routing key from the service node cluster; sending the first service request to the third target node. The method further comprises: if the target routing key is a non-hot routing key, determining a third target node corresponding to the target routing key from the service node cluster; sending the first service request to the third target node. The method further comprises: if the target routing key is a non-hot routing key, determining a third target node corresponding to the target routing key from the service node cluster; sending the first service request to the third target node. The method further comprises: if the target routing key is a non-hot routing key, determining a third target node corresponding to the target routing key from the service node cluster; sending the first service request to the third target node. The method further comprises: if the target routing key is a non-hot routing key, determining a third target node corresponding to the target routing key from the service node cluster; sending the first service request to the third target node. The method further comprises: if the target routing key is a non-hot routing key, determining a third target node corresponding to the target routing key from the service node cluster; sending the first service request to the third target node. The method further comprises: if the target routing key is a non-hot routing key, determining a third target node corresponding to the target routing key from the service node cluster; sending the first service request to the third target node. The method further comprises: if the target routing key is a non-hot routing key, determining a third target node corresponding to the target routing key from the service node cluster; sending the first service request to the third target node. The method further comprises: if the target routing key is a non-hot routing key, determining a third target node corresponding to the target routing key from the service node cluster; sending the first service request to the third target node. The method further comprises: if the target routing key is a non-hot routing key, determining a third target node corresponding to the target routing key from the service node cluster; sending the first service request to the third target node. The method further comprises: if the target routing key is a non-hot routing key, determining a third target node corresponding to the target routing key from the service node cluster; sending the first service request determining, based on a consistent hash algorithm, a virtual node matching the target routing key from a pre-constructed hash ring, wherein the hash ring is constructed based on the virtual nodes corresponding to the second service nodes in the service node cluster by using the consistent hash algorithm; determining, as the third target node, a second service node in the service node cluster corresponding to the matching virtual node.

7. The method according to any one of claims 1 to 6, characterized in that, The method further comprises: obtaining a hot routing key list; if the target routing key exists in the hot routing key list, determining that the target routing key is a hot routing key.

8. The method of claim 7, wherein, The method further comprises: in response to receiving a retry instruction sent by a fourth target node, updating the hot routing key list according to the target routing key, wherein the retry instruction is used to instruct the first service node to re-allocate a second service node for the first service request, the retry instruction includes the target routing key, the retry instruction is sent by the fourth target node when the fourth target node determines that the target routing key is a hot routing key according to its second load information, and the fourth target node is a second service node in the service node cluster that receives the first service request; returning to the step of determining the service node group corresponding to the target routing key from the service node cluster.

9. The method of claim 8, wherein, The second load information includes CPU usage and the number of second service requests being executed by the fourth target node, wherein the second service request is a service request carrying the target routing key; The fourth target node determines that the target routing key is hot when the number reaches a preset number threshold and the CPU usage of the fourth target node is greater than a first preset usage threshold.

10. The method of claim 8, wherein, The method further comprises: if the target routing key exists in the hot routing key list, updating the survival time of the target routing key in the hot routing key list to 0, wherein the survival time is the survival duration of the target routing key in the hot routing key list; if the target routing key does not exist in the hot routing key list, adding the target routing key to the hot routing key list.

11. The method of claim 10, wherein, The method further comprises: deleting a hot routing key with a survival time reaching a preset duration from the hot routing key list.

12. The method of claim 10, wherein, The method further comprises: setting a hot routing key with a survival time reaching a preset duration in the hot routing key list as an invalid routing key; if the target routing key exists in the other routing keys in the hot routing key list except the invalid routing key, determining that the target routing key is a hot routing key. The method further comprises:

13. The method of claim 7, wherein, periodically obtaining a manually configured hot routing key from a dynamic configuration center and adding the obtained manually configured hot routing key to the hot routing key list. The method is executed by a software development kit on the first service node.

14. The method of any one of claims 1-6, wherein, The method further comprises: ​ initializing the software development kit when the first service node starts; obtaining connection information of each second service node in the service node cluster; constructing a hash ring based on a virtual node corresponding to each second service node in the service node cluster by using a consistent hashing algorithm; establishing and maintaining a long connection between the software development kit and each second service node in the service node cluster in a connection pool based on the connection information; the first service request is sent to the first target node, comprising: sending the first service request to the first target node through the long connection between the software development kit and the first target node.

15. A data access device, characterized by applied to a first service node, comprising: extracting a target routing key in the first service request in response to receiving the first service request; determining whether the target routing key is a hot routing key; determining a service node group corresponding to the target routing key from a service node cluster if the target routing key is a hot routing key; determining a first target node for responding to the first service request from the service node group; sending the first service request to the first target node; the second determination module comprises: determining a virtual node matched with the target routing key from a pre-constructed hash ring based on a consistent hashing algorithm, wherein the hash ring is constructed based on a virtual node corresponding to each second service node in the service node cluster by using a consistent hashing algorithm; determining a second target node corresponding to the matched virtual node from the service node cluster; traversing a preset number of second service nodes in a preset direction from the second target node as a starting position in the service node cluster to obtain a service node group corresponding to the target routing key.

16. A computer readable medium having stored thereon a computer program, characterized in that, The computer program is executed by the processing device to implement the steps of the method of any one of claims 1-14.

17. An electronic device, comprising: comprising: a storage device having a computer program stored thereon; a processing device configured to execute the computer program in the storage device to implement the steps of the method of any one of claims 1-14.

18. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method of any one of claims 1-14.

Citation Information

Patent Citations

  • Load balancing method and device based on cloud cluster

    CN113596094A

  • Edge cloud collaboration method and device

    CN113630383A