CN115665144A - Routing information creating method and device, and routing information inquiring method and device - Google Patents

Routing information creating method and device, and routing information inquiring method and device Download PDF

Info

Publication number
CN115665144A
CN115665144A CN202211271331.XA CN202211271331A CN115665144A CN 115665144 A CN115665144 A CN 115665144A CN 202211271331 A CN202211271331 A CN 202211271331A CN 115665144 A CN115665144 A CN 115665144A
Authority
CN
China
Prior art keywords
data management
management node
information
node
group
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202211271331.XA
Other languages
Chinese (zh)
Inventor
林萌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Oceanbase Technology Co Ltd
Original Assignee
Beijing Oceanbase Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Oceanbase Technology Co Ltd filed Critical Beijing Oceanbase Technology Co Ltd
Priority to CN202211271331.XA priority Critical patent/CN115665144A/en
Publication of CN115665144A publication Critical patent/CN115665144A/en
Pending legal-status Critical Current

Links

Images

Abstract

The embodiment of the specification provides a method and a device for creating routing information, and a method and a device for querying the routing information, wherein the method for creating the routing information comprises the following steps: determining at least one data management node by traversing the distributed database system; 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 position information corresponding to the target data management node group according to the node information; and creating target routing information corresponding to the target data management node group according to the identification information and the group position information, thereby realizing the aggregation of the routing information, reducing the number of routing entries, relieving the hardware pressure of related storage equipment, enabling the routing information to be updated more frequently and further ensuring the accuracy of the routing information.

Description

Routing information creating method and device and routing information inquiring method and device
Technical Field
The embodiment of the specification relates to the technical field of computers, in particular to a routing information creating method and a routing information inquiring method. One or more embodiments of the present specification also relate to a routing information creating apparatus, a routing information querying apparatus, a computing device, and a computer-readable storage medium.
Background
With the rapid development of information technology and the explosive growth of data, a scenario of processing a large amount of data becomes more and more common, in order to realize the storage of a large amount of data in such a scenario, a distributed database system is more and more applied, and in a storage service provided by the distributed database system, it is necessary to record relevant routing information on a node that stores the latest data information, and because the number of nodes in a large-scale distributed database system is large, the update cycle of the relevant routing information is difficult to determine, the cycle is too short, which causes the system to be stressed greatly, and the cycle is too long, which causes the maintenance of the routing information to be untimely and inaccurate, and because the number of nodes is large, the storage space required by the routing information of the storage node is also large, a method is urgently needed to solve the above problems.
Disclosure of Invention
In view of this, embodiments of the present specification provide a method for creating routing information, and a method for querying routing information. One or more embodiments of the present disclosure also relate to a routing information creating apparatus, a routing information querying apparatus, a computing device, and a computer-readable storage medium, so as to solve technical deficiencies in the prior art.
According to a first aspect of embodiments of the present specification, there is provided a routing information creating method including:
determining at least one data management node by traversing the distributed database system;
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 position information corresponding to the target data management node group according to the node information;
and creating target routing information corresponding to the target data management node group according to the identification information and the group position information.
According to a second aspect of embodiments of the present specification, there is provided a routing information query method, including:
receiving a routing information reading request sent by a target data management node in a distributed database system;
responding to the routing information reading request, and determining a target data management node group containing the target data management node as a data management node group to be inquired in the distributed database system;
and traversing the data management nodes contained in the data management node group to be queried, and determining the node routing information of the target data management node.
According to a third aspect of embodiments herein, there is provided a routing information creating apparatus including:
a traversal module configured to determine at least one data management node by traversing the distributed database system;
the clustering module is 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;
the building module is configured to build identification information corresponding to the target data management node group and determine group position information corresponding to the target data management node group according to the node information;
and the creating module is configured to create target routing information corresponding to the target data management node group according to the identification information and the group position information.
According to a fourth aspect of embodiments of the present specification, there is provided a routing information query apparatus including:
the system comprises a receiving module, a sending module and a receiving module, wherein the receiving module is configured to receive a route information reading request sent by a target data management node in the distributed database system;
a response module configured to respond to the routing information reading request, and determine, in the distributed database system, a target data management node group including the target data management node as a data management node group to be queried;
and the determining module is configured to traverse the data management nodes contained in the data management node group to be queried and determine the node routing information of the target data management node.
According to a fifth aspect of embodiments herein, there is provided a computing device comprising:
a memory and a processor;
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.
According to a sixth aspect of embodiments herein, there is provided a computer-readable storage medium storing computer-executable instructions that, when executed by a processor, implement the steps of the routing information creation method or the steps of the routing information query method.
In the routing information creating method provided in an embodiment of the present specification, data management nodes included in a distributed database system are determined, node information of each data management node is determined according to attribute information of the distributed database system, so that data management nodes can be clustered according to the node information to obtain a target data management node group, then identification information and group position information are determined for the target data management node group, and finally target routing information corresponding to the target data management node group is created according to the identification information and the group position information, so that aggregation of routing information is achieved, the number of routing entries is reduced, hardware pressure of related storage devices is reduced, routing information can be updated more frequently, and accuracy of the routing information is further ensured.
In the routing information query method provided in an embodiment of the present specification, a target data management node group including a target data management node is determined in a distributed database system through a received routing information read request, and then the target data management node group is traversed to determine node routing information of the target data management node, so that the routing information of a specific data management node is read from the target routing information created by the routing information creation method provided in the embodiment of the present specification, the flexibility of querying the data management node is ensured, and the process of updating the distributed database system is not affected.
Drawings
Fig. 1 is a process flow diagram of a method for creating routing information according to an embodiment of the present specification;
fig. 2 is a schematic diagram of a distributed database system of a routing information creation method according to an embodiment of the present specification;
fig. 3 is a flowchart illustrating a processing of a routing information query method according to an embodiment of the present disclosure;
fig. 4 is a flowchart illustrating a processing procedure of a routing information creating method and a routing information querying method according to an embodiment of the present specification;
fig. 5 is a schematic diagram of a routing information creating apparatus according to an embodiment of the present specification;
fig. 6 is a schematic diagram of a routing information query device according to an embodiment of the present specification;
fig. 7 is a block diagram of a computing device according to an embodiment of the present disclosure.
Detailed Description
In the following description, numerous specific details are set forth in order to provide a thorough understanding of the present description. This description may be embodied in many different forms and should not be construed as limited to the embodiments set forth herein, as those skilled in the art will be able to make and use the present disclosure without departing from the spirit and scope of the present disclosure.
The terminology used in the description of the one or more embodiments is for the purpose of describing the particular embodiments only and is not intended to be limiting of the description of the one or more embodiments. As used in this specification and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used in one or more embodiments of the present specification refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It will be understood that, although the terms first, second, etc. may be used herein in one or more embodiments to describe various information, these information should not be limited by these terms. These terms are only used to distinguish one type of information from another. For example, a first can also be referred to as a second and, similarly, a second can also be referred to as a first without departing from the scope of one or more embodiments of the present description. The word "if" as used herein may be interpreted as "at" \8230; "or" when 8230; \8230; "or" in response to a determination ", depending on the context.
In the present specification, there are provided a route information creating method, a route information inquiring method, and the present specification also relates to a route information creating apparatus, a route information inquiring apparatus, a computing device, and a computer-readable storage medium, which are described in detail one by one in the following embodiments.
In practical application, for maintenance and update of a distributed database system, routing information of data nodes therein is maintained and updated, in the prior art, routing information of each data management node in the distributed database system is created and stored, and in this way, when facing a distributed database system with a large number of data nodes, the amount of routing information stored is also large, so that relevant equipment for storing the routing information can also face a large hardware storage pressure, and when performing daily update maintenance, because the amount of routing information is large, the equipment can detect each piece of routing information, and this way undoubtedly greatly increases investment of detection resources, and also requires a detection period of long enough duration to enable all pieces of routing information to be completely detected, and this comparatively long detection period is not favorable for accuracy and real-time of detection.
In addition, because the traditional distributed database system has the requirement on data consistency, the distributed database system usually saves a plurality of copies of data in order to support a disaster recovery mechanism; in this case, in the prior art, when data aggregation is performed, new and old data are basically completed at the same time, which results in that the characteristics of the database are greatly impaired and the database performance cannot be fully exerted.
In this specification, a routing information creating method is provided, in which associated data nodes are aggregated according to node information corresponding to data management nodes, so as to reduce the number of routing information, and in this process, the aggregated data nodes are all data management nodes in a distributed database system, so that it can be ensured that the routing information established thereafter is also associated with the data management nodes, thereby realizing that less routing data information can be involved when the distributed database system performs daily update maintenance, and a smaller update period can be set while less detection resources are invested, thereby effectively improving the detection accuracy and real-time performance, and because the data management nodes in the same group have the characteristics of physical closeness, the network delay or the encountered related physical damage conditions are basically consistent, and in this case, the state change of the data management nodes in the same group is consistent, for example, the state change of the data management nodes in one group is often synchronous, and the machine room only needs to record the state change; the routing information according to the aggregated packets does not affect the accuracy of the routing information.
Fig. 1 shows a processing flow chart of a routing information creation method provided according to an embodiment of the present specification, including step S102 to step S108.
Step S102: at least one data management node is determined by traversing the distributed database system.
The method is particularly applied to a distributed database system, the routing information of the nodes in the distributed database system is created, and the routing information is maintained in real time in the monitoring process of the distributed database system.
The data management node can be understood as a node which is used for reading and storing related data in the distributed database system, and the processed data is the latest version data; it should be noted that, in the distributed database system, each node corresponds to a related storage device, and these storage devices process read-write events of different requests by using threads in a thread pool, while in the distributed database storage system, facing the read-write events, some nodes call the threads in the thread pool to perform read tasks and write tasks, and meanwhile, the data that can be processed is the data of the latest version, and then the nodes are the data management nodes; as for other nodes, only the non-latest version of data can be processed, and the nodes and the data management node have a master-slave relationship, wherein the data changes along with the change of the data in the data management node. As can be seen from the above, the importance of the data management node is far higher for the distributed database system than for other nodes, and in this case, the relevant routing information of the distributed database system is recorded, and only the routing information of the data management node needs to be recorded.
Based on the above, all nodes in the distributed database system are queried to determine the data management nodes therein, and it can be known that recording the routing information of the distributed database system is actually recording the routing information of the data management nodes, and each data management node corresponds to one routing information, which causes the number of routing entries to be too large and is inconvenient to manage and maintain; in view of this, in order to conveniently manage and maintain the routing information, the problem may be directly solved from the root point by reducing the number of the routing entries, and therefore, the data management node may be determined first and then used subsequently.
Further, in the traversal distributed database system, the data management node and other nodes having only a reading capability are interchangeable, which means that there is no structural difference between the data management node and other nodes, and since the amount of the routing information is determined by the amount of the data management node, in order to achieve the effect of reducing the routing entries, the data management node needs to be determined in the distributed database system, and in this embodiment, the specific implementation manner is as follows:
traversing the distributed database system to obtain the execution state of the data nodes in the distributed database system; and determining the data node with the execution state being a read-write state as a data management node.
The data node can be understood as a minimum unit for storing data in a distributed database system; the execution state can be understood as an execution mode adopted by the data node for the read-write event of the distributed database system interface, for example, the data management node faces the read-write event of the distributed database system interface, the execution state of the data node can indicate that the data node can execute both the read task and the write task, and the execution states of other data nodes indicate that the data node can only execute the read task on the data in the data management node; the read-write state may be understood as indicating that a related data node, i.e., a data management node, may perform both a read task and a write task when facing a read-write event of a distributed database system interface.
Based on this, the execution states of all data nodes in the distributed database system are queried, and it is determined that the data node whose execution state is the read-write state is the data management node, it should be noted that, when the execution state of the data node is queried, the data management node may be queried and determined for a server state of the data node, and also the data management node may be queried and determined for a history record of a replica manager, where a specific determination manner adopted is determined by an actual usage scenario, and this embodiment is not limited.
For example, an insurance company a uses a distributed database system X to store related services, where the distributed database system X of the insurance company a occupies 3 machine rooms, as shown in a schematic diagram of the distributed database system of a routing information creation method in fig. 2, the machine rooms are respectively a machine room 1, a machine room 2, and a machine room 3, and each machine room has three data nodes, in order to create routing information about the distributed database system X, traverse the distributed database system X, determine execution states of nine data nodes in the three machine rooms of the distributed database system X, determine data nodes of which three execution states are read-write states as data management nodes, which are respectively a leader1, a leader2, and a leader3, where the leader1 is in the machine room 1, and the leader2 and the leader3 are in the machine room 2.
In conclusion, the execution state of the data node in the distributed database system is queried, so that the data management node in the distributed database system can be directly and accurately determined.
Step S104: and determining the 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.
Specifically, after the data management nodes included in the distributed database system are determined, in order to reduce the number of the routing entries, it may be considered that the data management nodes in the same machine room are indexed by one or more routing entries (the number of the routing entries is smaller than the number of the data management nodes in the machine room), so that the characteristics of the distributed database system may be determined by first combining the attribute information of the distributed database system, information required to be used when clustering is performed on the data management nodes in the current scene is determined according to the characteristics, and then the data management nodes are aggregated according to the node information, so as to obtain a target data management node group.
The attribute information of the distributed database system specifically refers to description information representing the characteristics of the distributed database system, and is used for aggregation of the data management nodes in the following process. That is, the attribute information can reflect the characteristics of the distributed database system, so that under the condition that the characteristics are added, the information of the data management nodes is determined as the node information, and the related data management nodes are integrated into the same group. Correspondingly, the node information refers to information used in a current aggregation scene, and is used for aggregation under the influence of the characteristics of the distributed database system, and the number of aggregation groups is smaller than that of nodes.
The node information includes, but is not limited to, node location information and node lease information, and the node location information can be understood as information for recording the location of the data management node, including geographical location information and device codes; for example, a data management node performs execution of related tasks of the data management node on a device B in a machine room a, in this case, node information of the data management node may be denoted as a-B; the node lease information can be understood as recording description information of the lease condition of the data management node, wherein the description information includes lease user information and equipment code, for example, a certain data management node, performs execution of related tasks of the data management node on a B equipment of a machine room a and leased by a user a, in this case, the node information of the data management node can be marked as a-B. The target data management node group may be understood as a group obtained by clustering data management nodes included in the distributed database system according to the relevant node information.
Based on the data management node group, determining attribute information of the distributed database system, reading node information of the data management nodes according to the attribute information, and clustering the data management nodes according to the node information to obtain a target data management node group; the obtained target data management node group has a close physical dimension relationship like a machine room, the same district, the same city and the like through clustering performed by the node information, or a close lease dimension relationship like a lease room, so that subsequent routing information creation is performed after the target data management node group is obtained according to a clustering result, and the purpose of reducing routing entries is achieved.
Further, considering that different characteristics exist in different distributed database systems, and the different characteristics affect the clustering mode of each data management node, before clustering, the node information of each data management node needs to be determined by combining the attribute information of the distributed database systems, and based on this, clustering can fully exert the performance of the distributed database systems, and simultaneously reduce routing bars.
(1) And under the condition that the attribute information of the distributed database system is position attribute information, determining the node position information of each data management node according to the position attribute information, and taking the node position information as the node information.
Specifically, the location attribute information specifically refers to attribute description information of a distributed database system with regional characteristics, which indicates that routing entries can be reduced by using location information clustering under the characteristics. Correspondingly, the node location information specifically refers to location information corresponding to each data management node, and is composed of a geographical location and an equipment code, where the equipment code refers to a unique code corresponding to equipment in each machine room where the data management node is deployed.
Based on this, in the case that the distribution of the distributed database system for the data management nodes is realized according to geographical locations, but in general, a plurality of devices are arranged in each machine room, so when the data management nodes are clustered, 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, and is used as the node information for subsequent use.
It should be noted that the attribute information of the distributed database system is information preset by the server based on the characteristics of the server, and the distributed database systems with different characteristics preset different attribute information, so that when clustering data management nodes, the node information to be read for the data management nodes can be determined by combining the attribute information, and the routing information is created on the basis of the node information.
(2) And under the condition that the attribute information of the distributed database system is lease attribute information, determining node lease information of each data management node according to the lease attribute information, wherein the node lease information is used as the node information.
Specifically, the lease attribute information specifically refers to attribute description information of a distributed database system with lease characteristics, which shows that routing entries can be reduced by adopting lease information clustering under the characteristics; correspondingly, the node leasing information specifically refers to leasing information corresponding to each data management node, and the node leasing information includes leasing identification information and the like, and is used for specifying a leasing party to which the data management node belongs.
Based on the characteristic, when the distributed database system realizes that the distribution of the data management nodes follows the lease information, namely the distributed database system controls the data management nodes belonging to the same lease party to be deployed in the same machine room, the node lease information of the data management nodes can be preferentially determined when the data management nodes are clustered, clustering is carried out on the basis of the node lease information, the data management nodes belonging to the same lease party in the same machine room can be guaranteed to be clustered together, and therefore the number of subsequent routing entries is effectively reduced.
For example, the distributed database system has a characteristic of controlling distribution of the leaders, and the characteristic can control that the leaders associated with the same leasing party need to be distributed to the same machine room, so when the leaders need to be clustered, if the leaders are implemented by using geographic locations, the leaders of the same leasing party may not be clustered together, so that routing entries are increased; therefore, the lease information of each leader can be read, and the leaders are clustered subsequently by combining the lease information, so that the leaders of the same lease party can be clustered into the same group, and the purpose of reducing routing entries is achieved.
Furthermore, in a case that the node information is node location information, before clustering the data management nodes according to the locations of the data management nodes, the location information of the data management nodes needs to be determined, in this embodiment, a specific implementation manner is as follows:
inquiring the geographical position information and the equipment code corresponding to the data management node according to the position attribute information; and determining the node position information of the data management node according to the geographical position information and the equipment code.
The geographical location information can be understood as information of the geographical location of the relevant device storing the data management node in the distributed database system; device coding, which can be understood as coding of the relevant devices in the distributed database system by the data management node.
Based on this, when it is determined that the distribution of the distributed database system for the data management nodes is realized according to the geographical location, the geographical location of the device corresponding to the data management node in the distributed database system and the code of the device may be queried in combination with the location attribute information, and then the geographical location of the device corresponding to the data management node and the code of the device are combined to obtain the node location information of the data management node.
For example, after the data management nodes are determined, node position information of each data management node is also required to be determined, and by inquiring the geographical position information of relevant equipment of the data management nodes in the distributed database system X, the geographical position information of leader1 is machine room 1, and the geographical position information of leader2 and leader3 is machine room 2; as shown in the schematic diagram of the distributed database system of the routing information creation method in fig. 2, there are 3 data nodes from top to bottom in the machine room 1, where the 3 nodes correspond to three devices, the device codes of the three nodes are A1, A2, and A3, the three data nodes in the similar machine room 2 also correspond to three devices, the device codes are B1, B2, and B3, and the device codes of the three devices corresponding to the three data nodes in the machine room 3 are C1, C2, and C3, respectively; thus, the device code corresponding to the leader1 is determined to be A2, the device code corresponding to the leader2 is determined to be B1, and the device code corresponding to the leader3 is determined to be B3; and finally, obtaining node position information respectively corresponding to the leader1, the leader2 and the leader3 as a machine room 1-A2, a machine room 2-B1 and a machine room 2-B3. After the node position information of the data management nodes is determined, clustering can be performed based on the node position information to obtain a target data management node group, and finally, the creation of target routing information is realized.
In conclusion, the geographical location information and the device code of the data management node are inquired, the node location information is determined, the device corresponding to the data management node can be accurately located, and the aggregation of the data management node can be realized based on the node location information.
Further, because the node location information of the data management node is composed of geographic location information and device codes, and the data management nodes in the same machine room have the same location information, the node location information may be combined to perform aggregation to reduce routing entries, in this embodiment, the specific implementation manner is as follows:
reading geographical position information in the node position information of each data management node; and clustering the at least one data management node according to each piece of geographical position information to obtain a target data management node group.
The method includes querying node position information of each data management node, determining geographical position information contained in the node position information, and clustering each data management node according to the geographical position information to obtain a target data management node group.
Following the above example, after determining the node position information of the leader1, the leader2 and the leader3, clustering the leader1, the leader2 and the leader3 according to the geographical position information in the node position information, wherein because the leader2 and the leader3 are in the same machine room, two groups of target data management nodes which can be clustered at this time are respectively a group of the leader1 and a group of the leader2 and the leader3, and related routing information can be subsequently created according to the groups to obtain target routing information.
In conclusion, the process of clustering the data management nodes through the geographical position information and then obtaining the target routing information through the clustering result can reduce the quantity of the routing information and reduce the hardware pressure of related storage equipment on the premise of not influencing the routing information maintenance of the distributed database system, and the routing information can be updated more frequently, so that the accuracy of the routing information is further ensured.
Step S106: and constructing identification information corresponding to the target data management node group, and determining group position information corresponding to the target data management node group according to the node information.
The identification information may be understood as information indicating the identity of a target data management node group, each target data management node group corresponds to different identification information, it should be noted that the identification information may be set manually or generated based on information acquired in a preset manner, and it is only necessary to ensure that each identification information is different and can correspond to a target data management node group, a specific creation manner is determined by an actual use scenario, and this embodiment is not limited; the group location information may be understood as information that records a location of each target data management node group, and is capable of locating data management nodes in the target data management node group, and locating each data management node in the group, that is, information corresponding to a physical address corresponding to the target data management node group, may be located by locating the group.
The group location information may be a location corresponding to a group of data management nodes of a city, a district, a machine room, or the like, or the same leasing party. The specific range of the selected magnitude is determined by an actual use scene, the embodiment is not limited, and in the determination process of the group position information, the determination can be performed according to the node position information of the data management nodes in the target data management node group, for example, if two data management nodes exist in one group, the node position information of the two data management nodes is respectively an a city-B region-C machine room and an a city-D region-C machine room, then the group position information can be determined as an a city at this time; or the node position information is respectively an A city-B area-C machine room and an A city-B area-E machine room, and then the group position information can be determined as the A city-B area; certainly, the magnitude range of the group position information can also be manually set, the node position information is respectively a machine room from the city A to the district B to the district C, a machine room from the city A to the district B to the district E, and the manually specified magnitude is 'city' at the moment, so that the group position information can be obtained as the city A; in addition, the magnitude of the group position information can be determined according to the clustering process, for example, the distance between the devices which limit two data management nodes cannot exceed five kilometers of the radius during clustering, and at this time, the magnitude of the group position information can also be determined as an 'area' according to the limitation of clustering processing; specifically, according to the node location information of the data management nodes in the same group, the method used for determining the group location information is determined by the actual usage scenario, and this embodiment is not limited.
On the other hand, in the process of determining the group position information, the group position information can be determined according to the node leasing information of the data management nodes in the target data management node group, if two data management nodes exist in one group, the node leasing information of the two data management nodes is respectively the leasing party of the two data management nodes, the node leasing information is located in a machine room from A city to B district to C district, the node leasing information is the leasing party of the two data management nodes, the node leasing information is the user A, the node leasing information is located in a machine room from A city to D district to C, and then the group position information can be determined to be from A city; that is to say, when the group location information of the target data management node group is determined by the node lease information, the group location information is determined by combining the information of the lease party and the location information, because different lease parties to which the data management nodes in the same machine room belong may exist, if clustering is performed according to the location at the moment, the data management nodes of different lease parties may be clustered together, and after subsequent routing information creation is performed on the basis, if data reading is performed in a data reading stage, the problem of inaccurate data reading may be caused, so that the data reading needs to be completed according to the node lease information during clustering, and similarly, when the group location information is determined for the target data management node group, the determination is also performed according to the node lease information.
Based on the identification information, the identification information of the target data management node group is established by a preset method, so that different groups clustered in the distributed database system have different identification information, and then the group position information of the group is further determined according to the node information of the data management nodes in the same group. And related target routing information can be created subsequently through the identification information and the group position information of the same target data management node group, so that the aggregation of the routing information of the data management nodes in the same group is realized.
Step S108: and creating target routing information corresponding to the target data management node group according to the identification information and the group position information.
Specifically, after the identification information and the group location information are determined, it is clear that the amount of information for creating the routing information after the node location information is determined separately for each data management node is reduced, and then the target routing information may be created based on the identification information and the group location information. The target routing information may be understood as routing information corresponding to the target data management node group, and the routing information of the data management nodes in the target data management node group is aggregated.
Further, in the distributed database system, if one of the data nodes is elected to become a new data management node, the target routing information needs to be updated, and the specific implementation process is as follows:
receiving a data management node insertion instruction; responding to the data management node insertion instruction, and determining a data management node to be updated and node information to be updated of the data management node to be updated; and under the condition that the position information of the node to be updated contained in the information of the node to be updated is determined to be the same as the position information of the group, inserting the data management node to be updated into the target data management node group.
The data management node insertion instruction can be understood as an instruction for indicating the target routing information to update when a new data management node appears in the distributed database system; the data management node to be updated can be understood as a new data management node in the distributed database system; the node information to be updated may be understood as the node information of the data management node to be updated, where the node information to be updated is the same as the description of the node information, and the same or similar contents may refer to the foregoing embodiment, which is not described in detail herein; the node location information to be updated may be understood as information containing the address of the data management node to be updated.
Based on the above, under the condition that a data management node insertion instruction is received, the data management node insertion instruction is analyzed, a newly added data management node to be updated in the distributed database system is determined, the position information of the data management node to be updated is determined, then the node information to be updated is analyzed to obtain the position information of the node to be updated, then the position information of the node to be updated is compared with the group position information of each target data management node group in the distributed database system, and after the group position information which is the same as the position information of the node to be updated is determined, the data management node to be updated is inserted into the target data management node group corresponding to the group position information.
According to the use example, a group where the leader1 is located is named as a leader group 1, a group where the leader2 and the leader3 are located is named as a leader group 2, the group location information of the leader group 1 is determined to be a machine room 1 and the group location information of the leader group 2 is determined to be the machine room 2 according to the geographical location information machine room 1-A2 of the leader1 and the geographical location information machine rooms 2-B1 and 2-B3 of the leader2 and the leader3, and then the target routing information is constructed to be the < leader group 1, the machine room 1> and the < leader group 2 and the machine room 2> according to the identification information and the group location information of different groups.
Subsequently, after receiving the data management node insertion instruction Z1, analyzing the Z1, determining that the data management node to be updated is leader4 and the position information of the node to be updated is machine room 1-A3, thereby acquiring that the geographical position information to be updated is machine room 1, inquiring that the group position information is the same as that of the leader group 1, and inserting the leader4 into the leader group 1.
In conclusion, through the above manner, when a newly added data management node appears in the distributed database system, the target routing information is updated, and because a manner of aggregating the data management nodes based on the node information and only recording the routing information of the same group is used, when the newly added data management node is within the range of the original target data management node group, the target routing information does not need to be updated, so that the update resource is saved.
Further, except for the case that the newly added data management node is within the range of the original target data management node group, there is also a case that the newly added data management node is not within the range of the original target data management node group, in this embodiment, a specific implementation manner is as follows:
constructing a data management node group to be updated containing the data management node to be updated; establishing identification information to be updated corresponding to the data management node group to be updated, and determining position information of a group to be updated corresponding to the data management node group to be updated according to the position information of the node to be updated; and creating the routing information to be updated corresponding to the data management node group to be updated according to the identification information to be updated and the group position information to be updated.
The data management node group to be updated can be understood as a new target data management node group created based on the data management node to be updated; the identification information to be updated can be understood as identification information corresponding to the data management node group to be updated; the node position information to be updated can be understood as group position information corresponding to the data management node group to be updated; the routing information to be updated may be understood as target routing information corresponding to the data management node group to be updated.
Based on the method, a data management node group to be updated is established based on the newly added data management node to be updated, the group comprises the data management node to be updated, then identification information of the newly added group is established, group position information of the newly added group is determined according to the data management node to be updated, and then target routing information corresponding to the newly added group is established according to the identification information and the group position information of the newly added group. It should be noted that, after the to-be-updated data management node group including the to-be-updated data management node is constructed, a process of creating the identification information and the group location information corresponding to the to-be-updated data management node group, and creating new routing information according to the identification information and the group location information is similar to the process of creating the target routing information corresponding to the target data management node group, and is not described herein again.
Along the use example, if the leader4 is not in the original leader group 1 and the leader group 2, a data management node group to be updated is created, which contains the leader4, then the identification information of the group is constructed to be the leader group 3, then the group position information of the leader group 3 is determined to be the machine room 3 according to the node position information machine room 3-C1 of the leader4, and finally the routing information < leader group 3, machine room 3> about the leader group 3 is created.
In conclusion, by the above manner, it is ensured that the new target data management node group and the corresponding target routing information can be generated under the condition that the new data management node is not in the original target data management node group, and the correctness and the real-time property of the update of the target routing information are ensured.
In addition, there is also a case of removing an original data management node in the distributed database system, and in this embodiment, a specific implementation manner is as follows:
receiving a data management node removal instruction; responding to the data management node removing instruction, and determining a data management node to be removed and node information to be removed of the data management node to be removed; and under the condition that the position information of the node to be removed contained in the information of the node to be removed is determined to be the same as the group position information, deleting the data management node to be removed from the target data management node group.
The data management node removing instruction can be understood as an instruction for indicating the target routing information to update under the condition that the original data management node is removed from the distributed database system; the data management node to be removed can be understood as an original data management node needing to be removed in the distributed database system; the node information to be removed can be understood as node information corresponding to the data management node to be removed; the node location information to be removed may be understood as location information included in the node location information to be removed.
Based on the above, under the condition that a data management node removal instruction is received, the data management node removal instruction is analyzed, a to-be-removed data management node which needs to be removed in the distributed database system is determined, node information of the to-be-removed data management node is determined, then the to-be-removed node information is analyzed, position information of the to-be-removed node is obtained, then the position information of the to-be-removed node is compared with group position information of each target data management node group in the distributed database system, and after the group position information which is the same as the position information of the to-be-removed node is determined, the to-be-removed data management node is removed from the target data management node group corresponding to the group position information.
According to the above example, after receiving the data management node removal instruction Z2, analyzing Z2, determining that the data management node to be removed is leader2, and the position information of the node to be removed is machine room 2-A1, thereby obtaining that the geographical position information to be removed is machine room 2, inquiring that the group position information of the leader group 2 is the same, and removing leader2 from the leader group 2.
In conclusion, through the above manner, the target routing information is updated when the original data management node is removed from the distributed database system.
Further, when the data management node to be removed is removed from the corresponding target data management node group, there are two situations, one is that after the data management node to be removed is removed, the data management node still exists in the target data management node group, and the other is that after the data management node to be removed is removed, the data management node does not exist in the target data management node group, and these two different situations need different processing, and in this embodiment, the specific implementation manner is as follows:
determining a target data management node group corresponding to the information of the node to be removed as a data management node group to be deleted; and querying the data management node group to be deleted, deleting the data management node group to be deleted under the condition that the data management node group to be deleted does not contain a data management node, and deleting the target routing information corresponding to the data management node group to be deleted.
The data management node group to be deleted may be understood as a target data management node group from which node information to be removed is removed.
Based on the data management node group to be deleted, determining that the target data management node group removed by the data management node to be removed is the data management node group to be deleted, then inquiring whether the data management node group to be deleted still has a data management node, and if so, keeping the data management node group to be deleted and corresponding target routing information; and if not, deleting the management group of the data management node to be deleted and the corresponding target routing information.
Along the above example, if there are two nodes for managing data to be processed, which are leader2 and leader4, respectively, where leader4 is inserted into the leader group 3 corresponding to the machine room 3. Then, removing the data management node from the corresponding target data management node group, deleting leader2 from the leader group 2, and deleting leader4 from the leader group 3; after deletion, the leader group 2 is inquired to contain the leader3, the leader group 3 is inquired not to contain the data management node, at this time, the < leader group 2 and the machine room 2> are kept unchanged, the < leader group 3 and the machine room 3> are deleted, and the leader group 3 is deleted.
In summary, because a manner of aggregating data management nodes based on node information and recording only the routing information of the same group is used, when a data management node still exists in the target data management node group from which the data management node is removed, the target routing information does not need to be updated, and the update resource is saved.
Further, since a single data management node cannot be directly found after aggregation, for supporting service usage, the specific implementation manner is as follows:
receiving a routing information reading request sent by a target data management node in a distributed database system; responding to the routing information reading request, and determining a target data management node group containing the target data management node as a data management node group to be inquired in the distributed database system; and traversing the data management nodes contained in the data management node group to be queried, and determining the node routing information of the target data management node.
The routing information reading request can be understood as a request sent by a certain single data management node for reading; the target data management node can be understood as a data management node which needs to be read; the data management node group to be queried can be understood as a target data management node group where a target data management node is located; the node routing information may be understood to include routing information of the destination data management node.
Based on the method, a routing information reading request is received, then the routing information reading request is analyzed, a target data management node is determined, then query is carried out in the distributed database system, a target data management node group containing the target data management node is determined, the target data management node group is a to-be-queried data management node group, then data management nodes containing the to-be-queried data management node group are queried, the target data management node is found, and node routing information of the target data management node is determined.
In practical application, when a data reading request is received, a data storage position is determined based on the data reading request, then data is searched according to the data storage position for feedback, in the process, the data reading request needs to be classified, the classification aims at positioning an identifier corresponding to the data reading request, the identifier is an identifier in routing information, after the identifier is determined, unique routing information corresponding to the data reading request can be determined by inquiring the stored routing information, node address information can be determined from the routing information by analyzing the routing information, and the node address information is positioned to equipment in a machine room through the node address information to complete data reading operation.
In the above example, after receiving the routing information reading request Z3, analyzing Z3, determining that the target data management node is leader3, querying the distributed database system X, determining that the leader3 exists in the leader group 2, querying the data management nodes in the leader group 2, and determining the node routing information of the leader 3.
In conclusion, by the method, the routing information of a specific data management node is read, the flexibility of querying the data management node is ensured, and the updating process of the distributed database system is not influenced.
Further, in the process of determining the routing information of the target data management node, the location information of the target data management node needs to be combined, and in this embodiment, the specific implementation manner is as follows:
traversing the data management node group to be queried and determining a target equipment 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; and determining the node routing information of the target data management node according to the target node identification and the target equipment code.
The target device code can be understood as a device code corresponding to the target data management node; the target node identification may be understood as an identification representing the identity of the target data management node.
Based on the method, a data management node group is inquired, a target device code of a device corresponding to a target data management node is determined, then a target node identifier of the target data management node is determined according to the analysis of the routing information reading request, and finally node routing information of the target data management node is created according to the target device code and the target node identifier.
Along the above example, the device code for querying the leader3 in the leader group 2 is B3, the identifier of the target data management node, the leader3, is determined to be the leader3 by Z3, and then the node routing information < leader3, B3> corresponding to the leader3 is created.
In conclusion, the method realizes the determination of the routing information of a specific data management node, and ensures the flexibility of querying the data management node.
In the routing information creating method provided in an embodiment of the present specification, data management nodes included in a distributed database system are determined, node information of each data management node is determined according to 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, identification information and group position information are determined for the target data management node group, and finally, target routing information corresponding to the target data management node group is created according to the identification information and the group position information, so that aggregation of the routing information is achieved, the number of routing entries is reduced, hardware pressure of related storage devices is reduced, the routing information can be updated more frequently, and accuracy of the routing information is further ensured.
Fig. 3 shows a processing flow chart of a routing information query method provided according to an embodiment of the present specification, which includes step S302 to step S306.
Step S302: and receiving a routing information reading request sent by a target data management node in the distributed database system.
Step S304: and responding to the routing information reading request, and determining a target data management node group containing the target data management node as a to-be-queried data management node group in the distributed database system.
Step S306: and traversing the data management nodes contained in the data management node group to be queried, and determining the node routing information of the target data management node.
The route information query method in steps S302 to S306 is similar to the record of the route information query for the designated data management node in the route information creation method in steps S102 to S108, and therefore is not described herein again.
The foregoing is a schematic scheme of a routing information query method according to this embodiment. It should be noted that the technical solution of the routing information query method and the technical solution of the routing information creation method belong to the same concept, and details of the technical solution of the routing information query method, which are not described in detail, can be referred to the description of the technical solution of the routing information creation method.
In the routing information query method provided in an embodiment of the present specification, a target data management node group including a target data management node is determined in a distributed database system through a received routing information read request, and then the target data management node group is traversed to determine node routing information of the target data management node, so that the routing information of a specific data management node is read from the target routing information created by the routing information creation method provided in an embodiment of the present specification, flexibility of querying the data management node is ensured, and a process of updating the distributed database system is not affected.
The following describes the routing information creating method and the routing information querying method further with reference to fig. 4 by taking an application of the routing information creating method and the routing information querying method provided in this specification in OceanBase as an example. Fig. 4 shows a flowchart of a processing procedure of a routing information creating method and a routing information querying method provided in an embodiment of the present specification, and the specific steps include step S402 to step S436.
Step S402: and traversing the distributed database system to obtain the execution state of the data nodes in the distributed database system.
Specifically, the OceanBase database is queried to acquire the execution state of each partition in OceanBase.
Step S404: and determining the data node with the execution state being a read-write state as a data management node.
Specifically, the partition whose execution state is the read-write state in the OceanBase database is determined to be the leader.
Step S406: and inquiring the geographic position information and the equipment code corresponding to the data management node.
Specifically, the geographic location and the device code corresponding to the 1000 inquired leaders are determined.
Step S408: and determining the node position information of the data management node according to the geographical position information and the equipment code.
Specifically, the geographical position and the device code corresponding to each leader are combined to obtain the node position information of each leader.
Step S410: and clustering the at least one data management node according to each piece of geographical position information to obtain a target data management node group.
Specifically, the 1000 leaders are clustered according to the geographical position information of each leader, and the leaders in the same machine room are divided into the same target data management node group.
Step S412: and constructing identification information corresponding to the target data management node group, and determining group position information corresponding to the target data management node group according to the node position information.
Specifically, 6 target data management node groups are obtained in total, that is, 1000 leaders are distributed in 6 machine rooms, each target data management node group is named, the names of the leader group 1, the leader group 2, the leader group 3, the leader group 4, the leader group 5 and the leader group 6 are determined, and the group position information of the six groups is determined to be the machine room 1, the machine room 2, the machine room 3, the machine room 4, the machine room 5 and the machine room 6 respectively.
Step S414: and creating target routing information corresponding to the target data management node group according to the identification information and the group position information.
Specifically, according to the obtained identification information and the group position information, six target routing information < leader group 1, machine room 1>, < leader group 2, machine room 2>, < leader group 3, machine room 3>, < leader group 4, machine room 4>, < leader group 5, machine room 5>, < leader group 6, and machine room 6> are created.
Step S416: and receiving a data management node insertion instruction.
Specifically, the data management node insertion instruction is received when a new data management node is elected.
Step S418: and responding to the data management node insertion instruction, and determining a data management node to be updated and the position information of the node to be updated of the data management node to be updated.
Specifically, according to the data management node insertion instruction, the newly added data management node leader1001 is determined, and the node position information of the leader1001 is determined.
Step S420: and updating the target routing information.
Specifically, under the condition that the leader1001 is determined to be in the leader groups 1 to 6, the leader1001 is inserted into the corresponding group, and the corresponding routing information is not changed; under the condition that the leader1001 is determined not to be in the leader groups 1 to 6, a leader group 7 containing the leader1001 is newly established, and then the routing information < leader group 7, machine room 7> corresponding to the leader group 7 is established according to the machine room where the leader1001 is located as the machine room 7.
Step S422: a data management node removal instruction is received.
Specifically, when the original data management node is removed, a data management node removal instruction is received.
Step S424: and responding to the data management node removing instruction, and determining a data management node to be removed and the position information of the node to be removed of the data management node to be removed.
Specifically, according to the data management node removal instruction, the removed data management node leader1 is determined, and the node position information of the leader1 is determined.
Step S426: and updating the target routing information.
Specifically, according to the node position information of the leader1, removing the data from the corresponding target data management node group, and then determining whether other data management nodes exist in the removed target data management node group, if so, the target routing information is not changed; if no other data management node exists, the target data management node group corresponding to the leader1 is deleted, and the corresponding target routing information is also deleted.
When the route information of the OceanBase database is maintained and updated subsequently, if relevant maintenance personnel find that the data output of the leader100 is always abnormal, relevant equipment of the leader100 needs to be checked, and in this case, the following steps in the route information query method are executed later.
Step S428: receiving a routing information reading request sent by a target data management node in the distributed database system.
Specifically, a route information read request for a target data management node is received.
Step S430: and responding to the routing information reading request, and determining a target data management node group containing the target data management node as a data management node group to be inquired in the distributed database system.
Specifically, according to the routing information reading request, determining that the leader group 2 includes the target data management node.
Step S432: and traversing the data management node group to be queried and determining a target device code of the target data management node.
Specifically, the leader group 2 is queried, and the device code of the target data management node is determined to be Ap100.
Step S434: and determining the target node identification of the target data management node according to the routing information reading request.
Specifically, the routing information reading request is analyzed, and the target node identifier of the target data management node is determined to be leader100.
Step S436: and determining the node routing information of the target data management node according to the target node identification and the target equipment code.
Specifically, node routing information < leader100, ap100> of the leader100 is created, and the node routing information is fed back to the maintenance personnel, so that the maintenance personnel can smoothly query the position where the leader100 is located, it should be noted that, if the design forms of the machine codes in the two pieces of geographical location information are the same, the geographical location information may be added to the node routing information in this case, for example, in this embodiment, the final node routing information may be < leader100, machine room 2-Ap100>.
In the routing information creating method provided in an embodiment of the present specification, data management nodes included in a distributed database system are determined, then node position information of each data management node is determined, the data management nodes are clustered according to the node position information to obtain a target data management node group, then identification information and group position information are determined for the target data management node group, and finally target routing information corresponding to the target data management node group is created according to the identification information and the group position information.
In the routing information query method provided in an embodiment of the present specification, a target data management node group including a target data management node is determined in a distributed database system through a received routing information read request, and then the target data management node group is traversed to determine node routing information of the target data management node, so that the routing information of a specific data management node is read from the target routing information created by the routing information creation method provided in an embodiment of the present specification, flexibility of querying the data management node is ensured, and a process of updating the distributed database system is not affected.
Corresponding to the above method embodiment, the present specification further provides an embodiment of a routing information creating apparatus, and fig. 5 shows a schematic diagram of a routing information creating apparatus provided in an embodiment of the present specification. As shown in fig. 5, the apparatus includes:
a traversal module 502 configured to determine at least one data management node by traversing the distributed database system;
a clustering module 504, configured to determine 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;
a constructing module 506 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;
a creating module 508, configured to create target routing information corresponding to the target data management node group according to the identification information and the group location information.
In an alternative embodiment, the traversal module 502 is further configured to:
traversing the distributed database system to obtain the execution state of the data nodes in the distributed database system; and determining the data node with the execution state being the read-write state as a data management node.
In an alternative embodiment, the clustering module 504 is further configured to:
under the condition that the attribute information of the distributed database system is position attribute information, determining node position information of each data management node according to the position attribute information, and taking the node position information as the node information; or, under the condition that the attribute information of the distributed database system is lease attribute information, determining node lease information of each data management node according to the lease attribute information as the node information.
In an alternative embodiment, the clustering module 504 is further configured to:
inquiring the geographical position information and the equipment code corresponding to the data management node according to the position attribute information; and determining the node position information of the data management node according to the geographical position information and the equipment code.
In an alternative embodiment, the clustering module 504 is further configured to:
reading geographical position information in the node position information of each data management node; and clustering the at least one data management node according to each piece of geographical position information to obtain a target data management node group.
In an optional embodiment, the routing information creating apparatus further includes:
the insertion module is configured to receive a data management node insertion instruction; responding to the data management node insertion instruction, and determining a data management node to be updated and node information to be updated of the data management node to be updated; and under the condition that the position information of the node to be updated contained in the information of the node to be updated is determined to be the same as the position information of the group, inserting the data management node to be updated into the target data management node group.
In an optional embodiment, the routing information creating apparatus further includes:
the group creation module is configured to construct a data management node group to be updated containing the data management node to be updated; establishing identification information to be updated corresponding to the data management node group to be updated, and determining position information of a group to be updated corresponding to the data management node group to be updated according to the position information of the node to be updated; and creating the routing information to be updated corresponding to the data management node group to be updated according to the identification information to be updated and the group position information to be updated.
In an optional embodiment, the routing information creating apparatus further includes:
a removal module configured to receive a data management node removal instruction; responding to the data management node removing instruction, and determining a data management node to be removed and node information to be removed of the data management node to be removed; and under the condition that the position information of the node to be removed contained in the information of the node to be removed is determined to be the same as the group position information, deleting the data management node to be removed from the target data management node group.
In an optional embodiment, the routing information creating apparatus further includes:
the deleting module is configured to determine that the target data management node group corresponding to the to-be-removed node information is a to-be-deleted data management node group; and inquiring the data management node group to be deleted, deleting the data management node group to be deleted under the condition that the data management node group to be deleted does not contain a data management node, and deleting the target routing information corresponding to the data management node group to be deleted.
In an optional embodiment, the routing information creating apparatus further includes:
the reading module is configured to receive a routing information reading request sent by a target data management node in the distributed database system; responding to the routing information reading request, and determining a target data management node group containing the target data management node as a data management node group to be inquired in the distributed database system; and traversing the data management nodes contained in the data management node group to be queried, and determining the node routing information of the target data management node.
In an alternative embodiment, the reading module is further configured to:
traversing the data management node group to be queried and determining a target equipment 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; and determining the node routing information of the target data management node according to the target node identification and the target equipment code.
The routing information creating apparatus provided in an embodiment of the present specification implements aggregation of routing information, reduces the number of routing entries, relieves hardware pressure on related storage devices, and enables the routing information to be updated more frequently, thereby further ensuring accuracy of the routing information.
The foregoing is a schematic scheme of a routing information creating apparatus according to the present embodiment. It should be noted that the technical solution of the routing information creating apparatus and the technical solution of the routing information creating method belong to the same concept, and details that are not described in detail in the technical solution of the routing information creating apparatus can be referred to the description of the technical solution of the routing information creating method.
Corresponding to the foregoing method embodiment, this specification further provides a routing information query apparatus embodiment, and fig. 6 shows a schematic diagram of a routing information query apparatus provided in an embodiment of this specification. As shown in fig. 6, the apparatus includes:
a receiving module 602 configured to receive a routing information reading request sent for a target data management node in the distributed database system;
a response module 604, configured to respond to the routing information reading request, in the distributed database system, determine a target data management node group including the target data management node as a data management node group to be queried;
a determining module 606 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.
The routing information query device provided in an embodiment of the present specification realizes that, in the target routing information created by the routing information creation method provided in an embodiment of the present specification, the routing information of a specific data management node is read, so that flexibility of querying the data management node is ensured, and a process of updating the distributed database system is not affected.
The above is an illustrative scheme of a routing information query device of this embodiment. It should be noted that the technical solution of the routing information query apparatus and the technical solution of the routing information query method belong to the same concept, and details that are not described in detail in the technical solution of the routing information query apparatus can be referred to the description of the technical solution of the routing information query method.
FIG. 7 illustrates a block diagram of a computing device 700 provided in accordance with one embodiment of the present description. The components of the computing device 700 include, but are not limited to, memory 710 and a processor 720. Processor 720 is coupled to memory 710 via bus 730, and database 750 is used to store data.
Computing device 700 also includes access device 740, access device 740 enabling computing device 700 to communicate via one or more networks 760. Examples of such networks include the 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. Access device 740 may include one or more of any type of network interface (e.g., a Network Interface Card (NIC)) whether wired or wireless, such as an IEEE802.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 so forth.
In one embodiment of the present description, the above-described components of computing device 700, as well as other components not shown in FIG. 7, may also be connected to each other, such as by a bus. It should be understood that the block diagram of the computing device architecture shown in FIG. 7 is for purposes of example only and is not limiting as to the scope of the present description. Those skilled in the art may add or replace other components as desired.
Computing device 700 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., tablet, personal digital assistant, laptop, notebook, netbook, etc.), mobile phone (e.g., smartphone), wearable computing device (e.g., smartwatch, smartglasses, etc.), or other type of mobile device, or a stationary computing device such as a desktop computer or PC. Computing device 700 may also be a mobile or stationary server.
The memory 710 is used for storing computer-executable instructions, and the processor 720 is used for implementing a routing information creating method and a routing information querying method when executing the computer-executable instructions.
The above is an illustrative scheme of a computing device of the present embodiment. It should be noted that, the technical solution of the computing device belongs to the same concept as the technical solution of the above-mentioned route information creating method and route information querying method, and details of the technical solution of the computing device, which are not described in detail, can be referred to the description of the technical solution of the above-mentioned route information creating method and route information querying method.
An embodiment of the present specification also 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.
The above is an illustrative scheme of a computer-readable storage medium of the embodiment. It should be noted that the technical solution of the storage medium belongs to the same concept as the technical solution of the above-mentioned route information creating method and route information querying method, and details that are not described in detail in the technical solution of the storage medium can refer to descriptions of the technical solutions of the above-mentioned route information creating method and route information querying method.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The computer instructions comprise computer program code which may be in source code form, object code form, an executable file or some intermediate form, or the like. The computer-readable medium may include: any entity or device capable of carrying the computer program code, recording medium, U.S. disk, removable hard disk, magnetic diskette, optical disk, computer Memory, read-Only Memory (ROM), random Access Memory (RAM), electrical carrier wave signal, telecommunications signal, and software distribution medium, etc. It should be noted that the computer readable medium may contain content that is subject to appropriate increase or decrease as required by legislation and patent practice in jurisdictions, for example, in some jurisdictions, computer readable media does not include electrical carrier signals and telecommunications signals as is required by legislation and patent practice.
It should be noted that, for the sake of simplicity, the foregoing method embodiments are described as a series of acts, but those skilled in the art should understand that the present embodiment is not limited by the described acts, because some steps may be performed in other sequences or simultaneously according to the present embodiment. Further, those skilled in the art should also appreciate that the embodiments described in this specification are preferred embodiments and that acts and modules referred to are not necessarily required for an embodiment of the specification.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to the related descriptions of other embodiments.
The preferred embodiments of the present specification disclosed above are intended only to aid in the description of the specification. Alternative embodiments are not exhaustive and do not limit the invention to the precise embodiments described. Obviously, many modifications and variations are possible in light of the teaching of the embodiments of the present disclosure. The embodiments were chosen and described in order to best explain the principles of the embodiments and the practical application, to thereby enable others skilled in the art to best understand and utilize the embodiments. The specification is limited only by the claims and their full scope and equivalents.

Claims (16)

1. A route information creating method is applied to a distributed database system and comprises the following steps:
determining at least one data management node by traversing the distributed database system;
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 position information corresponding to the target data management node group according to the node information;
and creating target routing information corresponding to the target data management node group according to the identification information and the group position information.
2. The method of claim 1, the determining at least one data management node by traversing the distributed database system, comprising:
traversing the distributed database system to obtain the execution state of the data nodes in the distributed database system;
and determining the data node with the execution state being the read-write state as a data management node.
3. The method of claim 1, the determining node information for each data management node based on attribute information of the distributed database system, comprising:
under the condition that the attribute information of the distributed database system is position attribute information, determining node position information of each data management node according to the position attribute information, and taking the node position information as the node information; alternatively, the first and second electrodes may be,
and under the condition that the attribute information of the distributed database system is lease attribute information, determining node lease information of each data management node according to the lease attribute information, wherein the node lease information is used as the node information.
4. The method according to claim 3, in the case that the node information is node location information, the determining of the node location information of any data management node of at least one data management node includes:
inquiring the geographical position information and the equipment code corresponding to the data management node according to the position attribute information;
and determining the node position information of the data management node according to the geographical position information and the equipment code.
5. The method of claim 4, clustering the at least one data management node according to the node information to obtain a target data management node group, comprising:
reading geographical position information in the node position information of each data management node;
and clustering the at least one data management node according to each piece of geographical position information to obtain a target data management node group.
6. The method of claim 1, after creating the target routing information corresponding to the target data management node group, further comprising:
receiving a data management node insertion instruction;
responding to the data management node insertion instruction, and determining a data management node to be updated and node information to be updated of the data management node to be updated;
and under the condition that the position information of the node to be updated contained in the information of the node to be updated is determined to be the same as the position information of the group, inserting the data management node to be updated into the target data management node group.
7. The method of claim 6, in the case that the node information to be updated does not belong to group location information of any target data management node group in the distributed database system, further comprising:
constructing a data management node group to be updated containing the data management node to be updated;
establishing identification information to be updated corresponding to the data management node group to be updated, and determining position information of a group to be updated corresponding to the data management node group to be updated according to the position information of the node to be updated;
and creating the routing information to be updated corresponding to the data management node group to be updated according to the identification information to be updated and the group position information to be updated.
8. The method of claim 1, after creating the target routing information corresponding to the target data management node group, further comprising:
receiving a data management node removal instruction;
responding to the data management node removing instruction, and determining a data management node to be removed and node information to be removed of the data management node to be removed;
and under the condition that the position information of the node to be removed contained in the information of the node to be removed is determined to be the same as the group position information, deleting the data management node to be removed from the target data management node group.
9. The method of claim 8, further comprising, after deleting the to-be-removed data management node in the target group of data management nodes:
determining a target data management node group corresponding to the information of the node to be removed as a data management node group to be deleted;
and inquiring the data management node group to be deleted, deleting the data management node group to be deleted under the condition that the data management node group to be deleted does not contain a data management node, and deleting the target routing information corresponding to the data management node group to be deleted.
10. The method of claim 1, after creating the 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 by a target data management node in a distributed database system;
responding to the routing information reading request, and determining a target data management node group containing the target data management node as a data management node group to be inquired in the distributed database system;
and traversing the data management nodes contained in the data management node group to be queried, and determining the node routing information of the target data management node.
11. The method of claim 10, wherein traversing the data management nodes included in the data management node group to be queried to determine the node routing information of the target data management node comprises:
traversing the data management node group to be queried and determining a target equipment 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;
and determining the node routing information of the target data management node according to the target node identification and the target equipment code.
12. A routing information query method is applied to a distributed database system and comprises the following steps:
receiving a routing information reading request sent by a target data management node in a distributed database system;
responding to the routing information reading request, and determining a target data management node group containing the target data management node as a data management node group to be inquired in the distributed database system;
and traversing the data management nodes contained in the data management node group to be queried, and determining the node routing information of the target data management node.
13. A routing information creating apparatus 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;
the clustering module is configured to determine 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;
the building module is configured to build identification information corresponding to the target data management node group and determine group position information corresponding to the target data management node group according to the node information;
and the creating module is configured to create target routing information corresponding to the target data management node group according to the identification information and the group position information.
14. A routing information inquiry device is applied to a distributed database system and comprises:
the system comprises a receiving module, a sending module and a receiving module, wherein the receiving module is configured to receive a route information reading request sent by a target data management node in the distributed database system;
a response module configured to respond to the routing information reading request, and determine, in the distributed database system, a target data management node group including the target data management node as a data management node group to be queried;
and the determining module is configured to traverse the data management nodes contained in the data management node group to be queried and determine the node routing information of the target data management node.
15. A computing device, comprising:
a memory and a processor;
the memory is for storing computer-executable instructions which, when executed by the processor, implement the steps of the method of any one of claims 1 to 11 or 12.
16. A computer readable storage medium storing computer instructions which, when executed by a processor, carry out the steps of the method of any one of claims 1 to 11 or 12.
CN202211271331.XA 2022-10-17 2022-10-17 Routing information creating method and device, and routing information inquiring method and device Pending CN115665144A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211271331.XA CN115665144A (en) 2022-10-17 2022-10-17 Routing information creating method and device, and routing information inquiring method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211271331.XA CN115665144A (en) 2022-10-17 2022-10-17 Routing information creating method and device, and routing information inquiring method and device

Publications (1)

Publication Number Publication Date
CN115665144A true CN115665144A (en) 2023-01-31

Family

ID=84988710

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211271331.XA Pending CN115665144A (en) 2022-10-17 2022-10-17 Routing information creating method and device, and routing information inquiring method and device

Country Status (1)

Country Link
CN (1) CN115665144A (en)

Similar Documents

Publication Publication Date Title
CN109960710A (en) Method of data synchronization and system between database
US20190042659A1 (en) Data writing and reading and apparatus and cloud storage system
US20140237024A1 (en) Network communication devices and file tracking methods thereof
CN111258978B (en) Data storage method
CN109213604A (en) A kind of management method and device of data source
CN108932286A (en) A kind of date storage method, data query method and device
CN113704790A (en) Abnormal log information summarizing method and computer equipment
GB2458204A (en) Selecting attributes of resources of a system with the highest degree of reliability where conflict exists between plural attributes as to the same resources
CN114722092A (en) Time series data processing method, system, storage medium and electronic equipment
CN112491609B (en) Business service-based system application architecture discovery method and system
CN113792008A (en) Method and device for acquiring network topology structure, electronic equipment and storage medium
CN108205559A (en) A kind of data managing method and its equipment
CN115665144A (en) Routing information creating method and device, and routing information inquiring method and device
WO2023071367A1 (en) Processing method and apparatus for communication service data, and computer storage medium
CN107422991B (en) Storage strategy management system
CN116204540A (en) Operation log recording method, device, equipment and storage medium
CN105871659A (en) Monitoring method and device of newly added server
CN115237889A (en) Database switching method and device, storage medium and computer equipment
CN112199426B (en) Interface call management method, device, server and medium under micro-service architecture
CN110569231B (en) Data migration method, device, equipment and medium
CN114816408A (en) Information processing method and device
CN114969083A (en) Real-time data analysis method and system
CN113326276A (en) Graph database updating method and device
US10896159B1 (en) System, method, and computer program for configuration based coexistence routing
CN112948494A (en) Data synchronization method and device, electronic equipment and computer readable medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination