WO2023207082A1 - Procédé et appareil d'équilibrage de charge, ainsi que dispositif électronique - Google Patents

Procédé et appareil d'équilibrage de charge, ainsi que dispositif électronique Download PDF

Info

Publication number
WO2023207082A1
WO2023207082A1 PCT/CN2022/135418 CN2022135418W WO2023207082A1 WO 2023207082 A1 WO2023207082 A1 WO 2023207082A1 CN 2022135418 W CN2022135418 W CN 2022135418W WO 2023207082 A1 WO2023207082 A1 WO 2023207082A1
Authority
WO
WIPO (PCT)
Prior art keywords
blockchain
transaction request
transaction
consensus
node device
Prior art date
Application number
PCT/CN2022/135418
Other languages
English (en)
Chinese (zh)
Inventor
林鹏
邓福喜
Original Assignee
蚂蚁区块链科技(上海)有限公司
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 蚂蚁区块链科技(上海)有限公司 filed Critical 蚂蚁区块链科技(上海)有限公司
Publication of WO2023207082A1 publication Critical patent/WO2023207082A1/fr

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/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1001Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
    • H04L67/1004Server selection for load balancing
    • H04L67/1025Dynamic adaptation of the criteria on which the server selection is based

Definitions

  • One or more embodiments of this specification relate to the field of blockchain technology, and in particular, to a load balancing method and device and electronic equipment.
  • Blockchain technology also known as distributed ledger technology, is an emerging technology in which several computing devices jointly participate in "bookkeeping" and jointly maintain a complete distributed database. Because blockchain technology is decentralized, open and transparent, each computing device can participate in database records, and data can be synchronized quickly between computing devices, blockchain technology has been widely used in many fields. Apply.
  • the embodiments of this specification provide a method, device and electronic equipment for improving information security.
  • a load balancing method is provided, applied to an access program corresponding to a blockchain, and the method includes:
  • the transaction request is a transaction request related to a blockchain transaction
  • the node device participating in the consensus in the blockchain provides the transaction with Request allocation of target node equipment, and send the transaction request to the allocated target node equipment for processing; wherein, different types of consensus algorithms supported by the blockchain respectively correspond to different load balancing strategies.
  • the method also includes:
  • the transaction request is a transaction request that is not related to the blockchain transaction, based on the preset load balancing strategy, allocate the node device with the optimal load to the transaction request from the node devices that do not participate in the consensus in the blockchain. , and send the transaction request to the node device for processing.
  • the consensus algorithm supported by the blockchain includes an asynchronous consensus algorithm;
  • the transaction requests related to blockchain transactions include blockchain transactions and query requests for blockchain transactions;
  • the method of allocating a target node device to the transaction request from the node devices participating in the consensus in the blockchain based on the load balancing strategy corresponding to the consensus algorithm supported by the blockchain includes:
  • the transaction request is a blockchain transaction, based on the load balancing strategy corresponding to the asynchronous consensus algorithm, the target of allocating the optimal load to the blockchain transaction from the node devices participating in the consensus in the blockchain Node equipment, and establish a binding relationship between the blockchain transaction and the target node equipment;
  • the transaction request is a query request corresponding to a blockchain transaction
  • the binding relationship is queried, and the target node device bound to the blockchain transaction is assigned to the query request.
  • the consensus algorithm supported by the blockchain also includes a synchronous consensus algorithm
  • the method of allocating a target node device to the transaction request from the node devices participating in the consensus in the blockchain based on the load balancing strategy corresponding to the consensus algorithm supported by the blockchain includes:
  • the target node device with the optimal load is allocated to the transaction request from the node devices participating in the consensus in the blockchain.
  • the optimally loaded node device includes a randomly designated node device.
  • the synchronous consensus algorithm includes the pbft consensus algorithm; the asynchronous consensus algorithm includes the honeybadger consensus algorithm.
  • the access program includes an SDK program for accessing the blockchain.
  • the SDK program includes an SDK access program installed on the user client;
  • the reception of transaction requests submitted by users includes:
  • the SDK program includes an SDK access service program corresponding to the user client mounted on the blockchain service platform;
  • the reception of transaction requests submitted by users includes:
  • the access program maintains a first connection pool based on connections with each node device that participates in consensus in the blockchain; and, based on connections with nodes that do not participate in consensus in the blockchain A second connection pool composed of connections between various node devices;
  • Allocating a target node device to the transaction request from the node devices participating in the consensus in the blockchain, and sending the transaction request to the assigned target node device for processing including:
  • Allocating the node device with the optimal load to the transaction request from the node devices that do not participate in the consensus in the blockchain, and sending the transaction request to the node device for processing includes:
  • the method also includes:
  • Timing detection determines whether the connections in the first connection pool and the second connection pool are available, and based on the detection results, adds an indication that the connection is available to the connections in the first connection pool and the second connection pool. available tags;
  • Allocating a target connection for the transaction request from the first connection pool includes:
  • Allocating a target connection for the transaction request from the second connection pool includes:
  • the timing to determine whether connections in the first connection pool and the second connection pool are available includes:
  • the preset timestamp range includes a timestamp range corresponding to a specified block in the blockchain.
  • a load balancing device which is applied to the access program corresponding to the blockchain.
  • the device includes:
  • the receiving unit receives transaction requests submitted by users
  • a determining unit that determines the type of the transaction request in response to the received transaction request submitted by the user
  • a balancing unit when the transaction request is a transaction request related to a blockchain transaction, based on the load balancing strategy corresponding to the consensus algorithm supported by the blockchain, from the node devices participating in the consensus in the blockchain Allocate a target node device to the transaction request, and send the transaction request to the assigned target node device for processing; wherein, the different types of consensus algorithms supported by the blockchain respectively correspond to different load balancing strategies. .
  • the balancing unit is also configured to remove node devices that do not participate in the consensus from the blockchain based on a preset load balancing strategy when the transaction request is a transaction request that is not related to a blockchain transaction. Allocate the node device with the optimal load to the transaction request, and send the transaction request to the node device for processing.
  • the consensus algorithm supported by the blockchain includes an asynchronous consensus algorithm;
  • the transaction requests related to blockchain transactions include blockchain transactions and query requests for blockchain transactions;
  • the balancing unit is also configured to, when the transaction request is a blockchain transaction, based on the load balancing strategy corresponding to the asynchronous consensus algorithm, from the node devices participating in the consensus in the blockchain, provide the balance for the zone.
  • the block chain transaction allocates the target node device with the optimal load, and establishes a binding relationship between the block chain transaction and the target node device; and, when the transaction request is a query request corresponding to the block chain transaction, based on The load balancing strategy corresponding to the asynchronous consensus algorithm queries the binding relationship, and allocates the target node device bound to the blockchain transaction to the query request.
  • the consensus algorithm supported by the blockchain also includes a synchronous consensus algorithm
  • the balancing unit is also configured to allocate the target node device with the optimal load to the transaction request from the node devices participating in the consensus in the blockchain based on the load balancing strategy corresponding to the synchronous consensus algorithm.
  • the optimally loaded node device includes a randomly designated node device.
  • the synchronous consensus algorithm includes the pbft consensus algorithm; the asynchronous consensus algorithm includes the honeybadger consensus algorithm.
  • the access program includes an SDK program for accessing the blockchain.
  • the SDK program includes an SDK access program installed on the user client;
  • the receiving unit is also used to obtain the transaction request initiated by the user on the user client.
  • the SDK program includes an SDK access service program corresponding to the user client mounted on the blockchain service platform;
  • the receiving unit is also configured to receive a transaction request submitted by the user client by calling the service interface deployed on the blockchain service platform and corresponding to the SDK access service program.
  • the access program maintains a first connection pool based on connections with each node device that participates in consensus in the blockchain; and, based on connections with nodes that do not participate in consensus in the blockchain A second connection pool composed of connections between various node devices;
  • the balancing unit allocates a target node device for the transaction request from the node devices participating in the consensus in the blockchain, and sends the transaction request to the assigned target node device for processing, including:
  • the balancing unit allocates the node device with the optimal load for the transaction request from the node devices in the blockchain that do not participate in the consensus, and sends the transaction request to the node device for processing, including:
  • the device also includes:
  • a detection unit that periodically detects and determines whether the connections in the first connection pool and the second connection pool are available, and adds the indication to the connections in the first connection pool and the second connection pool based on the detection results. Connect to available tags available;
  • the balancing unit allocates a target connection for the transaction request from the first connection pool, including:
  • the balancing unit allocates a target connection for the transaction request from the second connection pool, including:
  • the detection unit is also configured to regularly send an asynchronous query request to the node device corresponding to the connection in the first connection pool and the second connection pool; if the request is received within the preset timestamp range, If the response data returned by the node device is received, it is determined that the connection is available; if the response data returned by the node device is not received within the preset timestamp range, the connection is determined to be unavailable.
  • the preset timestamp range includes a timestamp range corresponding to a specified block in the blockchain.
  • an electronic device including:
  • Memory used to store instructions executable by the processor
  • the processor is configured for any one of the above load balancing methods.
  • the embodiment of this specification provides a load balancing solution that sets different load balancing strategies for different types of consensus algorithms supported by the blockchain to adapt to the load differences caused by different types of consensus algorithms; in this way, for users
  • the submitted transaction request related to the blockchain transaction can be assigned a target from the node devices participating in the consensus in the blockchain according to the load balancing strategy corresponding to the consensus algorithm for the transaction request. node device for processing. Since the load balancing strategy takes into account the load difference of the consensus algorithm, the allocated target node device is the current optimal node device. Based on the target node device, the transaction request can be quickly responded to, thereby avoiding the problem of slow response caused by excessive load on some node devices. .
  • Figure 1 is a flow chart of a load balancing method provided by an exemplary embodiment
  • Figure 2 is a system architecture diagram of load balancing provided by an exemplary embodiment
  • Figure 3 is a schematic structural diagram of an electronic device provided by an exemplary embodiment
  • Figure 4 is a block diagram of a load balancing device provided by an exemplary embodiment.
  • the steps of the corresponding method are not necessarily performed in the order shown and described in this specification.
  • methods may include more or fewer steps than described in this specification.
  • a single step described in this specification may be broken down into multiple steps for description in other embodiments; and multiple steps described in this specification may also be combined into a single step in other embodiments. describe.
  • this manual provides a load balancing solution specifically suitable for blockchain scenarios, which can efficiently allocate transaction requests, enable node devices in the blockchain to process transaction requests in a balanced manner, and solve the load of each node device. Problem of imbalance.
  • Figure 1 is a flow chart of a load balancing method provided by an exemplary embodiment.
  • the method can be applied to the access program corresponding to the blockchain; the method can include the following steps:
  • Step 110 Receive the transaction request submitted by the user
  • Step 120 In response to the received transaction request submitted by the user, determine the type of the transaction request;
  • Step 130 If the transaction request is a transaction request related to a blockchain transaction, based on the load balancing strategy corresponding to the consensus algorithm supported by the blockchain, from the node devices participating in the consensus in the blockchain, The transaction request is assigned to a target node device, and the transaction request is sent to the assigned target node device for processing; wherein, different types of consensus algorithms supported by the blockchain respectively correspond to different load balancing strategies.
  • the blockchain described in this manual can specifically include any type of blockchain network; in practical applications, any one of public blockchain, private blockchain and consortium blockchain can be used. kind. In addition, there can also be a combination of the above types, such as private chain + alliance chain, alliance chain + public chain, etc.
  • the public chain is the most decentralized. Participants who join the public chain (also called node devices in the blockchain) can read data records on the chain, participate in transactions, and compete for the accounting rights of new blocks, etc. Moreover, each node device can freely join or exit the network and perform related operations.
  • the private chain has the writing permission of the network controlled by an organization or institution, and the data reading permission is regulated by the organization.
  • a private chain can be a weakly centralized system with strict restrictions on node equipment and a small number of node equipment. This type of blockchain is more suitable for internal use within specific organizations.
  • the alliance chain is a blockchain between the public chain and the private chain, which can achieve "partial decentralization".
  • Each node device in the alliance chain usually has a corresponding entity or organization; the node device joins the network through authorization and forms an alliance of stakeholders to jointly maintain the operation of the blockchain.
  • FIG. 2 is a load balancing system architecture diagram described in this manual.
  • the load balancing system may include a user client, an access program and a blockchain.
  • the above-mentioned user client (such as an APP application) can provide users with a service portal of the blockchain. Users can submit transaction requests to the access program through the service portal shown above, and the access program will transfer all transactions based on the load balancing strategy. The transaction request is sent to the target node device with the optimal load in the blockchain, so that the target node device processes the transaction request.
  • the above-mentioned access program may refer to the intermediate system between the blockchain and the user client, which does not belong to the blockchain.
  • the access program can maintain a connection pool that connects each user client to each node device in the blockchain. That is, the access program maintains a corresponding connection pool for each user client.
  • the above-mentioned access program may specifically include an SDK (Software Development Kit) program for accessing the blockchain.
  • SDK Software Development Kit
  • the load balancing implementation code provided in this manual can be integrated into the SDK program to achieve the load balancing goal of the blockchain based on the SDK program.
  • the SDK program may include an SDK access program installed on the user client;
  • the above step 110 may include obtaining the transaction request initiated by the user on the user client.
  • the SDK program includes an SDK access service program corresponding to the user client mounted on the blockchain service platform;
  • the above step 110 may include receiving a transaction request submitted by the user client by calling a service interface deployed on the blockchain service platform corresponding to the SDK access service program.
  • any transaction request submitted by a user client will first be sent to the access program; then the access program will confirm an optimal load target node device from the connection pool corresponding to the user client; then the access program will The entry program sends the transaction request to the target node device in the blockchain; finally, the target node device in the blockchain responds and processes the transaction request submitted by the user client.
  • the access program performs load balancing in advance before submitting transaction requests to the blockchain, so that the target node equipment responsible for processing the transaction request is optimal each time.
  • Loaded node equipment in this way, it avoids the problem of load imbalance such that some node equipment is overloaded but has to process more transaction requests, while some node equipment is underloaded but has no transaction requests to process.
  • the processing capabilities of node devices that are originally idle and have no transaction requests can be reasonably utilized, thereby improving the overall processing efficiency of the blockchain and reducing the response time of blockchain processing requests.
  • a transaction request for the blockchain may refer to a request produced in a standard transaction format supported by the blockchain, and the request contains the data required for the business to be performed by the blockchain.
  • any real data generated in the physical world can be constructed into a standard transaction format supported by the blockchain, and then published to the blockchain and received by the node pairs in the blockchain.
  • the transaction is processed, and the node in the blockchain, which is the accounting node, packages the transaction into a block and makes a persistent certificate in the blockchain.
  • transaction requests can be divided into transaction requests related to blockchain transactions and transaction requests unrelated to blockchain transactions.
  • the transaction request requires consensus before execution. That is, after receiving the transaction request, the node device participating in the consensus in the blockchain first needs to perform consensus processing on the transaction request. After the consensus is passed, the transaction request will be processed.
  • the block The node in the chain which serves as the accounting node, packages the transaction into a block and stores it permanently in the blockchain. Transaction requests do not require consensus before execution.
  • the aforementioned step 230 can be performed. That is, if the transaction request is a transaction request related to a blockchain transaction, based on the consensus algorithm corresponding to the blockchain support
  • the load balancing strategy is to allocate target node equipment for the transaction request from the node equipment participating in the consensus in the blockchain, and send the transaction request to the allocated target node equipment for processing; wherein, the zone
  • the different types of consensus algorithms supported by the blockchain correspond to different load balancing strategies.
  • step 240 can be performed:
  • the transaction request is a transaction request that is not related to the blockchain transaction, based on the preset load balancing strategy, allocate the node device with the optimal load to the transaction request from the node devices that do not participate in the consensus in the blockchain. , and send the transaction request to the node device for processing.
  • the node device that does not participate in consensus may be a light node.
  • Light nodes do not store blockchain ledgers locally, so transaction requests related to blockchain transactions cannot be sent to such node devices for processing.
  • this manual also provides different load balancing strategies for different consensus algorithms to further improve the performance and efficiency of load balancing.
  • publishing a transaction is divided into two steps.
  • the first step is to publish the transaction request to the blockchain.
  • the second step is to query the blockchain based on the transaction hash to execute the transaction execution result generated after the first step of the transaction request. .
  • For the blockchain it will first receive the transaction request and then the transaction query, so the transaction request and transaction execution result need to be combined into a response result and returned to the user client.
  • the transaction request related to the blockchain transaction includes a blockchain transaction and a query request for the blockchain transaction;
  • the target node device is allocated to the transaction request from the node devices participating in the consensus in the blockchain. Further, it can be include:
  • the transaction request is a blockchain transaction, based on the load balancing strategy corresponding to the asynchronous consensus algorithm, the target of allocating the optimal load to the blockchain transaction from the node devices participating in the consensus in the blockchain Node equipment, and establish a binding relationship between the blockchain transaction and the target node equipment;
  • the transaction request is a query request corresponding to a blockchain transaction
  • the binding relationship is queried, and the target node device bound to the blockchain transaction is assigned to the query request.
  • the asynchronous consensus algorithm since the asynchronous consensus algorithm will not broadcast the transaction execution result generated after the blockchain executes the first step transaction request to each node device, only the current node device that accepted the first step transaction request and executed the transaction request itself has the certificate. There are transaction execution results. Therefore, when performing the second step, except for the current node device, other node devices do not have a certificate of transaction execution results, so they cannot query the transaction execution results when performing the second step. Therefore, for the asynchronous consensus algorithm, the binding relationship between the blockchain transaction and the target node device can be established when performing the first step, and then the query transaction is also forced to be loaded to the target of the first step when performing the second step. on the node device. In this way, there will be no problem of not being able to query the transaction execution results.
  • the asynchronous consensus algorithm may include the honeybadger consensus algorithm.
  • the consensus algorithm supported by the blockchain also includes a synchronous consensus algorithm
  • allocating the target node device for the transaction request from the node devices participating in the consensus in the blockchain may include :
  • the target node device with the optimal load is allocated to the transaction request from the node devices participating in the consensus in the blockchain.
  • the synchronous consensus algorithm will broadcast the transaction execution result generated after the blockchain executes the first step of the transaction request to each node device, so that each node device can locally store the transaction execution result. Therefore, for the synchronous consensus algorithm, any node device that receives the transaction execution result can be used as the node device that receives the transaction query in the second step. Based on this, when doing load balancing, the target node device with the optimal load for the transaction request can be allocated from the node devices participating in the consensus in the blockchain.
  • the synchronous consensus algorithm may include a PBFT (Practical Byzantine Fault Tolerance, Practical Byzantine Fault Tolerance) consensus algorithm.
  • the node device with the optimal load may include a randomly designated node device.
  • the optimal load node device is a randomly designated node device, due to the introduction of the mandatory load balancing of transaction requests and transaction result query requests to the same node
  • the load balancing mechanism of equipment processing can ensure that when the blockchain supports asynchronous consensus algorithms, the business system can obtain the transaction execution results in real time.
  • connection pool maintained in the access program is used to maintain the connection between the user client and the node device in the blockchain, and records the load status of each node device.
  • Transaction requests can be divided into transaction requests related to blockchain transactions and transaction requests unrelated to blockchain transactions. Among them, the transaction request requires consensus before execution. That is, after receiving the transaction request, the node device participating in the consensus in the blockchain first needs to perform consensus processing on the transaction request. After the consensus is passed, the transaction request will be processed. The block The node in the chain, which serves as the accounting node, packages the transaction into a block and stores it permanently in the blockchain. Transaction requests do not require consensus before execution.
  • connection pools can also be classified in this specification.
  • the access program can maintain a first connection pool based on connections with each node device participating in the consensus in the blockchain; And, a second connection pool based on connections with various node devices in the blockchain that do not participate in consensus;
  • a target node device is assigned to the transaction request from the node devices participating in the consensus in the blockchain, and the transaction request is sent to the assigned target node device for processing, Further can include:
  • step 140 the node device with the optimal load is allocated to the transaction request from the node devices in the blockchain that do not participate in the consensus, and the transaction request is sent to the node device for processing, and further Can include:
  • Timing detection determines whether the connections in the first connection pool and the second connection pool are available, and based on the detection results, adds an indication that the connection is available to the connections in the first connection pool and the second connection pool. Available tags to update the connection pool corresponding to the user client.
  • the user client when the user client is started, it can create a connection with each node device based on the configured IP and port of each node on the blockchain, and it is managed by the connection pool. At the same time, you can set up a scheduled task to detect the connections in the connection pool. Scheduled tasks can send asynchronous query requests to all connections, and each node device can return response data after receiving the asynchronous query request. In this way, the scheduled task can update the connection pool based on whether the connection corresponding to each node device returns response data.
  • the aforementioned allocating a target connection for the transaction request from the first connection pool may include:
  • the aforementioned allocating a target connection for the transaction request from the second connection pool may include:
  • the timing to determine whether connections in the first connection pool and the second connection pool are available includes:
  • connection is unavailable (the connection between the connection pool and the node device is marked as unavailable).
  • the timeout mechanism of the scheduled task will automatically confirm the timeout, thereby marking the connection with the node device as unavailable.
  • unavailable node devices obviously cannot be used, and the target node device can only be determined from the available connections in the connection pool.
  • the connection pool can be updated periodically through scheduled tasks to update the latest load status of each node equipment.
  • the preset timestamp range includes a timestamp range corresponding to a specified block in the blockchain.
  • the timestamp range corresponding to the latest block in the blockchain or the timestamp range corresponding to the most recent blocks in the blockchain.
  • this specification provides a load balancing solution that adapts to the load differences caused by different types of consensus algorithms by setting different load balancing strategies for different types of consensus algorithms supported by the blockchain; thus, For a transaction request related to a blockchain transaction submitted by a user, the transaction request can be processed from the node devices participating in the consensus in the blockchain according to the load balancing strategy corresponding to the consensus algorithm for the transaction request. Assign target node devices for processing. Since the load balancing strategy takes into account the load difference of the consensus algorithm, the allocated target node device is the current optimal node device. Based on the target node device, the transaction request can be quickly responded to, thereby avoiding the problem of slow response caused by excessive load on some node devices. .
  • this specification also provides an embodiment of a load balancing device.
  • the embodiments of the load balancing device in this specification can be applied to electronic equipment.
  • the device embodiments may be implemented by software, or may be implemented by hardware or a combination of software and hardware.
  • Taking software implementation as an example as a logical device, it is formed by reading the corresponding computer program instructions in the non-volatile memory into the memory and running them through the processor of the electronic device where it is located.
  • FIG. 3 it is a hardware structure diagram of the electronic equipment where the load balancing device of this specification is located.
  • the electronic device where the device in the embodiment is located may also include other hardware according to the actual functions of the electronic device, which will not be described again.
  • FIG. 4 is a block diagram of a load balancing device according to an exemplary embodiment of this specification.
  • the load balancing device can be applied to the access program corresponding to the blockchain, and the device includes:
  • the receiving unit 410 receives the transaction request submitted by the user
  • the determining unit 420 determines the type of the transaction request in response to the received transaction request submitted by the user;
  • the balancing unit 430 when the transaction request is a transaction request related to a blockchain transaction, based on the load balancing strategy corresponding to the consensus algorithm supported by the blockchain, node devices participating in the consensus from the blockchain Allocate target node equipment to the transaction request in , and send the transaction request to the allocated target node equipment for processing; wherein, the different types of consensus algorithms supported by the blockchain respectively correspond to different load balancing Strategy.
  • the balancing unit 430 is also configured to remove nodes from the blockchain that do not participate in the consensus based on a preset load balancing strategy when the transaction request is a transaction request that is not related to a blockchain transaction.
  • the device allocates the node device with the optimal load for the transaction request, and sends the transaction request to the node device for processing.
  • the consensus algorithm supported by the blockchain includes an asynchronous consensus algorithm;
  • the transaction requests related to blockchain transactions include blockchain transactions and query requests for blockchain transactions;
  • the balancing unit 430 is also configured to, when the transaction request is a blockchain transaction, based on the load balancing strategy corresponding to the asynchronous consensus algorithm, from the node devices participating in the consensus in the blockchain, for the The blockchain transaction allocates the target node device with the optimal load, and establishes a binding relationship between the blockchain transaction and the target node device; and, when the transaction request is a query request corresponding to the blockchain transaction, Based on the load balancing strategy corresponding to the asynchronous consensus algorithm, the binding relationship is queried, and the target node device bound to the blockchain transaction is assigned to the query request.
  • the consensus algorithm supported by the blockchain also includes a synchronous consensus algorithm
  • the balancing unit 430 is also configured to allocate the target node device with the optimal load for the transaction request from the node devices participating in the consensus in the blockchain based on the load balancing strategy corresponding to the synchronous consensus algorithm.
  • the optimally loaded node device includes a randomly designated node device.
  • the synchronous consensus algorithm includes the pbft consensus algorithm; the asynchronous consensus algorithm includes the honeybadger consensus algorithm.
  • the access program includes an SDK program for accessing the blockchain.
  • the SDK program includes an SDK access program installed on the user client;
  • the receiving unit 410 is also used to obtain the transaction request initiated by the user on the user client.
  • the SDK program includes an SDK access service program corresponding to the user client mounted on the blockchain service platform;
  • the receiving unit 410 is also configured to receive a transaction request submitted by the user client by calling the service interface deployed on the blockchain service platform and corresponding to the SDK access service program.
  • the access program maintains a first connection pool based on connections with each node device that participates in consensus in the blockchain; and, based on connections with nodes that do not participate in consensus in the blockchain A second connection pool composed of connections between various node devices;
  • the balancing unit 430 allocates a target node device for the transaction request from the node devices participating in the consensus in the blockchain, and sends the transaction request to the assigned target node device for processing, including:
  • the balancing unit 430 allocates the node device with the optimal load for the transaction request from the node devices that do not participate in the consensus in the blockchain, and sends the transaction request to the node device for processing, including:
  • the device also includes:
  • a detection unit that periodically detects and determines whether the connections in the first connection pool and the second connection pool are available, and adds the indication to the connections in the first connection pool and the second connection pool based on the detection results. Connect to available tags available;
  • the balancing unit 430 allocates a target connection for the transaction request from the first connection pool, including:
  • the balancing unit 430 allocates a target connection for the transaction request from the second connection pool, including:
  • the detection unit is also configured to regularly send an asynchronous query request to the node device corresponding to the connection in the first connection pool and the second connection pool; if the request is received within the preset timestamp range, If the response data returned by the node device is received, it is determined that the connection is available; if the response data returned by the node device is not received within the preset timestamp range, the connection is determined to be unavailable.
  • the preset timestamp range includes a timestamp range corresponding to a specified block in the blockchain.
  • a typical implementation device is a computer, which may be in the form of a personal computer, a laptop, a cellular phone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email transceiver, or a game controller. desktop, tablet, wearable device, or a combination of any of these devices.
  • a computer includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
  • processors CPUs
  • input/output interfaces network interfaces
  • memory volatile and non-volatile memory
  • Memory may include non-permanent storage in computer-readable media, random access memory (RAM) and/or non-volatile memory in the form of read-only memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
  • RAM random access memory
  • ROM read-only memory
  • flash RAM flash random access memory
  • Computer-readable media includes both persistent and non-volatile, removable and non-removable media that can be implemented by any method or technology for storage of information.
  • Information may 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), and read-only memory.
  • PRAM phase change memory
  • SRAM static random access memory
  • DRAM dynamic random access memory
  • RAM random access memory
  • read-only memory read-only memory
  • ROM read-only memory
  • EEPROM electrically erasable programmable read-only memory
  • flash memory or other memory technology
  • compact disc read-only memory CD-ROM
  • DVD digital versatile disc
  • Magnetic tape cartridges magnetic disk storage, quantum memory, graphene-based storage media or other magnetic storage devices, or any other non-transmission medium, can be used to store information that can be accessed by computing devices.
  • computer-readable media does not include transitory media, such as modulated data signals and carrier waves.
  • first, second, third, etc. may use the terms first, second, third, etc. to describe various information, the information should not be limited to these terms. These terms are only used to distinguish information of the same type from each other.
  • first information may also be called second information, and similarly, the second information may also be called first information.
  • word “if” as used herein may be interpreted as "when” or “when” or “in response to determining.”

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

L'invention concerne un procédé et un appareil d'équilibrage de charge, ainsi qu'un dispositif électronique. Le procédé comprend les étapes consistant à : recevoir une demande de transaction soumise par un utilisateur; en réponse à la demande de transaction reçue, soumise par l'utilisateur, déterminer le type de la demande de transaction; et, si la demande de transaction est une demande de transaction relative à une transaction de chaîne de blocs, attribuer, sur la base d'une politique d'équilibrage de charge correspondant à un algorithme de consensus pris en charge par une chaîne de blocs, la demande de transaction à un dispositif de nœud cible parmi des dispositifs de nœud dans la chaîne de blocs participant à un consensus, et envoyer au dispositif de nœud cible attribué la demande de transaction à traiter, des algorithmes de consensus de différents types pris en charge par la chaîne de blocs correspondant respectivement à différentes politiques d'équilibrage de charge.
PCT/CN2022/135418 2022-04-29 2022-11-30 Procédé et appareil d'équilibrage de charge, ainsi que dispositif électronique WO2023207082A1 (fr)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202210473991.XA CN114884962B (zh) 2022-04-29 2022-04-29 负载均衡方法及装置和电子设备
CN202210473991.X 2022-04-29

Publications (1)

Publication Number Publication Date
WO2023207082A1 true WO2023207082A1 (fr) 2023-11-02

Family

ID=82673009

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/135418 WO2023207082A1 (fr) 2022-04-29 2022-11-30 Procédé et appareil d'équilibrage de charge, ainsi que dispositif électronique

Country Status (2)

Country Link
CN (1) CN114884962B (fr)
WO (1) WO2023207082A1 (fr)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114884962B (zh) * 2022-04-29 2024-03-26 蚂蚁区块链科技(上海)有限公司 负载均衡方法及装置和电子设备
CN117034361A (zh) * 2023-07-31 2023-11-10 广州承启医学检验有限公司 一种基因检测检验实验室信息管理方法及系统

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111181715A (zh) * 2019-12-30 2020-05-19 杭州云象网络技术有限公司 一种基于一致性哈希共识协议的多方跨链方法
CN111600967A (zh) * 2020-07-24 2020-08-28 江苏荣泽信息科技股份有限公司 一种基于访问压力的区块链节点间负载均衡系统
US20200344290A1 (en) * 2019-03-18 2020-10-29 Reliance Jio Infocomm Limited Systems and methods for microservice execution load balancing in virtual distributed ledger networks
CN112087502A (zh) * 2020-08-28 2020-12-15 成都质数斯达克科技有限公司 处理请求的方法、装置、设备及存储介质
CN112434114A (zh) * 2021-01-26 2021-03-02 腾讯科技(深圳)有限公司 电子票据处理方法、装置、介质及电子设备
CN113761068A (zh) * 2021-09-15 2021-12-07 虎彩印艺股份有限公司 一种提升区块链网络并发处理能力的方法
CN114884962A (zh) * 2022-04-29 2022-08-09 蚂蚁区块链科技(上海)有限公司 负载均衡方法及装置和电子设备

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11386405B2 (en) * 2017-12-19 2022-07-12 International Business Machines Corporation Dynamic blockchain transactional policy management
CN111464633B (zh) * 2020-03-31 2023-03-21 成都质数斯达克科技有限公司 用于区块链的交易信息的共识方法及系统
CN111786952B (zh) * 2020-05-29 2023-03-17 中国银联股份有限公司 区块链系统的共识方法、装置、设备及介质
CN115114009A (zh) * 2021-03-17 2022-09-27 中移(上海)信息通信科技有限公司 数据查询方法、主节点及从节点

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200344290A1 (en) * 2019-03-18 2020-10-29 Reliance Jio Infocomm Limited Systems and methods for microservice execution load balancing in virtual distributed ledger networks
CN111181715A (zh) * 2019-12-30 2020-05-19 杭州云象网络技术有限公司 一种基于一致性哈希共识协议的多方跨链方法
CN111600967A (zh) * 2020-07-24 2020-08-28 江苏荣泽信息科技股份有限公司 一种基于访问压力的区块链节点间负载均衡系统
CN112087502A (zh) * 2020-08-28 2020-12-15 成都质数斯达克科技有限公司 处理请求的方法、装置、设备及存储介质
CN112434114A (zh) * 2021-01-26 2021-03-02 腾讯科技(深圳)有限公司 电子票据处理方法、装置、介质及电子设备
CN113761068A (zh) * 2021-09-15 2021-12-07 虎彩印艺股份有限公司 一种提升区块链网络并发处理能力的方法
CN114884962A (zh) * 2022-04-29 2022-08-09 蚂蚁区块链科技(上海)有限公司 负载均衡方法及装置和电子设备

Also Published As

Publication number Publication date
CN114884962B (zh) 2024-03-26
CN114884962A (zh) 2022-08-09

Similar Documents

Publication Publication Date Title
WO2023207082A1 (fr) Procédé et appareil d'équilibrage de charge, ainsi que dispositif électronique
CN108829350B (zh) 基于区块链的数据迁移方法和装置
TWI752939B (zh) 用戶請求的處理方法和裝置
US10701139B2 (en) Life cycle management method and apparatus
RU2649788C1 (ru) Способ и система для обработки запроса на транзакцию в распределенных системах обработки данных
KR101959153B1 (ko) 데이터베이스에서의 계좌와 관련된 거래 요청의 효율적인 처리를 위한 시스템
CN111898139B (zh) 数据读写方法及装置、电子设备
WO2019137320A1 (fr) Procédé, appareil, dispositif et système de planification de ressources
US8117611B2 (en) Method, system, and program product for deploying a platform dependent application in a grid environment
US20080256248A1 (en) Single server access in a multiple tcp/ip instance environment
WO2020024650A1 (fr) Procédé et appareil de traitement de données, et client
TW202025057A (zh) 欄位更新方法及裝置、電子設備
US20200052885A1 (en) File storage method and apparatus for blockchain network
WO2017201984A1 (fr) Procédé de traitement de données, appareil associé et système de stockage de données
WO2023131058A1 (fr) Système et procédé de planification d'application de service de ressources dans un bureau intermédiaire numérique d'entreprise
WO2020024648A1 (fr) Procédé et dispositif de traitement de données, client et serveur
WO2023040502A1 (fr) Enregistrement de service d'utilisateur
WO2021067156A1 (fr) Location imbriquée qui permet une hiérarchie ayant une pluralité de niveaux
JP2005503596A5 (fr)
WO2023040498A1 (fr) Utilisation de service d'utilisateur
US11947534B2 (en) Connection pools for parallel processing applications accessing distributed databases
WO2017118318A1 (fr) Procédé et dispositif de traitement de service et de stockage de données
JPH0962635A (ja) 疎結合並列処理環境においてトランザクション直列化制御機能を有する顧客情報制御システム及び方法
WO2023207087A1 (fr) Procédé et appareil de sélection de liaison optimale pour chaîne de blocs, et dispositif électronique
US9088569B2 (en) Managing access to a shared resource using client access credentials

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22939896

Country of ref document: EP

Kind code of ref document: A1