WO2024099224A1 - 工业区块链网络的优化方法及装置、节点和存储介质 - Google Patents
工业区块链网络的优化方法及装置、节点和存储介质 Download PDFInfo
- Publication number
- WO2024099224A1 WO2024099224A1 PCT/CN2023/129488 CN2023129488W WO2024099224A1 WO 2024099224 A1 WO2024099224 A1 WO 2024099224A1 CN 2023129488 W CN2023129488 W CN 2023129488W WO 2024099224 A1 WO2024099224 A1 WO 2024099224A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- business
- transaction
- message
- delay
- block
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 96
- 238000005457 optimization Methods 0.000 title claims abstract description 28
- 238000003860 storage Methods 0.000 title claims abstract description 16
- 230000005540 biological transmission Effects 0.000 claims description 31
- 238000012545 processing Methods 0.000 claims description 24
- 238000012795 verification Methods 0.000 claims description 9
- 238000004590 computer program Methods 0.000 claims description 8
- 238000004519 manufacturing process Methods 0.000 description 39
- 238000010586 diagram Methods 0.000 description 12
- 230000008569 process Effects 0.000 description 8
- 238000004891 communication Methods 0.000 description 7
- 238000005516 engineering process Methods 0.000 description 7
- 238000004364 calculation method Methods 0.000 description 6
- 230000007246 mechanism Effects 0.000 description 5
- 238000004422 calculation algorithm Methods 0.000 description 4
- 238000002955 isolation Methods 0.000 description 4
- 101000827703 Homo sapiens Polyphosphoinositide phosphatase Proteins 0.000 description 3
- 102100023591 Polyphosphoinositide phosphatase Human genes 0.000 description 3
- 101100012902 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) FIG2 gene Proteins 0.000 description 3
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 238000013523 data management Methods 0.000 description 3
- 238000013500 data storage Methods 0.000 description 3
- 230000006870 function Effects 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000009286 beneficial effect Effects 0.000 description 2
- 238000007726 management method Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 101001121408 Homo sapiens L-amino-acid oxidase Proteins 0.000 description 1
- 102100026388 L-amino-acid oxidase Human genes 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/12—Shortest path evaluation
- H04L45/121—Shortest path evaluation by minimising delays
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/104—Peer-to-peer [P2P] networks
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L2463/00—Additional details relating to network architectures or network communication protocols for network security covered by H04L63/00
- H04L2463/102—Additional details relating to network architectures or network communication protocols for network security covered by H04L63/00 applying security measure for e-commerce
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02P—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
- Y02P90/00—Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
- Y02P90/30—Computing systems specially adapted for manufacturing
Definitions
- the embodiments of the present application relate to blockchain technology, and are related to but not limited to an optimization method and device, nodes and storage medium of an industrial blockchain network.
- peer-to-peer This is a distributed network communication technology, also known as a "peer-to-peer network".
- peer-to-peer network Unlike the traditional client/server (C/S) structure, there is no master-slave distinction between nodes in a P2P network. The status is equal, and each node can be both a server and a client.
- nodes are classified by distance, and the routing table is maintained to complete the dissemination of information such as blocks, transactions, and data.
- the embodiments of the present application provide an optimization method and device, node and storage medium for an industrial blockchain network.
- an embodiment of the present application provides an optimization method for an industrial blockchain network, which is applied to a blockchain node of the industrial blockchain network, and the method includes:
- Determining a service attribute of the first service transaction wherein the service attribute is used to characterize whether the first service transaction has a delay-sensitive requirement
- real-time transactions and non-real-time transactions can be distinguished, so that the consensus blockchain nodes can determine the order of transactions on the chain based on whether the transactions are delay-sensitive, thereby meeting the requirements of high real-time collaborative manufacturing.
- the consensus blockchain node determines the block generation order of the first business transaction based on the business attributes, which is achieved by the following steps: if the business attributes characterize that the first business transaction has delay-sensitive requirements, the first business transaction is added to a first block generation queue; if the business attributes characterize that the first business transaction does not have delay-sensitive requirements, the first business transaction is added to a second block generation queue; wherein the block generation priority of the first block generation queue is higher than the block generation priority of the second block generation queue.
- the method further includes: if there is no business transaction in the first block production queue, selecting the business transaction in the second block production queue for block production; or, if a preset condition is met, selecting the business transaction in the second block production queue for block production.
- the business transaction in the second block queue is selected for block generation, including: determining a first number of business transactions currently existing in the first block queue, and a second number of business transactions currently existing in the second block queue; determining the transaction proportion of business transactions with delay-sensitive requirements in the business transactions that have been blocked within a historical preset time period; if the second number is greater than the first number, and the transaction proportion of the business transactions with delay-sensitive requirements is greater than a first preset threshold, selecting the business transaction in the second block queue Proceed to produce a block.
- the business transactions in the second block-out queue are selected for block out, including: if the second number is greater than the first number, and the transaction proportion of the business transactions with delay-sensitive requirements is greater than the first preset threshold, in at least one subsequent block, the transaction proportion of business transactions without delay-sensitive requirements is increased to the second preset threshold; wherein the number of blocks included in the at least one block is determined by the maximum number of transactions included in a single block and the second number.
- the method further includes: calling a sub-chain interface that matches the business attributes; performing a legitimacy verification on the first business transaction through the sub-chain interface; and if the verification passes, identifying the business attributes in the first business transaction.
- the method also includes: determining the first sub-blockchain of the business to which the first business transaction belongs; wherein different businesses have different sub-blockchains; correspondingly, sending the first business transaction identified with the business attributes to the consensus blockchain node of the industrial blockchain network, so that the consensus blockchain node can determine the block generation order of the first business transaction based on the business attributes, including: sending the first business transaction set with the identification information to the consensus blockchain node, so that the consensus blockchain node can determine the block generation order of the first business transaction to be uploaded to the first sub-blockchain based on the identification information.
- the method also includes: receiving a first message; wherein the first message includes at least one business transaction; determining a message attribute of the first message; wherein the message attribute is used to characterize whether the first message has a delay-sensitive requirement; determining a delay routing table of the industrial blockchain network; and sending the first message based on the delay routing table and the message attribute of the first message.
- determining the delay routing table of the industrial blockchain network includes: using a delay-sensitive network to globally network the blockchain nodes in the industrial blockchain network. Clock synchronization; when the clock synchronization is completed, determine the network transmission delay and the node processing delay of the industrial blockchain network; based on the network transmission delay and the node processing delay, determine the delay routing forwarding table of the industrial blockchain network.
- the method further includes: if the message attributes of the first message indicate that the first message has a delay-sensitive requirement, adding the first message to a first forwarding queue; if the message attributes of the first message indicate that the first message does not have a delay-sensitive requirement, adding the first message to a second forwarding queue; wherein the first forwarding queue is at least used to cache delay-sensitive messages to be sent, and the second forwarding queue is at least used to cache non-delay-sensitive messages to be sent; the forwarding priority of the first forwarding queue is higher than the forwarding priority of the second forwarding queue.
- sending the first message based on the latency routing forwarding table and the message attributes of the first message includes: determining a target forwarding route according to the latency routing forwarding table; determining a sorting position of the first message in the first forwarding queue; and sending the first message based on the target forwarding route and the sorting position.
- the method further includes: if there is a dependency relationship between the first business transaction and the second business transaction, and the first business transaction and the second business transaction have different business attributes, obtaining transaction information of the second business transaction through a preset interface; determining the first business transaction based on the transaction information of the second business transaction and the dependency relationship; wherein the preset interface is used to implement mutual calls between different sub-blockchains.
- an optimization device for an industrial blockchain network comprising:
- a receiving unit configured to receive a first business transaction
- a determination unit configured to determine a service attribute of the first service transaction; wherein the service attribute is used to characterize whether the first service transaction has a delay-sensitive requirement;
- a sending unit is used to send the first business transaction marked with the business attribute to the consensus blockchain node of the industrial blockchain network, so that the consensus blockchain node can The attribute determines the block generation order of the first business transaction.
- an embodiment of the present application provides a blockchain node, comprising a memory and a processor, wherein the memory stores a computer program that can be executed on the processor, and the processor implements the steps in the above method when executing the program.
- an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which implements the steps in the above method when executed by a processor.
- FIG1 is a schematic diagram of a first implementation flow of an optimization method for an industrial blockchain network according to an embodiment of the present application
- FIG2 is a second schematic diagram of the implementation process of the optimization method of the industrial blockchain network according to an embodiment of the present application
- FIG3A is a schematic diagram of the network topology of the industrial blockchain network according to an embodiment of the present application.
- FIG3B is a third schematic diagram of the implementation process of the optimization method of the industrial blockchain network according to an embodiment of the present application.
- FIG4 is a schematic diagram of the composition structure of an optimization device for an industrial blockchain network according to an embodiment of the present application.
- FIG5 is a schematic diagram of a hardware entity of a blockchain node according to an embodiment of the present application.
- module means, “component” or “unit” used to represent elements are only used to facilitate the description of the present application, and have no specific meanings. Therefore, “module”, “component” or “unit” can be used in a mixed manner.
- first ⁇ second ⁇ third involved in the embodiments of the present application are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that “first ⁇ second ⁇ third” can be interchanged in a specific order or sequence where permitted, so that the embodiments of the present application described here can be implemented in an order other than that illustrated or described here.
- the existing industrial blockchain network has the following two main shortcomings:
- the existing P2P network classifies blockchain nodes by distance, and the routing table is sorted by distance, without considering network transmission delay and node forwarding processing delay, etc., resulting in different blockchain nodes receiving data at asynchronicity, which cannot meet the requirements of high real-time collaborative manufacturing.
- the embodiment of the present application provides an optimization method for an industrial blockchain network, the method is applied to the blockchain node of the industrial blockchain network, and the function implemented by the method can be implemented by calling the program code by the processor in the blockchain node, and of course the program code can be stored in the storage medium of the blockchain node.
- Figure 1 is a schematic diagram of the implementation process of the optimization method for the industrial blockchain network of the embodiment of the present application. As shown in Figure 1, the method includes:
- Step S101 receiving a first business transaction
- the industrial blockchain network includes multiple blockchain nodes; wherein the blockchain nodes can be various nodes of collaborative manufacturing, each blockchain node provides blockchain services, and different blockchain nodes are interconnected based on a P2P network.
- Each blockchain node can be an independent server or a server cluster composed of multiple servers.
- any client i.e., the user of blockchain business
- any blockchain node which can be a blockchain node with business association in actual use
- the client uploads data information to the blockchain node.
- the first business transaction refers to a certain transaction information corresponding to the first business.
- the industrial scenario includes various businesses, such as automated guided vehicle (AGV) control business, production data management business, etc.
- AGV automated guided vehicle
- a blockchain node in the industrial blockchain network receives a first business transaction sent by a client, or a blockchain node in the industrial blockchain network receives a first business transaction sent by another blockchain node.
- Step S102 determining a service attribute of the first service transaction; wherein the service attribute is used to characterize whether the first service transaction has a delay-sensitive requirement;
- the service attribute is used to characterize whether the first service transaction has a delay-sensitive requirement.
- the service attribute includes delay-sensitive and non-delay-sensitive.
- the first service transaction can be divided into a real-time service transaction or a non-real-time service transaction.
- Step S103 Send the first business transaction identified with the business attributes to the consensus blockchain node of the industrial blockchain network, so that the consensus blockchain node can determine the block generation order of the first business transaction based on the business attributes.
- the business attribute can be identified in the first business transaction, for example, a flag bit is set in the first business transaction, the flag bit of the real-time business transaction is 1, and the flag bit of the non-real-time business transaction is 0. Then, the first business transaction with the flag bit is sent to the consensus blockchain node, and the consensus blockchain node determines the block generation order of the first business transaction according to the value of the flag bit.
- the first business transaction can be sent to other blockchain nodes with blockchain systems for chain processing; if the blockchain node that receives the first business transaction itself has a blockchain system, it can rely on its own blockchain system for chain processing.
- corresponding sub-chains can be created for different businesses based on blockchain sub-chain technology.
- the blockchain can then link the first business transaction to its corresponding sub-blockchain.
- the consensus blockchain node determines the block generation order of the first business transaction based on the business attribute, which is achieved by the following steps:
- Step S11a if the service attribute indicates that the first service transaction has a delay-sensitive requirement, add the first service transaction to a first block-out queue;
- Step S12a If the business attribute indicates that the first business transaction does not have a delay-sensitive requirement, the first business transaction is added to a second block-out queue; wherein the block-out priority of the first block-out queue is higher than the block-out priority of the second block-out queue.
- the first block queue may be a block queue for caching real-time services
- the second block queue may be a block queue for caching non-real-time services.
- the block priority of the first block queue is higher than the block priority of the second block queue, which means that the block order of business transactions in the first block queue takes precedence over the business transactions in the second block queue, that is, the business transactions in the first block queue are preferentially selected for block production.
- the method further includes: determining a first sub-blockchain of a business to which the first business transaction belongs; wherein different businesses have different sub-blockchains;
- the step S103 sending the first business transaction identified with the business attributes to the consensus blockchain node of the industrial blockchain network, so that the consensus blockchain node can determine the block generation order of the first business transaction based on the business attributes, includes: sending the first business transaction set with the identification information to the consensus blockchain node, so that the consensus blockchain node can determine the block generation order of the first business transaction to be uploaded to the first sub-blockchain based on the identification information.
- different sub-blockchains can be created for different businesses through the system chain (i.e., the parent blockchain).
- real-time businesses include port AGV control business and factory production line control business.
- Non-real-time services include factory order management services, production data management services, etc.
- a sub-blockchain can be created for the port AGV control service, and a sub-blockchain can be created for the factory production line control service.
- a sub-blockchain can also be created for the factory order management service, and a sub-blockchain can be created for the production data management service.
- the method further includes:
- Step S11b calling a subchain interface matching the service attribute
- Step S12b verify the legitimacy of the first business transaction through the subchain interface
- Step S13b If the verification is successful, the business attribute is identified in the first business transaction.
- each blockchain node includes two systems: the collaborative manufacturing business system and the industrial blockchain system; among them, the collaborative manufacturing business system is the upper-level business system, and the industrial blockchain system is the lower-level data storage system.
- the blockchain node After receiving the first business transaction through the business interface in the collaborative manufacturing business system, the blockchain node determines the business attribute of the first business transaction, and calls the subchain interface that matches the business attribute. For example, if the business attribute is latency sensitive, the subchain interface of the real-time business subchain is called; if the business attribute is not latency sensitive, the subchain interface of the non-real-time business subchain is called.
- an RT flag may be set in the header of the first business transaction, thereby setting identification information of the business attribute. That is, by setting the RT flag in the header of the first business transaction, the business attribute may be identified in the first business transaction when verification is passed.
- the present application further provides an optimization method for an industrial blockchain network, the method being applied to a blockchain node of the industrial blockchain network, the method comprising:
- Step S111 receiving a first business transaction
- Step S112 Determine the business attributes of the first business transaction; wherein the business attributes are expressed as to characterize whether the first business transaction is delay-sensitive;
- Step S113 sending the first business transaction marked with the business attribute to the consensus blockchain node of the industrial blockchain network
- the consensus blockchain node may be a designated blockchain node among the blockchain nodes of the industrial blockchain network.
- Step S114 If the business attribute indicates that the first business transaction has a delay-sensitive requirement, the consensus blockchain node adds the first business transaction to a first block-out queue;
- the first block queue is at least used to cache delay-sensitive transactions to be blocked
- the second block queue is at least used to cache non-delay-sensitive transactions to be blocked.
- Step S115 If the business attribute indicates that the first business transaction does not have delay-sensitive requirements, the consensus blockchain node adds the first business transaction to the second block production queue; wherein the block production priority of the first block production queue is higher than the block production priority of the second block production queue.
- the method further comprises:
- Step S11c when there is no business transaction in the first block queue, select the business transaction in the second block queue for block generation; or,
- Step S12c If the preset conditions are met, select the business transaction in the second block generation queue for block generation.
- step S12c if the preset condition is met, selecting the business transaction in the second block queue for block generation, can be implemented by the following steps:
- Step S121c determining a first number of business transactions currently existing in the first block-out queue, and a second number of business transactions currently existing in the second block-out queue;
- Step S122c determining the transaction ratio of business transactions with delay-sensitive requirements among the business transactions that have been generated within the historical preset time period;
- Step S123c If the second number is greater than the first number, and the transaction proportion of the business transactions with delay-sensitive requirements is greater than a first preset threshold, select the business transactions in the second block generation queue for block generation.
- a flow control mechanism can be provided to ensure that non-real-time transactions can also be processed in a timely manner.
- the present application further provides an optimization method for an industrial blockchain network, the method being applied to a blockchain node of the industrial blockchain network, the method comprising:
- Step S121 receiving a first business transaction
- Step S122 determining a service attribute of the first service transaction; wherein the service attribute is used to characterize whether the first service transaction has a delay-sensitive requirement;
- Step S123 sending the first business transaction marked with the business attribute to the consensus blockchain node of the industrial blockchain network
- Step S124 If the business attribute indicates that the first business transaction has a delay-sensitive requirement, the consensus blockchain node adds the first business transaction to a first block-out queue;
- Step S125 If the business attribute indicates that the first business transaction does not have a delay-sensitive requirement, the consensus blockchain node adds the first business transaction to a second block-out queue; wherein the block-out priority of the first block-out queue is higher than the block-out priority of the second block-out queue;
- Step S126 determining a first number of business transactions currently existing in the first block-out queue and a second number of business transactions currently existing in the second block-out queue;
- the currently existing business transaction refers to the business transaction in the queue that has not yet been blocked.
- Step S127 determining the transaction ratio of business transactions with delay-sensitive requirements among the business transactions that have been generated in the historical preset time period;
- the block generation period is a seconds, that is, a new block is created every a seconds
- x consecutive blocks are recorded, and the business transactions with latency-sensitive requirements among the business transactions that have been generated within a*x time are recorded.
- Percentage where a and x can be set and modified through the configuration file. For example, if there are 20 business transactions that have been produced in the historical preset time period, and 10 business transactions with latency-sensitive requirements, the percentage is 50%.
- Step S128 If the second number is greater than the first number, and the transaction proportion of the business transactions with delay-sensitive requirements is greater than a first preset threshold, select the business transactions in the second block generation queue for block generation.
- the first preset threshold value can be set through a configuration file and supports modification.
- a flow control mechanism can be provided to ensure that non-real-time transactions can be processed in a timely manner while real-time transactions are blocked first, thereby meeting the needs of real-time transmission of blockchain network data.
- selecting the business transactions in the second block-out queue for block out includes:
- the transaction ratio of the service transactions with delay-sensitive requirements is greater than a first preset threshold, in at least one subsequent block, the transaction ratio of the service transactions without delay-sensitive requirements is increased to the second preset threshold;
- the number of blocks included in the at least one block is determined by the maximum number of transactions included in a single block and the second number.
- the number of blocks included in at least one subsequent block is determined by the maximum number of transactions included in a single block and the number of business transactions currently existing in the second block queue. For example, if the maximum number of transactions included in a single block is b, and the number of business transactions currently existing in the second block queue is d, then the number of blocks included in the at least one block is d/b, and the transaction proportion of non-real-time transactions is increased to the second preset threshold in the subsequent d/b blocks.
- the second preset threshold may be the same as or different from the first preset threshold, and the second preset threshold may be set and supported for modification through a configuration file.
- the present application further provides an optimization method for an industrial blockchain network.
- the method is applied to the blockchain node of the industrial blockchain network.
- FIG2 is a schematic diagram of the implementation flow of the optimization method of the industrial blockchain network in the embodiment of the present application. As shown in FIG2, the method includes:
- Step S201 receiving a first business transaction
- Step S202 determining a service attribute of the first service transaction; wherein the service attribute is used to characterize whether the first service transaction has a delay-sensitive requirement;
- Step S203 sending the first business transaction marked with the business attribute to the consensus blockchain node of the industrial blockchain network, so that the consensus blockchain node can determine the block generation order of the first business transaction based on the business attribute;
- Step S204 receiving a first message; wherein the first message includes at least one business transaction;
- the first message refers to the business transaction block message, which can be transmitted to different blockchain nodes through the Internet.
- Step S205 determining a message attribute of the first message; wherein the message attribute is used to characterize whether the first message has a delay-sensitive requirement;
- the first message includes multiple business transactions, and the multiple business transactions are all real-time business transactions, then the first message has a delay-sensitive requirement.
- Step S206 Determine the delay routing forwarding table of the industrial blockchain network
- the delay routing table of the industrial blockchain network records the routing relationship between each blockchain node, as well as information such as the transmission delay and node processing delay between each node.
- Step S207 Send the first message based on the delay routing forwarding table and the message attributes of the first message.
- the first message needs to be sent from blockchain node A to blockchain node B, and the message attribute of the first message is a delay-sensitive requirement. Then, the delay routing table is used to find the path with the smallest delay among the multiple paths from blockchain node A to blockchain node B as the target path, and the first message is sent preferentially through the target path.
- the step S206, determining the delay routing forwarding table of the industrial blockchain network can be implemented by the following steps:
- Step S2061 Using a delay-sensitive network to perform global network clock synchronization on blockchain nodes in the industrial blockchain network;
- Step S2062 When clock synchronization is completed, determine the network transmission delay and node processing delay of the industrial blockchain network;
- node processing delay refers to the time it takes for a blockchain node to receive a message and forward it
- network transmission delay refers to the network transmission delay between different nodes.
- Step S2063 Based on the network transmission delay and the node processing delay, determine the delay routing forwarding table of the industrial blockchain network.
- the delay routing table of the entire network can be obtained based on the delay-sensitive network, thereby laying a foundation for the subsequent preferential forwarding of real-time messages according to the delay routing table.
- the method further comprises:
- Step S21a if the message attribute of the first message indicates that the first message has a delay-sensitive requirement, add the first message to a first forwarding queue;
- Step S22a If the message attribute of the first message indicates that the first message does not have a delay-sensitive requirement, add the first message to a second forwarding queue;
- the first forwarding queue is at least used to cache delay-sensitive messages to be sent, and the second forwarding queue is at least used to cache non-delay-sensitive messages to be sent; the forwarding priority of the first forwarding queue is higher than the forwarding priority of the second forwarding queue.
- the P2P network transmission message can be extended to add an RT flag; if it is a real-time transaction block message, the RT flag is set to 1, and if it is a non-real-time transaction block message, the RT flag is set to 0; after the P2P network receives the message, it inserts the message into different forwarding blocks according to the RT flag.
- real-time messages can occupy the forwarding window of non-real-time messages, and real-time queue messages are forwarded preferentially according to latency routing.
- the step S207 sending the first message based on the delay routing forwarding table and the message attribute of the first message, includes:
- Step S2071 determining a target forwarding route according to the delay routing forwarding table
- the target forwarding route can be the forwarding route with the minimum delay.
- the global network clock synchronization, network transmission delay calculation and node forwarding processing delay calculation can be completed through the TSN protocol, and a delay-based routing forwarding table can be generated, thereby completing data synchronization across the entire network in the shortest time.
- Step S2072 Determine the sorting position of the first message in the first forwarding queue
- Step S2073 Send the first message based on the target forwarding route and the sorting position.
- the P2P network message can be expanded (adding the RT flag) and the forwarding mechanism can be optimized (providing different message queues, distinguishing between real-time and non-real-time messages, and real-time messages can preempt non-real-time message transmission windows), thereby meeting the needs of high real-time, high concurrency, and high-security collaborative manufacturing.
- the method further comprises:
- Step S21b if there is a dependency relationship between the first business transaction and the second business transaction, and the first business transaction and the second business transaction have different business attributes, acquiring transaction information of the second business transaction through a preset interface;
- Step S22b determining the first business transaction based on the transaction information of the second business transaction and the dependency relationship;
- the preset interface is used to implement mutual calls between different sub-blockchains.
- a specific account can be authorized to call the sub-blockchain interface to complete the acquisition of transaction information.
- interfaces must be opened between each other (i.e., cross-chain), and different sub-chains can call each other. That is, through the above steps S21b to S22b, cross-chain data interaction can be achieved.
- the embodiments of the present application further provide an optimization method for an industrial blockchain network, namely, a network optimization method based on a time-sensitive network (TSN) and a sub-blockchain.
- TSN time-sensitive network
- Each blockchain node completes global network clock synchronization, network transmission delay calculation, and calculation of the forwarding processing delay of the blockchain node through the TSN protocol, and generates a delay-based routing table based on the calculation results.
- TSN time-sensitive network
- Each blockchain sub-chain technology corresponding sub-blockchains are established for real-time and non-real-time services, and transaction data is isolated between sub-blockchains.
- This method data synchronization across the entire network is completed in the shortest time, and multi-chain coexistence meets the requirements of high real-time, high concurrency, and high-security collaborative manufacturing.
- Figure 3A is a schematic diagram of the network topology structure of the industrial blockchain network of an embodiment of the present application.
- the industrial blockchain network includes: at least one client 31 (i.e., user) and multiple blockchain nodes 32; wherein, the multiple blockchain nodes 32 may include host manufacturers, regional industrial Internet platforms, and component manufacturers based on industrial use.
- the client 31 is a user of blockchain services and can upload data and other information to the blockchain node.
- the multiple blockchain nodes 32 are nodes of collaborative manufacturing, providing blockchain services, and the multiple blockchain nodes 32 provide network interconnection based on the P2P network. At the same time, the multiple blockchain nodes 32 realize clock synchronization of blockchain nodes and calculation of node processing delay and link transmission delay through the TSN network.
- the node processing delay refers to the time it takes for a blockchain node to receive a message and forward it;
- the link transmission delay refers to the network transmission delay between different blockchain nodes.
- the values of the local processing delay of each blockchain node in Figure 3A and the values of the transmission delay between different nodes are all examples.
- the values can be calculated using the TSN network.
- each blockchain node in Figure 3A (such as host manufacturer, Parts manufacturers, etc.) are all examples.
- the purpose of each blockchain node i.e., the industrial service corresponding to each blockchain node) can be determined according to the actual use of industrial manufacturing, and the embodiments of this application do not limit this.
- only some blockchain nodes are shown in Figure 3A, and the embodiments of this application do not limit the number of blockchain nodes in the industrial blockchain network.
- FIG3A only shows an exemplary client, and the client interacts with the blockchain node of the host manufacturer. In actual use, multiple clients may be included, and different clients may interact with different blockchain nodes, which is not limited in the present embodiment.
- FIG3B is a schematic diagram of the implementation process of the optimization method of the industrial blockchain network of the embodiment of the present application. As shown in FIG3B , the optimization method is applied to multi-chain business.
- any blockchain node there are two systems: a collaborative manufacturing business system and an industrial blockchain system; wherein the collaborative manufacturing business system is a business system at the upper layer, and the industrial blockchain system is a data storage system at the lower layer.
- the optimization method (i.e., the process of multi-chain business) includes the following parts:
- the collaborative manufacturing business system calls different sub-chain interfaces in the industrial blockchain system according to the real-time attributes of the business.
- the real-time business subchain verifies the transaction user’s signature information. After verification, it processes the transaction, sets the RT flag of the transaction information to 1, and sends it to the consensus node.
- the received real-time transactions can be cached in the real-time transaction pool.
- the non-real-time business sub-chain After receiving the transaction, the non-real-time business sub-chain verifies the transaction user's signature information, processes the transaction after verification, sets the RT flag of the transaction information to 0, and sends it to the consensus node.
- the received non-real-time transactions can be cached in the non-real-time transaction pool.
- PBFT Practical Byzantine Fault Tolerance
- the block generation period is a seconds, that is, a new block is created every a seconds, and the maximum number of transactions contained in each block is b.
- the system needs to count the number of transactions c in the real-time transaction queue and the number of transactions d in the non-real-time transaction queue, and record x consecutive blocks, and calculate the proportion of real-time transactions in a*x time. If d>c and the proportion of real-time transactions exceeds y%, then increase the proportion of non-real-time transactions to z% in the subsequent d/b blocks.
- the values of parameters a, x, y and z can be specified through the configuration file, and support real-time online modification; and the values of parameters y and z can be the same or different.
- the P2P network expands the P2P network transmission message, add the RT flag, occupying 1 bit. If it is a real-time transaction block message, set the RT flag to 1, if it is a non-real-time transaction block message, set the RT flag to 0.
- the P2P network inserts the message into different forwarding queues according to the RT flag, completes the establishment of the global delay routing forwarding table according to TSN, and preferentially forwards the real-time queue message according to the delay routing in the delay routing forwarding table; among them, the real-time message can preempt the non-real-time message forwarding window, and then transmit the message to different blockchain nodes through the Internet network.
- a specific account can be authorized to call the sub-chain interface to complete the acquisition of transaction information.
- the embodiments of the present application use TSN to synchronize the global clock, calculate the local processing delay and network transmission delay, and meet the requirements of real-time transmission, high concurrency and data isolation of blockchain network data by optimizing blockchain transactions, consensus algorithms and P2P network messages, thereby achieving the purpose of industrial high-precision collaborative manufacturing.
- the embodiments of the present application provide an optimization device for an industrial blockchain network, which includes the units included and the modules included in the units, and can be implemented by a processor in a blockchain node; of course, it can also be implemented by a specific logic circuit; in the implementation process, the processor can be a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP) or a field programmable gate array (FPGA), etc.
- CPU central processing unit
- MPU microprocessor
- DSP digital signal processor
- FPGA field programmable gate array
- FIG4 is a schematic diagram of the composition structure of an optimization device for an industrial blockchain network according to an embodiment of the present application.
- the device 400 includes:
- the receiving unit 401 is configured to receive a first business transaction
- a determination unit 402 is configured to determine a service attribute of the first service transaction; wherein the service attribute is used to characterize whether the first service transaction has a delay-sensitive requirement;
- the sending unit 403 is used to send the first business transaction identified with the business attributes to the consensus blockchain node of the industrial blockchain network, so that the consensus blockchain node can determine the block generation order of the first business transaction based on the business attributes.
- the apparatus further comprises:
- a first processing unit is configured to add the first business transaction to a first block generation queue if the business attribute indicates that the first business transaction has a delay-sensitive requirement
- a second processing unit is configured to add the first business transaction to a second block generation queue if the business attribute indicates that the first business transaction does not have a delay-sensitive requirement;
- the block priority of the first block output queue is higher than the block priority of the second block output queue.
- the apparatus further comprises:
- a first block generation unit is configured to select a business transaction in the second block generation queue for block generation when there is no business transaction in the first block generation queue;
- the second block generation unit is used to select the business transaction in the second block generation queue for block generation if a preset condition is met.
- the second block output unit includes:
- a quantity determination module used to determine a first quantity of business transactions currently existing in the first block-out queue, and a second quantity of business transactions currently existing in the second block-out queue;
- a proportion determination module is used to determine the proportion of business transactions with latency-sensitive requirements among the business transactions that have been generated within a historical preset time period;
- a selection module is used to select the business transactions in the second block generation queue for block generation if the second number is greater than the first number and the transaction proportion of the business transactions with delay-sensitive requirements is greater than a first preset threshold.
- the selection module includes:
- a selection component configured to increase the transaction ratio of the business transactions without delay sensitive requirements to a second preset threshold in at least one subsequent block if the second number is greater than the first number and the transaction ratio of the business transactions with delay sensitive requirements is greater than a first preset threshold;
- the number of blocks included in the at least one block is determined by the maximum number of transactions included in a single block and the second number.
- the apparatus further comprises:
- An interface calling unit used to call a subchain interface matching the service attribute
- a verification unit configured to verify the legitimacy of the first business transaction through the subchain interface
- the identification setting unit is used to identify the business attribute in the first business transaction when the verification is passed.
- the apparatus further comprises:
- a sub-chain determining unit used to determine a first sub-blockchain of the business to which the first business transaction belongs; Among them, different businesses have different sub-blockchains;
- the sending unit 403 includes:
- the sending subunit is used to send the first business transaction provided with the identification information to the consensus blockchain node, so that the consensus blockchain node can determine the block generation order of the first business transaction to be uploaded to the first sub-blockchain based on the identification information.
- the apparatus further comprises:
- a message receiving unit configured to receive a first message; wherein the first message includes at least one business transaction;
- a message attribute determination unit used to determine a message attribute of the first message; wherein the message attribute is used to characterize whether the first message has a delay-sensitive requirement;
- a routing table determination unit used to determine a delay routing table of the industrial blockchain network
- a message sending unit is used to send the first message based on the delay routing forwarding table and the message attribute of the first message.
- the routing table determination unit includes:
- a clock synchronization module used to perform global network clock synchronization on blockchain nodes in the industrial blockchain network using a delay-sensitive network
- a delay determination module used to determine the network transmission delay and node processing delay of the industrial blockchain network when clock synchronization is completed
- a routing table determination module is used to determine the delay routing table of the industrial blockchain network based on the network transmission delay and the node processing delay.
- the apparatus further comprises:
- a first forwarding unit configured to add the first message to a first forwarding queue if a message attribute of the first message indicates that the first message has a delay-sensitive requirement
- a second forwarding unit configured to add the first message to a second forwarding queue if a message attribute of the first message indicates that the first message does not have a delay-sensitive requirement
- the first forwarding queue is used at least to buffer delay-sensitive messages to be sent.
- the second forwarding queue is at least used to buffer non-delay-sensitive messages to be sent; the forwarding priority of the first forwarding queue is higher than the forwarding priority of the second forwarding queue.
- the message sending unit includes:
- a route determination module used to determine a target forwarding route according to the delay route forwarding table
- a position determination module used to determine the sorting position of the first message in the first forwarding queue
- a message sending module is used to send the first message based on the target forwarding route and the sorting position.
- the apparatus further comprises:
- a cross-chain acquisition unit configured to acquire transaction information of the second business transaction through a preset interface if there is a dependency relationship between the first business transaction and the second business transaction, and the first business transaction and the second business transaction have different business attributes;
- a transaction determining unit configured to determine the first business transaction based on the transaction information of the second business transaction and the dependency relationship
- the preset interface is used to implement mutual calls between different sub-blockchains.
- the above-mentioned optimization method is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.
- the technical solution of the embodiments of the present application can essentially or partly be reflected in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for enabling an electronic device (which can be a personal computer, server, etc.) to execute all or part of the methods described in each embodiment of the present application.
- the aforementioned storage medium includes: various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM), a magnetic disk or an optical disk.
- program codes such as a U disk, a mobile hard disk, a read-only memory (ROM), a magnetic disk or an optical disk.
- An embodiment of the present application provides a blockchain node, including a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the program, the steps in the optimization method provided in the above embodiment are implemented.
- An embodiment of the present application provides a computer-readable storage medium on which a computer program is stored.
- the computer program is executed by a processor, the steps in the above-mentioned optimization method are implemented.
- FIG5 is a schematic diagram of a hardware entity of a blockchain node in an embodiment of the present application.
- the hardware entity of the blockchain node 500 includes: a processor 501, a communication interface 502, and a memory 503, wherein
- Processor 501 generally controls the overall operation of blockchain node 500.
- the communication interface 502 may enable the blockchain node 500 to communicate with other blockchain nodes or servers or platforms over a network.
- the memory 503 is configured to store instructions and applications executable by the processor 501, and can also cache data to be processed or processed by the processor 501 and various modules in the blockchain node 500 (for example, image data, audio data, voice communication data, and video communication data), which can be implemented through FLASH (flash memory) or random access memory (Random Access Memory, RAM).
- FLASH flash memory
- RAM Random Access Memory
- the disclosed devices and methods can be implemented in other ways.
- the device embodiments described above are only schematic.
- the division of the units is only a logical function division.
- the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, devices or units.
- the indirect coupling or communication connection may be electrical, mechanical or other.
- the units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.
- all functional units in the embodiments of the present application can be integrated into one processing module, or each unit can be a separate unit, or two or more units can be integrated into one unit; the above integrated unit can be implemented in the form of hardware or in the form of hardware plus software functional units.
- a person of ordinary skill in the art can understand that all or part of the steps of implementing the above method embodiments can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium, which, when executed, executes the steps of the above method embodiments; and the aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, disks or optical disks.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
本申请实施例公开了一种工业区块链网络的优化方法及装置、节点和存储介质,其中,所述方法应用于所述工业区块链网络的区块链节点,所述方法包括:接收第一业务交易;确定所述第一业务交易的业务属性;其中,所述业务属性用于表征所述第一业务交易是否具有时延敏感的需求;将标识有所述业务属性的第一业务交易发送至所述工业区块链网络的共识区块链节点,使得所述共识区块链节点能够基于所述业务属性确定所述第一业务交易的出块顺序。
Description
相关申请的交叉引用
本申请主张在2022年11月10日在中国提交的中国专利申请No.202211406045.X的优先权,其全部内容通过引用包含于此。
本申请实施例涉及区块链技术,涉及但不限于一种工业区块链网络的优化方法及装置、节点和存储介质。
工业高精度协同制造领域对不同车间、厂区相关产品数据实时同步有着明确需求,传统通过中心化数据方式提供服务,在跨工厂场景存在数据安全不可靠、网络时延不确定等问题。
区块链的底层网络技术采用的是点对点(peer-to-peer,P2P)网络。这是一种分布式网络通信技术,又称“对等网络”。与传统的客户端/服务器端(Client/Server,C/S)结构不同的是,在P2P网络中各个节点之间没有主从之分,地位都是对等的,每一个节点既可以是服务器端也可以是客户端。P2P网络中通过距离来对节点进行分类,维护路由转发表完成区块、交易和数据等信息的传播。
数据存储采用区块链的方式可解决协同制造领域的数据安全可靠性问题,但还无法解决其他的问题。
发明内容
有鉴于此,本申请实施例提供一种工业区块链网络的优化方法及装置、节点和存储介质。
本申请实施例的技术方案是这样实现的:
第一方面,本申请实施例提供一种工业区块链网络的优化方法,该方法应用于所述工业区块链网络的区块链节点,所述方法包括:
接收第一业务交易;
确定所述第一业务交易的业务属性;其中,所述业务属性用于表征所述第一业务交易是否具有时延敏感的需求;
将标识有所述业务属性的第一业务交易发送至所述工业区块链网络的共识区块链节点,使得所述共识区块链节点能够基于所述业务属性确定所述第一业务交易的出块顺序。
通过上述方式,能够区分实时交易与非实时交易,进而使得共识区块链节点能够根据交易是否具有时延敏感需求来决定交易的上链顺序,从而满足高实时协同制造要求。
在一些实施例中,所述共识区块链节点基于所述业务属性确定所述第一业务交易的出块顺序,通过以下步骤实现:如果所述业务属性表征所述第一业务交易具有时延敏感的需求,将所述第一业务交易加入第一出块队列;如果所述业务属性表征所述第一业务交易不具有时延敏感的需求,将所述第一业务交易加入第二出块队列;其中,所述第一出块队列的出块优先级高于所述第二出块队列的出块优先级。
在一些实施例中,所述方法还包括:在所述第一出块队列中不存在业务交易的情况下,选择所述第二出块队列中的业务交易进行出块;或,如果满足预设条件,选择所述第二出块队列中的业务交易进行出块。
在一些实施例中,所述如果满足预设条件,选择所述第二出块队列中的业务交易进行出块,包括:确定所述第一出块队列中当前存在的业务交易的第一数量,以及所述第二出块队列中当前存在的业务交易的第二数量;确定历史预设时间段内已出块的业务交易中具有时延敏感需求的业务交易的交易占比;如果所述第二数量大于所述第一数量、且所述具有时延敏感需求的业务交易的交易占比大于第一预设阈值,选择所述第二出块队列中的业务交易
进行出块。
在一些实施例中,所述如果所述第二数量大于所述第一数量、且所述具有时延敏感需求的业务交易的交易占比大于第一预设阈值,选择所述第二出块队列中的业务交易进行出块,包括:如果所述第二数量大于所述第一数量、且所述具有时延敏感需求的业务交易的交易占比大于第一预设阈值,在后续的至少一个区块中增加不具有时延敏感需求的业务交易的交易占比至第二预设阈值;其中,所述至少一个区块包括的区块数量由单个区块包括的最大交易数量和所述第二数量确定。
在一些实施例中,所述确定所述第一业务交易的业务属性之后,所述方法还包括:调用与所述业务属性相匹配的子链接口;通过所述子链接口,对所述第一业务交易进行合法性验证;在验证通过的情况下,将所述业务属性标识在所述第一业务交易中。
在一些实施例中,所述方法还包括:确定所述第一业务交易所属业务的第一子区块链;其中,不同的业务具有不同的子区块链;对应地,所述将标识有所述业务属性的第一业务交易发送至所述工业区块链网络的共识区块链节点,使得所述共识区块链节点能够基于所述业务属性确定所述第一业务交易的出块顺序,包括:将设置有所述标识信息的第一业务交易发送至所述共识区块链节点,使得所述共识区块链节点能够基于所述标识信息确定待上链至所述第一子区块链的第一业务交易的出块顺序。
在一些实施例中,所述方法还包括:接收第一报文;其中,所述第一报文包括至少一个业务交易;确定所述第一报文的报文属性;其中,所述报文属性用于表征所述第一报文是否具有时延敏感的需求;确定所述工业区块链网络的时延路由转发表;基于所述时延路由转发表和所述第一报文的报文属性,发出所述第一报文。
在一些实施例中,所述确定所述工业区块链网络的时延路由转发表,包括:利用时延敏感网络对所述工业区块链网络中的区块链节点进行全局网络
时钟同步;在时钟同步完成的情况下,确定所述工业区块链网络的网络传输时延以及节点处理时延;基于所述网络传输时延和所述节点处理时延,确定所述工业区块链网络的时延路由转发表。
在一些实施例中,所述确定所述第一报文的报文属性之后,所述方法还包括:如果所述第一报文的报文属性表征所述第一报文具有时延敏感的需求,将所述第一报文加入第一转发队列;如果所述第一报文的报文属性表征所述第一报文不具有时延敏感的需求,将所述第一报文加入第二转发队列;其中,所述第一转发队列至少用于缓存待发送的时延敏感报文,所述第二转发队列至少用于缓存待发送的非时延敏感报文;所述第一转发队列的转发优先级高于所述第二转发队列的转发优先级。
在一些实施例中,所述基于所述时延路由转发表和所述第一报文的报文属性,发出所述第一报文,包括:根据所述时延路由转发表,确定目标转发路由;确定所述第一报文在所述第一转发队列中的排序位置;基于所述目标转发路由和所述排序位置,发出所述第一报文。
在一些实施例中,所述方法还包括:如果所述第一业务交易与第二业务交易之间存在依赖关系、且所述第一业务交易与所述第二业务交易具有不同的业务属性,则通过预设接口获取所述第二业务交易的交易信息;基于所述第二业务交易的交易信息和所述依赖关系,确定所述第一业务交易;其中,所述预设的接口用于实现不同的子区块链之间的相互调用。
第二方面,本申请实施例提供一种工业区块链网络的优化装置,所述装置包括:
接收单元,用于接收第一业务交易;
确定单元,用于确定所述第一业务交易的业务属性;其中,所述业务属性用于表征所述第一业务交易是否具有时延敏感的需求;
发送单元,用于将标识有所述业务属性的第一业务交易发送至所述工业区块链网络的共识区块链节点,使得所述共识区块链节点能够基于所述业务
属性确定所述第一业务交易的出块顺序。
第三方面,本申请实施例提供一种区块链节点,包括存储器和处理器,所述存储器存储有可在处理器上运行的计算机程序,所述处理器执行所述程序时实现上述方法中的步骤。
第四方面,本申请实施例提供一种计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现上述方法中的步骤。
图1为本申请实施例工业区块链网络的优化方法的实现流程示意图一;
图2为本申请实施例工业区块链网络的优化方法的实现流程示意图二;
图3A为本申请实施例工业区块链网络的网络拓扑结构示意图;
图3B为本申请实施例工业区块链网络的优化方法的实现流程示意图三;
图4为本申请实施例工业区块链网络的优化装置的组成结构示意图;
图5为本申请实施例区块链节点的一种硬件实体示意图。
下面结合附图和实施例对本申请的技术方案进一步详细阐述。显然,所描述的实施例仅是本申请一部分实施例,而不是全部的实施例。基于本申请的实施例,本领域普通技术人员在没有做出创造性劳动的前提下所获得的所有其他实施例,都属于本申请保护的范围。
在以下的描述中,涉及到“一些实施例”,其描述了所有可能实施例的子集,但是可以理解,“一些实施例”可以是所有可能实施例的相同子集或不同子集,并且可以在不冲突的情况下相互结合。
在后续的描述中,使用用于表示元件的诸如“模块”、“部件”或“单元”的后缀仅为了有利于本申请的说明,其本身没有特定的意义。因此,“模块”、“部件”或“单元”可以混合地使用。
需要指出,本申请实施例所涉及的术语“第一\第二\第三”仅仅是区别类似的对象,不代表针对对象的特定排序,可以理解地,“第一\第二\第三”在允许的情况下可以互换特定的顺序或先后次序,以使这里描述的本申请实施例能够以除了在这里图示或描述的以外的顺序实施。
由于区块链发展历程较短,行业内并没有统一的定义,现在还存在各种各样的问题。现有技术方案按照节点距离进行转发,未考虑网络传输时延、节点处理时延等因素,易出现分叉,且浪费网络算力、浪费网络资源。网络传播时延达到100ms(毫秒),无法满足高实时协同制造要求。此外区块链的各参与方之间共享账本,交易并发量较低且相互之间未进行数据隔离,安全性低。
即,现有的工业区块链网络主要存在以下两个缺点:
1):现有P2P网络通过距离来对区块链节点进行分类,路由表按距离远近进行排序,未考虑网络传输时延和节点转发处理时延等,导致不同区块链节点接收数据时间不同步,无法满足高实时协同制造要求。
2):区块链的各参与方之间共享账本,交易并发量较低且相互之间未进行数据隔离,安全性低。
基于此,本申请实施例提供一种工业区块链网络的优化方法,所述方法应用于所述工业区块链网络的区块链节点,该方法所实现的功能可以通过所述区块链节点中的处理器调用程序代码来实现,当然程序代码可以保存在所述区块链节点的存储介质中。图1为本申请实施例工业区块链网络的优化方法的实现流程示意图一,如图1所示,所述方法包括:
步骤S101、接收第一业务交易;
本申请实施例中,该工业区块链网络包括多个区块链节点;其中,所述区块链节点可以为协同制造的各个节点,每一区块链节点提供区块链服务,且不同的区块链节点之间基于P2P网络实现网络互连。每一区块链节点可以是独立的服务器或者是多个服务器组成的服务器集群。
其中,任一客户端(即区块链业务的使用方)可以与任一区块链节点(实际使用时可为存在业务关联的区块链节点)进行交互,例如客户端往区块链节点上传数据信息等。
这里,第一业务交易指的是第一业务对应的某一交易信息。工业场景下包括各种各样的业务,例如自动导航车(Automated Guided Vehicle,AGV)控制业务、生产数据管理业务等。
其中,工业区块链网络中的某一区块链节点接收客户端发送的第一业务交易,或,工业区块链网络中的某一区块链节点接收另一区块链节点发送的第一业务交易。
步骤S102、确定所述第一业务交易的业务属性;其中,所述业务属性用于表征所述第一业务交易是否具有时延敏感的需求;
这里,所述业务属性用于表征所述第一业务交易是否具有时延敏感的需求。例如,业务属性包括时延敏感和非时延敏感。进而,可以将第一业务交易划分为实时业务交易或者非实时业务交易。
步骤S103、将标识有所述业务属性的第一业务交易发送至所述工业区块链网络的共识区块链节点,使得所述共识区块链节点能够基于所述业务属性确定所述第一业务交易的出块顺序。
这里,可以将业务属性标识在所述第一业务交易中,例如,在第一业务交易中设置标志位,实时业务交易的标志位为1,非实时业务交易的标志位为0。然后,将带有标志位的第一业务交易发送至共识区块链节点,共识区块链节点根据该标志位的取值确定第一业务交易的出块顺序。
本申请实施例中,如果接收第一业务交易的区块链节点没有区块链系统则可以将该第一业务交易发送给其他有区块链系统的区块链节点进行上链处理;如果接收第一业务交易的区块链节点本身有区块链系统则可以依赖自身的区块链系统进行上链处理。
在一些实施例中,可以基于区块链子链技术为不同的业务创建对应的子
区块链,进而可以将该第一业务交易上链至其对应的子区块链中。
这里,通过上述步骤S101至步骤S103,能够区分实时交易与非实时交易,进而使得共识区块链节点能够根据交易是否具有时延敏感需求来决定交易的上链顺序,从而满足高实时协同制造要求。
在一些实施例中,所述共识区块链节点基于所述业务属性确定所述第一业务交易的出块顺序,通过以下步骤实现:
步骤S11a、如果所述业务属性表征所述第一业务交易具有时延敏感的需求,将所述第一业务交易加入第一出块队列;
步骤S12a、如果所述业务属性表征所述第一业务交易不具有时延敏感的需求,将所述第一业务交易加入第二出块队列;其中,所述第一出块队列的出块优先级高于所述第二出块队列的出块优先级。
这里,第一出块队列可以为缓存实时业务的出块队列,第二出块队列可以为缓存非实时业务的出块队列。所述第一出块队列的出块优先级高于所述第二出块队列的出块优先级指的是第一出块队列中的业务交易的出块顺序优先于第二出块队列中的业务交易,即优先选择第一出块队列中的业务交易进行出块。
在一些实施例中,所述方法还包括:确定所述第一业务交易所属业务的第一子区块链;其中,不同的业务具有不同的子区块链;
对应地,所述步骤S103、将标识有所述业务属性的第一业务交易发送至所述工业区块链网络的共识区块链节点,使得所述共识区块链节点能够基于所述业务属性确定所述第一业务交易的出块顺序,包括:将设置有所述标识信息的第一业务交易发送至所述共识区块链节点,使得所述共识区块链节点能够基于所述标识信息确定待上链至所述第一子区块链的第一业务交易的出块顺序。
这里,可以通过系统链(即母区块链)为不同的业务创建不同的子区块链。例如,实时业务包括港口AGV控制业务和工厂生产流水线控制业务等。
非实时业务包括厂区秩序管理业务、生产数据管理业务等。进而,可以为港口AGV控制业务创建一子区块链,为工厂生产流水线控制业务创建一子区块链。也可以为厂区秩序管理业务创建一子区块链,为生产数据管理业务创建一子区块链。通过为不同的业务创建不同的子区块链,可以满足工业区块链网络数据的高并发和数据隔离需求。
在一些实施例中,所述步骤S102、确定所述第一业务交易的业务属性之后,所述方法还包括:
步骤S11b、调用与所述业务属性相匹配的子链接口;
步骤S12b、通过所述子链接口,对所述第一业务交易进行合法性验证;
步骤S13b、在验证通过的情况下,将所述业务属性标识在所述第一业务交易中。
这里,每一区块链节点包括两个系统:协同制造业务系统和工业区块链系统;其中,协同制造业务系统为上层的业务系统,工业区块链系统为下层的数据存储系统。
其中,区块链节点通过协同制造业务系统中的业务接口接收到第一业务交易后,判断该第一业务交易的业务属性,从而调用与该业务属性匹配的子链接口。例如,业务属性为时延敏感,则调用实时业务子链的子链接口;业务属性为非时延敏感,则调用非实时业务子链的子链接口。
本申请实施例中,可以在第一业务交易的头部设置RT标志位,从而设置所述业务属性的标识信息,即可以通过在第一业务交易的头部设置RT标志位,来实现在验证通过的情况下,将所述业务属性标识在所述第一业务交易中。
基于前述的实施例,本申请实施例再提供一种工业区块链网络的优化方法,所述方法应用于所述工业区块链网络的区块链节点,所述方法包括:
步骤S111、接收第一业务交易;
步骤S112、确定所述第一业务交易的业务属性;其中,所述业务属性用
于表征所述第一业务交易是否具有时延敏感的需求;
步骤S113、将标识有所述业务属性的第一业务交易发送至所述工业区块链网络的共识区块链节点;
这里,所述共识区块链节点可以为所述工业区块链网络的区块链节点中指定的区块链节点。
步骤S114、如果所述业务属性表征所述第一业务交易具有时延敏感的需求,所述共识区块链节点将所述第一业务交易加入第一出块队列;
这里,所述第一出块队列至少用于缓存待出块的时延敏感交易,第二出块队列至少用于缓存待出块的非时延敏感交易。
步骤S115、如果所述业务属性表征所述第一业务交易不具有时延敏感的需求,所述共识区块链节点将所述第一业务交易加入第二出块队列;其中,所述第一出块队列的出块优先级高于所述第二出块队列的出块优先级。
这里,通过上述步骤S111至步骤S115,能够提供不同交易消息队列,区分实时与非实时交易,从而实现实时交易先上链满足工业高精度协同制造领域区块链网络数据的实时传输需求。
在一些实施例中,所述方法还包括:
步骤S11c、在所述第一出块队列中不存在业务交易的情况下,选择所述第二出块队列中的业务交易进行出块;或,
步骤S12c、如果满足预设条件,选择所述第二出块队列中的业务交易进行出块。
这里,通过上述步骤S11c至步骤S12c,能够根据不同的方法确定第二出块队列中的业务交易进行出块。
在一些实施例中,所述步骤S12c、如果满足预设条件,选择所述第二出块队列中的业务交易进行出块,可以通过以下步骤实现:
步骤S121c、确定所述第一出块队列中当前存在的业务交易的第一数量,以及所述第二出块队列中当前存在的业务交易的第二数量;
步骤S122c、确定历史预设时间段内已出块的业务交易中具有时延敏感需求的业务交易的交易占比;
步骤S123c、如果所述第二数量大于所述第一数量、且所述具有时延敏感需求的业务交易的交易占比大于第一预设阈值,选择所述第二出块队列中的业务交易进行出块。
这里,通过上述步骤S121c至步骤S123c,能够提供流控机制,确保非实时交易也能得到及时处理。
基于前述的实施例,本申请实施例再提供一种工业区块链网络的优化方法,所述方法应用于所述工业区块链网络的区块链节点,所述方法包括:
步骤S121、接收第一业务交易;
步骤S122、确定所述第一业务交易的业务属性;其中,所述业务属性用于表征所述第一业务交易是否具有时延敏感的需求;
步骤S123、将标识有所述业务属性的第一业务交易发送至所述工业区块链网络的共识区块链节点;
步骤S124、如果所述业务属性表征所述第一业务交易具有时延敏感的需求,所述共识区块链节点将所述第一业务交易加入第一出块队列;
步骤S125、如果所述业务属性表征所述第一业务交易不具有时延敏感的需求,所述共识区块链节点将所述第一业务交易加入第二出块队列;其中,所述第一出块队列的出块优先级高于所述第二出块队列的出块优先级;
步骤S126、确定所述第一出块队列中当前存在的业务交易的第一数量,以及所述第二出块队列中当前存在的业务交易的第二数量;
这里,所述当前存在的业务交易指的是队列中还未出块的业务交易。
步骤S127、确定历史预设时间段内已出块的业务交易中具有时延敏感需求的业务交易的交易占比;
举例来说,出块周期为a秒即每a秒创建一个新的区块,则记录连续x个区块,a*x时间内已出块的业务交易中具有时延敏感需求的业务交易的交易
占比;其中,a和x均可通过配置文件设置并支持修改。例如,历史预设时间段内已出块的业务交易为20个,具有时延敏感需求的业务交易的交易为10个,则占比为50%。
步骤S128、如果所述第二数量大于所述第一数量、且所述具有时延敏感需求的业务交易的交易占比大于第一预设阈值,选择所述第二出块队列中的业务交易进行出块。
这里,第一预设阈值可通过配置文件设置并支持修改。
可以看出,通过上述步骤S121至步骤S128,能够提供一种流控机制来确保在实时交易先出块的同时非实时交易也能得到及时处理,从而满足区块链网络数据实时传输的需求。
在一些实施例中,所述如果所述第二数量大于所述第一数量、且所述具有时延敏感需求的业务交易的交易占比大于第一预设阈值,选择所述第二出块队列中的业务交易进行出块,包括:
如果所述第二数量大于所述第一数量、且所述具有时延敏感需求的业务交易的交易占比大于第一预设阈值,在后续的至少一个区块中增加不具有时延敏感需求的业务交易的交易占比至第二预设阈值;
其中,所述至少一个区块包括的区块数量由单个区块包括的最大交易数量和所述第二数量确定。
本申请实施例中,后续的至少一个区块中包括的区块数量由单个区块包括的最大交易数量和所述第二出块队列中当前存在的业务交易的数量确定。例如,单个区块包括的最大交易数量为b,第二出块队列中当前存在的业务交易的数量为d,则所述至少一个区块包括的区块数量为d/b,则在后续的d/b个区块中增加非实时交易的交易占比至第二预设阈值。这里,所述第二预设阈值与所述第一预设阈值可以相同也可以不同,且所述第二预设阈值可通过配置文件设置并支持修改。
基于前述的实施例,本申请实施例再提供一种工业区块链网络的优化方
法,所述方法应用于所述工业区块链网络的区块链节点,图2为本申请实施例工业区块链网络的优化方法的实现流程示意图二,如图2所示,所述方法包括:
步骤S201、接收第一业务交易;
步骤S202、确定所述第一业务交易的业务属性;其中,所述业务属性用于表征所述第一业务交易是否具有时延敏感的需求;
步骤S203、将标识有所述业务属性的第一业务交易发送至所述工业区块链网络的共识区块链节点,使得所述共识区块链节点能够基于所述业务属性确定所述第一业务交易的出块顺序;
步骤S204、接收第一报文;其中,所述第一报文包括至少一个业务交易;
这里,第一报文指的是业务交易区块报文,可以通过因特网(internet)网络将报文传输至不同的区块链节点。
步骤S205、确定所述第一报文的报文属性;其中,所述报文属性用于表征所述第一报文是否具有时延敏感的需求;
例如,第一报文中包括多个业务交易,且所述多个业务交易均为实时业务交易,则该第一报文具有时延敏感的需求。
步骤S206、确定所述工业区块链网络的时延路由转发表;
这里,所述工业区块链网络的时延路由转发表记录了各区块链节点之间的路由关系,以及各节点之间的传输时延和节点处理时延等信息。
步骤S207、基于所述时延路由转发表和所述第一报文的报文属性,发出所述第一报文。
举例来说,所述第一报文需要从区块链节点A发送至区块链节点B,且所述第一报文的报文属性为具有时延敏感的需求,则通过所述时延路由转发表查找从区块链节点A至区块链节点B的众多路径中时延最小的路径作为目标路径,并优先通过所述目标路径发送所述第一报文。
这里,通过上述步骤S201至步骤S207,能够区分实时与非实时报文,
从而优先发送实时报文,并基于确定的时延路由转发表减少报文的传输时延,满足区块链网络数据实时传输的需求。
在一些实施例中,所述步骤S206、确定所述工业区块链网络的时延路由转发表,可以通过以下步骤实现:
步骤S2061、利用时延敏感网络对所述工业区块链网络中的区块链节点进行全局网络时钟同步;
步骤S2062、在时钟同步完成的情况下,确定所述工业区块链网络的网络传输时延以及节点处理时延;
这里,节点处理时延指的是区块链节点从接收报文到转发出去需要耗费的时间;网络传输时延指的是不同节点间网络传输时延。
步骤S2063、基于所述网络传输时延和所述节点处理时延,确定所述工业区块链网络的时延路由转发表。
这里,通过上述步骤S2061至步骤S2063,能够基于时延敏感网络获得全网的时延路由转发表,从而为后续根据该时延路由转发表优先转发实时报文打下基础。
在一些实施例中,所述方法还包括:
步骤S21a、如果所述第一报文的报文属性表征所述第一报文具有时延敏感的需求,将所述第一报文加入第一转发队列;
步骤S22a、如果所述第一报文的报文属性表征所述第一报文不具有时延敏感的需求,将所述第一报文加入第二转发队列;
其中,所述第一转发队列至少用于缓存待发送的时延敏感报文,所述第二转发队列至少用于缓存待发送的非时延敏感报文;所述第一转发队列的转发优先级高于所述第二转发队列的转发优先级。
本申请实施例中,可以扩展P2P网络传输报文增加RT标志位;如果为实时交易区块报文,则设置RT标志为1,如果为非实时交易区块报文,则设置RT标志为0;P2P网络收到报文后,根据RT标志将报文插入不同的转发
队列。进而,实时报文可抢占非实时报文转发窗口,按时延路由优先转发实时队列报文。
这里,通过上述步骤S21a至步骤S22a,能够提供不同报文转发队列,区分实时与非实时报文,从而实现实时报文优先转发,满足工业高精度协同制造领域区块链网络数据的实时传输需求。
在一些实施例中,所述步骤S207、基于所述时延路由转发表和所述第一报文的报文属性,发出所述第一报文,包括:
步骤S2071、根据所述时延路由转发表,确定目标转发路由;
这里,所述目标转发路由可以为时延最小的转发路由。从而,可以通过TSN协议完成全局网络时钟同步、网络传输时延计算和节点转发处理时延计算,生成基于时延的路由转发表,进而以最短时间完成数据全网同步。
步骤S2072、确定所述第一报文在所述第一转发队列中的排序位置;
步骤S2073、基于所述目标转发路由和所述排序位置,发出所述第一报文。
通过上述步骤,能够扩展P2P网络报文(增加RT标志位),优化转发机制(提供不同报文队列,区分实时与非实时报文,实时报文可抢占非实时报文传输窗口),从而满足高实时、高并发、高安全协同制造需求。
在一些实施例中,所述方法还包括:
步骤S21b、如果所述第一业务交易与第二业务交易之间存在依赖关系、且所述第一业务交易与所述第二业务交易具有不同的业务属性,则通过预设接口获取所述第二业务交易的交易信息;
步骤S22b、基于所述第二业务交易的交易信息和所述依赖关系,确定所述第一业务交易;
其中,所述预设的接口用于实现不同的子区块链之间的相互调用。
这里,实时业务子区块链与非实时业务子区块链之间的交易如有依赖关系,可授权特定账户调用子链接口,完成交易信息获取。例如,实时业务要
去非实时业务上获取信息,则相互之间要开放接口(即跨链),不同子链之间可以相互调用。即,通过上述步骤S21b至步骤S22b,能够实现跨链数据的交互。
基于前述的实施例,本申请实施例再提供一种工业区块链网络的优化方法,即基于时间敏感网络(Time Sensitive Network,TSN)与子区块链的网络优化方法,各区块链节点通过TSN协议完成全局网络时钟同步、网络传输时延计算和本区块链节点转发处理时延的计算,并基于计算结果生成基于时延的路由转发表。通过区块链子链技术,为实时业务和非实时业务分别建立对应的子区块链,子区块链间隔离交易数据,通过该方法以最短时间完成数据全网同步,多链并存满足高实时、高并发和高安全协同制造需求。
图3A为本申请实施例工业区块链网络的网络拓扑结构示意图,如图3A所示,所述工业区块链网络包括:至少一个客户端31(即用户)和多个区块链节点32;其中,所述多个区块链节点32从工业用途上划分可以包括主机厂商,也可以包括区域工业互联网平台,还可以包括零部件厂商。
所述客户端31为区块链业务的使用方,可以上传数据等信息至所述区块链节点。
所述多个区块链节点32为协同制造的各个节点,提供区块链服务,且所述多个区块链节点32基于P2P网络提供网络互连。同时,所述多个区块链节点32通过TSN网络实现区块链节点的时钟同步,以及节点处理时延、链路传输时延的计算。
其中,所述节点处理时延指的是区块链节点从接受报文到报文转发出去需要耗费的时间;所述链路传输时延指的是不同区块链节点间网络传输时延。
需要说明的是,图3A中各区块链节点的本地处理时延的取值以及不同节点之间的传输时延的取值,例如2ms(毫秒)、3ms、4ms、10ms、5ms、8ms和6ms等,均为示例,该值可以利用TSN网络计算获得。
需要说明的是,图3A中对各区块链节点标注的用途(例如主机厂商、
零部件厂商等)均为示例,可以根据工业制造的实际使用情况确定每一区块链节点的用途(即每一区块链节点对应的工业服务),本申请实施例对此并不做限制。并且,图3A中仅示出了部分区块链节点,本申请实施例对工业区块链网络中区块链节点的数量也不做限制。
需要说明的是,图3A中仅示例性地展示了一个客户端、且该客户端与主机厂商的区块链节点存在交互。在实际的使用过程中可以包括多个客户端,且不同的客户端可以与不同的区块链节点进行交互,本申请实施例对此并不做限制。
图3B为本申请实施例工业区块链网络的优化方法的实现流程示意图三,如图3B所示,该优化方法应用于多链业务,在任一区块链节点上,存在两个系统:协同制造业务系统和工业区块链系统;其中,所述协同制造业务系统是处于上层的业务系统,所述工业区块链系统是位于下层的数据存储系统,
其中,所述优化方法(即多链业务的流程)包括以下几个部分:
①协同制造业务系统根据业务的实时属性,调用工业区块链系统中不同的子链接口。
②扩展区块链交易信息,在交易信息的头部设置实时(Real Time,RT)标志位,占用1个bit(比特)。
③实时业务子链收到交易后,验证交易用户签名信息,验证通过后处理交易,将交易信息的RT标志设为1,发给共识节点。
这里,可以将收到的实时交易缓存至实时交易池中。
④非实时业务子链收到交易后,验证交易用户签名信息,验证通过后处理交易,将交易信息的RT标志设为0,发给共识节点。
这里,可以将收到的非实时交易缓存至非实时交易池中。通过引入子链技术,扩展交易数据结构,增加RT标志位,来满足高实时、高并发和高安全协同制造的需求。
⑤修改实用拜占庭容错算法(Practical Byzantine Fault Tolerance,PBFT)
共识算法,增加实时交易与非实时交易两个队列,共识节点收到交易后进行排序,RT标志为1的交易排在实时队列,RT标志为0的交易排在非实时队列,优先选择实时队列中的交易进行出块,实时交易队列为空时选择非实时交易队列中的交易进行出块。
其中,为提高系统稳定性,确保非实时交易也能得到及时处理,提出以下策略:假设出块周期为a秒,即每a秒创建一个新区块,每个区块所含最大交易数为b。系统需统计实时交易队列交易数c、非实时交易队列交易数d,并记录连续x个区块,计算a*x时间内实时交易的占比。如d>c且实时交易的占比超过y%,则在其后的d/b个区块中增加非实时交易的占比至z%。其中,参数a、x、y和z的值均可通过配置文件指定,并支持实时在线修改;且参数y和参数z的值可以相同也可以不同。
这里,通过优化区块链共识算法,提供不同交易消息队列,区分实时与非实时交易,以及提供流控机制,确保非实时交易也能得到及时处理,来满足高实时和高安全协同制造的需求。
⑥扩展P2P网络传输报文,增加RT标志位,占用1个bit。如果为实时交易区块报文,则设置RT标志为1,如果为非实时交易区块报文,则设置RT标志为0。P2P网络收到报文后,根据RT标志将报文插入不同转发队列,根据TSN完成全局时延路由转发表的建立,按该时延路由转发表中的时延路由优先转发实时队列报文;其中,实时报文可抢占非实时报文转发窗口,然后通过Internet网络将报文传输到不同区块链节点。
这里,通过扩展P2P网络报文,增加RT标志位,优化转发机制,提供不同报文队列,区分实时与非实时报文,实时报文可抢占非实时报文传输窗口,来满足高实时协同制造的需求。
⑦实时业务子链(即实时业务的子区块链)与非实时业务子链(即非实时业务的子区块链)之间的交易如果存在依赖关系,可授权特定账户调用子链接口,完成交易信息的获取。
相比于相关技术,本申请实施例使用TSN来同步全局时钟、计算本地处理时延与网络传输时延,并通过优化区块链交易、共识算法与P2P网络报文来满足区块链网络数据实时传输、高并发和数据隔离的需求,实现工业高精度协同制造的目的。
基于前述的实施例,本申请实施例提供一种工业区块链网络的优化装置,该装置包括所包括的各单元、以及各单元所包括的各模块,可以通过区块链节点中的处理器来实现;当然也可通过具体的逻辑电路实现;在实施的过程中,处理器可以为中央处理器(Central Processing Unit,CPU)、微处理器(Microprocessor Unit,MPU)、数字信号处理器(Digital Signal Processing,DSP)或现场可编程门阵列(Field Programmable Gate Array,FPGA)等。
图4为本申请实施例工业区块链网络的优化装置的组成结构示意图,如图4所示,所述装置400包括:
接收单元401,用于接收第一业务交易;
确定单元402,用于确定所述第一业务交易的业务属性;其中,所述业务属性用于表征所述第一业务交易是否具有时延敏感的需求;
发送单元403,用于将标识有所述业务属性的第一业务交易发送至所述工业区块链网络的共识区块链节点,使得所述共识区块链节点能够基于所述业务属性确定所述第一业务交易的出块顺序。
在一些实施例中,所述装置还包括:
第一处理单元,用于如果所述业务属性表征所述第一业务交易具有时延敏感的需求,将所述第一业务交易加入第一出块队列;
第二处理单元,用于如果所述业务属性表征所述第一业务交易不具有时延敏感的需求,将所述第一业务交易加入第二出块队列;
其中,所述第一出块队列的出块优先级高于所述第二出块队列的出块优先级。
在一些实施例中,所述装置还包括:
第一出块单元,用于在所述第一出块队列中不存在业务交易的情况下,选择所述第二出块队列中的业务交易进行出块;或,
第二出块单元,用于如果满足预设条件,选择所述第二出块队列中的业务交易进行出块。
在一些实施例中,所述第二出块单元,包括:
数量确定模块,用于确定所述第一出块队列中当前存在的业务交易的第一数量,以及所述第二出块队列中当前存在的业务交易的第二数量;
占比确定模块,用于确定历史预设时间段内已出块的业务交易中具有时延敏感需求的业务交易的交易占比;
选择模块,用于如果所述第二数量大于所述第一数量、且所述具有时延敏感需求的业务交易的交易占比大于第一预设阈值,选择所述第二出块队列中的业务交易进行出块。
在一些实施例中,所述选择模块,包括:
选择部件,用于如果所述第二数量大于所述第一数量、且所述具有时延敏感需求的业务交易的交易占比大于第一预设阈值,在后续的至少一个区块中增加不具有时延敏感需求的业务交易的交易占比至第二预设阈值;
其中,所述至少一个区块包括的区块数量由单个区块包括的最大交易数量和所述第二数量确定。
在一些实施例中,所述装置还包括:
接口调用单元,用于调用与所述业务属性相匹配的子链接口;
验证单元,用于通过所述子链接口,对所述第一业务交易进行合法性验证;
标识设置单元,用于在验证通过的情况下,将所述业务属性标识在所述第一业务交易中。
在一些实施例中,所述装置还包括:
子链确定单元,用于确定所述第一业务交易所属业务的第一子区块链;
其中,不同的业务具有不同的子区块链;
对应地,所述发送单元403,包括:
发送子单元,用于将设置有所述标识信息的第一业务交易发送至所述共识区块链节点,使得所述共识区块链节点能够基于所述标识信息确定待上链至所述第一子区块链的第一业务交易的出块顺序。
在一些实施例中,所述装置还包括:
报文接收单元,用于接收第一报文;其中,所述第一报文包括至少一个业务交易;
报文属性确定单元,用于确定所述第一报文的报文属性;其中,所述报文属性用于表征所述第一报文是否具有时延敏感的需求;
路由转发表确定单元,用于确定所述工业区块链网络的时延路由转发表;
报文发送单元,用于基于所述时延路由转发表和所述第一报文的报文属性,发出所述第一报文。
在一些实施例中,所述路由转发表确定单元,包括:
时钟同步模块,用于利用时延敏感网络对所述工业区块链网络中的区块链节点进行全局网络时钟同步;
时延确定模块,用于在时钟同步完成的情况下,确定所述工业区块链网络的网络传输时延以及节点处理时延;
路由转发表确定模块,用于基于所述网络传输时延和所述节点处理时延,确定所述工业区块链网络的时延路由转发表。
在一些实施例中,所述装置还包括:
第一转发单元,用于如果所述第一报文的报文属性表征所述第一报文具有时延敏感的需求,将所述第一报文加入第一转发队列;
第二转发单元,用于如果所述第一报文的报文属性表征所述第一报文不具有时延敏感的需求,将所述第一报文加入第二转发队列;
其中,所述第一转发队列至少用于缓存待发送的时延敏感报文,所述第
二转发队列至少用于缓存待发送的非时延敏感报文;所述第一转发队列的转发优先级高于所述第二转发队列的转发优先级。
在一些实施例中,所述报文发送单元,包括:
路由确定模块,用于根据所述时延路由转发表,确定目标转发路由;
位置确定模块,用于确定所述第一报文在所述第一转发队列中的排序位置;
报文发送模块,用于基于所述目标转发路由和所述排序位置,发出所述第一报文。
在一些实施例中,所述装置还包括:
跨链获取单元,用于如果所述第一业务交易与第二业务交易之间存在依赖关系、且所述第一业务交易与所述第二业务交易具有不同的业务属性,则通过预设接口获取所述第二业务交易的交易信息;
交易确定单元,用于基于所述第二业务交易的交易信息和所述依赖关系,确定所述第一业务交易;
其中,所述预设的接口用于实现不同的子区块链之间的相互调用。
以上装置实施例的描述,与上述方法实施例的描述是类似的,具有同方法实施例相似的有益效果。对于本申请装置实施例中未披露的技术细节,请参照本申请方法实施例的描述而理解。
需要说明的是,本申请实施例中,如果以软件功能模块的形式实现上述的优化方法,并作为独立的产品销售或使用时,也可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台电子设备(可以是个人计算机、服务器等)执行本申请各个实施例所述方法的全部或部分。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read Only Memory,ROM)、磁碟或者光盘等各种可以存储程序代码的介质。这样,本申请实施
例不限制于任何特定的硬件和软件结合。
本申请实施例提供一种区块链节点,包括存储器和处理器,所述存储器存储有可在处理器上运行的计算机程序,所述处理器执行所述程序时实现上述实施例中提供的优化方法中的步骤。
本申请实施例提供一种计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现上述优化方法中的步骤。
这里需要指出的是:以上存储介质、节点实施例的描述,与上述方法实施例的描述是类似的,具有同方法实施例相似的有益效果。对于本申请存储介质、节点实施例中未披露的技术细节,请参照本申请方法实施例的描述而理解。
需要说明的是,图5为本申请实施例区块链节点的一种硬件实体示意图,如图5所示,该区块链节点500的硬件实体包括:处理器501、通信接口502和存储器503,其中
处理器501通常控制区块链节点500的总体操作。
通信接口502可以使区块链节点500通过网络与其他区块链节点或服务器或平台通信。
存储器503配置为存储由处理器501可执行的指令和应用,还可以缓存待处理器501以及区块链节点500中各模块待处理或已经处理的数据(例如,图像数据、音频数据、语音通信数据和视频通信数据),可以通过FLASH(闪存)或随机访问存储器(Random Access Memory,RAM)实现。
在本申请所提供的几个实施例中,应该理解到,所揭露的设备和方法,可以通过其它的方式实现。以上所描述的设备实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,如:多个单元或组件可以结合,或可以集成到另一个系统,或一些特征可以忽略,或不执行。另外,所显示或讨论的各组成部分相互之间的耦合、或直接耦合、或通信连接可以是通过一些接口,设备或单元
的间接耦合或通信连接,可以是电性的、机械的或其它形式的。
上述作为分离部件说明的单元可以是、或也可以不是物理上分开的,作为单元显示的部件可以是、或也可以不是物理单元,即可以位于一个地方,也可以分布到多个网络单元上;可以根据实际的需要选择其中的部分或全部单元来实现本实施例方案的目的。
另外,在本申请各实施例中的各功能单元可以全部集成在一个处理模块中,也可以是各单元分别单独作为一个单元,也可以两个或两个以上单元集成在一个单元中;上述集成的单元既可以采用硬件的形式实现,也可以采用硬件加软件功能单元的形式实现。本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成,前述的程序可以存储于一计算机可读取存储介质中,该程序在执行时,执行包括上述方法实施例的步骤;而前述的存储介质包括:移动存储设备、ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。
本申请所提供的几个方法实施例中所揭露的方法,在不冲突的情况下可以任意组合,得到新的方法实施例。
本申请所提供的几个产品实施例中所揭露的特征,在不冲突的情况下可以任意组合,得到新的产品实施例。
本申请所提供的几个方法或设备实施例中所揭露的特征,在不冲突的情况下可以任意组合,得到新的方法实施例或设备实施例。
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。
Claims (15)
- 一种工业区块链网络的优化方法,应用于所述工业区块链网络的区块链节点,所述方法包括:接收第一业务交易;确定所述第一业务交易的业务属性;其中,所述业务属性用于表征所述第一业务交易是否具有时延敏感的需求;将标识有所述业务属性的第一业务交易发送至所述工业区块链网络的共识区块链节点,使得所述共识区块链节点能够基于所述业务属性确定所述第一业务交易的出块顺序。
- 根据权利要求1所述的方法,其中,所述共识区块链节点基于所述业务属性确定所述第一业务交易的出块顺序,通过以下步骤实现:如果所述业务属性表征所述第一业务交易具有时延敏感的需求,将所述第一业务交易加入第一出块队列;如果所述业务属性表征所述第一业务交易不具有时延敏感的需求,将所述第一业务交易加入第二出块队列;其中,所述第一出块队列的出块优先级高于所述第二出块队列的出块优先级。
- 根据权利要求2所述的方法,其中,所述方法还包括:在所述第一出块队列中不存在业务交易的情况下,选择所述第二出块队列中的业务交易进行出块;或,如果满足预设条件,选择所述第二出块队列中的业务交易进行出块。
- 根据权利要求3所述的方法,其中,所述如果满足预设条件,选择所述第二出块队列中的业务交易进行出块,包括:确定所述第一出块队列中当前存在的业务交易的第一数量,以及所述第二出块队列中当前存在的业务交易的第二数量;确定历史预设时间段内已出块的业务交易中具有时延敏感需求的业务交易的交易占比;如果所述第二数量大于所述第一数量、且所述具有时延敏感需求的业务交易的交易占比大于第一预设阈值,选择所述第二出块队列中的业务交易进行出块。
- 根据权利要求4所述的方法,其中,所述如果所述第二数量大于所述第一数量、且所述具有时延敏感需求的业务交易的交易占比大于第一预设阈值,选择所述第二出块队列中的业务交易进行出块,包括:如果所述第二数量大于所述第一数量、且所述具有时延敏感需求的业务交易的交易占比大于第一预设阈值,在后续的至少一个区块中增加不具有时延敏感需求的业务交易的交易占比至第二预设阈值;其中,所述至少一个区块包括的区块数量由单个区块包括的最大交易数量和所述第二数量确定。
- 根据权利要求1至5任一项所述的方法,其中,所述确定所述第一业务交易的业务属性之后,所述方法还包括:调用与所述业务属性相匹配的子链接口;通过所述子链接口,对所述第一业务交易进行合法性验证;在验证通过的情况下,将所述业务属性标识在所述第一业务交易中。
- 根据权利要求6所述的方法,其中,所述方法还包括:确定所述第一业务交易所属业务的第一子区块链;其中,不同的业务具有不同的子区块链;对应地,所述将标识有所述业务属性的第一业务交易发送至所述工业区块链网络的共识区块链节点,使得所述共识区块链节点能够基于所述业务属性确定所述第一业务交易的出块顺序,包括:将设置有所述标识信息的第一业务交易发送至所述共识区块链节点,使得所述共识区块链节点能够基于所述标识信息确定待上链至所述第一子区块 链的第一业务交易的出块顺序。
- 根据权利要求1至5任一项所述的方法,其中,所述方法还包括:接收第一报文;其中,所述第一报文包括至少一个业务交易;确定所述第一报文的报文属性;其中,所述报文属性用于表征所述第一报文是否具有时延敏感的需求;确定所述工业区块链网络的时延路由转发表;基于所述时延路由转发表和所述第一报文的报文属性,发出所述第一报文。
- 根据权利要求8所述的方法,其中,所述确定所述工业区块链网络的时延路由转发表,包括:利用时延敏感网络对所述工业区块链网络中的区块链节点进行全局网络时钟同步;在时钟同步完成的情况下,确定所述工业区块链网络的网络传输时延以及节点处理时延;基于所述网络传输时延和所述节点处理时延,确定所述工业区块链网络的时延路由转发表。
- 根据权利要求8所述的方法,其中,所述确定所述第一报文的报文属性之后,所述方法还包括:如果所述第一报文的报文属性表征所述第一报文具有时延敏感的需求,将所述第一报文加入第一转发队列;如果所述第一报文的报文属性表征所述第一报文不具有时延敏感的需求,将所述第一报文加入第二转发队列;其中,所述第一转发队列至少用于缓存待发送的时延敏感报文,所述第二转发队列至少用于缓存待发送的非时延敏感报文;所述第一转发队列的转发优先级高于所述第二转发队列的转发优先级。
- 根据权利要求10所述的方法,其中,所述基于所述时延路由转发表 和所述第一报文的报文属性,发出所述第一报文,包括:根据所述时延路由转发表,确定目标转发路由;确定所述第一报文在所述第一转发队列中的排序位置;基于所述目标转发路由和所述排序位置,发出所述第一报文。
- 根据权利要求1所述的方法,其中,所述方法还包括:如果所述第一业务交易与第二业务交易之间存在依赖关系、且所述第一业务交易与所述第二业务交易具有不同的业务属性,则通过预设接口获取所述第二业务交易的交易信息;基于所述第二业务交易的交易信息和所述依赖关系,确定所述第一业务交易;其中,所述预设接口用于实现不同的子区块链之间的相互调用。
- 一种工业区块链网络的优化装置,所述装置包括:接收单元,用于接收第一业务交易;确定单元,用于确定所述第一业务交易的业务属性;其中,所述业务属性用于表征所述第一业务交易是否具有时延敏感的需求;发送单元,用于将标识有所述业务属性的第一业务交易发送至所述工业区块链网络的共识区块链节点,使得所述共识区块链节点能够基于所述业务属性确定所述第一业务交易的出块顺序。
- 一种区块链节点,包括存储器和处理器,所述存储器存储有可在处理器上运行的计算机程序,所述处理器执行所述程序时实现权利要求1至12任一项所述方法中的步骤。
- 一种计算机可读存储介质,其上存储有计算机程序,该计算机程序被处理器执行时实现权利要求1至12任一项所述方法中的步骤。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211406045.XA CN118055062A (zh) | 2022-11-10 | 2022-11-10 | 工业区块链网络的优化方法及装置、节点和存储介质 |
CN202211406045.X | 2022-11-10 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2024099224A1 true WO2024099224A1 (zh) | 2024-05-16 |
Family
ID=91031910
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2023/129488 WO2024099224A1 (zh) | 2022-11-10 | 2023-11-03 | 工业区块链网络的优化方法及装置、节点和存储介质 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN118055062A (zh) |
WO (1) | WO2024099224A1 (zh) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114826719A (zh) * | 2022-04-19 | 2022-07-29 | 中国信息通信研究院 | 基于区块链的可信终端认证方法、系统、设备和存储介质 |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20180240114A1 (en) * | 2017-02-22 | 2018-08-23 | Alibaba Group Holding Limited | Transaction verification in a consensus network |
CN110602096A (zh) * | 2019-09-12 | 2019-12-20 | 腾讯科技(深圳)有限公司 | 区块链网络中的数据处理方法、装置、存储介质和设备 |
CN112565104A (zh) * | 2020-12-01 | 2021-03-26 | 腾讯科技(深圳)有限公司 | 区块链系统的流量控制方法、装置、介质及电子设备 |
CN113935835A (zh) * | 2021-06-15 | 2022-01-14 | 腾讯科技(深圳)有限公司 | 一种交易数据处理方法、装置、设备及存储介质 |
-
2022
- 2022-11-10 CN CN202211406045.XA patent/CN118055062A/zh active Pending
-
2023
- 2023-11-03 WO PCT/CN2023/129488 patent/WO2024099224A1/zh unknown
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20180240114A1 (en) * | 2017-02-22 | 2018-08-23 | Alibaba Group Holding Limited | Transaction verification in a consensus network |
CN111917864A (zh) * | 2017-02-22 | 2020-11-10 | 创新先进技术有限公司 | 一种业务校验的方法及装置 |
CN110602096A (zh) * | 2019-09-12 | 2019-12-20 | 腾讯科技(深圳)有限公司 | 区块链网络中的数据处理方法、装置、存储介质和设备 |
CN112565104A (zh) * | 2020-12-01 | 2021-03-26 | 腾讯科技(深圳)有限公司 | 区块链系统的流量控制方法、装置、介质及电子设备 |
CN113935835A (zh) * | 2021-06-15 | 2022-01-14 | 腾讯科技(深圳)有限公司 | 一种交易数据处理方法、装置、设备及存储介质 |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114826719A (zh) * | 2022-04-19 | 2022-07-29 | 中国信息通信研究院 | 基于区块链的可信终端认证方法、系统、设备和存储介质 |
Also Published As
Publication number | Publication date |
---|---|
CN118055062A (zh) | 2024-05-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Kobo et al. | Fragmentation-based distributed control system for software-defined wireless sensor networks | |
WO2024099224A1 (zh) | 工业区块链网络的优化方法及装置、节点和存储介质 | |
US9747319B2 (en) | Read-modify-write processing of chunks at the storage server level in a distributed object storage system | |
US9307017B2 (en) | Member-oriented hybrid cloud operating system architecture and communication method thereof | |
JP2005316993A (ja) | ネットワーク上においてコンピュータ間でオブジェクトを共有するためのシステムおよび方法 | |
CN110113406B (zh) | 基于分布式的计算服务集群系统 | |
WO2022120806A1 (zh) | 面向高性能计算多云的分布式消息传递方法及系统 | |
CN104753817A (zh) | 一种云计算消息队列服务本地模拟方法和系统 | |
US11601360B2 (en) | Automated link aggregation group configuration system | |
JP5479709B2 (ja) | データを処理するためのサーバ‐プロセッサ・ハイブリッド・システムおよび方法 | |
EP4193657A1 (en) | Local and global quality of service shaper on ingress in a distributed system | |
US20130227568A1 (en) | Systems and methods involving virtual machine host isolation over a network | |
US20210328907A1 (en) | Blockchain systems, and message transmission methods and apparatuses | |
CN112527523A (zh) | 面向高性能计算多云的分布式消息传递方法及系统 | |
WO2024098815A1 (zh) | 一种数据传输处理方法、装置、存储介质及电子装置 | |
CN113676444A (zh) | 一种工业互联网的异构协议适配方法 | |
JP5479710B2 (ja) | データを処理するためのプロセッサ‐サーバ・ハイブリッド・システムおよび方法 | |
CN110688284A (zh) | 一种管理和监控RabbitMq消息队列的方法及系统 | |
US10938591B2 (en) | Multicast system | |
US20160212083A9 (en) | Connection sharing across entities in a distributed messaging system | |
US20200389409A1 (en) | In-band-telemetry-based path mtu size determination system | |
JP2014230114A (ja) | 通信システム | |
WO2012159493A1 (zh) | 一种用于实现用户信息共享的即时通讯系统及方法 | |
CN103312808A (zh) | 一种云操作系统总线及通信方法 | |
CN103491079B (zh) | 一种报文生成装置、服务器以及方法 |
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: 23887914 Country of ref document: EP Kind code of ref document: A1 |