CN116346878A - Method for accessing block chain system, service node and business system - Google Patents

Method for accessing block chain system, service node and business system Download PDF

Info

Publication number
CN116346878A
CN116346878A CN202310143363.XA CN202310143363A CN116346878A CN 116346878 A CN116346878 A CN 116346878A CN 202310143363 A CN202310143363 A CN 202310143363A CN 116346878 A CN116346878 A CN 116346878A
Authority
CN
China
Prior art keywords
service node
information
service
blockchain
connection
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310143363.XA
Other languages
Chinese (zh)
Inventor
倪盛鑫
余珊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ant Blockchain Technology Shanghai Co Ltd
Original Assignee
Ant Blockchain Technology Shanghai Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ant Blockchain Technology Shanghai Co Ltd filed Critical Ant Blockchain Technology Shanghai Co Ltd
Priority to CN202310143363.XA priority Critical patent/CN116346878A/en
Publication of CN116346878A publication Critical patent/CN116346878A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/141Setup of application sessions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/12Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

A method for accessing a blockchain system in a service system, a service node and the service system. The service system comprises a client, a data storage system, a plurality of service nodes and a plurality of blockchain systems, wherein long connection is established between a single service node and a plurality of blockchain systems in the plurality of blockchain systems, configuration information is stored in the data storage system, and the configuration information at least comprises connection relation information between the plurality of service nodes and the plurality of blockchain systems. The method performed by any first service node of the plurality of service nodes comprises: receiving a uplink request from a client, wherein the uplink request comprises transaction data and an identifier of a target blockchain system, and the uplink request is routed to a first service node according to connection relation information and the identifier of the target blockchain system; and transmitting the 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.

Description

Method for accessing block chain system, service node and business system
Technical Field
The embodiment of the specification belongs to the field of blockchain, and particularly relates to a method for accessing a blockchain system, a service node and a service system.
Background
Blockchain (Blockchain) is a new application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanisms, encryption algorithms, and the like. In the block chain system, the data blocks are combined into a chain data structure in a sequential connection mode according to the time sequence, and the distributed account book which is not tamperable and counterfeit and is ensured in a cryptographic mode is formed. Because the blockchain has the characteristics of decentralization, non-tamperability of information, autonomy and the like, the blockchain is also receiving more and more attention and application.
Disclosure of Invention
The invention aims to provide a method for accessing a blockchain system, a service node and a service system.
In a first aspect, a method for accessing a blockchain system in a service system is provided, where the service system includes a client, a data storage system, a plurality of service nodes, and a plurality of blockchain systems, a long connection is established between a single service node and a plurality of blockchain systems in the plurality of blockchain systems, configuration information is stored in the data storage system, and the configuration information at least includes connection relationship information between the plurality of service nodes and the plurality of blockchain systems, and the method is performed by any first service node in the plurality of service nodes. The method comprises the following steps: receiving a uplink request from the client, wherein the uplink request comprises transaction data and an identifier of a target blockchain system, and the uplink request is routed to the first service node according to the connection relation information and the identifier of the target blockchain system; and transmitting 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.
In a second aspect, a first service node in a service system is provided, the service system includes a client, a data storage system, a plurality of service nodes and a plurality of blockchain systems, a long connection is established between a single service node and a plurality of blockchain systems in the plurality of blockchain systems, configuration information is stored in the data storage system, the configuration information at least includes connection relation information between the plurality of service nodes and the plurality of blockchain systems, and the first service node is one of the plurality of service nodes. The first service node comprises: a request receiving unit configured to receive a uplink request from the client, the uplink request including transaction data and an identification of a target blockchain system, the uplink request being routed to the first service node according to the connection relationship information and the identification of the target blockchain system; and the uplink processing unit is configured to send 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.
In a third aspect, a service system is provided, including a client, a data storage system, a plurality of service nodes, and a plurality of blockchain systems, where a long connection is established between a single service node and a plurality of blockchain systems in the plurality of blockchain systems, and configuration information is stored in the data storage system, where the configuration information at least includes connection relationship information between the plurality of service nodes and the plurality of blockchain systems. Wherein: the client is configured to generate a uplink request including transaction data and an identification of a target blockchain system, such that the uplink 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 from the connection relationship information and the identification of the target blockchain system; the first service node is configured to send, to the target blockchain system, a target transaction corresponding to the transaction data through a long connection between the first service node and the target blockchain system.
In a fourth aspect, there is provided a computer readable storage medium having stored thereon a computer program which, when executed in a computer, causes the computer to perform the method described in the first aspect.
In the solution of the embodiment of the present disclosure, a single service node only needs to dock a few blockchain systems with a smaller number of the plurality of blockchain systems, so that it has enough resources to establish a long connection between the plurality of blockchain systems that dock with the single service node; the uplink request which is initiated by the client and contains the transaction data and the identification of the target blockchain system can be accurately routed to the service node which has established long connection with the target blockchain system according to the connection relation information and the identification of the target blockchain system, and the service node which receives the uplink request can more rapidly complete the transmission of the target transaction corresponding to the transaction data to the target blockchain system through the long connection established between the service node and the target blockchain system, thereby being beneficial to supporting the more rapid completion of the accurate access of the target blockchain system by the client.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings that are needed in the description of the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments described in the present disclosure, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a block chain system architecture diagram provided in an embodiment of the present disclosure;
FIG. 2 is a system frame diagram of a business system provided in an embodiment of the present disclosure;
FIG. 3 is one of the flowcharts of a method of accessing a blockchain system provided in an embodiment of the present description;
FIG. 4 is a second flowchart of a method of accessing a blockchain system provided in an embodiment of the present disclosure;
FIG. 5 is a flow chart illustrating an exemplary service node executing a load balancing policy;
FIG. 6 is a flow chart of an exemplary provided service node adjusting the number of blockchain systems with which long connections are established;
fig. 7 is a schematic structural diagram of a service node according to an embodiment of the present disclosure;
fig. 8 is a schematic structural diagram of a service system provided in an embodiment of the present disclosure.
Detailed Description
In order to make the technical solutions in the present specification better understood by those skilled in the art, the technical solutions in the embodiments of the present specification will be clearly and completely described below with reference to the drawings in the embodiments of the present specification, and it is obvious that the described embodiments are only some embodiments of the present specification, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are intended to be within the scope of the present disclosure.
Fig. 1 is a block chain system architecture diagram exemplarily provided in an embodiment of the present specification. The blockchain system may include N blockchain nodes, with 8 blockchain nodes, node 1-node 8, being shown in fig. 1 by way of example. The connections between nodes schematically represent P2P (Peer to Peer) connections, which may be for example transmission control protocol (transmission control trotocol, TCP) connections, for supporting the transmission of data between different nodes.
Transactions in a blockchain system refer to task units that execute in the blockchain system and are recorded in the blockchain system. The transaction typically includes a send field (From), a receive field (To), and a Data field (Data). Where the transaction is a transfer transaction, the From field includes an account address From which the transaction was initiated (i.e., a transfer task To another account was initiated), the To field includes an account address From which the transaction was received (i.e., a transfer was received), and the Data field includes a transfer amount; in the case where a transaction is used To deploy a smart contract, the From field includes the account address From which the transaction originated, the Data field includes the code (e.g., bytecode or machine code) of the smart contract To be created, and the To field is null To indicate that the transaction is used To deploy a smart contract; in the case where the transaction is for invoking a smart contract, the From field includes the account address From which the transaction originated, the To field includes the contract address of the smart contract that was invoked, and the Data field includes the method of invoking the smart contract and the parameters that need To be imported into the smart contract.
A reliable uplink service is provided in the related art that can interface multiple clients and multiple blockchain systems. The user may provide a request for a uplink to the reliable uplink service through the client, including the transaction data and an identification of a target blockchain system that the user desires to access, and the reliable uplink service may send a target transaction corresponding to the transaction data to the target blockchain system according to the identification of the target blockchain system, so that the target blockchain system completes a transaction that the user desires to complete according to the target transaction. The access logic of the bottom layers of the block chain systems is shielded through reliable uplink service, so that a user can more conveniently use the different block chain systems as required; in addition, the reliable uplink service can also perform technical processing such as request idempotent, abnormal retry, result notification and the like on the uplink request/target transaction, so as to ensure that the target transaction can be accurately uplink to complete the transaction expected to be completed by the user. However, the number of connections, threads, and other resources that may be used by reliable uplink services are limited, and reliable uplink services typically require that after receiving a uplink request, a communication connection be established with a target blockchain system that the user desires to access, and then a target transaction is sent to the target blockchain system through the communication connection, making it difficult for the client to quickly complete access to the target blockchain system.
Fig. 2 is a system frame diagram of a service system provided in an embodiment of the present disclosure. The service system can comprise a plurality of clients, a data storage system, a plurality of service nodes and a plurality of blockchain systems, and can also comprise routing nodes; in addition to the data storage system and routing nodes, 4 blockchain systems, client C1, client C2, serving node N1, serving node N2, and blockchain systems B1-B4, are illustratively shown in FIG. 2. A single service node establishes long connections with a plurality of blockchain systems in the plurality of blockchain systems; the data storage system stores configuration information, and the configuration information at least comprises connection relation information between a plurality of service nodes and a plurality of block chain systems. In the service system, a single service node only needs to dock a plurality of blockchain systems with smaller quantity in a plurality of blockchain systems, so that the service node has enough resources to establish long connection among the blockchain systems which are docked with the service node; the uplink request which is initiated by the client and contains the transaction data and the identification of the target blockchain system can be accurately routed to the service node which has established long connection with the target blockchain system according to the connection relation information and the identification of the target blockchain system, and the service node which receives the uplink request can more rapidly complete the target transaction which is corresponding to the transaction data and is sent to the target blockchain system through the long connection established between the service node and the target blockchain system, so that the client can be supported to more rapidly complete the accurate access to the target blockchain system.
The connection relation information includes a plurality of connection relations. For example, in the case where the service node N1 has established a long connection with the blockchain system B1 and the service node N2 has established a long connection with the blockchain system N3, the connection relationship information may include: the connection relation between the service node N1 and the blockchain system B1, which is formed by the identification of the service node N1 and the identification of the blockchain system B1, and the connection relation between the service node N2 and the blockchain system B3, which is formed by the identification of the service node N2 and the identification of the blockchain system B3.
The connection relation information may be divided into instant information (backup information) and delay information. In this case, a single blockchain system may correspond to two connection relationships respectively located in the instant message and the delay message, for example, there may be a case where a long connection is established between the blockchain system B1 and both the service node N1 and the service node N2, the connection relationship between the blockchain system B1 and the service node N1 may be located in the instant message, and the connection relationship between the blockchain system B1 and the service node N2 may be located in the delay message. The connection relation belonging to the instant message is correspondingly provided with the establishment time of the connection relation.
The configuration information may also include registration information for service nodes and blockchain systems registered in the business system. For example, for the service node N1, the identification of the service node N1 and the address information of the service node N1 may be stored as registration information of the service node N1 in the service node registration list in the configuration information, thereby completing registration of the service node N1 in the service system; further, as for the blockchain system B1, the identification of the blockchain system B1 and address information of a plurality of blockchain nodes included in the blockchain system B1 may be stored as registration information of the blockchain system B1 in the blockchain system registration list in the configuration information, thereby completing registration of the blockchain system B1 in the service system.
The configuration information may further include status information of the registered service node, where the status information is used to support determining whether the corresponding service node is in an online state. For example, for the service node N1, it may update its own state information periodically at a first predetermined time interval T1, specifically, for example, update its own state information to time T at time T, and when it is required to determine whether the service node N1 is in an online state, other service nodes may determine that the service node N1 is in an online state if a time difference between the current time and the time T is not greater than a second predetermined time interval T2, and may otherwise determine that the service node N1 is not in an online state. The status information may also be in other forms, for example, variable values that are incremented by predetermined steps.
The single service node and long connection with a single blockchain system may specifically include multiple long connections. For example, a long connection is established between the service node N1 and the blockchain system B1, specifically, a plurality of long connections are established between a plurality of blockchain nodes included in the service node N1 and the blockchain system B1; the type of protocol used for long connections may include, for example, but is not limited to, TCP.
The plurality of service nodes may be implemented as a plurality of computing services running on a single device cluster, or the plurality of service nodes may be implemented as a plurality of device clusters. When the plurality of computing services are implemented as a plurality of device clusters, the plurality of computing services can be run on a single device cluster, and different computing services on the same device cluster can establish communication connection with the same blockchain system; for example, a computing service D1 and a computing service D2 may be running on the service node N1, where the computing service D1 and the computing service D2 each establish a long connection with the blockchain system B1 and the blockchain system B2.
The service node may access configuration information in the data storage system as needed so that the service node and/or other nodes can complete corresponding transactions according to the accessed configuration information. In addition, the routing node may query the configuration information stored in the data storage system as needed, and the client may query the configuration information in the data storage system directly or indirectly through the service node.
The process of client on-demand access to a target blockchain system is described in exemplary fashion below in connection with the business system shown in fig. 2.
FIG. 3 is one of the flowcharts of a method for accessing a blockchain system provided in an embodiment of the present disclosure. The process of client C1 accessing blockchain system B1 on demand in the case of a routing node included in the traffic system is illustratively described in this method.
Referring to fig. 3, the method may include, but is not limited to, some or all of the following steps S31 to S39.
In step S31, the client C1 generates a uplink request including transaction data and an identification of the blockchain system B1.
The transaction data in the uplink request may be a target transaction that the client C1 desires to send to the blockchain system B1, or the transaction data may be service data for supporting the corresponding service node to generate the target transaction.
In step S33, the client C1 transmits a request for uplink to the routing node.
In step S35, the routing node determines, according to the identifier of the blockchain system B1 and the connection relationship information stored in the data storage system, a first service node that has established a long connection with the blockchain system B1.
The routing node may query the connection relationship information for a target connection relationship corresponding to the blockchain system B1, for example, for target connection information including an identification of the blockchain system B1, and the blockchain system corresponding to the target connection information will be determined as the first serving node that has established a long connection with the blockchain system B1. When the connection information includes the instant information and the delay information, the routing node needs to query whether the instant information has the target connection information preferentially, if so, the service node corresponding to the target connection information is determined to be the first service node, if not, the target connection information is continuously queried from the delay information, and the service node corresponding to the target connection information is determined to be the first service node. In other words, in the case where the connection information corresponding to the blockchain system B1 is included in both the instant information and the delay information, the routing node determines the first service node using the target connection information corresponding to the blockchain system B1 in the instant information.
Taking the connection relationship information including the connection relationship between the service node N1 and the blockchain system B1, which is formed by the identifier of the service node N1 and the identifier of the blockchain system B1, as an example, the routing node may query that the connection information is a target connection relationship corresponding to the blockchain system B1, and further determine, based on the target connection relationship, that the first service node having established a long connection with the blockchain system B1 includes the service node N1.
Continuing with the example in which the first serving node determined in step S35 is serving node N1, in step S37 the routing node sends a request for a uplink to serving node N1 as the first serving node.
In step S39, the service node N1 transmits the target transaction corresponding to the transaction data to the blockchain system B1 through the long connection with the blockchain system B1. With reference to the foregoing, the target transaction may be transaction data included in the serving node N1, or the target transaction may be generated by the serving node N1 based on transaction data included in the uplink request it receives.
The service node N1 may query address information of a plurality of blockchain nodes included in the blockchain system B1 from registration information of the blockchain system B1 included in the configuration information according to an identifier of the blockchain system B1 included in the received uplink request, and further complete sending the target transaction to the blockchain system B1 using at least one of a plurality of long connections established between the service node N1 and the blockchain system B1 according to the address information of a plurality of blockchain nodes included in the blockchain system B1.
It should be noted that, when the service node N1 is implemented as a device cluster running a plurality of computing services, the service node N1 may specifically select one computing service with a relatively smaller load from the plurality of computing services, and complete the target transaction to the blockchain system B1 through at least one of a plurality of long connections established between the selected computing service and the blockchain system B1.
It should be noted that, the service node N1 may perform technical processing such as request idempotent, abnormal retry, and result notification on the uplink request/target transaction, so as to ensure that the target transaction can be accurately uplink to complete the transaction that the user desires to complete.
It should be noted that, after the blockchain system B1 receives the target transaction from the service node N1, a subsequent processing procedure may be executed based on the target transaction, so as to complete the transaction that the client C1 desires to complete.
FIG. 4 is a second flowchart of a method for accessing a blockchain system provided in an embodiment of the present disclosure. The process of client C1 accessing blockchain system B1 on demand without the inclusion of routing nodes in the business system is illustratively described in this method. The method shown in fig. 4 mainly describes the difference between the method and the method shown in fig. 3, and the same points can be seen in the embodiment shown in fig. 3, and the method shown in fig. 4 will not be described again.
Referring to fig. 4, the method may include, but is not limited to, some or all of the following steps S41 to S49.
In step S41, the client C1 generates a uplink request including transaction data and an identification of the blockchain system B1.
In step S43, the client C1 acquires connection relationship information stored in the data storage system.
The client C1 can directly access the configuration information in the data storage system or indirectly access the configuration information in the data storage system through any service node, so as to realize on-demand query and use related data in the configuration information. For example, the client C1 may periodically send a query request to any service node, so that the service node queries the configuration information/connection relationship information from the data storage system according to the query request, and correspondingly returns the configuration information/connection relationship information to the client C1.
In step S45, the client C1 determines, according to the connection relationship information and the identifier of the blockchain system B1, the first service node that has established a long connection with the blockchain system B1. The process of determining the first service node by the client C1 is similar to the process of determining the first service node by the routing node, and thus will not be described herein.
Continuing with the example in which the first service node determined in step S45 is the service node N1, in step S47, the client C1 transmits a uplink request to the service node N1 as the first service node.
In step S49, the service node N1 transmits the target transaction corresponding to the transaction data to the blockchain system B1 through the long connection with the blockchain system B1.
In the operation process of the service system, besides the method shown in the foregoing fig. 3 or fig. 4, the access of the client to the blockchain system can be rapidly and accurately completed, after each service node in the service system is started and operates normally, the load balancing strategy can be periodically executed according to the first preset time interval T1, so that the number of blockchain systems respectively butted by a plurality of service nodes is relatively balanced, and the influence on the performance of the whole service system caused by the overload of a single service node is avoided.
The process by which a single service node performs a load balancing policy is described in connection with the business system illustrated in fig. 2.
Fig. 5 is a flowchart of a method for a service node to execute a load balancing policy according to an embodiment of the present disclosure. In the method, the execution process of a single execution round is described when the service node N1 executes the load balancing policy according to the first predetermined time interval T1. Referring to fig. 5, the process may include, but is not limited to, part or all of steps S51 to S59 as follows.
In step S51, the status information of the service node N1 is updated.
The serving node N1 may for example update its state information to the current time t.
In step S52, it is determined whether there is a second service node that is not in an on-line state according to the state information of the registered at least two service nodes, and if so, the connection relationship corresponding to the second service node is deleted from the connection relationship information.
For a registered service node in the service system, for example, the service node N2, assuming that when the service node N1 starts to execute the load balancing policy shown in fig. 5 at a time T, the service node N1 may determine whether a time difference between the time T and the time T1 is greater than a second predetermined time interval T2, if so, it is indicated that the service node N2 has successfully updated its own state information within the second predetermined time interval T2, and it may be determined that the service node N2 is in an online state; otherwise, it is indicated that the service node N2 fails to successfully update its own state information at the second predetermined time interval T2, and it may be determined that the service node N2 is not in the online state. Wherein the second predetermined time interval T2 is not smaller than the first predetermined time interval T1.
When the registered second service node is not in the online state, deleting the connection relation corresponding to the second service node from the connection relation information, so that other service nodes in the online state including the service node N1 can claim the blockchain system originally established with the second service node in a subsequent process, and the client can access the blockchain system originally butted with the second service node through the other service nodes in the online state including the service node N1.
The service node N1 may also delete the registration information of the second service node from the configuration information.
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, and if not, the long connection between the second blockchain system and the service node N1 is broken.
When the load of the service node N1 is high, other service nodes may actively preempt the blockchain system that originally has a long connection with the service node N1 in the process of executing the load balancing policy, and the connection relationship between the preempted blockchain system and the service node N1 may be deleted from the connection relationship information after a corresponding time interval (e.g., time interval T3) elapses. For the second blockchain system having established a long connection with the service node N1, if the service node N1 queries that the connection relationship between the second blockchain system and the service node N1 does not already exist in the connection relationship information, the service node N1 may learn that the second service node has been preempted by other service nodes, and the service node N1 may disconnect the long connection with the second blockchain system.
In the case where the connection relationship information is divided into the instant information and the delay information, the service node N1 may further perform the following step S54 of determining, for any of the first connection relationships belonging to the instant information, whether the time difference between the establishment time and the current time thereof reaches a preset threshold. If so, step S55 and step S56 are continued.
The predetermined threshold is, for example, the aforementioned time interval T3.
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.
In step S56, the first connection relationship is deleted from the instant message, and the first connection relationship is newly added in the delay message.
For example, in the process of executing the load balancing policy, the connection relationship information of the service node N2 includes the connection relationship between the service node N3 and the blockchain system B4; if the service node N2 preempts the blockchain system B4 originally having a long connection with the service node N3 at time t2, the service node N2 may newly add the connection relationship between the service node N2 and the blockchain system B4 in the instant message at time t2, and set the time of setting the connection relationship as time t2. If the service node N1 determines in step S54 that the time difference between the current time and the set-up time t2 reaches the second preset threshold, the connection relationship between the service node N2 and the blockchain system B4 may be deleted from the instant message, the connection relationship between the service node N3 and the blockchain system B4 may be deleted from the delay message, and the connection relationship between the service node N2 and the blockchain system B4 may be newly added to the delay message.
In step S57, the number of blockchain systems that establish a long connection with the serving node N1 is adjusted based on the first number of registered at least two blockchain systems and the second number of serving nodes that are in an online state.
As shown in fig. 6, the aforementioned step S57 may include, for example, some or all of the following steps S571 to S577.
In step S571, a second number of service nodes in an online state is determined according to the state information of the registered at least two service nodes.
At step S573, a third number of blockchain systems that have established long connections with the serving node N1 is determined by rounding up or rounding down the quotient of the first number and the second number of registered at least two blockchain systems to obtain a processing result.
In step S575, a fourth number of first blockchain systems that do not establish long connection with the service node N1 are selected from the registered at least two blockchain systems according to the connection relationship information, and the connection relationship between the first service node and the first blockchain systems is newly added in the connection relationship information, where the fourth number is a difference between the processing result and the third number.
The first blockchain system may be an unclaimed blockchain system registered in the business system. For example, if the service node N2 is not on-line, the second service node determined to be not on-line in the step S53 is deleted, and the connection relationship corresponding to the service node N2 in the connection relationship information is deleted, for example, the connection relationship among the blockchain system B3, the blockchain system B4 and the service node N2 is deleted in the step S52. In step S575, the service node N1 may find that the blockchain system B3 and the blockchain system B4 are unclaimed blockchain systems by querying the connection relationship information and the blockchain system registration information list in the configuration information; then the blockchain system B3 and/or the blockchain system B4 may be the first blockchain system for selection by the serving node N1. The service node N1 may add the connection relationship between the selected first blockchain system and the service node N1 to the connection relationship information, such as instant message.
The first blockchain system may be a blockchain system that has established long connections with the second service node, wherein the number of blockchain systems that have established long connections with the second service node is greater than the processing results described above. In step S575, the service node N1 may find a second service node with a higher load by querying the connection relationship information, and select one or more first blockchain systems from the blockchain systems that have established long connections with the second service node. In this case, if the connection relationship information includes the instant information and the delay information, the service node N1 may newly increase the connection relationship between the service node N1 and the first blockchain system in the instant information, correspondingly set the establishment time of the connection relationship, and establish a long connection between the service node N1 and the first blockchain system, so as to complete preemption of the first blockchain system from the second service node, so as to reduce the load of the second service node. It should be noted that, in the process that the service node N1 preempts the first blockchain system from the second service node, the connection relationship between the first blockchain system and the second service node is not deleted immediately from the connection relationship information, so that it can be ensured that the transaction corresponding to the uplink request that the second service node has received but has not completed processing can still be sent to the first blockchain system correspondingly.
In step S577, a long connection is established with the first blockchain system.
In the step S57, the adjustment of the number of the blockchain systems that establish the long connection with the service node N1 may be implemented in other manners, for example, the registered at least two blockchain systems may be numbered, and the service node in the online state may be numbered again; for each blockchain system, the number of the blockchain system can be subjected to modulo operation by utilizing the second number of the service nodes in the online state, and the blockchain node with the operation result identical to the number of the service node N1 can be used as the blockchain system needing to be in butt joint with the service node N1, so that the connection relation information is correspondingly updated, and long connection is established.
Based on the same concept as the foregoing method embodiment, in an embodiment of the present disclosure, a first service node in a service system is further provided, where the service system includes a client, a data storage system, a plurality of service nodes, and a plurality of blockchain systems, where a long connection is established between a single service node and a plurality of blockchain systems, and configuration information is stored in the data storage system, where the configuration information includes at least connection relationship information between the plurality of service nodes and the plurality of blockchain systems, and the first service node is one of the plurality of service nodes. Referring to fig. 7, the first service node includes: a request receiving unit 71 configured to receive a uplink request from the client, the uplink request including transaction data and an identification of a target blockchain system, the uplink request being routed to the first service node according to the connection relationship information and the identification of the target blockchain system; the uplink processing unit 73 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.
The same concept as the foregoing method embodiment is based on, and a service system is further provided in this embodiment of the present specification. Referring to fig. 8, the service system includes a client 81, a data storage system 83, a plurality of service nodes 85 and a plurality of blockchain systems 87, wherein a long connection is established between a single service node 85 and a plurality of blockchain systems 87 in the plurality of blockchain systems 87, and configuration information is stored in the data storage system 83, and at least includes connection relation information between the plurality of service nodes 85 and the plurality of blockchain systems 87. Wherein the client 81 is configured to generate a uplink request including transaction data and an identification of a target blockchain system such that the uplink request is routed to a first service node of the plurality of service nodes 85 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 identification of the target blockchain system; the first service node is configured to send, to the target blockchain system, a target transaction corresponding to the transaction data through a long connection between the first service node and the target blockchain system.
In one possible implementation, the service system further comprises a routing node 89; the client 81 is configured to send the uplink request to the routing node 89; the routing node 89 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 uplink request to the first service node.
In one possible implementation, the connection relation information includes instant information and delay information; the routing node 89 is specifically configured to query, according to the identifier of the target blockchain system, whether there is target connection information corresponding to the target blockchain system in the instant message, if so, determine a service node corresponding to the target connection information as the first service node, otherwise, query the first service node from the delay information.
In a possible implementation manner, the client 81 is further configured to obtain the connection relationship information; the client 81 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 uplink request to the first service node.
In one possible implementation, the connection relation information includes instant information and delay information; the client 81 is specifically configured to query, according to the identifier of the target blockchain system, whether target connection information corresponding to the target blockchain system exists in the instant message, if so, determine a service node corresponding to the target connection information as the first service node, otherwise, query the first service node from the delay information.
There is also provided in the embodiments of the present specification a computer readable storage medium having stored thereon a computer program which, when executed in a computer, causes the computer to perform the method steps performed by the client C1, the routing node or the service node N1 in the embodiments of the method described above.
In the 90 s of the 20 th century, improvements to one technology could clearly be distinguished as improvements in hardware (e.g., improvements to circuit structures such as diodes, transistors, switches, etc.) or software (improvements to the process flow). However, with the development of technology, many improvements of the current method flows can be regarded as direct improvements of hardware circuit structures. Designers almost always obtain corresponding hardware circuit structures by programming improved method flows into hardware circuits. Therefore, an improvement of a method flow cannot be said to be realized by a hardware entity module. For example, a programmable logic device (Programmable Logic Device, PLD) (e.g., field programmable gate array (Field Programmable Gate Array, FPGA)) is an integrated circuit whose logic function is determined by the programming of the device by a user. A designer programs to "integrate" a digital system onto a PLD without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Moreover, nowadays, instead of manually manufacturing integrated circuit chips, such programming is mostly implemented by using "logic compiler" software, which is similar to the software compiler used in program development and writing, and the original code before the compiling is also written in a specific programming language, which is called hardware description language (Hardware Description Language, HDL), but not just one of the hdds, but a plurality of kinds, 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, RHDL (Ruby Hardware Description Language), etc., VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog are currently most commonly used. It will also be apparent to those skilled in the art that a hardware circuit implementing the logic method flow can be readily obtained by merely slightly programming the method flow into an integrated circuit using several of the hardware description languages described above.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, 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 (Application Specific Integrated Circuit, ASIC), programmable logic controllers, and embedded microcontrollers, examples of which include, but are not limited to, the following microcontrollers: ARC 625D, atmel AT91SAM, microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic of the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller in a pure computer readable program code, it is well possible to implement the same functionality by logically programming the method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers, etc. Such a controller may thus be regarded as a kind of hardware component, and means for performing various functions included therein may also be regarded as structures within the hardware component. Or even means for achieving the various functions may be regarded as either software modules implementing the methods or structures within hardware components.
The system, apparatus, module or unit set forth in the above embodiments may be implemented in particular by a computer chip or entity, or by a product having a certain function. One typical implementation device is a server system. Of course, the present application does not exclude that as future computer technology evolves, the computer implementing the functions of the above-described embodiments may be, for example, a personal computer, a laptop computer, a car-mounted human-computer interaction device, a cellular telephone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
Although one or more embodiments of the present description provide method operational steps as 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 recited in the embodiments is merely one way of performing the order of steps and does not represent a unique order of execution. When implemented in an actual device or end product, the instructions may be executed sequentially or in parallel (e.g., in a parallel processor or multi-threaded processing environment, or even in a distributed data processing environment) as illustrated by the embodiments or by the figures. The terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, it is not excluded that additional identical or equivalent elements may be present in a process, method, article, or apparatus that comprises a described element. For example, if first, second, etc. words are used to indicate a name, but not any particular order.
For convenience of description, the above devices are described as being functionally divided into various modules, respectively. Of course, when one or more of the present description is implemented, the functions of each module may be implemented in the same piece or pieces of software and/or hardware, or a module that implements the same function may be implemented by a plurality of sub-modules or a combination of sub-units, or the like. The above-described apparatus embodiments are merely illustrative, for example, the division of the units is merely a logical function division, and there may be additional divisions when actually implemented, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be an indirect coupling or communication connection via some interfaces, devices or units, which may be in electrical, mechanical or other form.
The present 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 flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may 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, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In one typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer 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 technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage, graphene storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
One skilled in the relevant art will recognize that one or more embodiments of the present description may be provided as a method, system, or computer program product. Accordingly, one or more embodiments of the present description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Moreover, one or more embodiments of the present description can take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
One or more embodiments of the present specification may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. One or more embodiments of the present description may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for system embodiments, since they are substantially similar to method embodiments, the description is relatively simple, as relevant to see a section of the description of method embodiments. In the description of the present specification, a description referring to terms "one embodiment," "some embodiments," "examples," "specific examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present specification. In this specification, schematic representations of the above terms are not necessarily directed to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, the various embodiments or examples described in this specification and the features of the various embodiments or examples may be combined and combined by those skilled in the art without contradiction.
The foregoing is merely an example of one or more embodiments of the present specification and is not intended to limit the one or more embodiments of the present specification. Various modifications and alterations to one or more embodiments of this description will be apparent to those skilled in the art. Any modification, equivalent replacement, improvement, or the like, which is within the spirit and principles of the present specification, should be included in the scope of the claims.

Claims (20)

1. A method for accessing a blockchain system in a service system, the service system including a client, a data storage system, a plurality of service nodes, and a plurality of blockchain systems, a long connection being established between a single service node and a plurality of blockchain systems in the plurality of blockchain systems, configuration information being stored in the data storage system, the configuration information including 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 in the plurality of service nodes, the method comprising:
receiving a uplink request from the client, wherein the uplink request comprises transaction data and an identifier of a target blockchain system, and the uplink request is routed to the first service node according to the connection relation information and the identifier of the target blockchain system;
And transmitting 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 according to claim 1, wherein the configuration information further includes state information of the registered at least two service nodes, the state information being used to determine whether the corresponding service node is in an online state;
wherein the method further comprises: the number of blockchain systems that establish a long connection with the first service node is adjusted based on a first number of registered at least two blockchain systems and a second number of service nodes that are online.
3. The method of claim 2, the method further comprising: and updating the state information of the first service node, wherein the updated state information is used for supporting other service nodes to determine that the first service node is in an online state in a preset time interval, and determining that the first service node is not in the online state after the preset time interval.
4. The method of claim 2, the method further comprising: and determining whether a second service node which is not in an online state exists or not according to the state information of the at least two service nodes, and deleting the connection relation corresponding to the second service node from the connection relation information if the second service node is in the online state.
5. The method according to claim 2, wherein the adjusting the number of blockchain systems establishing a long connection with the first service node based on the first number of registered at least two blockchain systems and the second number of service nodes in an online state, specifically comprises:
determining a second number of service nodes in an online state according to the state information of the at least two service nodes;
rounding up or rounding down the quotient of the first number and the second number of the registered at least two blockchain systems to obtain a processing result, and determining a third number of blockchain systems which have established long connections with the first service node;
selecting a fourth number of first blockchain systems which do not establish long connection with the first service node from the at least two blockchain systems according to the connection relation information, and newly adding the connection relation between the first service node and the first blockchain systems in the connection relation information, wherein the fourth number is the difference between the processing result and the third number;
a long connection is established with the first blockchain system.
6. The method of claim 5, the first blockchain system being a blockchain system that does not establish a long connection with a serving node, the connection information including instant information and delay information; wherein, the newly adding the connection relationship between the first service node and the first blockchain system in the connection relationship information specifically includes: and newly adding the connection relation between the first service node and the first blockchain system in the delay information.
7. The method of claim 5, the first blockchain system being a blockchain system that has established long connections with a second serving node, the number of blockchain systems that have established long connections with the second serving node being greater than the processing result, the connection information including instant information and delay information; wherein, the newly adding the connection relationship between the first service node and the first blockchain system in the connection relationship information specifically includes: and newly adding the connection relation between the first service node and the first block chain system in the instant message, and correspondingly setting the establishment time of the connection relation.
8. The method of claim 1, the method further comprising: and for a second blockchain system which has established long connection with the first service node, determining whether the connection relation information comprises the connection relation between the second blockchain system and the first service node, and if not, disconnecting the long connection between the second blockchain system and the first service node.
9. The method of claim 1, the connection relationship information comprising instant information and delay information;
wherein the method further comprises: for any first connection relation belonging to the instant message, determining whether the time difference between the establishment time and the current time reaches a preset threshold value or not; and if so, deleting a second connection relation from the delay information, wherein the first connection relation and the second connection relation correspond to the same block chain system.
10. The method of claim 9, the method further comprising: deleting the first connection relation from the instant message, and adding the first connection relation in the delay message.
11. The method according to any of claims 1-10, the service system further comprising a routing node to which the uplink request is sent by the client, the first service node being correspondingly sent by the routing node after determining the first service node according to the identification of the target blockchain system and the connection relation information.
12. The method of any one of claims 1-10, the method further comprising: and sending the connection relation information to the client, and correspondingly sending the uplink request 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 relation information.
13. The method of any of claims 1-10, the plurality of service nodes being implemented as a plurality of device clusters; alternatively, 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 including a client, a data storage system, a plurality of service nodes, and a plurality of blockchain systems, a single of the service nodes and a plurality of blockchain systems having long connections established therein, configuration information stored in the data storage system, the configuration information including at least connection relationship information between the plurality of service nodes and the plurality of blockchain systems, the first service node being one of the plurality of service nodes, the first service node comprising:
a request receiving unit configured to receive a uplink request from the client, the uplink request including transaction data and an identification of a target blockchain system, the uplink request being routed to the first service node according to the connection relationship information and the identification of the target blockchain system;
and the uplink processing unit is configured to send 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.
15. The service system comprises a client, a data storage system, a plurality of service nodes and a plurality of blockchain systems, wherein long connection is established between a single service node and a plurality of blockchain systems in the plurality of blockchain systems, configuration information is stored in the data storage system, and the configuration information at least comprises connection relation information between the plurality of service nodes and the plurality of blockchain systems, wherein:
The client is configured to generate a uplink request including transaction data and an identification of a target blockchain system, such that the uplink 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 from the connection relationship information and the identification of the target blockchain system;
the first service node is configured to send, to the target blockchain system, a target transaction corresponding to the transaction data 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 uplink 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 uplink request to the first service node.
17. The business system of claim 16, wherein said connection relationship information includes instant information and delay information;
the routing node is specifically configured to query, according to the identifier of the target blockchain system, whether target connection information corresponding to the target blockchain system exists in the instant message, if so, determine a service node corresponding to the target connection information as the first service node, and 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 uplink request to the first service node.
19. The business system of claim 18, wherein said connection relationship information includes instant information and delay information;
the client is specifically configured to query, according to the identifier of the target blockchain system, whether target connection information corresponding to the target blockchain system exists in the instant message, if so, determine a 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 stored thereon a computer program which, when executed in a computer, causes the computer to perform the method of any of claims 1-13.
CN202310143363.XA 2023-02-20 2023-02-20 Method for accessing block chain system, service node and business system Pending CN116346878A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310143363.XA CN116346878A (en) 2023-02-20 2023-02-20 Method for accessing block chain system, service node and business system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310143363.XA CN116346878A (en) 2023-02-20 2023-02-20 Method for accessing block chain system, service node and business system

Publications (1)

Publication Number Publication Date
CN116346878A true CN116346878A (en) 2023-06-27

Family

ID=86875500

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310143363.XA Pending CN116346878A (en) 2023-02-20 2023-02-20 Method for accessing block chain system, service node and business system

Country Status (1)

Country Link
CN (1) CN116346878A (en)

Similar Documents

Publication Publication Date Title
CN111756550B (en) Block chain consensus method and device
CA3048742C (en) Blockchain-based consensus method and device
CN114679457B (en) Node grouping method in block chain and block chain link point
WO2024001024A1 (en) Method for executing transaction in blockchain system, and blockchain system and nodes
WO2023160083A1 (en) Method for executing transactions, blockchain, master node, and slave node
CN113852498B (en) Method and device for deploying, managing and calling components
CN110430255A (en) The processing method of service request, system and electronic equipment in distributed type assemblies
CN114820187A (en) Data processing method and device, electronic equipment and storage medium
CN114785800B (en) Cross-link communication method, device, storage medium and computing equipment
CN115150409B (en) Method for executing transaction in blockchain system, node and computer readable storage medium
WO2023231342A1 (en) Method and apparatus for automatically executing contract on the basis of variable state
CN116346878A (en) Method for accessing block chain system, service node and business system
CN114422526B (en) Block synchronization method and device, electronic equipment and storage medium
CN116366666A (en) Chain state updating method and block link point in block chain system
CN116032756A (en) Method for updating configuration information of application program based on block chain and block chain link point
CN116048886A (en) Method and device for performing active-standby switching of block chain nodes
CN115714652A (en) Transaction execution method and block link point
CN113126884B (en) Data migration method, data migration device, electronic equipment and computer storage medium
CN114422527B (en) Block synchronization method and device, electronic equipment and storage medium
CN114785853B (en) Method, apparatus, storage medium and computing device for cross-chain communication in a blockchain system
CN114697344B (en) Method for determining consensus node in blockchain system, node, storage medium and computing device
CN110413935B (en) Data information processing method, device and system
CN117041980B (en) Network element management method and device, storage medium and electronic equipment
CN110417904B (en) Push information processing method, device and system
CN114612238A (en) Method and device for returning block chain transaction execution result

Legal Events

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