Routing information creation method and apparatus, routing information query method and apparatus

By determining and clustering data management nodes in a distributed database system and constructing target routing information, the problems of untimely routing information updates and large storage space requirements are solved, and more efficient routing information management and query are achieved.

CN115665144BActive Publication Date: 2025-10-17BEIJING OCEANBASE TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211271331.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-17
Publication Date
2025-10-17
Estimated Expiration
2042-10-17

AI Technical Summary

Technical Problem

In a distributed database system, the large number of nodes makes it difficult to determine the routing information update cycle. A cycle that is too short will increase system pressure, while a cycle that is too long will lead to untimely and inaccurate maintenance of routing information and require large storage space.

Method used

By traversing the distributed database system, the data management nodes are determined, clustered according to the system attribute information, the identification and location information of the target data management node group are constructed, and the target routing information is created.

Benefits of technology

It reduces the amount of routing information, alleviates the hardware pressure of storage devices, improves the update frequency and accuracy of routing information, and ensures the flexibility of queries and the unaffected update process.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115665144B_ABST
    Figure CN115665144B_ABST
Patent Text Reader

Abstract

Embodiments of the present specification provide a route information creation method and device, a route information query method and device, wherein the route information creation method comprises: determining at least one data management node by traversing the distributed database system; determining node information of each data management node according to attribute information of the distributed database system, and clustering the at least one data management node according to the node information to obtain a target data management node group; constructing identification information corresponding to the target data management node group, and determining group location information corresponding to the target data management node group according to the node information; and creating target route information corresponding to the target data management node group according to the identification information and the group location information, which realizes aggregation of route information, reduces the number of route entries, reduces the hardware pressure of related storage devices, and enables route information to be updated more frequently, further ensuring the accuracy of route information.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] Embodiments of the present specification relate to the technical field of computer technology, and particularly relate to a routing information creation method and a routing information query method. One or more embodiments of the present specification also relate to a routing information creation apparatus, a routing information query apparatus, a computing device, and a computer-readable storage medium. BACKGROUND

[0002] With the rapid development of information technology, data is growing explosively, and scenarios for processing large amounts of data are becoming more and more common. In order to realize the storage of large amounts of data in such scenarios, distributed database systems are being used more and more. In the storage services provided by the distributed database system, the nodes that save the latest data information need to record relevant routing information. Because there are many nodes in a large distributed database system, it is difficult to determine the update period of the relevant routing information. If the period is too short, the system will be under great pressure, and if the period is too long, the routing information will not be maintained in time and accurately. In addition, because there are many nodes, the storage space required for the routing information of the storage nodes is also large. Therefore, there is an urgent need for a method to solve the above problems. SUMMARY

[0003] In view of this, embodiments of the present specification provide a routing information creation method and a routing information query method. One or more embodiments of the present specification also relate to a routing information creation apparatus, a routing information query apparatus, a computing device, and a computer-readable storage medium to solve the technical defects in the prior art.

[0004] According to a first aspect of an embodiment of the present specification, a routing information creation method is provided, comprising:

[0005] determining at least one data management node by traversing the distributed database system;

[0006] determining node information of each data management node according to attribute information of the distributed database system, and clustering the at least one data management node according to the node information to obtain a target data management node group;

[0007] constructing identification information corresponding to the target data management node group, and determining group location information corresponding to the target data management node group according to the node information;

[0008] creating target routing information corresponding to the target data management node group according to the identification information and the group location information.

[0009] According to a second aspect of an embodiment of the present specification, a routing information query method is provided, comprising:

[0010] receiving a route information reading request sent for a target data management node in a distributed database system;

[0011] in response to the route information reading request, determining a target data management node group containing the target data management node as a data management node group to be queried in the distributed database system;

[0012] traversing data management nodes contained in the data management node group to be queried to determine node route information of the target data management node.

[0013] According to a third aspect of an embodiment of the present specification, a route information creation apparatus is provided, comprising:

[0014] a traversal module configured to determine at least one data management node by traversing the distributed database system;

[0015] a clustering module configured to determine node information of each data management node according to attribute information of the distributed database system, and to cluster the at least one data management node according to the node information to obtain a target data management node group;

[0016] a construction module configured to construct identification information corresponding to the target data management node group, and to determine group location information corresponding to the target data management node group according to the node information;

[0017] a creation module configured to create target route information corresponding to the target data management node group according to the identification information and the group location information.

[0018] According to a fourth aspect of an embodiment of the present specification, a route information query apparatus is provided, comprising:

[0019] a receiving module configured to receive a route information reading request sent for a target data management node in a distributed database system;

[0020] a response module configured to, in response to the route information reading request, determine a target data management node group containing the target data management node as a data management node group to be queried in the distributed database system;

[0021] a determination module configured to traverse data management nodes contained in the data management node group to be queried to determine node route information of the target data management node.

[0022] According to a fifth aspect of an embodiment of the present specification, a computing device is provided, comprising:

[0023] a memory and a processor;

[0024] The memory is configured to store computer-executable instructions, and the processor is configured to implement the steps of the route information creation method or the steps of the route information query method when executing the computer-executable instructions.

[0025] According to a sixth aspect of an embodiment of the present specification, a computer-readable storage medium is provided, which stores computer-executable instructions, and the instructions implement the steps of the route information creation method or the steps of the route information query method when executed by a processor.

[0026] The route information creation method provided by one embodiment of the present specification determines the data management nodes contained in the distributed database system, and determines the node information of each data management node according to the attribute information of the distributed database system, so that the data management nodes can be clustered according to the node information to obtain a target data management node group. Then, the identification information and the group location information of the target data management node group are determined, and finally the target route information corresponding to the target data management node group is created through the identification information and the group location information, which realizes the aggregation of the route information, reduces the number of route entries, reduces the hardware pressure of the related storage device, and enables the route information to be updated more frequently, thereby further ensuring the accuracy of the route information.

[0027] The route information query method provided by one embodiment of the present specification determines the target data management node group containing the target data management node in the distributed database system through the received route information reading request, and then iterates the target data management node group to determine the node route information of the target data management node, which realizes reading out the route information of a specific data management node in the target route information created by the route information creation method provided by one embodiment of the present specification, ensures the flexibility of the data management node query, and does not affect the process of updating the distributed database system. BRIEF DESCRIPTION OF DRAWINGS

[0028] Figure 1 is a processing flowchart of a route information creation method provided by one embodiment of the present specification;

[0029] Figure 2 is a schematic diagram of a distributed database system of a route information creation method provided by one embodiment of the present specification;

[0030] Figure 3 is a processing flowchart of a route information query method provided by one embodiment of the present specification;

[0031] Figure 4This is a flowchart of a method for creating routing information and a method for querying routing information provided by an embodiment of this specification;

[0032] Figure 5 A schematic diagram of a routing information creation device provided by one embodiment of this specification;

[0033] Figure 6 This is a schematic diagram of a routing information query device provided by an embodiment of this specification;

[0034] Figure 7 This is a structural block diagram of a computing device provided by one embodiment of this specification. DETAILED DESCRIPTION

[0035] The following description sets forth many specific details to facilitate a thorough understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the scope of this specification. Therefore, this specification is not limited to the specific implementations disclosed below.

[0036] The terms used in one or more embodiments of this specification are for the purpose of describing specific embodiments only and are not intended to limit one or more embodiments of this specification. The singular forms "a," "the," and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms unless the context clearly indicates otherwise. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.

[0037] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of this specification, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".

[0038] This specification provides a routing information creation method and a routing information query method. This specification also relates to a routing information creation device, a routing information query device, a computing device, and a computer-readable storage medium, which are described in detail one by one in the following embodiments.

[0039] In actual applications, for the maintenance and update of a distributed database system, the routing information of the data nodes in the distributed database system is maintained and updated. In the prior art, the routing information of each data management node in the distributed database system is created and stored. When a distributed database system has a large number of data nodes, the amount of routing information stored is also large, which causes a great hardware storage pressure on the device storing the routing information. In addition, when performing daily maintenance and update, the device needs to detect each piece of routing information because of the large amount of routing information. This undoubtedly greatly increases the investment of detection resources, and the detection period needs to be long enough to enable all routing information to be completely detected. However, such a long detection period is not conducive to the accuracy and real-time performance of detection.

[0040] In addition, because the traditional distributed database system has a consistency requirement for data, the distributed database system usually saves multiple copies of data to support a disaster recovery mechanism. In this case, the prior art basically simultaneously completes the data aggregation for new data and old data, which greatly reduces the performance of the database and cannot fully exert the performance of the database.

[0041] In the present specification, a routing information creation method is provided, which aggregates associated data nodes according to the node information corresponding to the data management nodes, reduces the amount of routing information, and effectively reduces the hardware storage pressure of the related device by this method. In addition, the data nodes aggregated in this process are data management nodes in the distributed database system, which can ensure that the routing information established thereafter is also associated with the data management nodes, so that, when performing daily maintenance and update of the distributed database system, fewer routing data information can be involved, fewer detection resources can be invested, and a smaller update period can be set, which effectively improves the accuracy and real-time performance of detection. In addition, because the data management nodes in the same group have the characteristic of being physically close, the network delay and the related physical damage they encounter are basically consistent. In this case, the state transformation of the data management nodes in the same group is consistent. For example, the state change of the data management nodes in a computer room is usually synchronized, and only the change of the computer room needs to be recorded. Therefore, the aggregated routing information according to the grouping does not affect the accuracy of the routing information.

[0042] Figure 1 A processing flowchart of a routing information creation method according to one embodiment of the present specification is shown, which includes steps S102 to S108.

[0043] Step S102: At least one data management node is determined by traversing the distributed database system.

[0044] Specifically, the method is applied to a distributed database system, and route information of nodes in the distributed database system is created. In a monitoring process of the distributed database system, the route information is maintained in real time.

[0045] The data management node can be understood as a node in the distributed database system for reading and storing relevant data, and the processed data is the latest version data. It should be noted that in the distributed database system, each node corresponds to a relevant storage device. The storage devices use threads in a thread pool to process different read and write events. In the distributed database storage system, some nodes call threads in the thread pool to perform read tasks and write tasks, and can process the latest version data. These nodes are data management nodes. Other nodes can only process non-latest version data. These nodes have a master-slave relationship with the data management nodes. The data in these nodes changes with the data in the data management nodes. As can be seen from the above, the importance of the data management node is much higher than that of other nodes in the distributed database system. In this case, recording the relevant route information of the distributed database system only needs to record the route information of the data management node.

[0046] Based on this, all nodes in the distributed database system are queried to determine the data management nodes. As can be seen from the above, recording the route information of the distributed database system is actually recording the route information of the data management node. Recording a route information for each data management node will make the number of route entries too large and inconvenient to manage and maintain. Therefore, to facilitate the management and maintenance of route information, the problem can be solved directly by reducing the number of route entries. Therefore, the data management nodes can be determined first, and then used subsequently.

[0047] Further, in the distributed database system, the data management nodes and other nodes with only reading capability can be interchangeable, which means that there is no structural difference between the data management nodes and other nodes. Since the number of route information is determined by the number of data management nodes, in order to reduce the number of route entries, the data management nodes need to be determined in the distributed database system. In this embodiment, the specific implementation is as follows:

[0048] The distributed database system is traversed to obtain the execution state of the data nodes in the distributed database system. The data nodes with the read-write state are determined as data management nodes.

[0049] The data node can be understood as the smallest unit for storing data in the distributed database system. The execution state can be understood as the execution mode of the data node for the read-write event connected to the distributed database system. For example, the execution state of the data management node for the read-write event connected to the distributed database system indicates that the data management node can execute both read and write tasks. The read-write state can be understood as indicating that the relevant data node, i.e., the data management node, can execute both read and write tasks when facing the read-write event connected to the distributed database system.

[0050] Accordingly, the execution state of all data nodes in the distributed database system is queried to determine the data nodes with the read-write state as the data management nodes. It should be noted that the server state of the data node can be queried to determine the data management node, or the historical record of the replica manager can be queried to determine the data management node. The specific determination method is determined by the actual use scenario, and the present embodiment is not limited.

[0051] For example, an insurance company A uses a distributed database system X to store related business, wherein the distributed database system X of the company A occupies three machine rooms, such as Figure 2 A distributed database system schematic diagram of a routing information creation method is shown, which includes a machine room 1, a machine room 2, and a machine room 3. Each machine room has three data nodes. In order to establish the routing information of the distributed database system X, the execution state of the nine data nodes in the three machine rooms of the distributed database system X is determined. The three data nodes with the read-write state are determined as the data management nodes, which are leader1, leader2, and leader3. The leader1 is in the machine room 1, and the leader2 and leader3 are in the machine room 2.

[0052] In summary, by querying the execution state of the data node in the distributed database system, the data management node in the distributed database system can be directly and accurately determined.

[0053] Step S104: Determine the node information of each data management node according to the attribute information of the distributed database system, and cluster the at least one data management node according to the node information to obtain a target data management node group.

[0054] Specifically, after determining the data management nodes contained in the distributed database system, in order to reduce the number of routing entries, the data management nodes in the same machine room can be indexed by one or more routing entries (the number of routing entries is less than the number of data management nodes in the machine room), so that the properties of the distributed database system can be determined in combination with the property information of the distributed database system, and the information required for clustering the data management nodes in the current scenario can be determined according to the properties, and then the data management nodes are aggregated according to the node information to obtain the target data management node group.

[0055] The property information of the distributed database system specifically refers to description information representing the properties of the distributed database system, which is used when the data management nodes are aggregated subsequently. That is, the property information can reflect the properties of the distributed database system, so that the information of the data management nodes is determined as the node information under the influence of the properties, so that the related data management nodes can be integrated into the same group. Correspondingly, the node information refers to the information used in the current aggregation scenario, which can be aggregated by using the information under the influence of the properties of the distributed database system, and the number of aggregated groups is less than the number of nodes.

[0056] The node information includes but is not limited to node location information and node lease information. The node location information can be understood as information recording the location of the data management node, including geographic location information and device code. For example, a data management node performs a related task of the data management node on device B in machine room A, and in this case, the node information of the data management node can be recorded as A-B. The node lease information can be understood as description information recording the lease situation of the data management node, including lease user information and device code. For example, a data management node performs a related task of the data management node on device B in machine room A and is leased by user A, and in this case, the node information of the data management node can be recorded as A-B. The target data management node group can be understood as a group obtained by clustering the data management nodes contained in the distributed database system according to the related node information.

[0057] Therefore, the property information of the distributed database system is determined, and then the node information of the data management nodes is read according to the property information, and then each data management node is clustered according to the node information to obtain the target data management node group. The clustering by the node information ensures that the target data management node group obtained has a similar relationship in the physical dimension, such as the same machine room, the same area, the same city, or a similar relationship in the lease dimension, such as the same lease room. After obtaining the target data management node group according to the clustering result, subsequent routing information creation is performed to achieve the purpose of reducing the number of routing entries.

[0058] Further, considering that different distributed database systems have different characteristics, and different characteristics affect the clustering mode of each data management node, therefore, before clustering, the node information of each data management node needs to be determined in combination with the attribute information of the distributed database system, and on this basis, clustering can fully exert the performance of the distributed database system, while reducing the routing entries. In the embodiment, the following two modes are specifically implemented.

[0059] (1) In the case that the attribute information of the distributed database system is location attribute information, the node location information of each data management node is determined according to the location attribute information as the node information.

[0060] Specifically, the location attribute information specifically refers to attribute description information of the geographical characteristics of the distributed database system, which indicates that the use of location information clustering under this characteristic can reduce the routing entries. Correspondingly, the node location information specifically refers to the location information corresponding to each data management node, which is composed of geographical location and device code, wherein the device code refers to the unique code corresponding to the device of each data management node deployed in the machine room.

[0061] Based on this, in the case that the distribution of the data management nodes of the distributed database system is implemented in accordance with the geographical location, and in the usual case, multiple devices are arranged in each machine room, therefore, when clustering the data management nodes, the location attribute information of the distributed database system can be determined first, and then the node location information of each data management node is determined according to the location attribute information as the node information for subsequent use.

[0062] It should be noted that the attribute information of the distributed database system is information preset by the server based on its characteristics, and different attribute information is preset for distributed database systems with different characteristics. When clustering the data management nodes, the node information that needs to be read for the data management nodes can be determined in combination with the attribute information, and on this basis, the routing information is created, which can save the occupied space of the routing information compared with establishing the routing information for each data management node separately, and is more convenient for the management of the routing information.

[0063] (2) In the case that the attribute information of the distributed database system is lease attribute information, the node lease information of each data management node is determined according to the lease attribute information as the node information.

[0064] Specifically, the lease attribute information specifically refers to attribute description information of the lease characteristics of the distributed database system, which indicates that the use of lease information clustering under this characteristic can reduce the routing entries; correspondingly, the node lease information specifically refers to the lease information corresponding to each data management node, which contains lease identification information and the like, and is used to clearly indicate the lessee to which the data management node belongs.

[0065] Based on this, when the distribution of data management nodes in the distributed database system is implemented in accordance with the leasing information, that is, the distributed database system will control the data management nodes belonging to the same lessee to be deployed in the same computer room. Based on this feature, when clustering the data management nodes, the node leasing information of the data management nodes can be determined first, and clustering can be performed based on this. This can ensure that the data management nodes belonging to the same lessee in the same computer room can be clustered together, thereby effectively reducing the number of subsequent routing entries.

[0066] For example, a distributed database system has a feature that controls leader distribution, and this feature requires leaders associated with the same tenant to be distributed in the same data center. Therefore, when leaders need to be clustered, using geographic location may result in leaders from the same tenant not being clustered together, resulting in an increase in routing entries. Therefore, the lease information of each leader can be read and then used to cluster leaders based on the lease information. This ensures that leaders from the same tenant can be clustered into the same group, reducing the number of routing entries.

[0067] Furthermore, in the case where the node information is node location information, before clustering the data management nodes by their locations, it is necessary to first determine the location information of the data management nodes. In this embodiment, the specific implementation is as follows:

[0068] According to the location attribute information, the geographical location information and the device code corresponding to the data management node are queried; and according to the geographical location information and the device code, the node location information of the data management node is determined.

[0069] The geographic location information can be understood as information storing the geographic location of the relevant devices of the data management node in the distributed database system; the device code can be understood as the code of the relevant devices of the data management node in the distributed database system.

[0070] Based on this, when it is determined that the distribution of data management nodes in the distributed database system is implemented according to the geographical location, the geographical location of the device corresponding to the data management node in the distributed database system and the device code can be queried in combination with the location attribute information. Then, the geographical location of the device corresponding to the data management node is combined with the device code to obtain the node location information of the data management node.

[0071] For example, after determining the data management nodes, the node location information of each data management node also needs to be determined. The geographic location information of the relevant equipment of the data management nodes in the distributed database system X is queried, the geographic location information of leader 1 is machine room 1, and the geographic location information of leader 2 and leader 3 is machine room 2; as shown in the schematic diagram of the distributed database system of the route information creation method. Figure 2 A distributed database system schematic diagram of a route information creation method is shown, wherein there are three data nodes in machine room 1 from top to bottom, and the three nodes correspond to three devices, and the device codes are A1, A2, and A3, respectively. Similarly, the three data nodes in machine room 2 also correspond to three devices, and the device codes are B1, B2, and B3, respectively. The device codes of the three devices corresponding to the three data nodes in machine room 3 are C1, C2, and C3, respectively. Thus, the device code corresponding to leader 1 is A2, the device code corresponding to leader 2 is B1, and the device code corresponding to leader 3 is B3. Finally, the node location information corresponding to leader 1, leader 2, and leader 3 is obtained as machine room 1-A2, machine room 2-B1, and machine room 2-B3, respectively. After determining the node location information of the data management nodes, clustering can be performed based thereon to obtain a target data management node group, and finally the creation of target route information is realized.

[0072] In summary, by querying the geographic location information and device code of the data management nodes, the node location information is determined, which not only accurately locates the device corresponding to the data management node, but also enables the aggregation of the data management nodes based thereon.

[0073] Further, since the node location information of the data management nodes is composed of geographic location information and device code, and the data management nodes in the same machine room have the same location information, the aggregation can be performed in combination with the node location information to reduce the route entries. In this embodiment, the specific implementation is as follows:

[0074] Read the geographic location information in the node location information of each data management node; cluster the at least one data management node according to each geographic location information to obtain a target data management node group.

[0075] Wherein, the node location information of each data management node is queried to determine the geographic location information contained therein, and then the geographic location information is used to cluster the data management nodes to obtain a target data management node group. It should be noted that the clustering process only applies to the geographic location information in the node location information, and the device code contained in the node location information can be applied to the process of accurately querying the device where the data management node is located, and then determining the route information of the data management node.

[0076] With the above example, after determining the node location information of leader1, leader2 and leader3, leader1, leader2 and leader3 are clustered according to the geographic location information in the node location information, wherein since leader2 and leader3 are in the same machine room, the target data management node groups that can be clustered at this time are two groups, leader1 group and leader2 and leader3 group, and subsequent relevant routing information can be created according to each group to obtain target routing information.

[0077] In summary, by clustering data management nodes through geographic location information, and subsequently obtaining target routing information through the clustering results, the number of routing information can be reduced without affecting the maintenance of routing information of the distributed database system, the hardware pressure of the related storage device can be reduced, the routing information can be updated more frequently, and the accuracy of the routing information is further ensured.

[0078] Step S106: constructing identification information corresponding to the target data management node group, and determining group location information corresponding to the target data management node group according to the node information.

[0079] The identification information can be understood as information indicating the identity of the target data management node group. Each target data management node group corresponds to a different identification information. It should be noted that the identification information can be artificially set or generated based on information collected in a preset manner. It only needs to ensure that each identification information is different and can correspond to the target data management node group. The specific creation method is determined by the actual use scenario, and this embodiment does not limit it. The group location information can be understood as information recording the location of each target data management node group, which can realize the positioning of the data management nodes in the target data management node group. By positioning the group, each data management node in the group can be positioned, that is, the information corresponding to the physical address corresponding to the target data management node group.

[0080] It should be noted that the group location information can be a city, a district, or a machine room, or a location corresponding to a group composed of data management nodes of the same tenant. The range of the specific selected magnitude is determined by the actual use scenario, and the embodiment is not limited. In the determination process of the group location information, the node location information of the data management nodes in the target data management node group can be used for determination. For example, if there are two data management nodes in a group, and the node location information is A city-B district-C machine room and A city-D district-C machine room, respectively, the group location information can be determined as A city. Alternatively, the node location information is A city-B district-C machine room and A city-B district-E machine room, respectively, and the group location information can be determined as A city-B district. Of course, the magnitude range of the group location information can also be artificially set. The node location information is A city-B district-C machine room and A city-B district-E machine room, respectively. At this time, the artificial specified magnitude is “city”, and the group location information obtained is A city. In addition, the magnitude of the group location information can also be determined according to the clustering process. For example, when clustering, the distance between the devices of the two data management nodes cannot exceed five kilometers in radius. At this time, the magnitude of the group location information can also be determined according to the limitation of the clustering process. The method used to determine the group location information according to the node location information of the data management nodes in the same group is determined by the actual use scenario, and the embodiment is not limited.

[0081] On the other hand, in the determination process of the group location information, the node lease information of the data management nodes in the target data management node group can also be used for determination. For example, if there are two data management nodes in a group, and the node lease information is that the tenant is user A and the location is A city-B district-C machine room, and the tenant is user A and the location is A city-D district-C machine room, respectively, the group location information can be determined as A city. That is, when the node lease information is used to determine the group location information of the target data management node group, the information and location information of the tenant are combined to determine together. Because there can be data management nodes in the same machine room belonging to different tenants, if clustering is performed according to the location at this time, the data management nodes of different tenants can be clustered together. If the subsequent routing information is created on this basis, the data reading can be inaccurate in the data reading stage. Therefore, the clustering needs to be completed according to the node lease information. Similarly, when the group location information of the target data management node group is determined, the node lease information is also used to achieve the determination.

[0082] Based on this, the identification information of the target data management node group is constructed by a preset method, so that different groups clustered in the distributed database system have different identification information, and then the group location information of the data management nodes in the same group is determined according to the node information of the data management nodes in the same group. Subsequently, the target routing information related to the same target data management node group can be created according to the identification information and the group location information, so as to realize the aggregation of the routing information of the data management nodes in the same group.

[0083] Step S108: creating target routing information corresponding to the target data management node group according to the identification information and the group location information.

[0084] Specifically, after the identification information and the group location information are determined, it can be determined that the amount of information of the routing information created after the node location information of each data management node is determined separately is reduced, and then the target routing information can be created based on the identification information and the group location information. The target routing information can be understood as the routing information corresponding to the target data management node group, which realizes the aggregation of the routing information of the data management nodes in the target data management node group.

[0085] Further, in the distributed database system, if one of the data nodes is elected as a new data management node, the target routing information needs to be updated, and the specific implementation process is as follows:

[0086] receiving a data management node insertion instruction; in response to the data management node insertion instruction, determining a to-be-updated data management node and to-be-updated node information of the to-be-updated data management node; in a case where to-be-updated node location information contained in the to-be-updated node information is same as the group location information, inserting the to-be-updated data management node into the target data management node group.

[0087] The data management node insertion instruction can be understood as an instruction for updating the target routing information in the case where a new data management node appears in the distributed database system. The to-be-updated data management node can be understood as a new data management node appearing in the distributed database system. The to-be-updated node information can be understood as the node information of the to-be-updated data management node, and the to-be-updated node information is the same as the description of the node information. The same or similar content can be referred to the above embodiments, and the present embodiment will not be described in detail. The to-be-updated node location information can be understood as information containing the address of the to-be-updated data management node.

[0088] Based on this, in the case of receiving the data management node insertion instruction, the data management node insertion instruction is parsed, the newly added data management node to be updated in the distributed database system is determined, and the location information of the data management node to be updated is determined. Then the to-be-updated node information is parsed to obtain the to-be-updated node location information, and then compared with the group location information of each target data management node group in the distributed database system, the group location information same as the to-be-updated node location information is determined, and then the to-be-updated data management node is inserted into the target data management node group corresponding to the group location information.

[0089] According to the preset naming rule, the group where leader1 is located is named as leader group 1, and the group where leader2 and leader3 are located is named as leader group 2. According to the geographic location information of leader1, machine room 1-A2, and the geographic location information of leader2 and leader3, machine room 2-B1 and machine room 2-B3, the group location information of leader group 1 is determined as machine room 1, and the group location information of leader group 2 is determined as machine room 2. Then, according to the identification information and group location information of different groups, the target routing information is constructed as <leader group 1, machine room 1> and <leader group 2, machine room 2>.

[0090] Subsequently, after receiving the data management node insertion instruction Z1, Z1 is parsed, the data management node to be updated is determined as leader4, and the node location information to be updated is determined as machine room 1-A3. Thus, the to-be-updated geographic location information is obtained as machine room 1, the same as the group location information of leader group 1 is queried, and leader4 is inserted into leader group 1.

[0091] In summary, through the above-mentioned manner, the target routing information is updated when a new data management node appears in the distributed database system. Since the node information based aggregation of data management nodes is used and only the routing information of the same group is recorded, when the newly added data management node is within the scope of the original target data management node group, the target routing information does not need to be updated, thereby saving the update resources.

[0092] Further, in addition to the case that the newly added data management node is within the scope of the original target data management node group, there is also a case that the newly added data management node is not within the scope of the original target data management node group. In this embodiment, the specific implementation manner is as follows:

[0093] constructing a to-be-updated data management node group containing the to-be-updated data management node, constructing to-be-updated identification information corresponding to the to-be-updated data management node group, and determining to-be-updated group location information corresponding to the to-be-updated data management node group according to the to-be-updated node location information; and creating to-be-updated routing information corresponding to the to-be-updated data management node group according to the to-be-updated identification information and the to-be-updated group location information.

[0094] In this embodiment, the to-be-updated data management node group can be understood as a new target data management node group created based on the to-be-updated data management node; the to-be-updated identification information can be understood as identification information corresponding to the to-be-updated data management node group; the to-be-updated node location information can be understood as group location information corresponding to the to-be-updated data management node group; and the to-be-updated routing information can be understood as target routing information corresponding to the to-be-updated data management node group.

[0095] Based on this, a to-be-updated data management node group is created based on the newly added to-be-updated data management node, the to-be-updated data management node group contains the to-be-updated data management node, then identification information of the newly added group is constructed, group location information of the newly added group is determined according to the to-be-updated data management node, and then target routing information corresponding to the newly added group is created according to the identification information and the group location information of the newly added group. It should be noted that after the to-be-updated data management node group containing the to-be-updated data management node is constructed, the identification information and the group location information corresponding to the to-be-updated data management node group are created, and then the new routing information is created according to the identification information and the group location information. The process of creating the target routing information corresponding to the target data management node group is similar to the process described above, and will not be described here.

[0096] In the above example, if leader4 is not in the original leader group 1 and leader group 2, a to-be-updated data management node group containing leader4 is created, then the identification information of the group is constructed as leader group 3, then the group location information of leader group 3 is determined as machine room 3 according to the node location information of leader4, and finally the routing information about leader group 3 is created as <leader group 3, machine room 3>.

[0097] In summary, through the above-mentioned manner, in the case that the newly added data management node is not in the original target data management node group, a new target data management node group and corresponding target routing information can be generated, thereby ensuring the correctness and real-time performance of the target routing information update.

[0098] In addition, there is also a case of removing the original data management node in the distributed database system. In this embodiment, the specific implementation manner is as follows:

[0099] The receiving data management node removes the instruction; in response to the data management node removal instruction, the data management node to be removed is determined, and the node information to be removed of the data management node to be removed is determined; in the case where the node position information to be removed contained in the node information to be removed is the same as the group position information, the data management node to be removed is deleted from the target data management node group.

[0100] The data management node removal instruction can be understood as an instruction for updating the target routing information in the case of removing the original data management node in the distributed database system; the data management node to be removed can be understood as the original data management node to be removed in the distributed database system; the node information to be removed can be understood as the node information corresponding to the data management node to be removed; and the node position information to be removed can be understood as the position information contained in the node position information to be removed.

[0101] Therefore, when the data management node removal instruction is received, the data management node removal instruction is parsed, the data management node to be removed in the distributed database system is determined, and the node information of the data management node to be removed is determined. Then, the node information to be removed is parsed to obtain the node position information to be removed. Then, the group position information of each target data management node group in the distributed database system is compared with the node position information to be removed. After determining the group position information that is the same as the node position information to be removed, the data management node to be removed is removed from the target data management node group corresponding to the group position information.

[0102] In the above example, after receiving the data management node removal instruction Z2, Z2 is parsed, it is determined that the data management node to be removed is leader2, and the node position information to be removed is machine room 2-A1. Thus, the geographical position information to be removed is obtained as machine room 2. It is found that the group position information of leader group 2 is the same, and leader2 is removed from leader group 2.

[0103] In summary, by the above method, the target routing information is updated when the original data management node is removed in the distributed database system.

[0104] Further, when the data management node to be removed is removed from the corresponding target data management node group, there are two cases. One is that after removing the data management node to be removed, there are still data management nodes in the target data management node group, and the other is that after removing the data management node to be removed, there are no data management nodes in the target data management node group. These two different cases need to be handled differently. In this embodiment, the specific implementation is as follows:

[0105] determining that the target data management node group corresponding to the to-be-removed node information is a to-be-deleted data management node group; querying the to-be-deleted data management node group, and in a case where the to-be-deleted data management node group does not contain a data management node, deleting the to-be-deleted data management node group and deleting target routing information corresponding to the to-be-deleted data management node group.

[0106] The to-be-deleted data management node group can be understood as a target data management node group in which the to-be-removed node information is removed.

[0107] Based on this, the target data management node group in which the to-be-removed data management node is removed is determined to be the to-be-deleted data management node group, and then it is queried whether there is a data management node in the to-be-deleted data management node group. If there is, the to-be-deleted data management node management group and the corresponding target routing information are kept; if not, the to-be-deleted data management node management group and the corresponding target routing information are deleted.

[0108] In the above example, if there are two data management nodes, leader2 and leader4, and leader4 is inserted into the leader group 3 corresponding to the machine room 3. Then, the step of removing the data management node from the corresponding target data management node group is performed, leader2 is deleted from the leader group 2, and leader4 is deleted from the leader group 3. After deletion, it is queried that leader3 is contained in the leader group 2, and it is queried that no data management node is contained in the leader group 3. At this time, <leader group 2, machine room 2> remains unchanged, <leader group 3, machine room 3> is deleted, and the leader group 3 is deleted.

[0109] In summary, since the data management nodes are aggregated based on node information and only the routing information of the same group is recorded, in the case where there is a data management node in the target data management node group in which the data management node is removed, there is no need to update the target routing information, thereby saving the update resources.

[0110] Further, since the single data management node cannot be directly found after aggregation, the following specific implementation manner is used to support the business use:

[0111] receiving a routing information reading request sent by a target data management node in a distributed database system; in response to the routing information reading request, determining that a target data management node group containing the target data management node in the distributed database system is a to-be-queried data management node group; traversing data management nodes contained in the to-be-queried data management node group, and determining node routing information of the target data management node.

[0112] The routing information reading request can be understood as a request sent by a certain individual data management node for reading; the target data management node can be understood as a data management node that needs to be read; the group of data management nodes to be queried can be understood as a target data management node group in which the target data management node is located; and the node routing information can be understood as routing information of the target data management node.

[0113] Based on this, the routing information reading request is received, and then the routing information reading request is parsed to determine the target data management node. Then, the distributed database system is queried to determine the target data management node group containing the target data management node, which is the group of data management nodes to be queried. Then, the data management nodes in the group of data management nodes to be queried are queried to find the target data management node and determine the node routing information of the target data management node.

[0114] In actual application, when the data reading request is received, the data storage location is determined based on the data reading request, and then the data is searched according to the data storage location for feedback. In this process, the data reading request needs to be classified, and the purpose of classification is to locate the identifier corresponding to the data reading request, which is the identifier in the routing information. When the identifier is determined, the stored routing information is queried to determine the unique routing information corresponding to the data reading request. The node address information is determined from the routing information by parsing the routing information, so as to locate the equipment in the computer room through the node address information to complete the data reading operation.

[0115] In the above example, after receiving the routing information reading request Z3, Z3 is parsed to determine that the target data management node is leader3. The distributed database system X is queried to determine that leader3 exists in leader group 2. Then, the data management nodes in leader group 2 are queried to determine the node routing information of leader3.

[0116] In summary, through the above method, the routing information of a certain specific data management node is read out, ensuring the flexibility of data management node query and not affecting the process of updating the distributed database system.

[0117] Further, in the process of determining the routing information of the target data management node, the position information of the target data management node needs to be combined. In this embodiment, the specific implementation is as follows:

[0118] Traverse the to-be-queried data management node group, determine the target device code of the target data management node; determine the target node identifier of the target data management node according to the routing information reading request; and determine the node routing information of the target data management node according to the target node identifier and the target device code.

[0119] In this embodiment of the present specification, the target device code can be understood as the device code corresponding to the target data management node; and the target node identifier can be understood as the identifier representing the identity of the target data management node.

[0120] Based on this, the data management node group is queried to determine the target device code of the device corresponding to the target data management node, and then the target node identifier of the target data management node is determined according to the analysis of the routing information reading request, and finally the node routing information of the target data management node is created according to the target device code and the target node identifier.

[0121] In the above example, the device code of the leader 3 in the leader group 2 is B3, the identifier of the target data management node leader 3 is determined as leader 3 through Z3, and then the node routing information <leader 3, B3> corresponding to the leader 3 is created.

[0122] In summary, through the above method, the routing information of a specific data management node is determined, and the flexibility of querying the data management node is ensured.

[0123] The routing information creation method provided by one embodiment of the present specification determines the data management nodes contained in the distributed database system, and determines the node information of each data management node according to the attribute information of the distributed database system, so that the data management nodes can be clustered according to the node information to obtain a target data management node group, and then the identifier information and the group position information of the target data management node group are determined, and finally the target routing information corresponding to the target data management node group is created through the identifier information and the group position information, which realizes the aggregation of the routing information, reduces the number of routing entries, reduces the hardware pressure of the related storage device, and makes the routing information can be updated more frequently, and further ensures the accuracy of the routing information.

[0124] Figure 3 A processing flowchart of a routing information query method according to one embodiment of the present specification is shown, which includes steps S302 to S306.

[0125] Step S302: receiving a routing information reading request sent for a target data management node in a distributed database system.

[0126] Step S304: In response to the routing information reading request, a target data management node group containing the target data management node is determined as a data management node group to be queried in the distributed database system.

[0127] Step S306: The node routing information of the target data management node is determined by traversing the data management nodes contained in the data management node group to be queried.

[0128] The routing information query method of steps S302 to S306 is similar to the description of the routing information query of the specified data management node in the routing information creation method of steps S102 to S108, and thus will not be described here.

[0129] The above is a schematic scheme of the routing information query method of the embodiment. It should be noted that the technical scheme of the routing information query method and the technical scheme of the routing information creation method described above belong to the same concept. The details of the technical scheme of the routing information query method that are not described in detail can be referred to the description of the technical scheme of the routing information creation method.

[0130] The routing information query method provided by an embodiment of the present specification determines a target data management node group containing a target data management node in a distributed database system through a received routing information reading request, and then traverses the target data management node group to determine the node routing information of the target data management node, thereby realizing reading of the routing information of a specific data management node in the target routing information created by the routing information creation method provided by an embodiment of the present specification, ensuring the flexibility of querying the data management node, and not affecting the process of updating the distributed database system.

[0131] The following describes the routing information creation method and the routing information query method with reference to the accompanying drawings. Figure 4 The routing information creation method and the routing information query method provided by the present specification are further described by taking the application of the routing information creation method and the routing information query method in OceanBase as an example. Among them, Figure 4 FIG. 4 shows a process flow diagram of a routing information creation method and a routing information query method provided by an embodiment of the present specification, and the specific steps include steps S402 to S436.

[0132] Step S402: The execution state of the data node in the distributed database system is obtained by traversing the distributed database system.

[0133] Specifically, the OceanBase database is queried to obtain the execution state of each partition in OceanBase.

[0134] Step S404: Determine the data node with the read-write state as the data management node.

[0135] Specifically, the partition with the read-write state in the OceanBase database is determined as the leader.

[0136] Step S406: Query the geographical location information and device code corresponding to the data management node.

[0137] Specifically, the geographical location and device code corresponding to the 1000 leaders are determined.

[0138] Step S408: Determine the node location information of the data management node according to the geographical location information and the device code.

[0139] Specifically, the geographical location and device code corresponding to each leader are combined to obtain the node location information of each leader.

[0140] Step S410: Cluster the at least one data management node according to each geographical location information to obtain a target data management node group.

[0141] Specifically, according to the geographical location information of each leader, the 1000 leaders are clustered, and the leaders in the same machine room are divided into the same target data management node group.

[0142] Step S412: Construct the identification information corresponding to the target data management node group, and determine the group location information corresponding to the target data management node group according to the node location information.

[0143] Specifically, 6 target data management node groups are obtained, i.e. 1000 leaders are distributed in 6 machine rooms, each target data management node group is named, and its name is determined as leader group 1, leader group 2, leader group 3, leader group 4, leader group 5, leader group 6, and the group location information of the six groups is determined as machine room 1, machine room 2, machine room 3, machine room 4, machine room 5, and machine room 6.

[0144] Step S414: Create target routing information corresponding to the target data management node group according to the identification information and the group location information.

[0145] Specifically, according to the obtained identification information and group position information, six target routing information <leader group 1, computer room 1>, <leader group 2, computer room 2>, <leader group 3, computer room 3>, <leader group 4, computer room 4>, <leader group 5, computer room 5>, and <leader group 6, computer room 6> are created.

[0146] Step S416: receiving a data management node insertion instruction.

[0147] Specifically, in the case that a new data management node is elected, the data management node insertion instruction is received.

[0148] Step S418: in response to the data management node insertion instruction, determining a data management node to be updated and node position information of the data management node to be updated.

[0149] Specifically, according to the data management node insertion instruction, the newly added data management node leader1001 is determined, and node position information of the leader1001 is determined.

[0150] Step S420: updating target routing information.

[0151] Specifically, in the case that the leader1001 is determined to be within the leader group 1 to leader group 6, the leader1001 is inserted into the corresponding group, and the corresponding routing information does not change; in the case that the leader1001 is determined to be not within the leader group 1 to leader group 6, a leader group 7 containing the leader1001 is newly created, and according to the computer room in which the leader1001 is located, which is the computer room 7, the routing information corresponding to the leader group 7 <leader group 7, computer room 7> is created.

[0152] Step S422: receiving a data management node removal instruction.

[0153] Specifically, in the case that an original data management node is removed, the data management node removal instruction is received.

[0154] Step S424: in response to the data management node removal instruction, determining a data management node to be removed and node position information of the data management node to be removed.

[0155] Specifically, according to the data management node removal instruction, the removed data management node leader1 is determined, and node position information of the leader1 is determined.

[0156] Step S426: updating target routing information.

[0157] Specifically, according to the node position information of leader1, the corresponding target data management node group is removed, and then it is determined whether there is another data management node in the removed target data management node group. If there is target routing information, the target routing information does not change; if there is no other data management node, the corresponding target data management node group of leader1 is deleted, and the corresponding target routing information is also deleted.

[0158] In the subsequent maintenance and update of the routing information of the OceanBase database, if the relevant maintenance personnel find that the data output of leader100 is always abnormal, the relevant equipment of leader100 needs to be checked. In this case, the following steps in the routing information query method are performed.

[0159] Step S428: receiving a routing information reading request sent for a target data management node in the distributed database system.

[0160] Specifically, the routing information reading request for the target data management node is received.

[0161] Step S430: in response to the routing information reading request, determining a target data management node group containing the target data management node in the distributed database system as a to-be-queried data management node group.

[0162] Specifically, according to the routing information reading request, it is determined that leader group 2 contains the target data management node.

[0163] Step S432: traversing the to-be-queried data management node group to determine the target device code of the target data management node.

[0164] Specifically, the leader group 2 is queried to determine that the device code of the target data management node is Ap100.

[0165] Step S434: according to the routing information reading request, determining the target node identifier of the target data management node.

[0166] Specifically, the routing information reading request is parsed to determine that the target node identifier of the target data management node is leader100.

[0167] Step S436: according to the target node identifier and the target device code, determining the node routing information of the target data management node.

[0168] Specifically, the node routing information <leader100, Ap100> of the leader 100 is created, and the node routing information is fed back to the maintenance personnel, so that the maintenance personnel can successfully query the location of the leader 100. It should be noted that if the design forms of the machine codes in the two geographic location information are the same, the geographic location information can be added to the node routing information. In this embodiment, the final node routing information can be <leader100, computer room 2-Ap100>.

[0169] The routing information creation method provided by one embodiment of the present specification determines the data management nodes contained in the distributed database system, then determines the node location information of each data management node, clusters the data management nodes according to the node location information, obtains a target data management node group, then determines the identification information and group location information of the target data management node group, and finally creates target routing information corresponding to the target data management node group through the identification information and the group location information, thereby realizing the aggregation of routing information, reducing the number of routing entries, reducing the hardware pressure of related storage devices, and making the routing information more frequently updated, thereby further ensuring the accuracy of the routing information.

[0170] The routing information query method provided by one embodiment of the present specification receives a routing information reading request, determines a target data management node group containing a target data management node in the distributed database system, then iterates the target data management node group, and determines the node routing information of the target data management node, thereby realizing the reading of the routing information of a specific data management node in the target routing information created by the routing information creation method provided by one embodiment of the present specification, ensuring the flexibility of the data management node query, and not affecting the updating process of the distributed database system.

[0171] Corresponding to the method embodiments, the present specification also provides routing information creation device embodiments, Figure 5 A schematic diagram of a routing information creation device provided by one embodiment of the present specification is shown. As shown in the figure, Figure 5 The device includes:

[0172] The iteration module 502 is configured to determine at least one data management node by iterating the distributed database system;

[0173] The clustering module 504 is configured to determine the node information of each data management node according to the attribute information of the distributed database system, and cluster the at least one data management node according to the node information, to obtain a target data management node group;

[0174] The constructing module 506 is configured to construct identification information corresponding to the target data management node group, and determine group location information corresponding to the target data management node group according to the node information.

[0175] The creating module 508 is configured to create target routing information corresponding to the target data management node group according to the identification information and the group location information.

[0176] In an optional embodiment, the traversing module 502 is further configured to:

[0177] Traverse the distributed database system to obtain an execution state of a data node in the distributed database system; and determine that a data node with a read-write state as the execution state is a data management node.

[0178] In an optional embodiment, the clustering module 504 is further configured to:

[0179] In a case where the attribute information of the distributed database system is location attribute information, determine node location information of each data management node as the node information according to the location attribute information; or in a case where the attribute information of the distributed database system is lease attribute information, determine node lease information of each data management node as the node information according to the lease attribute information.

[0180] In an optional embodiment, the clustering module 504 is further configured to:

[0181] According to the location attribute information, query geographic location information and device code corresponding to the data management node; and determine node location information of the data management node according to the geographic location information and the device code.

[0182] In an optional embodiment, the clustering module 504 is further configured to:

[0183] Read geographic location information in node location information of each data management node; and cluster the at least one data management node according to each geographic location information to obtain a target data management node group.

[0184] In an optional embodiment, the routing information creating apparatus further includes:

[0185] The insertion module is configured to receive a data management node insertion instruction; in response to the data management node insertion instruction, determine a to-be-updated data management node and to-be-updated node information of the to-be-updated data management node; and in a case where to-be-updated node location information contained in the to-be-updated node information is same as the group location information, insert the to-be-updated data management node into the target data management node group.

[0186] In an optional embodiment, the routing information creation apparatus further comprises:

[0187] The group creation module is configured to construct a to-be-updated data management node group containing the to-be-updated data management node; construct to-be-updated identification information corresponding to the to-be-updated data management node group, and determine to-be-updated group location information corresponding to the to-be-updated data management node group according to the to-be-updated node location information; and create to-be-updated routing information corresponding to the to-be-updated data management node group according to the to-be-updated identification information and the to-be-updated group location information.

[0188] In an optional embodiment, the routing information creation apparatus further comprises:

[0189] The removal module is configured to receive a data management node removal instruction; in response to the data management node removal instruction, determine a to-be-removed data management node and to-be-removed node information of the to-be-removed data management node; and in a case where to-be-removed node location information contained in the to-be-removed node information is same as the group location information, delete the to-be-removed data management node in the target data management node group.

[0190] In an optional embodiment, the routing information creation apparatus further comprises:

[0191] The deletion module is configured to determine that a target data management node group corresponding to the to-be-removed node information is a to-be-deleted data management node group; query the to-be-deleted data management node group; in a case where the to-be-deleted data management node group does not contain a data management node, delete the to-be-deleted data management node group, and delete target routing information corresponding to the to-be-deleted data management node group.

[0192] In an optional embodiment, the routing information creation apparatus further comprises:

[0193] The reading module is configured to receive a routing information reading request sent for a target data management node in a distributed database system; in response to the routing information reading request, determine a target data management node group containing the target data management node as a data management node group to be queried in the distributed database system; and traverse data management nodes contained in the data management node group to be queried to determine node routing information of the target data management node.

[0194] In an optional embodiment, the reading module is further configured to:

[0195] traverse the data management node group to be queried to determine a target device code of the target data management node; determine a target node identifier of the target data management node according to the routing information reading request; and determine node routing information of the target data management node according to the target node identifier and the target device code.

[0196] The routing information creation device provided by one embodiment of the present specification realizes aggregation of routing information, reduces the number of routing entries, alleviates the hardware pressure of related storage devices, and enables routing information to be updated more frequently, thereby further ensuring the accuracy of routing information.

[0197] The above is a schematic scheme of the routing information creation device of the present embodiment. It should be noted that the technical scheme of the routing information creation device and the technical scheme of the routing information creation method described above belong to the same concept, and the details of the technical scheme of the routing information creation device that are not described in detail can be referred to the description of the technical scheme of the routing information creation method.

[0198] Corresponding to the method embodiments described above, the present specification also provides routing information query device embodiments, Figure 6 A schematic diagram of a routing information query device provided by one embodiment of the present specification is shown. As shown in the figure, Figure 6 The device includes:

[0199] The receiving module 602 is configured to receive a routing information reading request sent for a target data management node in a distributed database system;

[0200] The response module 604 is configured to, in response to the routing information reading request, determine a target data management node group containing the target data management node as a data management node group to be queried in the distributed database system;

[0201] The determination module 606 is configured to traverse data management nodes contained in the data management node group to be queried to determine node routing information of the target data management node.

[0202] The routing information query device provided by one embodiment of the present specification realizes reading out the routing information of a certain specific data management node in the target routing information created by the routing information creation method provided by one embodiment of the present specification, guarantees the flexibility of the data management node query, and does not affect the process of implementing the update of the distributed database system.

[0203] The above is a schematic scheme of the routing information query device of the present embodiment. It should be noted that the technical scheme of the routing information query device belongs to the same concept as the technical scheme of the routing information query method described above, and the details of the technical scheme of the routing information query device that are not described in detail can be referred to the description of the technical scheme of the routing information query method.

[0204] Figure 7 A structural block diagram of a computing device 700 according to one embodiment of the present specification is shown. The components of the computing device 700 include, but are not limited to, a memory 710 and a processor 720. The processor 720 is connected to the memory 710 through a bus 730, and a database 750 is used to save data.

[0205] The computing device 700 also includes an access device 740, which enables the computing device 700 to communicate via one or more networks 760. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 740 can include one or more of any type of network interface (e.g., network interface card (NIC)) such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a worldwide interoperability for microwave access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like, either wired or wireless.

[0206] In one embodiment of the present specification, the above-mentioned components of the computing device 700 and other components not shown in the Figure 7 may be connected to each other, for example, through a bus. It should be understood that Figure 7 The structural block diagram of the computing device shown is only for the purpose of example, and is not a limitation on the scope of the present specification. Other components can be added or replaced as needed by those skilled in the art.

[0207] Computing device 700 can be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook computer, etc.), a mobile phone (e.g., a smartphone), a wearable computing device (e.g., a smartwatch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or PC. Computing device 700 can also be a mobile or stationary server.

[0208] The memory 710 is used to store computer-executable instructions, and the processor 720 is used to implement the routing information creation method and the routing information query method when executing the computer-executable instructions.

[0209] The above is a schematic diagram of a computing device according to this embodiment. It should be noted that the technical solution of the computing device is based on the same concept as the technical solutions of the aforementioned routing information creation method and routing information query method. For details not described in detail in the technical solution of the computing device, please refer to the description of the technical solutions of the aforementioned routing information creation method and routing information query method.

[0210] An embodiment of the present specification further provides a computer-readable storage medium storing computer instructions, which, when executed by a processor, are used to implement the steps of the routing information creation method and the routing information query method.

[0211] The above is a schematic diagram of a computer-readable storage medium according to this embodiment. It should be noted that the technical solution of this storage medium is based on the same concept as the technical solutions of the aforementioned routing information creation method and routing information query method. For details not described in detail in the technical solution of the storage medium, please refer to the description of the technical solutions of the aforementioned routing information creation method and routing information query method.

[0212] The foregoing description of this specification describes specific embodiments. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims can be performed in an order different from that described in the embodiments and still achieve the desired results. Furthermore, the processes depicted in the accompanying drawings do not necessarily require the specific order shown or the sequential order to achieve the desired results. In certain embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0213] The computer readable medium can include any entity or apparatus capable of carrying the computer program code, recording medium, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signal, telecommunication signal, software distribution medium, etc. It should be noted that the computer readable medium can include appropriate additions or subtractions according to the requirements of legislation and patent practice in the jurisdiction, for example, in some jurisdictions, according to legislation and patent practice, the computer readable medium does not include electrical carrier signals and telecommunication signals.

[0214] It should be noted that for the foregoing method embodiments, the descriptions are expressed as a combination of a series of actions for the sake of simplicity and brevity, but those skilled in the art should appreciate that the embodiments of the present specification are not limited by the order of the described actions, because according to the embodiments of the present specification, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should appreciate that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to the embodiments of the present specification.

[0215] In the above embodiments, the description of each embodiment has its own focus, and the parts not described in detail in a certain embodiment can be referred to the related description of other embodiments.

[0216] The preferred embodiments of the present specification disclosed above are only used to help explain the present specification. The alternative embodiments do not describe all the details and limit the invention to the specific embodiments described. Obviously, according to the content of the embodiments of the present specification, many modifications and changes can be made. The present specification selects and describes these embodiments in order to better explain the principles and practical applications of the embodiments of the present specification, so that those skilled in the art can well understand and use the present specification. The present specification is limited by the claims and their entire scope and equivalents.

Claims

1. A method for creating routing information, applied to a distributed database system, comprising: Determine at least one data management node by traversing the distributed database system, wherein the distributed database system includes the data management node and other nodes, the data management node is a node in a read-write state and processes the latest version of data, and the other nodes are nodes in a read-only state; determining node information of each data management node according to the attribute information of the distributed database system, and clustering the at least one data management node according to the node information to obtain a target data management node group; Constructing identification information corresponding to the target data management node group, and determining group location information corresponding to the target data management node group based on the node information, wherein the group location information is information corresponding to the physical address corresponding to the target data management node group; Target routing information corresponding to the target data management node group is created according to the identification information and the group location information, wherein the target routing information is obtained by aggregating node routing information of data management nodes within the same target data management node group.

2. The method according to claim 1, wherein determining at least one data management node by traversing the distributed database system comprises: Traversing the distributed database system to obtain the execution status of data nodes in the distributed database system; The data node whose execution state is the read-write state is determined to be a data management node.

3. The method according to claim 1, wherein determining the node information of each data management node based on the attribute information of the distributed database system comprises: In a case where the attribute information of the distributed database system is location attribute information, determining node location information of each data management node according to the location attribute information as the node information; or, In a case where the attribute information of the distributed database system is lease attribute information, node lease information of each data management node is determined according to the lease attribute information as the node information.

4. The method according to claim 3, wherein when the node information is node location information, determining the node location information of any one of the at least one data management node comprises: According to the location attribute information, query the geographical location information and device code corresponding to the data management node; The node location information of the data management node is determined according to the geographical location information and the device code.

5. The method according to claim 4, clustering the at least one data management node according to the node information to obtain a target data management node group, comprising: Read the geographic location information in the node location information of each data management node; The at least one data management node is clustered according to each piece of geographical location information to obtain a target data management node group.

6. The method according to claim 1, after creating the target routing information corresponding to the target data management node group, further comprising: Receive a data management node insertion instruction; In response to the data management node insertion instruction, determining a data management node to be updated and node information to be updated of the data management node to be updated; When it is determined that the to-be-updated node position information included in the to-be-updated node information is the same as the group position information, the to-be-updated data management node is inserted into the target data management node group.

7. The method according to claim 6, further comprising: Constructing a data management node group to be updated including the data management node to be updated; Constructing identification information to be updated corresponding to the data management node group to be updated, and determining group position information to be updated corresponding to the data management node group to be updated according to the node position information to be updated; The to-be-updated routing information corresponding to the to-be-updated data management node group is created according to the to-be-updated identification information and the to-be-updated group location information.

8. The method according to claim 1, after creating the target routing information corresponding to the target data management node group, further comprising: Receive a data management node removal instruction; In response to the data management node removal instruction, determining a data management node to be removed and node information to be removed of the data management node to be removed; When it is determined that the node position information to be removed included in the node information to be removed is the same as the group position information, the data management node to be removed is deleted from the target data management node group.

9. The method according to claim 8, further comprising: after deleting the data management node to be removed from the target data management node group; Determining that the target data management node group corresponding to the to-be-removed node information is the to-be-deleted data management node group; The data management node group to be deleted is queried. If the data management node group to be deleted does not include a data management node, the data management node group to be deleted is deleted, and target routing information corresponding to the data management node group to be deleted is deleted.

10. The method according to claim 1, after creating target routing information corresponding to the target data management node group according to the identification information and the group location information, further comprising: Receiving a routing information reading request sent to a target data management node in a distributed database system; In response to the routing information read request, in the distributed database system, determining a target data management node group including the target data management node as a data management node group to be queried; The data management nodes included in the data management node group to be queried are traversed to determine the node routing information of the target data management node.

11. The method according to claim 10, wherein traversing the data management nodes included in the data management node group to be queried and determining the node routing information of the target data management node comprises: Traversing the data management node group to be queried, and determining the target device code of the target data management node; Determining a target node identifier of the target data management node according to the routing information reading request; Node routing information of the target data management node is determined according to the target node identifier and the target device code.

12. A routing information query method, applied to a distributed database system, comprising: Receiving a routing information read request sent to a target data management node in a distributed database system, wherein the distributed database system includes a data management node and other nodes, the data management node is a node in a read-write state and processes the latest version of the data, and the other nodes are nodes in a read-only state; In response to the routing information read request, in the distributed database system, determining a target data management node group including the target data management node as a data management node group to be queried; Traverse the data management nodes included in the data management node group to be queried, and determine the node routing information of the target data management node, wherein the data management node group corresponds to target routing information, and the target routing information is obtained by aggregating the node routing information of the data management nodes in the same target data management node group. The target routing information is created based on the identification information and group location information corresponding to the target data management node group, and the group location information is information corresponding to the physical address corresponding to the target data management node group.

13. A routing information creation device, applied to a distributed database system, comprising: a traversal module configured to determine at least one data management node by traversing the distributed database system, wherein the distributed database system includes data management nodes and other nodes, the data management node is a node whose execution state is read-write and the data processed is the latest version of data, and the other nodes are nodes whose execution state is read-only; a clustering module configured to determine node information of each data management node according to attribute information of the distributed database system, and cluster the at least one data management node according to the node information to obtain a target data management node group; a construction module configured to construct identification information corresponding to the target data management node group, and determine group location information corresponding to the target data management node group based on the node information, wherein the group location information is information corresponding to a physical address corresponding to the target data management node group; A creation module is configured to create target routing information corresponding to the target data management node group based on the identification information and the group location information, wherein the target routing information is obtained by aggregating the node routing information of the data management nodes within the same target data management node group.

14. A routing information query device, applied to a distributed database system, comprising: a receiving module configured to receive a routing information read request sent to a target data management node in a distributed database system, wherein the distributed database system includes a data management node and other nodes, the data management node is a node in a read-write state and processes the latest version of the data, and the other nodes are nodes in a read-only state; a response module configured to, in response to the routing information reading request, determine, in the distributed database system, a target data management node group including the target data management node as the data management node group to be queried; A determination module is configured to traverse the data management nodes included in the data management node group to be queried, and determine the node routing information of the target data management node, wherein the data management node group corresponds to target routing information, and the target routing information is obtained by aggregating the node routing information of the data management nodes within the same target data management node group. The target routing information is created based on the identification information and group location information corresponding to the target data management node group, and the group location information is information corresponding to the physical address corresponding to the target data management node group.

15. A computing device comprising: memory and processor; The memory is used to store computer-executable instructions, and the processor is used to implement the steps of the method according to any one of claims 1 to 11 or 12 when executing the computer-executable instructions.

16. A computer-readable storage medium storing computer instructions, wherein when the instructions are executed by a processor, the steps of the method according to any one of claims 1 to 11 or 12 are implemented.

17. A computer program product, characterized in that The method comprises computer instructions which, when executed by a processor, implement the steps of the method according to any one of claims 1 to 11 or 12.

Citation Information

Patent Citations

  • Ad hoc network topology establishment method and apparatus

    CN106487586A

  • Static routing deployment method for lamp control system network

    CN110234147A