Database response method and device, electronic equipment and storage medium

By receiving database requests in a distributed database, extracting data node identification and selecting appropriate computing nodes to respond, the problem of slow response speed of distributed database requests is solved, and a more efficient database response is achieved.

CN119719203APending Publication Date: 2025-03-28JINZHUAN INFORMATION TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411881999.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-19
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

In the prior art, distributed databases have a problem of slow response speed when requesting responses, mainly because computing nodes and data nodes are usually deployed in different server devices or computer rooms, resulting in cross-device or cross-device room communication.

Method used

By receiving the database request, the data node identification is extracted, and based on the identification, combined with the preset computing node selection strategy, the target computing node is determined, so as to respond to the database request through the target computing node.

Benefits of technology

This method can select target computing nodes that match the data node identification to respond in a targeted manner, significantly improving the response speed of the database, and solving the problem of slow response speed of distributed database requests.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119719203A_ABST
    Figure CN119719203A_ABST
Patent Text Reader

Abstract

The invention relates to a database response method and device, electronic equipment and a storage medium, and the method comprises the steps: receiving a database request, extracting a data node identifier from the database request, and determining a target calculation node based on the data node identifier in combination with a preset calculation node selection strategy, responding to the database request through the target computing node to obtain a database response result corresponding to the database request; therefore, the target computing node matched with the data node identifier can be selected in a targeted manner to carry out request response, the problem that the response speed is low when a distributed database carries out request response in the prior art is solved, and the response speed of the database can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a database response method, device, electronic equipment and storage medium. Background Art

[0002] With the continuous development of computer technology, various Internet applications and devices are increasing. In the operation of Internet applications or devices, databases are indispensable. As a common underlying data storage tool, databases are widely used in various industries. For some large databases, a large number of server devices are required to build them. At this time, due to the large number of server devices, there are many restrictions, such as site, transportation, personnel configuration, etc., which makes it difficult to complete the construction of the entire database in one location.

[0003] Existing related technologies usually use distributed databases to overcome the problem that it is difficult to complete the entire construction of a database in one location; a distributed database is a database built in multiple locations with different numbers of devices for coordinated use, specifically using an architecture that separates computing and storage. Although the distributed database approach solves the problem of difficulty in building a database, in specific applications, the computing nodes used for computing and the data nodes used for storage in the database are usually deployed on different server devices, and request responses require the computing nodes and data nodes to communicate in coordination, that is, when a distributed database responds to a request, it requires cross-device or cross-computer room communication. Since there is a certain physical distance in cross-device or cross-computer room communication, cross-device or cross-computer room traffic will inevitably be generated at this time, and the database response speed will also be reduced. Summary of the invention

[0004] The present application provides a database response method, device, electronic device and storage medium to solve the problem of slow response speed when a distributed database performs request response in the prior art.

[0005] In a first aspect, the present application provides a database response method, comprising:

[0006] Receive database requests;

[0007] Extracting a data node identifier from the database request;

[0008] Based on the data node identifier and in combination with a preset computing node selection strategy, determine a target computing node;

[0009] The target computing node responds to the database request to obtain a database response result corresponding to the database request.

[0010] Optionally, the determining the target computing node based on the data node identifier and in combination with a preset computing node selection strategy includes:

[0011] Determine a target data node corresponding to the data node identifier;

[0012] Based on the computing node selection strategy, determining the server where the target data node is located as a target server, wherein the target server includes at least one first computing node;

[0013] In a case where the target data node matches the first computing node, the first computing node is determined as the target computing node.

[0014] Optionally, after determining the server where the target data node is located as the target server based on the computing node selection strategy, the method further includes:

[0015] Determining whether the target data node matches each of the first computing nodes;

[0016] In the case that the target data node does not match any of the first computing nodes, determining a target computer room corresponding to the target server, wherein the target computer room includes at least one second computing node;

[0017] Determining whether the target data node matches each of the second computing nodes;

[0018] In a case where the target data node matches the second computing node, the second computing node is determined as the target data node.

[0019] Optionally, after determining whether the target data node matches each of the second computing nodes, the method further includes:

[0020] In the case that the target data node does not match any of the second computing nodes, determining a computer room in the same region corresponding to the target server, wherein the computer room in the same region includes at least one third computing node;

[0021] Determine whether the target data node matches each of the third computing nodes;

[0022] In a case where the target data node matches the third computing node, the third computing node is determined as the target data node.

[0023] Optionally, after determining whether the target data node matches each of the second computing nodes, the method further includes:

[0024] When at least two of the second computing nodes match the target data node, acquiring real-time status information of each of the second computing nodes;

[0025] Determine priority information corresponding to each of the second computing nodes according to the real-time status information;

[0026] Based on the priority information, the target computing node is determined.

[0027] Optionally, determining priority information corresponding to each of the second computing nodes according to the real-time status information includes:

[0028] For each of the second computing nodes, extracting load connection number information and response delay information from the real-time status information;

[0029] Based on the load connection number information, combined with the computer room connection number information corresponding to the target computer room, a weight calculation is performed to obtain a load weight;

[0030] Performing weight calculation based on the response delay information to obtain a response delay weight;

[0031] The priority information corresponding to the second computing node is generated according to the load weight and the response delay weight.

[0032] Optionally, determining whether the target data node matches each of the first computing nodes includes:

[0033] Determine a first cluster identifier to which the target data node belongs;

[0034] Determine a second cluster identifier to which the first computing node belongs;

[0035] When the first cluster identifier is consistent with the second cluster identifier, determining that the target data node matches the first computing node;

[0036] When the first cluster identifier is inconsistent with the second cluster identifier, it is determined that the target data node does not match the first computing node.

[0037] In a second aspect, the present application provides a database response device, including:

[0038] A receiving module, used for receiving a database request;

[0039] An extraction module, used to extract a data node identifier from the database request;

[0040] A selection module, configured to determine a target computing node based on the data node identifier and in combination with a preset computing node selection strategy;

[0041] The response module is used to respond to the database request through the target computing node to obtain a database response result corresponding to the database request.

[0042] In a third aspect, an electronic device is provided, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;

[0043] Memory, used to store computer programs;

[0044] The processor is used to implement the database response method described in any one of the first aspects when executing the program stored in the memory.

[0045] According to a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the database response method according to any one of the first aspects is implemented.

[0046] The embodiment of the present application receives a database request and extracts a data node identifier from the database request, determines a target computing node based on the data node identifier and a preset computing node selection strategy, and then responds to the database request through the target computing node to obtain a database response result corresponding to the database request; thereby, the target computing node matching the data node identifier can be selected in a targeted manner to respond to the request, which can effectively improve the response speed of the database and solve the problem of slow response speed of the distributed database when responding to requests in the existing related technologies. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Figure 1 A flowchart of a database response method provided in an embodiment of the present application;

[0048] Figure 2 A schematic diagram of the structure of a database response device provided in an embodiment of the present application;

[0049] Figure 3 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0050] The following will describe the embodiments of the present invention with reference to the accompanying drawings and preferred embodiments. Those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be understood that the preferred embodiments are only for illustrating the present invention, not for limiting the scope of protection of the present invention.

[0051] The process of the database responding to a request usually requires the cooperation of multiple devices. The specific process is as follows:

[0052] The client initiates a database operation request, such as a request to query, insert, update, or delete data. The database driver receives the request from the client and converts it into a format that the database system can understand. The database driver then sends the request to the database system through the network. This database system may be a single database instance or the entrance to a distributed database system. In a distributed database system, the request will be assigned to an idle computing node for processing based on the idle status of each computing node. The computing node receives the request and starts processing, such as parsing the query, optimizing the execution plan, and distributing tasks to the data node. The data node or storage node receives the request from the computing node, retrieves or updates the data, and returns the query result or confirmation information to the computing node. The computing node processes the results returned from the data node, which may include data aggregation, sorting, or other transformations, and sends the final result or intermediate status back to the database system through the network. The database driver receives the response from the database system and converts it into a format that the client application can understand and sends it to the client.

[0053] For a distributed database, after receiving a database request, it first determines the idle computing nodes to process the request, and then determines the corresponding data nodes to cooperate in responding. Since a distributed database is usually a database built in multiple computer rooms in multiple locations, that is, the computing nodes and data nodes are usually in different computer rooms or different geographical locations, that is, when the computing nodes and data nodes cooperate in the communication response request, there will be a large delay due to the distance communication, resulting in a problem of reducing the database response speed.

[0054] In order to solve the problem of slow response speed when a distributed database responds to a request in the existing related technology, the present application provides a database response method, device, electronic device and storage medium, which receives a database request and extracts a data node identifier from the database request, determines a target computing node based on the data node identifier and a preset computing node selection strategy, and then responds to the database request through the target computing node to obtain a database response result corresponding to the database request; thereby, the target computing node matching the data node identifier can be selected in a targeted manner to respond to the request, which can effectively improve the response speed of the database and solve the problem of slow response speed when a distributed database responds to a request in the existing related technology.

[0055] Figure 1A flowchart of a database response method provided for an embodiment of the present application. The method can be applied to one or more electronic devices such as a database system, a server, etc. In addition, the execution subject of the method can be hardware or software. When the above-mentioned execution subject is hardware, the execution subject can be one or more of the above-mentioned electronic devices. For example, a single electronic device can execute the method, or a plurality of electronic devices can cooperate with each other to execute the method. When the above-mentioned execution subject is software, the method can be implemented as a plurality of software or software modules, or as a single software or software module. No specific limitation is made here.

[0056] like Figure 1 As shown, a database response method provided in an embodiment of the present application may specifically include the following steps:

[0057] Step S110: receiving a database request.

[0058] The database request may represent a request sent by a client to request a database operation, wherein the client may be a terminal device with networking capabilities, such as a mobile terminal, an Internet of Things device, etc., which is not specifically limited in this embodiment.

[0059] Specifically, the database response method of this embodiment can be applied to an execution subject with database control capability, such as a database system or a server. In the process of receiving a database request, the database driver can receive the client request and convert the client request into a format that can be understood by the database system, that is, a database request.

[0060] Step S120: extracting the data node identifier from the database request.

[0061] Specifically, since a database request can be used to request a database operation, and a database operation can include but is not limited to operations such as query, insert, update or delete, the requested database operation has a specific operation object; after receiving the database request, a data node identifier can be extracted from the database request; the data node identifier can represent the identifier of the node where the operation object requested by the database request is located, such as the Internet Protocol Address (IP) of the data node, the physical address identifier of the data node, etc., and this embodiment does not make specific limitations on this.

[0062] Step S130: Determine the target computing node based on the data node identifier and the preset computing node selection strategy.

[0063] Specifically, after obtaining the data node identifier, a preset computing node selection strategy can be obtained, and the computing node can be selected in combination with the data node identifier, and the computing node that meets the computing node selection strategy is determined as the target computing node; wherein, the computing node selection strategy can represent a pre-configured strategy for selecting computing nodes; it should be noted that the strategy represented by the computing node selection strategy is associated with the data node identifier, for example, the specific strategy can be to select the computing node in the server corresponding to the data node identifier, or to select the computing node in the server room corresponding to the data node identifier, etc. This embodiment does not make specific limitations on this.

[0064] Step S140: respond to the database request through the target computing node to obtain a database response result corresponding to the database request.

[0065] Specifically, after determining the target computing node, the database request can be responded to through the target computing node to obtain a database response result corresponding to the database request, wherein the database response result can represent the result after performing the data operation corresponding to the database request, such as query results, write results, etc., and the process of the target computing node responding can include but is not limited to processing processes such as parsing database requests and communicating and interacting with data nodes. This embodiment does not make specific limitations on this.

[0066] It can be seen that compared with the prior art, after receiving a database request, the computing node is first determined, and then the computing node is used to determine the data node and communicate with each other. Since the data node is a fixed node corresponding to the database request, the predetermined computing node is usually not on the same server as the data node, which leads to the problem of slow request response speed. After receiving a database request, the present embodiment can first determine the data node identifier corresponding to the database request, and then select the target computing node matching it according to the data node identifier and the computing node selection strategy; wherein the computing node selection strategy and the data node identifier have a preset association, so that the target computing node matching the data node identifier can be selected according to the computing node selection strategy, for example, the computing node selection strategy can be a strategy for selecting the computing node in the same server device as the data node identifier as the target computing node, and when the computing node and storage node in the same server device are used for communication and interaction, not only will cross-device or cross-computer room traffic be generated, but also the response speed is greatly improved, so that the target computing node matching the data node identifier can be selected in a targeted manner for request response, which can effectively improve the response speed of the database and solve the problem of slow response speed when the distributed database in the prior art responds to requests.

[0067] In an optional embodiment of the present application, step S130 determines the target computing node based on the data node identifier and a preset computing node selection strategy, and may specifically include the following steps: determining the target data node corresponding to the data node identifier; based on the computing node selection strategy, determining the server where the target data node is located as the target server, the target server including at least one first computing node; when the target data node matches the first computing node, determining the first computing node as the target computing node.

[0068] After determining the data node identifier, this embodiment can determine the target data node corresponding to the data node identifier, and the target data node can represent the data node marked by the data node identifier. At this time, based on the computing node selection strategy, the server where the target data node is located can be determined as the target server, and the target server includes at least one first computing node, wherein the first computing node can represent the computing node configured in the target server. It is also possible to determine whether the target data node matches each first computing node based on the computing node selection strategy. The specific judgment method can be to determine whether the first computing node and the target data node are in the same cluster. When the target data node matches the first computing node, it means that the target data node and the first computing node are in the same cluster. At this time, the first computing node can be determined as the target computing node.

[0069] It can be seen that, in the target server where the target data node is located, the target computing node of the same cluster as the target data node can be determined by the computing node selection strategy in this embodiment; therefore, before implementing the database response method of this application, in the process of node deployment of the database, at least one computing node and at least one data node under the same cluster can be deployed in the same server. Of course, a server can deploy multiple clusters, and this embodiment of the application is not limited to this. Among them, the deployment mode of the computing node and the data node must be the same, so that the clusters do not affect each other, and in the subsequent process of responding to the request on the server, the target computing node in the same server device to which the data node corresponding to the data node identifier belongs can be accurately determined by combining the data node identification with the computing node selection strategy to respond, so that the target computing node matching the data node identification can be selected to respond to the request, which can effectively improve the response speed of the database and solve the problem of slow response speed when the distributed database responds to requests in the existing related technology. In addition, deploying at least one computing node and at least one data node under the same cluster in the same server in advance can not only improve the response speed of the database, but also facilitate operation and maintenance and improve management efficiency.

[0070] In an optional embodiment of the present application, after the server where the target data node is located is determined as the target server based on the computing node selection strategy, the following steps may be specifically included: determining whether the target data node matches each first computing node; if the target data node does not match each first computing node, determining the target computer room corresponding to the target server, the target computer room contains at least one second computing node; determining whether the target data node matches each second computing node; if the target data node matches the second computing node, determining the second computing node as the target data node.

[0071] After determining the target server, this embodiment can determine whether the target data node matches each first computing node. If the target data node does not match each first computing node, it means that there is no computing node in the target server that belongs to the same cluster as the target data node, or the computing node in the target server that belongs to the same cluster as the target data node is in a downtime state and cannot respond to the request. At this time, the target computer room corresponding to the target server can be determined, wherein the target computer room can represent the computer room to which the target server belongs, the target computer room can contain at least one second computing node, and the second computing node device can represent the computing nodes in other servers in the target computer room except the target server. It can also be determined whether the target data node matches each second computing node based on the computing node selection strategy. The specific judgment method can be to determine whether the second computing node and the target data node are in the same cluster. If the target data node matches the second computing node, it means that the target data node and the second computing node are in the same cluster. At this time, the second computing node can be determined as the target computing node.

[0072] In an optional embodiment of the present application, after determining whether the target data node matches each second computing node, the following steps may be specifically included: if the target data node does not match each second computing node, determine the same-region computer room corresponding to the target server, and the same-region computer room contains at least one third computing node; determine whether the target data node matches each third computing node; if the target data node matches the third computing node, determine the third computing node as the target data node.

[0073] After determining whether the target data node matches each second computing node, if the target data node does not match each second computing node, it means that there is no computing node in the target computer room that belongs to the same cluster as the target data node, or the computing node in the target computer room that belongs to the same cluster as the target data node is in a downtime state and cannot respond to the request. At this time, the same regional computer room corresponding to the target server can be determined, wherein the same regional computer room can represent the computer room in the same region to which the target server belongs; wherein the same region can be the same urban area, the same town area, or other same geographical areas, etc., and this embodiment does not make specific restrictions on this; and the same regional computer room can contain at least one third computing node, and the third computing node device can represent the computing nodes in other servers in the same regional computer room except the target computer room. It is also possible to determine whether the target data node matches each third computing node based on the computing node selection strategy. The specific judgment method can be to determine whether the third computing node and the target data node are in the same cluster. When the target data node matches the third computing node, it means that the target data node and the third computing node are in the same cluster. At this time, the third computing node can be determined as the target computing node.

[0074] It can be seen that this embodiment can use the computing node selection strategy to search for the target computing node that matches the target data node from the target server, target computer room and computer room in the same area corresponding to the target data node in turn, that is, give priority to selecting the first computing node in the target server as the target computing node, which can play the role of selecting matching target computing nodes from near to far according to the physical distance, so that the target computing node that matches the data node identifier can be selected in a targeted manner to respond to the request, which can effectively improve the response speed of the database and solve the problem of slow response speed of the distributed database when responding to requests in the existing related technologies.

[0075] In an optional embodiment of the present application, after determining whether the target data node matches each second computing node, the following steps may be specifically included: when at least two second computing nodes match the target data node, obtaining real-time status information of each second computing node; determining priority information corresponding to each second computing node based on the real-time status information; and determining the target computing node based on the priority information.

[0076] After determining whether the target data node matches each second computing node, this embodiment needs to perform a separate matching judgment on each second computing node. When at least two second computing nodes match the target data node, the real-time status information of each second computing node can be obtained. The real-time status information can indicate the current real-time status of the second computing node, such as the number of connected persons, response status, etc. Then, the priority information corresponding to each second computing node can be determined based on the real-time status information. The priority information can indicate the priority level of the current status of the second computing node, so that the target computing node can be determined based on the priority information, wherein the target computing node can indicate the second computing node corresponding to the priority information with the highest priority level.

[0077] It can be seen that when this embodiment determines that at least two second computing nodes match the target data node, it can perform priority judgment based on the real-time status information of the second computing nodes and select the second computing node with the highest priority as the target computing node, thereby improving the speed of responding to server requests.

[0078] Of course, in the aforementioned embodiment, when it is determined that at least two first computing nodes match the target data node, or when it is determined that at least two third computing nodes match the target data node, the aforementioned steps can be executed to perform priority judgment and determine the target computing node, which will not be repeated here.

[0079] In an optional embodiment of the present application, priority information corresponding to each second computing node is determined based on real-time status information, which may specifically include the following steps: for each second computing node, extracting load connection number information and response delay information from the real-time status information; performing weight calculation based on the load connection number information and the computer room connection number information corresponding to the target computer room to obtain the load weight; performing weight calculation based on the response delay information to obtain the response delay weight; and generating priority information corresponding to the second computing node based on the load weight and the response delay weight.

[0080] In the process of determining the priority information corresponding to each second computing node according to the real-time status information, this embodiment can extract the load connection number information and the response delay information from the real-time status information for each second computing node, wherein the load connection number information can indicate the number of loads currently connected to the second computing node, and the response delay information can indicate the response delay of the second computing node, for example, the response delay information can be the response time of the second computing node executing SELECT 1 FROM DUAL; thus, the load weight can be obtained by weight calculation based on the load connection number information and the computer room connection number information corresponding to the target computer room, and the load weight can indicate the weight corresponding to the current load number of the second computing node, and the computer room connection number information can indicate the sum of the load connection numbers of all computing nodes in the target computer room, and the specific weight calculation method can be to divide the number of connections corresponding to the load connection number information by the total number of connections corresponding to the computer room connection number information, and then obtain the load weight of the computing node. The weight calculation can also be performed based on the response delay information to obtain the response delay weight, wherein the response delay weight can indicate the weight corresponding to the current delay of the second computing node. After obtaining the load weight and response delay weight, the load weight and the response delay weight can be integrated to generate priority information corresponding to the second computing node. The specific generation method can be to determine the set of load weight and response delay weight as the priority information, or to perform weight accumulation processing on the load weight and the response delay weight to obtain the priority information. Of course, other methods can also be used, and this embodiment does not make specific limitations on this.

[0081] It should be noted that in the process of performing weight calculation based on response delay information to obtain response delay weight, the weight calculation can be performed in a normalized manner. For example, when the response delay information is the response time of the second computing node executing SELECT1FROM DUAL, the weight calculation can be performed at this time. The response time of the second computing node executing select1from dual can be normalized to a normalized number of (0,1) according to the normalization algorithm, so that the normalized number is determined as the response delay weight corresponding to the response delay information. Of course, the above is only an example, and this embodiment does not specifically limit this.

[0082] In an optional embodiment of the present application, determining whether the target data node matches each first computing node may specifically include the following steps: determining the first cluster identifier to which the target data node belongs; determining the second cluster identifier to which the first computing node belongs; when the first cluster identifier and the second cluster identifier are consistent, determining that the target data node matches the first computing node; when the first cluster identifier and the second cluster identifier are inconsistent, determining that the target data node does not match the first computing node.

[0083] In the process of determining whether the target data node matches each first computing node, this embodiment can determine the first cluster identifier to which the target data node belongs, where the first cluster identifier represents an identifier used to mark the cluster to which the target data node belongs; it can also determine the second cluster identifier to which the first computing node belongs, where the second cluster identifier represents an identifier used to mark the cluster to which the first computing node belongs; thereby determining whether the first cluster identifier is consistent with the second cluster identifier. When the first cluster identifier is consistent with the second cluster identifier, it indicates that the target data node and the first computing node belong to the same cluster, and at this time, it can be determined that the target data node matches the first computing node; and when the first cluster identifier is inconsistent with the second cluster identifier, it indicates that the target data node and the first computing node do not belong to the same cluster, and it is determined that the target data node does not match the first computing node.

[0084] It can be seen that in the present implementation, in the process of determining whether the target data node matches each first computing node, the target data node and the first computing node are determined by determining whether they belong to the same cluster. Correspondingly, in the process of determining whether the target data node matches each second computing node in the aforementioned embodiment, or in the process of determining whether the target data node matches each third computing node in the aforementioned embodiment, the steps of the present embodiment can be used to determine whether the target data node and the second computing node match by determining whether they belong to the same cluster, or to determine whether the target data node and the third computing node match by determining whether they belong to the same cluster; the specific process is as described above and will not be repeated here.

[0085] like Figure 2 As shown, the present application also discloses an embodiment, providing a database response device, including:

[0086] A receiving module 210, configured to receive a database request;

[0087] An extraction module 220, configured to extract a data node identifier from the database request;

[0088] A selection module 230, configured to determine a target computing node based on the data node identifier and in combination with a preset computing node selection strategy;

[0089] The response module 240 is used to respond to the database request through the target computing node to obtain a database response result corresponding to the database request.

[0090] In an optional embodiment of the present application, the selection module 230 may include:

[0091] A first determining unit, configured to determine a target data node corresponding to the data node identifier;

[0092] A second determining unit is configured to determine, based on the computing node selection strategy, a server where the target data node is located as a target server, wherein the target server includes at least one first computing node;

[0093] The third determining unit is configured to determine the first computing node as the target computing node if the target data node matches the first computing node.

[0094] In an optional embodiment of the present application, after determining the server where the target data node is located as the target server based on the computing node selection strategy, the selection module 230 may further include:

[0095] a fourth determining unit, configured to determine whether the target data node matches each of the first computing nodes;

[0096] A fifth determining unit, configured to determine a target computer room corresponding to the target server when the target data node does not match any of the first computing nodes, the target computer room including at least one second computing node;

[0097] a sixth determining unit, configured to determine whether the target data node matches each of the second computing nodes;

[0098] A seventh determining unit is configured to determine the second computing node as the target data node when the target data node matches the second computing node.

[0099] In an optional embodiment of the present application, after determining whether the target data node matches each of the second computing nodes, the selection module 230 may further include:

[0100] An eighth determining unit is used to determine a computer room in the same region corresponding to the target server when the target data node does not match any of the second computing nodes, wherein the computer room in the same region includes at least one third computing node;

[0101] a ninth determining unit, configured to determine whether the target data node matches each of the third computing nodes;

[0102] A tenth determining unit is configured to determine the third computing node as the target data node when the target data node matches the third computing node.

[0103] In an optional embodiment of the present application, after determining whether the target data node matches each of the second computing nodes, the selection module 230 may further include:

[0104] A first acquisition unit, configured to acquire real-time status information of each of the second computing nodes when at least two of the second computing nodes match the target data node;

[0105] an eleventh determining unit, configured to determine priority information corresponding to each of the second computing nodes according to the real-time status information;

[0106] A twelfth determining unit is configured to determine the target computing node based on the priority information.

[0107] In an optional embodiment of the present application, the eleventh determining unit may include:

[0108] an extraction subunit, configured to extract, for each of the second computing nodes, load connection number information and response delay information from the real-time status information;

[0109] A first weight calculation subunit, configured to perform weight calculation based on the load connection number information and the computer room connection number information corresponding to the target computer room, to obtain a load weight;

[0110] A second weight calculation subunit, configured to perform weight calculation based on the response delay information to obtain a response delay weight;

[0111] A generating subunit is used to generate the priority information corresponding to the second computing node according to the load weight and the response delay weight.

[0112] In an optional embodiment of the present application, the fourth determining unit may include:

[0113] A first determining subunit, configured to determine a first cluster identifier to which the target data node belongs;

[0114] A second determining subunit, configured to determine a second cluster identifier to which the first computing node belongs;

[0115] a third determining subunit, configured to determine that the target data node matches the first computing node when the first cluster identifier is consistent with the second cluster identifier;

[0116] The fourth determining subunit is configured to determine that the target data node does not match the first computing node when the first cluster identifier is inconsistent with the second cluster identifier.

[0117] The implementation process of the functions and effects of each module in the above-mentioned device is specifically described in the implementation process of the corresponding steps in the above-mentioned method, which will not be repeated here.

[0118] like Figure 3 As shown, an embodiment of the present application provides an electronic device, including a processor 310, a communication interface 320, a memory 330 and a communication bus 340, wherein the processor 310, the communication interface 320, and the memory 330 communicate with each other through the communication bus 340.

[0119] Memory 330, for storing computer programs;

[0120] In one embodiment of the present application, the processor 310, when executing the program stored in the memory 330, implements the database response method provided by any of the aforementioned method embodiments, by receiving a database request and extracting a data node identifier from the database request, so as to determine the target computing node based on the data node identifier and a preset computing node selection strategy, and then respond to the database request through the target computing node to obtain a database response result corresponding to the database request; thereby, the target computing node matching the data node identifier can be selected in a targeted manner to respond to the request, which can effectively improve the response speed of the database and solve the problem of slow response speed of the distributed database when responding to requests in the existing related technologies.

[0121] The embodiment of the present application also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the database response method provided in any of the aforementioned method embodiments are implemented, by receiving a database request and extracting a data node identifier from the database request, so as to determine a target computing node based on the data node identifier and a preset computing node selection strategy, and then respond to the database request through the target computing node to obtain a database response result corresponding to the database request; thereby, the target computing node matching the data node identifier can be selected in a targeted manner to respond to the request, which can effectively improve the response speed of the database and solve the problem of slow response speed of the distributed database when responding to requests in the existing related technologies.

[0122] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0123] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a general hardware platform, and of course, by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the relevant technology can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0124] It should be understood that the terms used in the text are only for the purpose of describing specific example embodiments and are not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms "one", "an" and "said" as used in the text may also be meant to include plural forms. The terms "include", "comprise", "contain", and "have" are inclusive, and therefore specify the existence of stated features, steps, operations, elements and / or parts, but do not exclude the existence or addition of one or more other features, steps, operations, elements, parts, and / or combinations thereof. The method steps, processes, and operations described in the text are not interpreted as necessarily requiring them to be performed in the specific order described or illustrated, unless the execution order is clearly indicated. It should also be understood that additional or alternative steps may be used.

[0125] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A database response method, characterized in that: include: Receive database requests; Extracting a data node identifier from the database request; Based on the data node identifier and in combination with a preset computing node selection strategy, determine a target computing node; The target computing node responds to the database request to obtain a database response result corresponding to the database request.

2. The database response method according to claim 1, characterized in that: The determining of the target computing node based on the data node identifier and in combination with a preset computing node selection strategy includes: Determine a target data node corresponding to the data node identifier; Based on the computing node selection strategy, determining the server where the target data node is located as a target server, wherein the target server includes at least one first computing node; In a case where the target data node matches the first computing node, the first computing node is determined as the target computing node.

3. The database response method according to claim 2, characterized in that: After determining the server where the target data node is located as the target server based on the computing node selection strategy, the method further includes: Determining whether the target data node matches each of the first computing nodes; In the case that the target data node does not match any of the first computing nodes, determining a target computer room corresponding to the target server, wherein the target computer room includes at least one second computing node; Determining whether the target data node matches each of the second computing nodes; In a case where the target data node matches the second computing node, the second computing node is determined as the target data node.

4. The database response method according to claim 3, characterized in that: After determining whether the target data node matches each of the second computing nodes, the method further includes: In the case that the target data node does not match any of the second computing nodes, determining a computer room in the same region corresponding to the target server, wherein the computer room in the same region includes at least one third computing node; Determine whether the target data node matches each of the third computing nodes; In a case where the target data node matches the third computing node, the third computing node is determined as the target data node.

5. The database response method according to claim 3, characterized in that: After determining whether the target data node matches each of the second computing nodes, the method further includes: When at least two of the second computing nodes match the target data node, acquiring real-time status information of each of the second computing nodes; Determine priority information corresponding to each of the second computing nodes according to the real-time status information; Based on the priority information, the target computing node is determined.

6. The database response method according to claim 5, characterized in that: The determining, according to the real-time status information, priority information corresponding to each of the second computing nodes includes: For each of the second computing nodes, extracting load connection number information and response delay information from the real-time status information; Based on the load connection number information, combined with the computer room connection number information corresponding to the target computer room, a weight calculation is performed to obtain a load weight; Performing weight calculation based on the response delay information to obtain a response delay weight; The priority information corresponding to the second computing node is generated according to the load weight and the response delay weight.

7. The database response method according to claim 3, characterized in that: The determining whether the target data node matches each of the first computing nodes includes: Determine a first cluster identifier to which the target data node belongs; Determine a second cluster identifier to which the first computing node belongs; When the first cluster identifier is consistent with the second cluster identifier, determining that the target data node matches the first computing node; When the first cluster identifier is inconsistent with the second cluster identifier, it is determined that the target data node does not match the first computing node.

8. A database response device, characterized in that: include: A receiving module, used for receiving a database request; An extraction module, used to extract a data node identifier from the database request; A selection module, configured to determine a target computing node based on the data node identifier and in combination with a preset computing node selection strategy; The response module is used to respond to the database request through the target computing node to obtain a database response result corresponding to the database request.

9. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; The processor is used to implement the database response method described in any one of claims 1 to 7 when executing the program stored in the memory.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the database response method according to any one of claims 1 to 7 is implemented.