Domain name multiplexing method and device of block chain cluster, electronic equipment and storage medium
By introducing cluster identification and directory mechanisms between blockchain clusters, the communication efficiency and chaos caused by multiple DNS servers are solved, efficient domain name reuse and accurate node positioning are achieved, and the communication efficiency and security of the blockchain network are improved.
Patent Information
- Application Number
- CN202510675729.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-23
- Publication Date
- 2025-08-12
AI Technical Summary
When communicating between blockchain clusters, the use of multiple DNS servers to achieve domain name reuse leads to low communication efficiency and prone to confusion.
By introducing cluster identifiers, configuring the cluster directory and reusing the domain name, using cluster identifiers to locate the target cluster directory, query the IP address of the target blockchain node, and establish a communication connection to avoid frequent switching of the DNS server.
It realizes the rapid and accurate positioning of nodes in the blockchain cluster without adding DNS servers, which improves communication efficiency, avoids communication chaos, and enhances data isolation and security.
Smart Images

Figure CN120475010A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of blockchain technology or other related technical fields, and more particularly to a domain name reuse method and device, electronic device, and storage medium for a blockchain cluster. Background Art
[0002] With the development of the internet and distributed computing technologies, especially the widespread adoption of blockchain technology, network architectures are facing increasingly complex node management and communication challenges. In scenarios with fragmented blockchains or multi-chain coexistence, multiple independent blockchain clusters may need to share the same network infrastructure and domain name space to achieve efficient communication and resource reuse across clusters. However, this requirement conflicts with the design principles of the traditional Domain Name System (DNS). Traditional DNS designs provide load balancing and redundancy for multiple IP addresses, but do not consider the need to distinguish and isolate nodes from different clusters within the same domain name framework.
[0003] In related technologies, in order to achieve domain name reuse, multiple DNS servers are used, each server serving a different blockchain cluster. However, when conducting inter-cluster communication with this method, the user end needs to select the correct DNS server according to the target cluster to access the nodes in the target cluster. When accessing multiple nodes in multiple clusters, it is necessary to frequently switch DNS servers, resulting in low communication efficiency and easily causing communication confusion.
[0004] To address the above-mentioned problems, no effective solutions have been proposed so far. Summary of the Invention
[0005] Embodiments of the present invention provide a domain name reuse method and device, an electronic device, and a storage medium for a blockchain cluster, to at least address the technical problem in related technologies of using multiple DNS servers to implement domain name reuse, resulting in low communication efficiency during inter-cluster communication.
[0006] According to one aspect of an embodiment of the present invention, a domain name reuse method for a blockchain cluster is provided, comprising: receiving a blockchain node access request from a user terminal, and extracting a cluster identifier and domain name information from the node access request, wherein the cluster identifier is used to indicate the blockchain cluster to which a target blockchain node to be accessed belongs, and domain name reuse is performed between clusters through the cluster identifier; locating a target cluster directory to be queried based on the cluster identifier, and querying an IP address of a target blockchain node from the target cluster directory based on the domain name information, wherein the target cluster directory stores node information of all blockchain nodes under the blockchain cluster, and the node information includes at least the IP address; establishing a communication connection with the target blockchain node based on the IP address of the target blockchain node; forwarding the blockchain node access request to the target blockchain node through the communication connection, receiving an access receipt from the target blockchain node, and returning the access receipt to the user terminal.
[0007] Furthermore, before receiving the blockchain node access request from the user terminal, it also includes: configuring a cluster identifier for each of the blockchain clusters; and creating a cluster directory for each of the blockchain clusters based on the cluster identifier.
[0008] Furthermore, before receiving the blockchain node access request from the user end, it also includes: registering a domain name for each blockchain node in the blockchain cluster to obtain domain name information, and mapping the domain name information of the blockchain node with the IP address to obtain a mapping relationship between the domain name information and the IP address; storing the domain name information, the IP address and the mapping relationship of all the blockchain nodes in the blockchain cluster to the cluster directory corresponding to the blockchain cluster.
[0009] Furthermore, after establishing a communication connection with the target blockchain node based on the IP address of the target blockchain node, it also includes: based on the cluster identifier, the domain name information and the IP address of the target blockchain node, storing the communication connection of the target blockchain node in a connection cache area, wherein the connection cache area is used to store the communication connection information between the user terminal and each blockchain node, and the communication connection information at least includes: the IP address of the blockchain node.
[0010] Furthermore, after extracting the cluster identifier and domain name information from the node access request, it also includes: querying the connection cache area based on the cluster identifier and the domain name information to obtain a query result; when the query result indicates that there is a communication connection of the target blockchain node in the connection cache area, forwarding the node access request to the target blockchain node through the existing communication connection.
[0011] Furthermore, the step of extracting the cluster identifier and domain name information from the node access request includes: extracting the cluster identifier from the request header of the node access request, parsing the node access request, and obtaining the domain name information; if the cluster identifier does not exist in the node access request, returning a request error message to the user end.
[0012] Furthermore, the domain name reuse method of the blockchain cluster also includes: monitoring the blockchain node, and when it is detected that the IP address of the blockchain node has changed, calling the cluster directory of the blockchain cluster to which the blockchain node belongs; updating the IP address of the blockchain node whose IP address has changed in the cluster directory; and deleting the communication connection corresponding to the blockchain node whose IP address has changed in the connection cache area.
[0013] According to another aspect of an embodiment of the present invention, a domain name reuse device for a blockchain cluster is also provided, including: an extraction unit for receiving a blockchain node access request from a user terminal, and extracting a cluster identifier and domain name information from the node access request, wherein the cluster identifier is used to indicate the blockchain cluster to which the target blockchain node to be accessed belongs, and domain name reuse is performed between clusters through the cluster identifier; a query unit for locating the target cluster directory to be queried based on the cluster identifier, and querying the IP address of the target blockchain node from the target cluster directory based on the domain name information, wherein the target cluster directory stores node information of all blockchain nodes under the blockchain cluster, and the node information includes at least the IP address; an establishment unit for establishing a communication connection with the target blockchain node based on the IP address of the target blockchain node; a return unit for forwarding the blockchain node access request to the target blockchain node through the communication connection, and receiving an access receipt from the target blockchain node, and returning the access receipt to the user terminal.
[0014] Furthermore, the domain name reuse device of the blockchain cluster also includes: a first configuration module, used to configure a cluster identifier for each of the blockchain clusters; and a first creation module, used to create a cluster directory for each of the blockchain clusters based on the cluster identifier.
[0015] Furthermore, the domain name reuse device of the blockchain cluster also includes: a first registration module, used to register a domain name for each of the blockchain nodes in the blockchain cluster, obtain domain name information, and map the domain name information of the blockchain node with the IP address to obtain a mapping relationship between the domain name information and the IP address; a first storage module, used to store the domain name information, the IP address and the mapping relationship of all the blockchain nodes in the blockchain cluster to the cluster directory corresponding to the blockchain cluster.
[0016] Furthermore, the domain name reuse device of the blockchain cluster also includes: a second storage module, which is used to store the communication connection of the target blockchain node in a connection cache area based on the cluster identifier, the domain name information and the IP address of the target blockchain node, wherein the connection cache area is used to store the communication connection information between the user terminal and each blockchain node, and the communication connection information includes at least: the IP address of the blockchain node.
[0017] Furthermore, the domain name reuse device of the blockchain cluster also includes: a first query module, used to query the connection cache area according to the cluster identifier and the domain name information to obtain a query result; a first forwarding module, used to forward the node access request to the target blockchain node through the existing communication connection when the query result indicates that the connection cache area has a communication connection with the target blockchain node.
[0018] Furthermore, the extraction unit includes: a first extraction module, used to extract the cluster identifier from the request header of the node access request, and parse the node access request to obtain the domain name information; a first return module, used to return request error information to the user end if the cluster identifier does not exist in the node access request.
[0019] Furthermore, the domain name reuse device of the blockchain cluster also includes: a first monitoring module, used to monitor the blockchain node, and when it is detected that the IP address of the blockchain node has changed, calling the cluster directory of the blockchain cluster to which the blockchain node belongs; a first update module, used to update the IP address of the blockchain node whose IP address has changed in the cluster directory; a first deletion module, used to delete the communication connection corresponding to the blockchain node whose IP address has changed in the connection cache area.
[0020] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is further provided, wherein the computer-readable storage medium includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute any one of the above-mentioned domain name reuse methods for the blockchain cluster.
[0021] According to another aspect of an embodiment of the present invention, an electronic device is further provided, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement any of the above-mentioned domain name reuse methods for the blockchain cluster.
[0022] In this application, the following steps are taken: first, a blockchain node access request from a user terminal is received, and a cluster identifier and domain name information are extracted from the node access request, wherein the cluster identifier is used to indicate the blockchain cluster to which the target blockchain node to be accessed belongs, domain names are reused between clusters through the cluster identifier, and the target cluster directory to be queried is located based on the cluster identifier, and the IP address of the target blockchain node is queried from the target cluster directory based on the domain name information, wherein the target cluster directory stores the node information of all blockchain nodes under the blockchain cluster, and the node information includes at least the IP address, and then based on the IP address of the target blockchain node, a communication connection is established with the target blockchain node, and finally the blockchain node access request is forwarded to the target blockchain node through the communication connection, and an access receipt of the target blockchain node is received, and the access receipt is returned to the user terminal.
[0023] In this application, different blockchain clusters are marked by cluster identifiers, so that multiple blockchain clusters can use the same domain name system to achieve domain name reuse between clusters. When the user accesses a specific node of the target cluster, the cluster identifier of the target cluster is carried in the request, and the cluster directory corresponding to the target cluster is located by the cluster identifier. The IP address of the target blockchain node to be accessed is obtained from the cluster directory, thereby locating the specific node in the target cluster. There is no need to introduce multiple DNS servers and communicate by frequently switching servers. The purpose of accurately locating nodes in the blockchain cluster in the domain name reuse scenario is achieved, and the technical effect of improving communication efficiency is achieved, thereby solving the technical problem in the related technology that multiple DNS servers are used to achieve domain name reuse and the communication efficiency is low when communicating between clusters. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0025] Figure 1 This is a flowchart of an optional domain name reuse method for a blockchain cluster according to an embodiment of the present invention;
[0026] Figure 2 This is a schematic diagram of an interaction in a domain name reuse scenario of an optional blockchain cluster according to an embodiment of the present invention;
[0027] Figure 3 1 is a schematic diagram of an optional domain name reuse device for a blockchain cluster according to an embodiment of the present invention;
[0028] Figure 4This is a hardware structure block diagram of an electronic device (or mobile device) that executes a domain name reuse method for a blockchain cluster according to an embodiment of the present invention. DETAILED DESCRIPTION
[0029] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.
[0030] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0031] To facilitate those skilled in the art to understand the present invention, some of the terms or nouns involved in the embodiments of the present invention are explained below:
[0032] The Domain Name System (DNS) converts easy-to-remember domain names (such as www.example.com) into corresponding IP addresses, thereby achieving the conversion between readable domain names and computer-recognizable IP addresses.
[0033] DOH is a domain name resolution method based on the http protocol (Hypertext Transfer Protocol). It can add header information to assist in domain name resolution.
[0034] DOG, a domain name resolution method based on the grpc protocol (gRPC Remote Procedure Call, a communication protocol suitable for distributed systems and microservice architectures), can append header information to assist in domain name resolution.
[0035] It should be noted that the domain name reuse method and device of the blockchain cluster in this application can be used in the field of blockchain technology when the domain name is reused based on the cluster identifier, and can also be used in any field other than the field of blockchain technology when the domain name is reused by the cluster identifier. This application does not limit the application field of the domain name reuse method and device of the blockchain cluster.
[0036] It should be noted that the relevant information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with the relevant laws, regulations and standards of the relevant regions, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse. For example, an interface is set up between this system and the relevant users or institutions. Before obtaining relevant information, it is necessary to send an acquisition request to the aforementioned user or institution through the interface, and obtain the relevant information after receiving the consent information fed back by the aforementioned user or institution.
[0037] It should be noted that in this application, when collecting and analyzing customer information, corresponding operation entrances are provided for users to choose to agree or reject the automated decision-making results; if the user chooses to reject, the expert decision-making process will be entered.
[0038] The following embodiments of the present invention can be applied to systems, applications, and devices for domain name reuse in various blockchain clusters. By introducing a cluster identifier for domain names, the present invention proposes a novel cluster-identifier-based domain name reuse registration and resolution connection method. This method, based on the cluster identifier, enables DNS communication between different blockchain clusters within the same domain name system. This method not only enables domain name reuse but also prevents domain name crosstalk between clusters, improves inter-cluster communication efficiency, and can accurately locate blockchain nodes within a specific blockchain cluster.
[0039] The present invention will be described in detail below with reference to various embodiments.
[0040] Example 1
[0041] According to an embodiment of the present invention, an embodiment of a domain name reuse method for a blockchain cluster is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in an order different from that shown here.
[0042] Figure 1This is a flowchart of an optional domain name reuse method for a blockchain cluster according to an embodiment of the present invention. The implementation subject of this method is a domain name reuse system for a blockchain cluster, such as Figure 1 As shown, the method includes the following steps:
[0043] Step S101: Receive a blockchain node access request from a user terminal and extract cluster identification and domain name information from the node access request.
[0044] It should be noted that the embodiments of the present invention can be used in the segmented blockchain scenario. The segmented blockchain implements distributed ledger technology by dividing the entire blockchain network into multiple independent "segments" or "shards". Each blockchain fragment runs on its own blockchain cluster. For each node in each blockchain cluster, the embodiment of the present invention configures a cluster identifier for each blockchain cluster and establishes a cluster directory. The cluster directory stores all blockchain nodes under the blockchain cluster. The use of cluster identifiers can enable multiple blockchain clusters to share a domain name system to achieve domain name reuse.
[0045] In step S101 above, the user terminal (blockchain application, computer, mobile device, etc.) sends a blockchain node access request to the interactive logic module based on its own blockchain node access needs. The blockchain node access request can be used for operations such as data query, transaction submission, and status acquisition. The blockchain node access request mainly includes a cluster identifier and domain name information. Since multiple blockchain clusters share the same domain name system, the cluster identifier can indicate the blockchain cluster to which the target blockchain node to be accessed belongs. Using the cluster identifier, the blockchain cluster where the target blockchain node to be accessed is located can be quickly located without adding a DNS server, thereby establishing a communication connection with the target blockchain to be accessed.
[0046] Furthermore, before receiving the blockchain node access request from the user terminal, it also includes: configuring a cluster identifier for each blockchain cluster; and creating a cluster directory for each blockchain cluster based on the cluster identifier.
[0047] Specifically, during the system initialization or configuration phase, each blockchain cluster is assigned a unique cluster identifier. This identifier is used to distinguish different blockchain clusters in a multi-cluster environment, ensuring that subsequent node access requests are quickly and accurately routed to the target cluster, thereby preventing confusion and communication errors caused by different clusters using the same domain name system. Simultaneously, a corresponding cluster directory is created within the DNS server's storage architecture based on the assigned cluster identifier. This cluster directory is created to address storage and management issues when multiple clusters share the same domain name configuration. Each cluster directory independently stores the mapping between node domain names and IP addresses for that cluster, ensuring accurate domain name resolution and isolation between clusters. The configuration of cluster identifiers and the creation of cluster directories prevents data crosstalk and communication confusion between clusters, enhancing data isolation and security within the blockchain network. Furthermore, when the DNS server receives requests forwarded by the interaction logic module, it can quickly locate the correct cluster directory based on the cluster identifier, effectively and efficiently resolving domain names, improving communication efficiency and user experience.
[0048] Furthermore, before receiving the blockchain node access request from the user end, it also includes: registering a domain name for each blockchain node in the blockchain cluster, obtaining domain name information, and mapping the domain name information of the blockchain node with the IP address to obtain a mapping relationship between the domain name information and the IP address; storing the domain name information, IP address and mapping relationship of all blockchain nodes in the blockchain cluster in the cluster directory corresponding to the blockchain cluster.
[0049] Specifically, during the blockchain cluster initialization phase, a specific domain name is registered for each blockchain node in the cluster, and the node's domain name information is obtained. Domain name registration provides each blockchain node with a recognizable network identifier, allowing it to be located and accessed using a simple domain name rather than a complex IP address, enhancing network accessibility. Next, each blockchain node's domain name information is mapped to its corresponding IP address, forming a domain-to-IP address mapping relationship. This mapping relationship is the foundation of domain name resolution services, enabling the DNS server to quickly retrieve and return the corresponding IP address based on received domain name query requests, thereby enabling accurate access to specific blockchain nodes. Finally, each blockchain node's domain name information, IP address, and established mapping relationship are stored in the cluster directory corresponding to the blockchain cluster. By storing this mapping relationship in the cluster directory, the DNS server can directly locate the correct cluster directory in response to received requests containing the cluster identifier and perform accurate domain name resolution services, avoiding cross-cluster domain name confusion and ensuring accurate and secure communication.
[0050] Furthermore, the step of extracting the cluster identifier and domain name information from the node access request includes: extracting the cluster identifier from the request header of the node access request, parsing the node access request, and obtaining the domain name information; if the cluster identifier does not exist in the node access request, returning a request error message to the user end.
[0051] Specifically, upon receiving a node access request from a client, the interaction logic module first examines the request header to extract the cluster identifier. The cluster identifier is present in the request header, complying with communication protocol standards and eliminating the need to modify the underlying communication protocol, thus improving system compatibility. The entire request is then parsed to retrieve the domain name information, namely the domain name of the target blockchain node. Extracting the cluster identifier allows accurate location of the target blockchain cluster, which is relied upon for subsequent domain name resolution. Obtaining the domain name information is crucial for determining the specific network identity of the target node during DNS resolution. If the cluster identifier is not found in the node access request, the system will not attempt to process the request and will instead return a request error message to the client. In domain name reuse scenarios, where multiple blockchain clusters share a common domain name system, missing the cluster identifier can prevent the request from being correctly routed to the target cluster. To mitigate communication disruptions caused by missing identifiers, a request error message is returned to the client, prompting it to make corrections.
[0052] Furthermore, after extracting the cluster identifier and domain name information from the node access request, it also includes: querying the connection cache area based on the cluster identifier and domain name information to obtain the query result; when the query result indicates that there is a communication connection of the target blockchain node in the connection cache area, forwarding the node access request to the target blockchain node through the existing communication connection.
[0053] It should be noted that in a TCP / IP-based network environment, each new connection requires a three-way handshake, which may incur certain network delays and computational overhead. Especially for frequent communication or high-concurrency scenarios, repeated connection establishment is not only inefficient but may also lead to resource bottlenecks.
[0054] To improve communication efficiency and alleviate resource bottlenecks, the present invention implements connection caching for established blockchain nodes. The purpose of connection caching is that when a communication connection with a target node is first established, the system does not immediately close the connection. Instead, it stores the relevant information (such as source IP, target IP, port number, connection status, etc.) in a cache. This allows the system to directly restore the connection from the cache the next time communication with the same target node is needed, avoiding the overhead of reestablishing the connection and thus achieving fast communication.
[0055] Specifically, after obtaining the cluster identifier and domain name information, the interactive logic module queries the connection cache based on the combined cluster identifier and domain name information. This query searches the connection cache for a previously established and cached communication connection with the target blockchain node. This avoids duplicate connection establishment, improving communication efficiency and reducing network resource consumption. If the query indicates a communication connection with the target blockchain node exists in the connection cache, the system directly uses this existing connection to forward the node access request to the target blockchain node. Using an existing communication connection to forward requests not only reduces potential delays associated with establishing the connection but also ensures continuous and efficient communication.
[0056] Step S102: locate the target cluster directory to be queried based on the cluster identifier, and query the IP address of the target blockchain node from the target cluster directory based on the domain name information.
[0057] In step S102 above, if the communication connection corresponding to the target blockchain node does not exist in the connection cache area, a new communication connection needs to be established. Specifically, the interactive logic module will call the DNS Resolver module to perform domain name resolution. The DNS Resolver module assembles a domain name resolution request, which includes a cluster identifier and domain name information. The DNS Resolver module sends the domain name resolution request to the DNS Server module via DOH / DOG. After receiving the domain name resolution request, the DNS Server locates the target cluster directory corresponding to the target cluster based on the cluster identifier carried in the request. The target cluster directory stores the node information of all blockchain nodes under the blockchain cluster. The node information includes at least the IP address. The cluster directory is queried using the domain name information as the key to obtain the IP address corresponding to the domain name, which is the IP address of the target blockchain node.
[0058] Step S103: Establish a communication connection with the target blockchain node based on the IP address of the target blockchain node.
[0059] In step S103, after successfully retrieving the target blockchain node's IP address from the target cluster directory, the system initiates a communication connection with the target blockchain node corresponding to that IP address. This communication connection involves the TCP three-way handshake network connection establishment mechanism to ensure connection reliability and security. By establishing a connection with the target blockchain node's IP address, the interaction logic module routes the client's request to the target blockchain node and receives the node's response, completing the communication between the client and the target blockchain node.
[0060] Furthermore, after establishing a communication connection with the target blockchain node based on the IP address of the target blockchain node, it also includes: based on the cluster identifier, domain name information and the IP address of the target blockchain node, storing the communication connection of the target blockchain node in a connection cache area, wherein the connection cache area is used to store the communication connection information between the user terminal and each blockchain node, and the communication connection information includes at least: the IP address of the blockchain node.
[0061] Specifically, after establishing a communication connection with a blockchain node for the first time, the interaction logic module stores the established connection in a connection cache area to implement connection caching. The connection cache actually stores a series of specific information and status related to the communication connection. This information together constitutes a "snapshot" of the connection, allowing for rapid reuse in future communication requests. From the established communication connection, the corresponding cluster identifier, domain name information, and IP address of the target blockchain node are extracted. Based on this identification information, a key-value pair is constructed, where the key consists of the cluster identifier and domain name information in the format clusterid_domain, and the value is the communication connection information with the target blockchain node. This communication connection information may include the source (which can be the interaction logic module or the client, etc.) IP address, source port, target node IP address, target port, protocol information (such as encryption algorithm and key), and session information (such as authentication token and session status). This communication connection information is then stored in the connection cache area. When storing the communication connection information, the current status of the connection, such as whether it is active or faulty, should also be recorded. The storage mechanism of the connection cache area is designed to reuse established communication connections, reduce the connection establishment delay when accessing the same node subsequently, improve communication efficiency, and reduce resource consumption.
[0062] Step S104: forward the blockchain node access request to the target blockchain node through the communication connection, receive the access receipt of the target blockchain node, and return the access receipt to the user end.
[0063] In step S104, based on the established communication connection, the interaction logic module forwards the blockchain node access request sent by the user to the target blockchain node via this connection. After processing the access request, the target blockchain node generates an access receipt, including the request execution result and status information. This receipt is returned to the interaction logic module via the same communication connection. Upon receiving the access receipt from the target node, the interaction logic module encapsulates it and returns it to the user, completing the closed-loop request processing process.
[0064] Furthermore, the domain name reuse method of the blockchain cluster also includes: monitoring the blockchain nodes, and when it is detected that the IP address of the blockchain node has changed, calling the cluster directory of the blockchain cluster to which the blockchain node belongs; updating the IP address of the blockchain node whose IP address has changed in the cluster directory; and deleting the communication connection corresponding to the blockchain node whose IP address has changed in the connection cache area.
[0065] Specifically, embodiments of the present invention ensure that domain names always point to the correct IP address, which is key to maintaining communication stability and accuracy. Embodiments of the present invention also dynamically monitor blockchain nodes and, upon detecting changes in a node's IP address, implement a series of updates and optimization measures. Specifically, this includes continuously monitoring the health and status of blockchain nodes, including checking the validity of their IP addresses. This step aims to promptly detect any potential changes to a node's IP address, thereby preventing communication failures caused by outdated or incorrect IP address information. When a change in a blockchain node's IP address is detected, the interaction logic module proactively calls the corresponding cluster directory and updates the IP address of the blockchain node in the cluster directory. The system then checks the connection cache to identify all communication connections pointing to the blockchain node with the changed IP address and deletes these connection entries from the cache. This step prevents the system from attempting to reuse invalid connections, minimizing the risk of communication errors and data loss. For deleted connection entries, subsequent blockchain node access requests involving these nodes will re-establish communication connections corresponding to the new IP address through the DNS resolution process, ensuring communication continuity and reliability.
[0066] Through the above steps, the blockchain node access request from the user end is first received, and the cluster identifier and domain name information are extracted from the node access request, wherein the cluster identifier is used to indicate the blockchain cluster to which the target blockchain node to be accessed belongs, the domain name is reused between clusters through the cluster identifier, and the target cluster directory to be queried is located based on the cluster identifier, and the IP address of the target blockchain node is queried from the target cluster directory based on the domain name information, wherein the target cluster directory stores the node information of all blockchain nodes under the blockchain cluster, and the node information includes at least the IP address, and then based on the IP address of the target blockchain node, a communication connection is established with the target blockchain node, and finally the blockchain node access request is forwarded to the target blockchain node through the communication connection, and the access receipt of the target blockchain node is received, and the access receipt is returned to the user end.
[0067] In this embodiment, different blockchain clusters are marked by cluster identifiers, so that multiple blockchain clusters can use the same domain name system to achieve domain name reuse between clusters. When the user terminal accesses a specific node of the target cluster, the cluster identifier of the target cluster is carried in the request, and the cluster directory corresponding to the target cluster is located by the cluster identifier. The IP address of the target blockchain node to be accessed is obtained from the cluster directory, thereby locating the specific node in the target cluster. There is no need to introduce multiple DNS servers and communicate by frequently switching servers. The purpose of accurately locating nodes in the blockchain cluster in the domain name reuse scenario is achieved, and the technical effect of improving communication efficiency is achieved, thereby solving the technical problem in the related art that multiple DNS servers are used to achieve domain name reuse and the communication efficiency is low when communicating between clusters.
[0068] The following describes in detail another optional specific implementation.
[0069] Figure 2 This is an interactive diagram of an optional blockchain cluster domain name reuse scenario according to an embodiment of the present invention, such as Figure 2 As shown in the figure, the domain name reuse system of the blockchain cluster includes the interaction logic module (Interaction Logic), domain name resolver (DNS Resolver), domain name server (DNS Server), connection cache (Connection Cache) and each blockchain cluster (cluster1, cluster2, cluster3...). Specifically,
[0070] The above-mentioned multiple blockchain clusters share a set of domain name systems. For example, the blockchain nodes in cluser1 include peer1.org1.com: 192.168.1.1 and peer1.org2.com: 192.168.1.2; the blockchain nodes in cluser2 include peer1.org1.com: 192.168.2.1 and peer1.org2.com: 192.168.2.2; the blockchain nodes in cluser2 include peer1.org1.com: 192.168.3.1 and peer1.org2.com: 192.168.3.2. That is, the three clusters use the same set of domain names, but the IP addresses corresponding to the domain names are different.
[0071] The client initiates a grpc or https blockchain node access request to access the target blockchain node and perform operations such as data query and transaction processing. The request includes the request domain name, request header, and request body. The request header contains cluster identification information, which can distinguish different clusters under the same domain name system. Without using multiple DNS servers, the blockchain cluster and blockchain node requested by the client can be quickly located.
[0072] The Interaction Logic module is responsible for scheduling grpc / https requests. It relies on the Connection Cache and DNS Resolver modules to work. It first checks the DNS Resolver to see if there is a connection cache to the target blockchain node. If so, it uses it directly. If not, it initiates a domain name resolution request to the DNS Resolver. After obtaining the IP address, it establishes a communication connection to this IP address and stores the corresponding communication connection information in the Connection Cache. The user's access request is routed and interacted on this communication connection.
[0073] The DNS Resolver module is a domain name resolver that provides a customized domain name resolution service. It is responsible for processing the domain name resolution request sent by the Interaction Logic module, extracting the domain name and cluster identifier in the request, encapsulating it in DOH / DOG format, and sending it to the DNS Server for resolution. After obtaining the IP address of the target blockchain node, it establishes a communication connection and returns it to the Interaction Logic module for use. It also caches the domain name and communication connection information in the Connection Cache module.
[0074] The DNS Server module, or domain name server, provides domain name registration, storage, and resolution services. First, the DNS Server provides cluster-based domain name registration services, identifying each blockchain cluster using a cluster ID. The default value of the cluster ID is "default." Second, registered domain names are stored in cluster directories named after the cluster ID, based on their cluster ID. The DNS Server uses a DOH or DOG resolution method. ClusterID information is appended to the domain name resolution request header. The DNS Server first resolves this clusterID information. If it is not set, it is considered "default." It then searches the corresponding cluster directory for the corresponding domain name resolution address (i.e., the IP address) and returns it to the DNS Resolver module.
[0075] The Connection Cache module stores connection To Ip, that is, TCP-type connections to specific IP addresses, which are used for interaction, sending and receiving data.
[0076] like Figure 2 As shown in the figure, in a domain reuse scenario, there are three blockchain clusters, each containing the same number of nodes and using the same domain name. The domain name is registered on the DNS server using a cluster identifier. When a client initiates a request via grpc / https, the target cluster's cluster identifier is appended to the request header. If it is not present, it is considered default and a request error message is returned. The Interaction Logic module extracts the cluster identifier (cluster identifier) and domain (domain name information) from the request. Using the clusterid_domain key, it checks whether a cached connection exists in the ConnectionCache. If so, it uses it directly. If not, the Interaction Logic module uses the DNS Resolver module to perform domain name resolution. The DNS Resolver module assembles a domain name resolution request and sends it to the DNS server. The request format uses the DOH / DOG format, with the clusterid information appended to the request. The DNS server receives the domain name resolution request, parses the clusterid and domain parameters, retrieves the IP address corresponding to the domain in the cluster directory corresponding to the clusterid, and responds. After receiving the IP address of the target blockchain node to be accessed, the DNS Resolver sends a reply to the Interaction Logic module. The Interaction Logic module receives the IP address, establishes a connection to it, and stores this connection in the ConnectionCache using the clusterid_domain as the key. The Interaction Logic module uses this connection to send a request to the target blockchain node in the cluster and receives and forwards the reply to complete the interaction.
[0077] Specifically, there are currently two blockchain clusters, cluser1 and cluster2. The blockchain nodes in cluser1 are peer1.org1.com: 192.168.1.1 and peer1.org2.com: 192.168.1.2; the blockchain nodes in cluser2 are peer1.org1.com: 192.168.2.1 and peer1.org2.com: 192.168.2.2.
[0078] First, create cluster1 and cluster2 directories in the DNS Server working directory, and store the domain name mapping information of each blockchain node under cluster1 and cluster2 in the cluster1 and cluster2 directories respectively.
[0079] Assume that the user initiates a node access request and requests data query from the target blockchain node: peer1.org1.com of cluser1. The specific implementation steps include:
[0080] Step 1: The client prepares a grpc request (corresponding to the blockchain node access request mentioned above) and appends clusterid: cluster1 to the metadata header of grpc.
[0081] Step 2: The client initiates access to the peer1.org1.com node in cluster1 through grpc request;
[0082] In step 3, the Interaction Logic module receives the request and extracts the clusterID (cluster1) and domain (peer1.org1,com) from the request. The Interaction Logic module uses cluster1_peer1.org1.com as the key to query the connection from the connection cache. If the connection is not found, the module executes step 4. If the corresponding communication connection is found, the module executes step 9.
[0083] Step 4: The Interaction Logic module calls the Dns Resolver module to perform domain name resolution;
[0084] Step 5: The DNS Resolver module assembles a domain name resolution request, where the domain is peer1.org1.com and the clusterid is cluster1. The DNS Resolver module sends the request to the DNS Server through DOH / DOG.
[0085] Step 6: The DNS Server receives the domain name resolution request, resolves the cluster ID (cluster1) and the domain (peer1.org1.com) from the request, locates the cluster directory (cluster1), retrieves the IP address (192.168.1.1) corresponding to peer1.org1.com from the configuration file in the cluster directory (cluster1), and sends a reply OP address (192.168.1.1) to the DNS Resolver.
[0086] Step 7: DNS Resolver receives the IP address: 192.168.1.1 and sends the receipt to the InteractionLogic module.
[0087] In step 8, the Interaction Logic module establishes a connection to the IP address 192.168.1.1 and stores the connection in the Connection Cache using cluser1_peer1.org1.com as the key.
[0088] Step 9: The Interaction Logic module sends the grpc request to the 192.168.1.1 node of cluster 1 through the connection.
[0089] Step 10: peer1.org1.com of cluser1 receives the request, processes it, and returns the query data.
[0090] In step 11, the Interaction Logic module receives the query data returned by the peer1.org1.com node of cluser1 and forwards it to the user end.
[0091] In an embodiment of the present invention, by introducing a cluster affiliation identifier for a domain name, a novel domain name reuse registration and resolution connection method based on a cluster identifier is proposed. This method realizes DNS communication of different blockchain clusters under the same domain name system based on the cluster identifier. This method not only makes domain name reuse possible, but also does not cause crosstalk of domain names between clusters, thereby improving the communication efficiency between clusters and being able to accurately locate the blockchain node of a specific blockchain cluster.
[0092] The following describes it in detail with reference to another embodiment.
[0093] Example 2
[0094] A domain name reuse device for a blockchain cluster provided in this embodiment includes multiple implementation units, each of which corresponds to each implementation step in the above-mentioned embodiment 1. Its specific implementation methods and beneficial effects can be referred to the above-mentioned method embodiments and will not be repeated here.
[0095] Figure 3 : is a schematic diagram of an optional domain name reuse device for a blockchain cluster according to an embodiment of the present invention, such as Figure 3 As shown, the domain name reuse device of the blockchain cluster may include: an extraction unit 31, a query unit 32, an establishment unit 33, and a return unit 34, wherein:
[0096] An extraction unit 31 is configured to receive a blockchain node access request from a user terminal and extract a cluster identifier and domain name information from the node access request, wherein the cluster identifier is used to indicate the blockchain cluster to which the target blockchain node to be accessed belongs, and domain name reuse is performed between clusters through the cluster identifier;
[0097] A query unit 32 is configured to locate a target cluster directory to be queried based on the cluster identifier, and query the IP address of the target blockchain node from the target cluster directory based on the domain name information, wherein the target cluster directory stores node information of all blockchain nodes in the blockchain cluster, and the node information includes at least the IP address;
[0098] An establishing unit 33 is used to establish a communication connection with the target blockchain node based on the IP address of the target blockchain node;
[0099] The return unit 34 is used to forward the blockchain node access request to the target blockchain node through the communication connection, receive the access receipt of the target blockchain node, and return the access receipt to the user end.
[0100] The domain name reuse device of the above-mentioned blockchain cluster receives the blockchain node access request from the user end through the extraction unit 31, and extracts the cluster identifier and domain name information from the node access request, wherein the cluster identifier is used to indicate the blockchain cluster to which the target blockchain node to be accessed belongs, and the domain name is reused between clusters through the cluster identifier; the query unit 32 locates the target cluster directory to be queried based on the cluster identifier, and queries the IP address of the target blockchain node from the target cluster directory based on the domain name information, wherein the target cluster directory stores the node information of all blockchain nodes under the blockchain cluster, and the node information includes at least the IP address; the establishment unit 33 establishes a communication connection with the target blockchain node based on the IP address of the target blockchain node; the return unit 34 forwards the blockchain node access request to the target blockchain node through the communication connection, and receives the access receipt of the target blockchain node, and returns the access receipt to the user end.
[0101] In this embodiment, different blockchain clusters are marked by cluster identifiers, so that multiple blockchain clusters can use the same domain name system to achieve domain name reuse between clusters. When the user terminal accesses a specific node of the target cluster, the cluster identifier of the target cluster is carried in the request, and the cluster directory corresponding to the target cluster is located by the cluster identifier. The IP address of the target blockchain node to be accessed is obtained from the cluster directory, thereby locating the specific node in the target cluster. There is no need to introduce multiple DNS servers and communicate by frequently switching servers. The purpose of accurately locating nodes in the blockchain cluster in the domain name reuse scenario is achieved, and the technical effect of improving communication efficiency is achieved, thereby solving the technical problem in the related art that multiple DNS servers are used to achieve domain name reuse and the communication efficiency is low when communicating between clusters.
[0102] Furthermore, the domain name reuse device of the blockchain cluster also includes: a first configuration module, used to configure a cluster identifier for each blockchain cluster; and a first creation module, used to create a cluster directory for each blockchain cluster based on the cluster identifier.
[0103] Furthermore, the domain name reuse device of the blockchain cluster also includes: a first registration module, used to register a domain name for each blockchain node in the blockchain cluster, obtain domain name information, and map the domain name information of the blockchain node with the IP address to obtain a mapping relationship between the domain name information and the IP address; a first storage module, used to store the domain name information, IP address and mapping relationship of all blockchain nodes in the blockchain cluster to the cluster directory corresponding to the blockchain cluster.
[0104] Furthermore, the domain name reuse device of the blockchain cluster also includes: a second storage module, which is used to store the communication connection of the target blockchain node in a connection cache area based on the cluster identifier, domain name information and the IP address of the target blockchain node, wherein the connection cache area is used to store the communication connection information between the user terminal and each blockchain node, and the communication connection information includes at least: the IP address of the blockchain node.
[0105] Furthermore, the domain name reuse device of the blockchain cluster also includes: a first query module, which is used to query the connection cache area according to the cluster identifier and domain name information to obtain a query result; a first forwarding module, which is used to forward the node access request to the target blockchain node through the existing communication connection when the query result indicates that there is a communication connection of the target blockchain node in the connection cache area.
[0106] Furthermore, the extraction unit includes: a first extraction module, used to extract the cluster identifier from the request header of the node access request, and parse the node access request to obtain domain name information; a first return module, used to return request error information to the user end when the cluster identifier does not exist in the node access request.
[0107] Furthermore, the domain name reuse device of the blockchain cluster also includes: a first monitoring module, which is used to monitor the blockchain node, and when it is detected that the IP address of the blockchain node has changed, calls the cluster directory of the blockchain cluster to which the blockchain node belongs; a first update module, which is used to update the IP address of the blockchain node whose IP address has changed in the cluster directory; and a first deletion module, which is used to delete the communication connection corresponding to the blockchain node whose IP address has changed in the connection cache area.
[0108] The domain name reuse device of the above-mentioned blockchain cluster may further include a processor and a memory. The above-mentioned extraction unit 31, query unit 32, establishment unit 33, return unit 34, etc. are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to realize corresponding functions.
[0109] The processor includes a kernel, which retrieves the corresponding program unit from the memory. One or more kernels can be set, and domain names can be reused by adjusting kernel parameters.
[0110] The above-mentioned memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0111] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is further provided, wherein the computer-readable storage medium includes a stored computer program, wherein when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute any of the above-mentioned domain name reuse methods for the blockchain cluster.
[0112] According to another aspect of an embodiment of the present invention, an electronic device is also provided, comprising one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by one or more processors, the one or more processors implement any of the above-mentioned domain name reuse methods for a blockchain cluster.
[0113] According to another aspect of an embodiment of the present invention, a computer program product is further provided, comprising a computer program, wherein when the computer program is executed by a processor, any one of the above-mentioned domain name reuse methods for a blockchain cluster is implemented.
[0114] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program initialized with the following method steps: receiving a blockchain node access request from a user terminal, and extracting a cluster identifier and domain name information from the node access request, wherein the cluster identifier is used to indicate the blockchain cluster to which the target blockchain node to be accessed belongs, and domain names are reused between clusters through the cluster identifier; locating the target cluster directory to be queried based on the cluster identifier, and querying the IP address of the target blockchain node from the target cluster directory based on the domain name information, wherein the target cluster directory stores node information of all blockchain nodes under the blockchain cluster, and the node information includes at least an IP address; establishing a communication connection with the target blockchain node based on the IP address of the target blockchain node; forwarding the blockchain node access request to the target blockchain node through the communication connection, and receiving an access receipt from the target blockchain node, and returning the access receipt to the user terminal.
[0115] The present application also provides a computer program product, which, when executed on a data processing device, is also suitable for executing a program that initializes the following method steps: before receiving a blockchain node access request from a user terminal, it also includes: configuring a cluster identifier for each blockchain cluster; and creating a cluster directory for each blockchain cluster based on the cluster identifier.
[0116] The present application also provides a computer program product, which, when executed on a data processing device, is also suitable for executing a program that initializes the following method steps: before receiving a blockchain node access request from a user terminal, it also includes: registering a domain name for each blockchain node in the blockchain cluster, obtaining domain name information, and mapping the domain name information of the blockchain node with the IP address to obtain a mapping relationship between the domain name information and the IP address; storing the domain name information, IP addresses and mapping relationship of all blockchain nodes in the blockchain cluster in the cluster directory corresponding to the blockchain cluster.
[0117] The present application also provides a computer program product, which, when executed on a data processing device, is also suitable for executing a program that initializes the following method steps: after establishing a communication connection with a target blockchain node based on the IP address of the target blockchain node, it also includes: based on the cluster identifier, domain name information and the IP address of the target blockchain node, storing the communication connection of the target blockchain node in a connection cache area, wherein the connection cache area is used to store the communication connection information between the user terminal and each blockchain node, and the communication connection information includes at least: the IP address of the blockchain node.
[0118] The present application also provides a computer program product, which, when executed on a data processing device, is also suitable for executing a program that initializes the following method steps: after extracting the cluster identifier and domain name information from the node access request, it also includes: querying the connection cache area based on the cluster identifier and domain name information to obtain a query result; when the query result indicates that there is a communication connection with the target blockchain node in the connection cache area, forwarding the node access request to the target blockchain node through the existing communication connection.
[0119] The present application also provides a computer program product, which, when executed on a data processing device, is also suitable for executing a program that is initialized with the following method steps: the step of extracting the cluster identifier and domain name information from the node access request includes: extracting the cluster identifier from the request header of the node access request, and parsing the node access request to obtain the domain name information; if the cluster identifier does not exist in the node access request, returning a request error message to the user end.
[0120] The present application also provides a computer program product, which, when executed on a data processing device, is also suitable for executing a program that initializes the following method steps: the domain name reuse method of the blockchain cluster also includes: monitoring the blockchain node, and when a change is detected in the IP address of the blockchain node, calling the cluster directory of the blockchain cluster to which the blockchain node belongs; updating the IP address of the blockchain node whose IP address has changed in the cluster directory; and deleting the communication connection corresponding to the blockchain node whose IP address has changed in the connection cache area.
[0121] Figure 4 This is a hardware structure diagram of an electronic device (or mobile device) that executes a domain name reuse method for a blockchain cluster according to an embodiment of the present invention. Figure 4 As shown, the electronic device may include one or more processors ( Figure 4 402a, 402b, ..., 402n are used to illustrate that the processor may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA), a memory 404 for storing data. In addition, it may also include: a display, an input / output interface (I / O interface), a universal serial bus (USB) port (which may be included as one of the ports of the I / O interface), a network interface, a keyboard, a power supply and / or a camera. It will be understood by those skilled in the art that Figure 4 The structure shown is only for illustration and does not limit the structure of the above electronic device. Figure 4 More or fewer components than shown, or with Figure 4 Different configurations shown.
[0122] The serial numbers of the above embodiments of the present invention are for description only and do not represent the advantages or disadvantages of the embodiments.
[0123] In the above embodiments of the present invention, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0124] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only exemplary. For example, the division of the units can be a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.
[0125] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
[0126] In addition, the functional units in the various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0127] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, server or network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk, etc. Various media that can store program codes.
[0128] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as within the scope of protection of the present invention.
Claims
1. A domain name reuse method for a blockchain cluster, characterized in that: include: Receive a blockchain node access request from a user, and extract a cluster identifier and domain name information from the node access request, wherein the cluster identifier is used to indicate the blockchain cluster to which the target blockchain node to be accessed belongs, and the cluster identifier is used to multiplex domain names between clusters; Locating the target cluster directory to be queried based on the cluster identifier, and querying the IP address of the target blockchain node from the target cluster directory based on the domain name information, wherein the target cluster directory stores node information of all blockchain nodes under the blockchain cluster, and the node information includes at least the IP address; Establishing a communication connection with the target blockchain node based on the IP address of the target blockchain node; The blockchain node access request is forwarded to the target blockchain node through the communication connection, and an access receipt from the target blockchain node is received, and the access receipt is returned to the user terminal.
2. The method according to claim 1, characterized in that Before receiving the blockchain node access request from the user, it also includes: Configuring a cluster identifier for each of the blockchain clusters; A cluster directory is created for each of the blockchain clusters based on the cluster identifier.
3. The method according to claim 2, characterized in that Before receiving the blockchain node access request from the user, it also includes: Registering a domain name for each of the blockchain nodes in the blockchain cluster to obtain domain name information, and mapping the domain name information of the blockchain node with the IP address to obtain a mapping relationship between the domain name information and the IP address; The domain name information, the IP address and the mapping relationship of all the blockchain nodes in the blockchain cluster are stored in the cluster directory corresponding to the blockchain cluster.
4. The method according to claim 1, wherein After establishing a communication connection with the target blockchain node based on the IP address of the target blockchain node, the method further includes: Based on the cluster identifier, the domain name information and the IP address of the target blockchain node, the communication connection of the target blockchain node is stored in a connection cache area, wherein the connection cache area is used to store the communication connection information between the user terminal and each blockchain node, and the communication connection information includes at least: the IP address of the blockchain node.
5. The method according to claim 4, characterized in that After extracting the cluster identifier and domain name information from the node access request, the method further includes: Querying the connection cache area according to the cluster identifier and the domain name information to obtain a query result; When the query result indicates that a communication connection to the target blockchain node exists in the connection cache area, the node access request is forwarded to the target blockchain node through the existing communication connection.
6. The method according to claim 1, characterized in that The step of extracting the cluster identifier and domain name information from the node access request includes: Extracting the cluster identifier from a request header of the node access request, and parsing the node access request to obtain the domain name information; If the cluster identifier does not exist in the node access request, request error information is returned to the user terminal.
7. The method according to claim 1, characterized in that Also includes: Monitor the blockchain node, and when a change in the IP address of the blockchain node is detected, call the cluster directory of the blockchain cluster to which the blockchain node belongs; Updating the IP address of the blockchain node whose IP address has changed in the cluster directory; The communication connection corresponding to the blockchain node whose IP address has changed in the connection cache area is deleted.
8. A domain name reuse device for a blockchain cluster, characterized in that: include: An extraction unit, configured to receive a blockchain node access request from a user terminal and extract a cluster identifier and domain name information from the node access request, wherein the cluster identifier is used to indicate the blockchain cluster to which the target blockchain node to be accessed belongs, and to reuse domain names between clusters through the cluster identifier; a query unit, configured to locate a target cluster directory to be queried based on the cluster identifier, and query the IP address of a target blockchain node from the target cluster directory based on the domain name information, wherein the target cluster directory stores node information of all blockchain nodes under the blockchain cluster, and the node information includes at least the IP address; An establishing unit, configured to establish a communication connection with the target blockchain node based on the IP address of the target blockchain node; A returning unit is used to forward the blockchain node access request to the target blockchain node through the communication connection, receive an access receipt from the target blockchain node, and return the access receipt to the user terminal.
9. A computer-readable storage medium, characterized in that The computer-readable storage medium includes a stored computer program, wherein, when the computer program is running, the device where the computer-readable storage medium is located is controlled to execute the domain name reuse method of the blockchain cluster according to any one of claims 1 to 7.
10. An electronic device, characterized in that: The system comprises one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the domain name reuse method for the blockchain cluster as described in any one of claims 1 to 7.