Method, service node and business system for accessing a blockchain system

By establishing long-term connections between service nodes in the business system and the blockchain system, and utilizing configuration information for routing and load balancing, the problem of low efficiency in client access to the target blockchain system was solved, enabling fast and accurate transaction processing.

CN116346878BActive Publication Date: 2026-03-31ANT BLOCKCHAIN TECHNOLOGY (SHANGHAI) CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-20
Publication Date
2026-03-31

AI Technical Summary

Technical Problem

In existing technologies, clients have difficulty accessing the target blockchain system quickly and accurately, and resource constraints lead to low efficiency in establishing communication connections and sending transactions.

Method used

By establishing long-connection service nodes in the business system and the blockchain system, and using configuration information for routing and load balancing, client requests can be quickly and accurately routed to the service nodes with established long-connections, and communicate with the target blockchain system through these nodes.

Benefits of technology

It enables clients to access target blockchain systems quickly and accurately, improves transaction processing efficiency, reduces communication latency and resource limitations, and supports more efficient access to blockchain systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116346878B_ABST
    Figure CN116346878B_ABST
Patent Text Reader

Abstract

A method, a service node and a business system for accessing a blockchain system in a business system. The business system comprises a client, a data storage system, a plurality of service nodes and a plurality of blockchain systems, a single service node and a plurality of blockchain systems in the plurality of blockchain systems establish a long connection, and the data storage system stores configuration information, and the configuration information at least includes connection relationship information between the plurality of service nodes and the plurality of blockchain systems. The method executed by any first service node in the plurality of service nodes comprises: receiving a chain request from the client, the chain request comprising transaction data and an identifier of a target blockchain system, the chain request being routed to the first service node according to the connection relationship information and the identifier of the target blockchain system; and sending a target transaction corresponding to the transaction data to the target blockchain system through the long connection between the first service node and the target blockchain system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments in this specification pertain to the field of blockchain, and particularly relate to a method, service node, and business system for accessing a blockchain system. Background Technology

[0002] Blockchain is a novel application model of computer technologies such as distributed data storage, peer-to-peer transmission, consensus mechanisms, and cryptographic algorithms. In a blockchain system, data blocks are sequentially linked together to form a chain-like data structure, and a distributed ledger is cryptographically guaranteed to be immutable and unforgeable. Due to its decentralized, immutable, and autonomous characteristics, blockchain is receiving increasing attention and application. Summary of the Invention

[0003] The purpose of this invention is to provide a method, service node, and business system for accessing a blockchain system.

[0004] Firstly, a method for accessing a blockchain system within a business system is provided. The business system includes a client, a data storage system, multiple service nodes, and multiple blockchain systems. A single service node establishes a long-lived connection with several of the multiple blockchain systems. The data storage system stores configuration information, which includes at least connection relationship information between the multiple service nodes and the multiple blockchain systems. The method is executed by any first service node among the multiple service nodes. The method includes: receiving an on-chain request from the client, the on-chain request including transaction data and an identifier of a target blockchain system; routing the on-chain request to the first service node based on the connection relationship information and the identifier of the target blockchain system; and sending a target transaction corresponding to the transaction data to the target blockchain system through the long-lived connection between the first service node and the target blockchain system.

[0005] Secondly, a first service node is provided in a business system. The business system includes a client, a data storage system, multiple service nodes, and multiple blockchain systems. Each service node establishes a long-lived connection with several of the multiple blockchain systems. The data storage system stores configuration information, which includes at least connection relationship information between the multiple service nodes and the multiple blockchain systems. The first service node is one of the multiple service nodes. The first service node includes: a request receiving unit configured to receive an on-chain request from the client, the on-chain request including transaction data and an identifier of a target blockchain system, the on-chain request being routed to the first service node based on the connection relationship information and the identifier of the target blockchain system; and an on-chain processing unit configured to send a target transaction corresponding to the transaction data to the target blockchain system through the long-lived connection between the first service node and the target blockchain system.

[0006] Thirdly, a business system is provided, including a client, a data storage system, multiple service nodes, and multiple blockchain systems. Each service node establishes a long-lived connection with several of the multiple blockchain systems. The data storage system stores configuration information, which includes at least connection relationship information between the multiple service nodes and the multiple blockchain systems. Specifically: the client is used to generate an on-chain request including transaction data and the identifier of the target blockchain system, such that the on-chain request is routed to a first service node among the multiple service nodes that has established a long-lived connection with the target blockchain system. The first service node is determined based on the connection relationship information and the identifier of the target blockchain system. The first service node is used to send a target transaction corresponding to the transaction data to the target blockchain system through its long-lived connection with the target blockchain system.

[0007] Fourthly, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed in a computer, causes the computer to perform the method described in the first aspect.

[0008] In the embodiments of this specification, a single service node only needs to connect to a small number of blockchain systems, thus possessing sufficient resources to establish long-term connections between the blockchain systems it connects to. The on-chain request initiated by the client, which includes transaction data and the identifier of the target blockchain system, can be accurately routed to the service node that has already established a long-term connection with the target blockchain system based on the connection relationship information and the identifier of the target blockchain system. The service node that receives the on-chain request can more quickly complete the sending of the target transaction corresponding to the transaction data to the target blockchain system through the long-term connection it has established with the target blockchain system, which is beneficial for supporting the client to more quickly and accurately access the target blockchain system. Attached Figure Description

[0009] To more clearly illustrate the technical solutions of the embodiments in this specification, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0010] Figure 1 This is an architecture diagram of a blockchain system provided in the embodiments of this specification;

[0011] Figure 2 This is a system framework diagram of a business system provided in the embodiments of this specification;

[0012] Figure 3 This is one of the flowcharts illustrating a method for accessing a blockchain system provided in the embodiments of this specification;

[0013] Figure 4 This is a second flowchart of a method for accessing a blockchain system provided in the embodiments of this specification;

[0014] Figure 5 A flowchart illustrating the execution of a load balancing strategy by a service node is provided as an example.

[0015] Figure 6 A flowchart is provided as an example of a service node adjusting the number of blockchain systems with which it establishes long-term connections;

[0016] Figure 7 This is a schematic diagram of the structure of a service node provided in the embodiments of this specification;

[0017] Figure 8 This is a schematic diagram of the structure of a business system provided in the embodiments of this specification. Detailed Implementation

[0018] To enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this specification, and not all embodiments. Based on the embodiments in this specification, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this specification.

[0019] Figure 1 This is an exemplary architecture diagram of a blockchain system provided in the embodiments of this specification. The blockchain system may include N blockchain nodes, wherein... Figure 1 The example shows eight blockchain nodes, numbered 1 through 8. The connections between the nodes schematically represent P2P (Peer-to-Peer) connections, such as Transmission Control Protocol (TCP) connections, which are used to support the transfer of data between different nodes.

[0020] A transaction in a blockchain system refers to a task unit executed and recorded within the blockchain system. A transaction typically includes a From field, a To field, and a Data field. Specifically, in the case of a transfer transaction, the From field includes the account address initiating the transaction (i.e., initiating a transfer task to another account), the To field includes the account address receiving the transaction (i.e., receiving the transfer), and the Data field includes the transfer amount. In the case of a transaction used to deploy a smart contract, the From field includes the account address initiating the transaction, the Data field includes the code (such as bytecode or machine code) of the smart contract to be created, and the To field is empty, indicating that the transaction is for deploying a smart contract. In the case of a transaction used to invoke a smart contract, the From field includes the account address initiating the transaction, the To field includes the contract address of the smart contract being invoked, and the Data field includes the method used to invoke the smart contract and the parameters to be passed to the smart contract.

[0021] Related technologies provide reliable on-chain services that can connect to multiple clients and multiple blockchain systems. Users can submit on-chain requests to the reliable on-chain service through their clients, including transaction data and the identifier of the target blockchain system they wish to access. The reliable on-chain service can then send the target transaction corresponding to the transaction data to the target blockchain system based on the identifier, enabling the target blockchain system to complete the transaction as expected by the user. By shielding the underlying access logic of multiple blockchain systems, the reliable on-chain service allows users to more conveniently use multiple different blockchain systems on demand. Furthermore, the reliable on-chain service can ensure that the target transaction is accurately on-chain to complete the user's expected transaction through techniques such as idempotency of on-chain request / target transaction execution requests, exception retries, and result notifications. However, the reliable on-chain service has limited resources such as the number of connections and threads it can use. Typically, the reliable on-chain service can only establish a communication connection with the target blockchain system after receiving the on-chain request, and then send the target transaction to the target blockchain system through this communication connection, making it difficult for clients to quickly complete access to the target blockchain system.

[0022] Figure 2 This is a system framework diagram of a business system provided in the embodiments of this specification. The business system may include several clients, a data storage system, multiple service nodes, and multiple blockchain systems, and may also include routing nodes; wherein, apart from the data storage system and routing nodes, Figure 2 The example illustrates four blockchain systems: client C1, client C2, service node N1, service node N2, and blockchain systems B1 through B4. Each service node establishes long-lived connections with several of these blockchain systems. The data storage system stores configuration information, including at least the connection relationships between the service nodes and the blockchain systems. In this system, a single service node only needs to connect to a small number of blockchain systems, thus possessing sufficient resources to establish long-lived connections with them. A client-initiated on-chain request containing transaction data and the identifier of the target blockchain system can be accurately routed to a service node that has already established a long-lived connection with the target blockchain system, based on the connection relationship information and the target blockchain system's identifier. The service node receiving the on-chain request can then more quickly send the target transaction corresponding to the transaction data to the target blockchain system through its established long-lived connection, thereby facilitating faster and more accurate access to the target blockchain system by the client.

[0023] The connection relationship information includes multiple connection relationships. For example, if service node N1 has established a long connection with blockchain system B1 and service node N2 has established a long connection with blockchain system N3, the connection relationship information may include: the connection relationship between service node N1 and blockchain system B1 consisting of the identifier of service node N1 and the identifier of blockchain system B1, and the connection relationship between service node N2 and blockchain system B3 consisting of the identifier of service node N2 and the identifier of blockchain system B3.

[0024] Connection information can be divided into immediate information (backup information) and delayed information. In this case, a single blockchain system can correspond to two connection relationships, one in the immediate information and the other in the delayed information. For example, there might be a situation where blockchain system B1 has established long-lived connections with both service nodes N1 and N2. The connection relationship between blockchain system B1 and service node N1 might be located in the immediate information, while the connection relationship between blockchain system B1 and service node N2 might be located in the delayed information. The connection relationship belonging to the immediate information is associated with the establishment time of that connection.

[0025] The configuration information may also include the registration information of service nodes registered in the business system and the blockchain system. For example, for service node N1, the identifier and address information of service node N1 can be stored as the registration information of service node N1 in the service node registration list in the configuration information, thereby completing the registration of service node N1 in the business system. Similarly, for blockchain system B1, the identifier of blockchain system B1 and the address information of the multiple blockchain nodes included in blockchain system B1 can be stored as the registration information of blockchain system B1 in the blockchain system registration list in the configuration information, thereby completing the registration of blockchain system B1 in the business system.

[0026] The configuration information may also include the status information of registered service nodes, which is used to determine whether the corresponding service node is online. For example, service node N1 can periodically update its own status information at a first predetermined time interval T1. Specifically, it updates its status information to the time of time t. When other service nodes need to determine whether service node N1 is online, if the time difference between the current time and time t is not greater than a second predetermined time interval T2, they can determine that service node N1 is online; otherwise, they can determine that service node N1 is not online. The status information may also be in other forms, such as variable values ​​that increase in predetermined steps.

[0027] A single service node and a long-lived connection with a single blockchain system can specifically include multiple long-lived connections. For example, a long-lived connection is established between service node N1 and blockchain system B1, specifically meaning that multiple long-lived connections are established between service node N1 and multiple blockchain nodes included in blockchain system B1; the protocol type used by the long-lived connection can be, for example, including but not limited to, TCP.

[0028] Multiple service nodes can be implemented as multiple computing services running on a single device cluster, or multiple service nodes can be implemented as multiple device clusters. When multiple computing services are implemented as multiple device clusters, multiple computing services can run on a single device cluster, and different computing services on the same device cluster can establish communication connections with the same blockchain system. For example, service node N1 can run computing services D1 and D2, and both computing services D1 and D2 have long-lived connections with blockchain systems B1 and B2.

[0029] Service nodes can access configuration information in the data storage system on demand, enabling service nodes and / or other nodes to complete corresponding transactions based on the accessed configuration information. Furthermore, routing nodes may query configuration information stored in the data storage system on demand, and clients may also query configuration information in the data storage system directly or indirectly through service nodes.

[0030] The following is combined Figure 2 The business system shown exemplifies the process by which a client accesses a target blockchain system on demand.

[0031] Figure 3 This is one of the flowcharts illustrating a method for accessing a blockchain system provided in the embodiments of this specification. The method exemplarily describes the process by which client C1 accesses blockchain system B1 on demand, in a business system that includes routing nodes.

[0032] See Figure 3 As shown, the method may include, but is not limited to, some or all of the following steps S31 to S39.

[0033] In step S31, client C1 generates an on-chain request, which includes transaction data and the identifier of blockchain system B1.

[0034] The transaction data in the on-chain request can be the target transaction that client C1 expects to send to blockchain system B1, or the transaction data can be business data used to support the corresponding service node in generating the target transaction.

[0035] In step S33, client C1 sends an on-chain request to the routing node.

[0036] In step S35, the routing node determines the first service node that has established a long connection with the blockchain system B1 based on the identifier of the blockchain system B1 and the connection relationship information stored in the data storage system.

[0037] Routing nodes can query the target connection relationship corresponding to blockchain system B1 from the connection relationship information. For example, they can query target connection information containing the identifier of blockchain system B1. The blockchain system corresponding to the target connection information will be identified as the first service node that has established a long connection with blockchain system B1. Specifically, when the connection information includes both immediate and delayed information, the routing node first checks if the target connection information exists in the immediate information. If it does, the service node corresponding to that target connection information is identified as the first service node. Otherwise, it continues to query the delayed information for target connection information and identifies the service node corresponding to that delayed connection information as the first service node. In other words, when both the immediate and delayed information include connection information corresponding to blockchain system B1, the routing node will use the target connection information corresponding to blockchain system B1 in the immediate information to determine the first service node.

[0038] Taking the connection relationship information including the connection relationship between service node N1 and blockchain system B1, which consists of the identifier of service node N1 and the identifier of blockchain system B1, as an example, the routing node can query that the connection information is the target connection relationship corresponding to blockchain system B1, and then determine the first service node that has established a long connection with blockchain system B1, including service node N1, based on the target connection relationship.

[0039] Taking the example of the first service node determined in step S35 being service node N1, in step S37, the routing node sends an on-chain request to service node N1, which is the first service node.

[0040] In step S39, service node N1 sends the target transaction corresponding to the transaction data to blockchain system B1 through its long-lived connection with blockchain system B1. Referring to the preceding text, the target transaction can be the transaction data included in service node N1, or it can be generated by service node N1 based on the transaction data included in the on-chain request it receives.

[0041] Service node N1 can query the address information of multiple blockchain nodes included in blockchain system B1 from the registration information of blockchain system B1 included in the configuration information based on the identifier of blockchain system B1 included in the received on-chain request. Then, based on the address information of multiple blockchain nodes included in blockchain system B1, it can use at least one of the multiple long connections established between service node N1 and blockchain system B1 to send the target transaction to blockchain system B1.

[0042] It should be noted that when service node N1 is implemented as a device cluster running multiple computing services, service node N1 can specifically select a computing service with a relatively low load from these multiple computing services, and complete the sending of the target transaction to blockchain system B1 through at least one of the multiple long connections established between the selected computing service and blockchain system B1.

[0043] It should be noted that service node N1 can ensure that the target transaction can be accurately uploaded to the blockchain to complete the transaction that the user expects to complete by using technologies such as idempotency of on-chain requests / target transaction execution requests, exception retries, and result notifications.

[0044] It should be noted that after receiving a target transaction from service node N1, blockchain system B1 can execute subsequent processing based on the target transaction in order to complete the transaction expected by client C1.

[0045] Figure 4 This is a second flowchart illustrating a method for accessing a blockchain system provided in the embodiments of this specification. The method exemplifies the process by which client C1 accesses blockchain system B1 on demand, in a business system that does not include a routing node. Figure 4 The method shown mainly describes the method as described above. Figure 3 The differences and similarities between the methods shown can be found in the preceding text. Figure 3 The embodiment shown, Figure 4 The method shown will not be described in detail here.

[0046] See Figure 4 As shown, the method may include, but is not limited to, some or all of the following steps S41 to S49.

[0047] In step S41, client C1 generates an on-chain request, which includes transaction data and the identifier of blockchain system B1.

[0048] In step S43, client C1 obtains the connection relationship information stored in the data storage system.

[0049] Client C1 can directly access the configuration information in the data storage system, or indirectly access it through any service node, enabling on-demand querying and use of relevant data within the configuration information. For example, client C1 can periodically send query requests to any service node, causing the service node to retrieve configuration information / connection relationship information from the data storage system based on the query request and return the corresponding configuration information / connection relationship information to client C1.

[0050] In step S45, client C1 determines the first service node that has established a long connection with blockchain system B1 based on the connection relationship information and the identifier of blockchain system B1. The process by which client C1 determines the first service node is similar to the process described earlier using routing nodes, and therefore will not be repeated here.

[0051] Taking the example of the first service node determined in step S45 being service node N1, in step S47, client C1 sends an on-chain request to service node N1, which is the first service node.

[0052] In step S49, service node N1 sends the target transaction corresponding to the transaction data to blockchain system B1 through its long connection with blockchain system B1.

[0053] During the operation of the business system, in addition to the aforementioned Figure 3 or Figure 4 The method shown not only enables clients to access the blockchain system quickly and accurately, but also allows each service node in the business system to periodically execute a load balancing strategy at a predetermined time interval T1 after startup and normal operation. This ensures that the number of blockchain systems connected to by each service node is relatively balanced, preventing excessive load on a single service node from affecting the performance of the entire business system.

[0054] The following is combined Figure 2 The business system shown is an example of the process by which a single service node executes a load balancing strategy.

[0055] Figure 5 This is a flowchart illustrating a method for a service node to execute a load balancing strategy according to an embodiment of this specification. The method describes the execution process of a single execution round when service node N1 executes the load balancing strategy according to a first predetermined time interval T1. See also... Figure 5 As shown, the process may include, but is not limited to, some or all of the following steps S51 to S59.

[0056] In step S51, update the status information of service node N1.

[0057] For example, service node N1 can update its status information to the current time t.

[0058] In step S52, based on the status information of at least two registered service nodes, it is determined whether there is a second service node that is not online. If so, the connection relationship corresponding to the second service node is deleted from the connection relationship information.

[0059] For a service node already registered in the business system, such as service node N2, assume that service node N1 starts execution at time t. Figure 5When implementing the load balancing strategy shown, if the status information of service node N2 is at time t1, service node N2 can determine whether the time difference between time t and time t1 is greater than the second predetermined time interval T2. If it is, it means that service node N2 has successfully updated its own status information within the second predetermined time interval T2, and service node N2 is online. Conversely, if it is not, it means that service node N2 has failed to successfully update its own status information within the second predetermined time interval T2, and service node N2 is offline. The second predetermined time interval T2 is not less than the first predetermined time interval T1.

[0060] When a registered second service node is not online, the connection relationship corresponding to the second service node is deleted from the connection relationship information. This allows other online service nodes, including service node N1, to claim the blockchain system that originally had a long connection with the second service node in the subsequent process. This enables clients to access the blockchain system that was originally connected to the second service node through other online service nodes, including service node N1.

[0061] Service node N1 can also delete the registration information of the second service node from the configuration information.

[0062] In step S53, for the second blockchain system that has established a long connection with the service node N1, it is determined whether the connection relationship information includes the connection relationship between the second blockchain system and the service node N1. If not, the long connection between the second blockchain system and the service node N1 is disconnected.

[0063] When service node N1 is under high load, other service nodes may proactively preempt the blockchain systems that originally had long-term connections with service node N1 during the execution of load balancing strategies. The connection between the preempted blockchain system and service node N1 may be deleted from the connection relationship information after a corresponding time interval (e.g., time interval T3). For a second blockchain system that has already established a long-term connection with service node N1, if service node N1 finds that the connection relationship between the second blockchain system and service node N1 no longer exists in the connection relationship information, service node N1 can know that the second service node has been preempted by other service nodes, and service node N1 can disconnect its long-term connection with the second blockchain system.

[0064] When connection information is divided into instantaneous information and delayed information, service node N1 can also perform the following step S54: for any first connection relationship belonging to instantaneous information, determine whether the time difference between its establishment time and the current time reaches a preset threshold. If so, continue to perform steps S55 and S56.

[0065] The preset threshold is, for example, the aforementioned time interval T3.

[0066] In step S55, the second connection relationship is deleted from the delay information, wherein the first connection relationship and the second connection relationship correspond to the same blockchain system.

[0067] In step S56, the first connection relationship is deleted from the instant information and a new first connection relationship is added to the delayed information.

[0068] For example, during the execution of a load balancing strategy, service node N2's connection relationship information includes the connection relationship between service node N3 and blockchain system B4. If service node N2 preempts blockchain system B4, which originally had a long-term connection with service node N3, at time t2, service node N2 may add a new connection relationship between service node N2 and blockchain system B4 in the instant information at time t2, and set the establishment time of this connection relationship to time t2. If service node N1 determines in step S54 that the time difference between the current time and the establishment time t2 reaches a second preset threshold, it can delete the connection relationship between service node N2 and blockchain system B4 from the instant information, delete the connection relationship between service node N3 and blockchain system B4 from the delay information, and add a new connection relationship between service node N2 and blockchain system B4 in the delay information.

[0069] In step S57, based on a first number of at least two registered blockchain systems and a second number of service nodes that are online, the number of blockchain systems that have established long connections with service node N1 is adjusted.

[0070] See Figure 6 As shown, the aforementioned step S57 may include some or all of the following steps S571 to S577.

[0071] In step S571, a second number of service nodes that are online are determined based on the status information of at least two registered service nodes.

[0072] In step S573, the quotient of the first and second quantities of at least two registered blockchain systems is rounded up or down to obtain the processing result, and the third quantity of blockchain systems that have established long connections with service node N1 is determined.

[0073] In step S575, based on the connection relationship information, a fourth number of first blockchain systems that have not established a long connection with service node N1 are selected from at least two registered blockchain systems, and the connection relationship between the first service node and the first blockchain system is added to the connection relationship information. The fourth number is the difference between the processing result and the third number.

[0074] The first blockchain system can be an unclaimed blockchain system registered in the business system. For example, if service node N2 is not online, then the second service node identified as offline in step S53 will have its connection relationship with service node N2 deleted from the connection relationship information. For example, the connection relationship between blockchain systems B3 and B4 and service node N2 will be deleted in step S52. In step S575, service node N1 can query the connection relationship information in the configuration information and the blockchain system registration information list to find that blockchain systems B3 and B4 are unclaimed blockchain systems; then blockchain systems B3 and / or B4 may be selected as the first blockchain system for service node N1. Service node N1 can add the selected first blockchain system and its connection relationship to service node N1 in the connection relationship information, such as real-time information.

[0075] The first blockchain system can be a blockchain system that has established a long connection with the second service node, wherein the number of blockchain systems that have established a long connection with the second service node is greater than the aforementioned processing result. In step S575, service node N1 can discover the second service node with a high load by querying the connection relationship information, and select one or more first blockchain systems from the blockchain systems that have established a long connection with the second service node. In this case, if the connection relationship information includes instant information and delayed information, service node N1 can add the connection relationship between service node N1 and the first blockchain system in the instant information, set the establishment time of the connection relationship accordingly, and establish a long connection between service node N1 and the first blockchain system, thereby completing the takeover of the first blockchain system from the second service node in order to reduce the load of the second service node. It should be noted that during the process of service node N1 taking over the first blockchain system from the second service node, the connection relationship between the first blockchain system and the second service node is not immediately deleted from the connection relationship information, thereby ensuring that the transactions corresponding to the on-chain requests that the second service node has received but has not yet completed processing can still be sent to the first blockchain system.

[0076] In step S577, a long connection is established with the first blockchain system.

[0077] In step S57 mentioned above, the number of blockchain systems that establish long connections with service node N1 can also be adjusted in other ways. For example, at least two registered blockchain systems can be numbered, and the service nodes that are online can be renumbered. For each blockchain system, the number of the blockchain system can be moduloed using the second number of online service nodes. The blockchain node whose number is the same as that of service node N1 can be used as the blockchain system that needs to connect with service node N1. Then, the connection relationship information can be updated and a long connection can be established accordingly.

[0078] Based on the same concept as the aforementioned method embodiments, this specification also provides a first service node in a business system. The business system includes a client, a data storage system, multiple service nodes, and multiple blockchain systems. Each service node establishes a long-lived connection with several of the multiple blockchain systems. The data storage system stores configuration information, which includes at least connection relationship information between the multiple service nodes and the multiple blockchain systems. The first service node is one of the multiple service nodes. See also... Figure 7 The first service node includes: a request receiving unit 71, configured to receive an on-chain request from the client, the on-chain request including transaction data and the identifier of the target blockchain system, the on-chain request being routed to the first service node according to the connection relationship information and the identifier of the target blockchain system; and an on-chain processing unit 73, configured to send a target transaction corresponding to the transaction data to the target blockchain system through a long connection between the first service node and the target blockchain system.

[0079] Based on the same concept as the foregoing method embodiments, this specification also provides a business system. See [link to documentation]. Figure 8 The business system includes a client 81, a data storage system 83, multiple service nodes 85, and multiple blockchain systems 87. Each service node 85 establishes a long-lived connection with several of the blockchain systems 87. The data storage system 83 stores configuration information, which includes at least connection relationship information between the multiple service nodes 85 and the multiple blockchain systems 87. The client 81 generates an on-chain request including transaction data and the identifier of the target blockchain system. This on-chain request is routed to a first service node among the multiple service nodes 85 that has established a long-lived connection with the target blockchain system. The first service node is determined based on the connection relationship information and the identifier of the target blockchain system. The first service node sends a target transaction corresponding to the transaction data to the target blockchain system through its long-lived connection with the target blockchain system.

[0080] In one possible implementation, the business system further includes a routing node 89; the client 81 is configured to send the on-chain request to the routing node 89; the routing node 89 is configured to determine the first service node based on the identifier of the target blockchain system and the connection relationship information, and send the on-chain request to the first service node.

[0081] In one possible implementation, the connection relationship information includes instantaneous information and delayed information; the routing node 89 is specifically used to query whether there is target connection information corresponding to the target blockchain system in the instantaneous information according to the identifier of the target blockchain system. If so, the service node corresponding to the target connection information is determined as the first service node; otherwise, the first service node is queried from the delayed information.

[0082] In one possible implementation, the client 81 is further configured to obtain the connection relationship information; specifically, the client 81 is configured to determine the first service node based on the identifier of the target blockchain system and the connection relationship information, and send the on-chain request to the first service node.

[0083] In one possible implementation, the connection relationship information includes instant information and delayed information; the client 81 is specifically used to query whether there is target connection information corresponding to the target blockchain system in the instant information according to the identifier of the target blockchain system, and if so, determine the service node corresponding to the target connection information as the first service node, otherwise query the first service node from the delayed information.

[0084] This specification also provides a computer-readable storage medium storing a computer program that, when executed in a computer, causes the computer to perform the various method steps executed by the client C1, the routing node, or the service node N1 in the aforementioned method embodiments.

[0085] In the 1990s, improvements to a technology could be clearly distinguished as either hardware improvements (e.g., improvements to the circuit structure of diodes, transistors, switches, etc.) or software improvements (improvements to the methodology). However, with technological advancements, many methodological improvements today can be considered direct improvements to the hardware circuit structure. Designers almost always obtain the corresponding hardware circuit structure by programming the improved methodology into the hardware circuit. Therefore, it cannot be said that a methodological improvement cannot be implemented using hardware physical modules. For example, a Programmable Logic Device (PLD) (such as a Field Programmable Gate Array (FPGA)) is such an integrated circuit whose logic function is determined by the user programming the device. Designers can program and "integrate" a digital system onto a PLD themselves, without needing chip manufacturers to design and manufacture dedicated integrated circuit chips. Furthermore, nowadays, instead of manually manufacturing integrated circuit chips, this programming is mostly implemented using "logic compiler" software. Similar to the software compiler used in program development, the original code before compilation must be written in a specific programming language, called a Hardware Description Language (HDL). There are many HDLs, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), Confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), Lava, Lola, MyHDL, PALASM, and RHDL (Ruby Hardware Description Language). Currently, the most commonly used are VHDL (Very-High-Speed ​​Integrated Circuit Hardware Description Language) and Verilog. Those skilled in the art should understand that by simply performing some logic programming on the method flow using one of these hardware description languages ​​and programming it into an integrated circuit, the hardware circuit implementing the logical method flow can be easily obtained.

[0086] The controller can be implemented in any suitable manner. For example, it can take the form of a microprocessor or processor and a computer-readable medium storing computer-readable program code (e.g., software or firmware) executable by the (micro)processor, logic gates, switches, application-specific integrated circuits (ASICs), programmable logic controllers, and embedded microcontrollers. Examples of controllers include, but are not limited to, the following microcontrollers: ARC 625D, Atmel AT91SAM, Microchip PIC18F26K20, and Silicon Labs C8051F320. A memory controller can also be implemented as part of the control logic of the memory. Those skilled in the art will also recognize that, in addition to implementing the controller in purely computer-readable program code form, the same functionality can be achieved by logically programming the method steps to make the controller take the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers. Therefore, such a controller can be considered a hardware component, and the means included therein for implementing various functions can also be considered as structures within the hardware component. Alternatively, the means for implementing various functions can be considered as both software modules implementing the method and structures within the hardware component.

[0087] The systems, devices, modules, or units described in the above embodiments can be implemented by computer chips or physical entities, or by products with certain functions. A typical implementation device is a server system. Of course, this application does not exclude the possibility that, with the future development of computer technology, the computer implementing the functions of the above embodiments can be, for example, a personal computer, a laptop computer, an in-vehicle human-machine interaction device, a cellular phone, a camera phone, a smartphone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or any combination of these devices.

[0088] While one or more embodiments of this specification provide the operational steps of the methods described in the embodiments or flowcharts, more or fewer operational steps may be included based on conventional or non-inventive means. The order of steps listed in the embodiments is merely one possible order of execution among many steps and does not represent the only possible order. In actual device or end product execution, the methods shown in the embodiments or drawings may be executed sequentially or in parallel (e.g., in a parallel processor or multi-threaded processing environment, or even a distributed data processing environment). The terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, product, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, product, or apparatus. Without further limitations, the presence of other identical or equivalent elements in the process, method, product, or apparatus that includes the elements is not excluded. For example, the use of terms such as "first," "second," etc., is to denote names and does not indicate any particular order.

[0089] For ease of description, the above devices are described in terms of function, divided into various modules. Of course, when implementing one or more of these specifications, the functions of each module can be implemented in one or more software and / or hardware components, or a module that performs the same function can be implemented by a combination of multiple sub-modules or sub-units. The device embodiments described above are merely illustrative. For example, the division of units is only a logical functional division; in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, indirect coupling or communication connection between devices or units, and may be electrical, mechanical, or other forms.

[0090] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0091] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0092] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0093] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0094] Memory may include non-persistent storage in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0095] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information by any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage, graphene storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0096] Those skilled in the art will understand that one or more embodiments of this specification can be provided as a method, system, or computer program product. Therefore, one or more embodiments of this specification may take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, one or more embodiments of this specification may take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0097] One or more embodiments of this specification can be described in the general context of computer-executable instructions, such as program modules, that are executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform a particular task or implement a particular abstract data type. One or more embodiments of this specification can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.

[0098] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, system embodiments are basically similar to method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments. In the description of this specification, the terms "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of this specification. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described can be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification and the features of different embodiments or examples.

[0099] The above description is merely an embodiment of one or more embodiments of this specification and is not intended to limit the scope of these embodiments. Various modifications and variations can be made to these embodiments by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this specification should be included within the scope of the claims.

Claims

1. A method for accessing a blockchain system in a business system, the business system comprising a client, a data storage system, a plurality of service nodes and a plurality of blockchain systems, a single service node and a number of blockchain systems of the plurality of blockchain systems establishing a long connection, the data storage system storing configuration information, the configuration information comprising at least connection relationship information between the plurality of service nodes and the plurality of blockchain systems, the method being performed by any first service node of the plurality of service nodes, and comprising: receiving a chain-up request from the client, the chain-up request comprising transaction data and an identification of a target blockchain system, the chain-up request being routed to the first service node according to the connection relationship information and the identification of the target blockchain system; and sending a target transaction corresponding to the transaction data to the target blockchain system through the long connection between the first service node and the target blockchain system. 2.The method of claim 1, wherein the configuration information further comprises state information of at least two registered service nodes, the state information being used to determine whether a corresponding service node is in an online state; and the method further comprises adjusting a number of blockchain systems establishing a long connection with the first service node based on a first number of the at least two registered blockchain systems and a second number of service nodes in the online state. updating state information of the first service node, the updated state information being used to support other service nodes to determine that the first service node is in the online state within a predetermined time interval, and to determine that the first service node is not in the online state after the predetermined time interval. determining whether there is a second service node not in the online state according to the state information of the at least two service nodes, and if so, deleting a connection relationship corresponding to the second service node from the connection relationship information. wherein 5.The method of claim 2, wherein the adjusting a number of blockchain systems establishing a long connection with the first service node based on a first number of the at least two registered blockchain systems and a second number of service nodes in the online state comprises: determining the second number of service nodes in the online state according to the state information of the at least two service nodes; rounding up or down a quotient of the first number of the at least two registered blockchain systems and the second number to obtain a processing result, and determining a third number of blockchain systems having established a long connection with the first service node; selecting a fourth number of first blockchain systems not having established a long connection with the first service node from the at least two blockchain systems according to the connection relationship information, and adding a connection relationship between the first service node and the first blockchain systems in the connection relationship information, the fourth number being a difference between the processing result and the third number; and establishing a long connection with the first blockchain systems.

3. The method of claim 2, further comprising: ​ 4. The method of claim 2, further comprising: ​ ​ ​ ​ ​ ​ 6.The method of claim 5, wherein the first blockchain system is a blockchain system that does not have a long connection established with a service node, and the connection information includes instant information and delay information. The adding of the connection relationship between the first service node and the first blockchain system in the connection relationship information specifically includes: adding the connection relationship between the first service node and the first blockchain system in the delay information. 7.The method of claim 5, wherein the first blockchain system is a blockchain system that has established a long connection with a second service node, a number of blockchain systems that have established a long connection with the second service node is greater than the processing result, and the connection information includes instant information and delay information. The adding of the connection relationship between the first service node and the first blockchain system in the connection relationship information specifically includes: adding the connection relationship between the first service node and the first blockchain system in the instant information, and correspondingly setting the establishment time of the connection relationship.

8. The method of claim 1, further comprising: For a second blockchain system that has established a long connection with the first service node, it is determined whether the connection relationship between the second blockchain system and the first service node is included in the connection relationship information, and if not, the long connection between the second blockchain system and the first service node is disconnected.

9. The method of claim 1, wherein the connection relationship information comprises instant information and delay information. wherein The method further comprises: for any first connection relationship belonging to the instant information, determining whether the time difference between its establishment time and the current time reaches a preset threshold; if so, deleting a second connection relationship from the delay information, wherein the first connection relationship and the second connection relationship correspond to the same blockchain system.

10. The method of claim 9, further comprising: The first connection relationship is deleted from the instant information, and the first connection relationship is added in the delay information.

11. The method of any one of claims 1-10, wherein the service system further comprises a routing node, and the on-chain request is sent to the routing node by the client, and is correspondingly sent to the first service node by the routing node after determining the first service node according to the identification of the target blockchain system and the connection relationship information.

12. The method of any one of claims 1-10, further comprising: The connection relationship information is sent to the client, and the on-chain request is correspondingly sent to the first service node by the client after determining the first service node according to the identification of the target blockchain system and the connection relationship information.

13. The method of any one of claims 1-10, wherein the plurality of service nodes are implemented as a plurality of device clusters; or the plurality of service nodes are implemented as a plurality of computing services running in a single device cluster.

14. A first service node in a service system, the service system comprising a client, a data storage system, a plurality of service nodes and a plurality of blockchain systems, a single service node and a plurality of blockchain systems establish a long connection, the data storage system stores configuration information, the configuration information at least includes connection relationship information between the plurality of service nodes and the plurality of blockchain systems, the first service node is one of the plurality of service nodes, and the first service node comprises: a request receiving unit configured to receive an on-chain request from the client, the on-chain request comprising transaction data and an identification of a target blockchain system, and the on-chain request is routed to the first service node according to the connection relationship information and the identification of the target blockchain system; The upper chain processing unit is configured to send a target transaction corresponding to the transaction data to the target blockchain system through a long connection between the first service node and the target blockchain system.

15. A business system comprising a client, a data storage system, a plurality of service nodes and a plurality of blockchain systems, a single service node and a plurality of blockchain systems of the plurality of blockchain systems establishing a long connection, the data storage system storing configuration information, the configuration information at least including connection relationship information between the plurality of service nodes and the plurality of blockchain systems, wherein: The client is configured to generate an upper chain request including transaction data and an identifier of a target blockchain system, so that the upper chain request is routed to a first service node of the plurality of service nodes that has established a long connection with the target blockchain system, wherein the first service node is determined according to the connection relationship information and the identifier of the target blockchain system. The first service node is configured to send a target transaction corresponding to the transaction data to the target blockchain system through a long connection between the first service node and the target blockchain system.

16. The business system of claim 15, further comprising a routing node. The client is specifically configured to send the upper chain request to the routing node. The routing node is configured to determine the first service node according to the identifier of the target blockchain system and the connection relationship information, and send the upper chain request to the first service node.

17. The business system of claim 16, wherein the connection relationship information includes instant information and delay information. The routing node is specifically configured to query whether there is target connection information corresponding to the target blockchain system in the instant information according to the identifier of the target blockchain system, and if so, determine the service node corresponding to the target connection information as the first service node, otherwise query the first service node from the delay information.

18. The business system of claim 15, wherein the client is further configured to obtain the connection relationship information. The client is specifically configured to determine the first service node according to the identifier of the target blockchain system and the connection relationship information, and send the upper chain request to the first service node.

19. The business system of claim 18, wherein the connection relationship information includes instant information and delay information. The client is specifically configured to query whether there is target connection information corresponding to the target blockchain system in the instant information according to the identifier of the target blockchain system, and if so, determine the service node corresponding to the target connection information as the first service node, otherwise query the first service node from the delay information.

20. A computer-readable storage medium having a computer program stored thereon, when the computer program is executed in a computer, the computer program causes the computer to execute the method of any one of claims 1-13.

Citation Information

Patent Citations

  • Block chain-based trusted service scheduling method and device, equipment and storage medium

    CN113347212A