Parallel chain efficient management method and device and storage medium
By deploying a policy contract in the alliance chain main chain, setting priorities based on transaction policy items and rejecting low-priority transactions, the problem of improper processing of parallel chain transactions in the alliance chain network is solved, and efficient service quality assurance is achieved.
Patent Information
- Application Number
- CN202210800168.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-07-06
- Publication Date
- 2025-10-10
- Estimated Expiration
- 2042-07-06
AI Technical Summary
In the existing technology, the parallel chain transactions of different businesses in the alliance chain network adopt the first-in-first-out mode, which results in the inability to package high-timeliness parallel chain transactions in a timely manner, affecting the service quality, and parallel chain transactions with low timeliness frequently fail.
Deploy a policy contract in the main chain, set the priority according to the policy items of the transaction, and reject low-priority transactions during network peak hours. The lowest access priority is determined through the priority screening mechanism, and low-priority transactions are rejected to ensure that high-priority transactions are packaged in a timely manner.
It achieves strategic and layered rejection of low-priority transactions during business peak periods, ensuring high TPS and low-latency service quality for important businesses.
Smart Images

Figure CN115220889B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the technical field of computer, and particularly relates to a parallel chain efficient management method, device and storage medium. BACKGROUND
[0002] In the alliance chain network, a main chain can configure multiple parallel chains of different businesses. For example, financial parallel chain, financial parallel chain, traceability parallel chain, legal parallel chain, logistics parallel chain and the like. All parallel chain transactions of these parallel chains need to be sent to the main chain node first, packaged into the main chain block and recorded on the main chain, and then synchronized to the local by the parallel chain node of the corresponding parallel chain to generate a parallel chain block. In the prior art, the order of processing parallel chain transactions is usually based on the first-in first-out mode, and the transactions submitted first are processed first. However, in real use scenarios, different businesses have different requirements for the timeliness of transactions. The prior art uniformly adopts the first-in first-out mode for any parallel chain corresponding to different business layers, which may cause the parallel chain with high timeliness to be unable to be packaged into the main chain in time, while the parallel chain corresponding to the business with low timeliness is packaged into the main chain, which may cause the parallel chain transaction corresponding to the business with high timeliness to frequently fail, thereby affecting the service quality guarantee. SUMMARY
[0003] The present application provides a parallel chain efficient management method, device and storage medium, which can realize planned order processing of different parallel chain transactions.
[0004] In order to solve or partially solve the above technical problems, the present application adopts the following technical solutions:
[0005] In a first aspect, the present application provides a parallel chain efficient management method, which comprises:
[0006] Deploying a strategy contract in the main chain; the strategy contract is used for setting the priority of transactions according to a plurality of strategy items, and the strategy items include one of transaction initiator address, transaction recipient address, transaction belonging to parallel chain name and contract name;
[0007] The first parallel chain node determines whether the first parallel chain belongs to a transaction peak period according to the network condition, and if yes, rejects the transaction submitted from the business layer corresponding to the first parallel chain, and if not, receives the transaction from the business layer corresponding to the first parallel chain and forwards it to the transaction buffer pool of the main chain; the first parallel chain node is a node in the first parallel chain;
[0008] The first main chain node determines a minimum access priority of a transaction buffer pool according to a priority screening mechanism, and each parallel chain of the main chain rejects transactions with a priority lower than the minimum access priority; the priority strategy mechanism includes: if the total number of pending transactions with a priority higher than or equal to a floating priority in the current transaction buffer pool is greater than a preset number of times of the maximum packaging number of blocks, the current floating priority is the minimum access priority; the floating priority is sequentially brought in from high to low according to the priority registration set in the strategy contract until the minimum access priority is determined; and the first main chain node is a current block node.
[0009] After the first main chain node packages the block, the main chain updates transactions in the transaction buffer pool.
[0010] Preferably, the strategy contract is configured with a priority weight of each strategy item, and the strategy contract obtains the priority of the transaction based on each strategy item of the transaction and the priority weight of each configured strategy item.
[0011] Preferably, the method for the strategy contract to obtain the priority of the transaction based on each strategy item of the transaction and the priority weight of each configured strategy item includes:
[0012] All strategy items of the transaction are obtained, each strategy item configured by the strategy contract is matched with all strategy items of the transaction, and if no match is found, the priority of the transaction is set as a default priority;
[0013] If one strategy item is matched, the priority of the transaction is set as the priority of the matched strategy item;
[0014] If multiple strategy items are matched, the priority of the transaction is set as the priority of the strategy item with the highest priority weight.
[0015] In a second aspect, a computer device is provided, including one or more processors;
[0016] a memory for storing one or more programs,
[0017] When the one or more programs are executed by the one or more processors, the one or more processors execute the method of the first aspect.
[0018] In a third aspect, a storage medium storing a computer program is provided, and the program is executed by a processor to implement the method of the first aspect.
[0019] The present application has the beneficial effect of solving the problem of how to configure multiple business parallel chains in the alliance chain main chain by setting a priority, and strategically rejecting transactions with a low priority during a business peak, thereby effectively ensuring that important and priority businesses can obtain high TPS and low latency service quality guarantee. BRIEF DESCRIPTION OF DRAWINGS
[0020] Figure 1 A flow chart of a parallel chain efficient management method provided by an embodiment of the present application is shown in FIG. 1.
[0021] Figure 2 A structural schematic diagram of a computer device provided by an embodiment of the present application is shown in FIG. 2. DETAILED DESCRIPTION
[0022] The present application will be further described in detail in the following with reference to specific embodiments and the accompanying drawings. A person of ordinary skill in the art can implement the present application based on the description. In addition, the embodiments of the present application involved in the following description are generally only a part of the embodiments of the present application, but not all the embodiments. Therefore, all other embodiments obtained by a person of ordinary skill in the art based on the embodiments of the present application without making creative efforts shall fall within the protection scope of the present application. It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other without conflict. The methods described in the embodiments of the present application are all the methods mastered by the person of ordinary skill in the art unless otherwise specified.
[0023] Figure 1 A flow chart of a delay transaction method based on EVM provided by an embodiment of the present application is shown in FIG. 3.
[0024] A parallel chain efficient management method, the method comprising:
[0025] deploying a policy contract in the main chain; the policy contract is used to set priority of a transaction according to a plurality of policy items, the policy items including one of a transaction initiator address, a transaction recipient address, a parallel chain name to which the transaction belongs, and a contract name;
[0026] a first parallel chain node determines whether the first parallel chain belongs to a transaction peak period according to network conditions, if yes, rejects a transaction submitted by a business layer corresponding to the first parallel chain, if not, receives the transaction from the business layer corresponding to the first parallel chain and forwards the transaction to a transaction buffer pool of the main chain; the first parallel chain node is a node in the first parallel chain;
[0027] The first main chain node determines a minimum access priority of the transaction buffer pool according to a priority screening mechanism, and each parallel chain of the main chain rejects transactions with a priority lower than the minimum access priority; the priority strategy mechanism includes: if the total number of pending transactions with a priority higher than or equal to the floating priority in the current transaction buffer pool is greater than a preset number of times of the maximum packaging number of blocks, the current floating priority is the minimum access priority; the floating priority is sequentially brought in from high to low according to the priority registration set in the strategy contract until the minimum access priority is determined; and the first main chain node is a current block node.
[0028] After the first main chain node packages the block, the main chain updates the transactions in the transaction buffer pool.
[0029] Specifically, the strategy contract is configured with a priority weight of each policy item, and the strategy contract obtains the priority of the transaction based on each policy item of the transaction and the configured priority weight of each policy item.
[0030] More specifically, the method for the strategy contract to obtain the priority of the transaction based on each policy item of the transaction and the configured priority weight of each policy item includes:
[0031] Obtaining all policy items of the transaction, matching each policy item configured by the strategy contract with all policy items of the transaction, and setting the priority of the transaction as a default priority if no matching is found;
[0032] If one policy item is matched, the priority of the transaction is set as the priority of the matched policy item;
[0033] If multiple policy items are matched, the priority of the transaction is set as the priority of the policy item with the highest priority weight.
[0034] The embodiment takes a large company as an example, which is configured with alliance chain main chain A, the main chain A is provided with financial parallel chain B, legal parallel chain C, bill parallel chain D, logistics parallel chain E, the number of parallel chains can be set according to the actual demand, here is only an example, the main chain A is configured with a strategy contract, the strategy contract stipulates the priority of all parallel chain transactions, of course, the main chain transaction is prior to the parallel chain transaction, which can also be reflected in the strategy contract, the application only discusses the priority among the parallel chain transactions, so the main chain transaction is not described in detail, it is assumed that the strategy items of the contract include transaction initiator, transaction receiver, parallel chain name and contract name, wherein the weight of the parallel chain name is 0.5, the weight of the contract name is 0.3, the weight of the transaction initiator and the transaction receiver is 0.1, then when the parallel chain transaction has multiple strategy items, the greater one is taken according to the weight, in addition, different parameters under the same strategy item have different priorities, for example, the priority of the financial parallel chain is 0, the priority of the logistics parallel chain is 2, the priority of the legal parallel chain is 1, the smaller the priority number is, the higher the priority is, the different parameters can be classified according to the priority, the parallel chain name and the contract name can adopt the exhaustive way, and the strategy items such as the transaction initiator and the transaction receiver can adopt the special record way, for example, the transaction priority of the initiator administrator is 0, and the others are 1 and the like, so as to form the generation of the priority, all the parallel chain transactions are marked with the corresponding priority by the strategy contract before entering the transaction buffer pool, the parallel chain receives the transaction according to the current network condition to determine the acceptable priority, rejects the transaction with low priority, and prompts that the network is busy, and after each block is output, the transactions with different priorities cached in the transaction buffer pool are updated, so as to provide the basis for decision whether to receive the transactions with different priorities. The design can strategically reject the transactions with low priority in the business peak of the blockchain business, and effectively guarantee that the important and priority business can obtain the service quality guarantee of high TPS and low time delay.
[0035] Figure 2 A structural schematic diagram of a device provided by an embodiment of the application.
[0036] As Figure 2 shown, as another embodiment of the application, a computer device 100 is provided, which includes one or more central processing units (CPUs) 101, which can perform various appropriate actions and processes according to programs stored in a read-only memory (ROM) 102 or programs loaded from a storage part 108 into a random access memory (RAM) 103. In the RAM 103, various programs and data required for the operation of the device 100 are also stored. The CPU 101, the ROM 102 and the RAM 103 are connected to each other through a bus 104. An input / output (I / O) interface 105 is also connected to the bus 104.
[0037] The following components are connected to the I / O interface 105: an input section 106 including a keyboard, a mouse, etc.; an output section 107 including a display such as a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 108 including a hard disk, etc.; and a communication section 109 including a network interface card such as a LAN card, a modem, etc. The communication section 109 performs communication processing via a network such as the Internet, and a communication processing driver 110 is also connected to the I / O interface 105 as necessary. A removable media 111 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc. is attached to the driver 110 as necessary, so that a computer program read out therefrom is installed in the storage section 108 as necessary.
[0038] In particular, according to the embodiments disclosed in the present application, the method described in Embodiment 1 above can be implemented as a computer software program. For example, the embodiments disclosed in the present application include a computer program product comprising a computer program tangibly embodied on a machine-readable medium, the computer program containing program code for executing the method described in any of the above embodiments. In such embodiments, the computer program can be downloaded and installed from a network via the communication section 109, and / or installed from the removable media 111.
[0039] As still another aspect, the present application also provides a computer readable storage medium, which can be the computer readable storage medium contained in the apparatus of the above embodiments; or can exist separately from the apparatus and not be assembled into the apparatus. The computer readable storage medium stores one or more programs for execution by one or more processors to perform the methods described in the present application.
[0040] The flow diagrams and the block diagrams in the drawings are illustrations of possible architectures, functions, and operations for systems, methods, and computer program products according to various embodiments of the present application. In this regard, each block in the flow diagrams or block diagrams can represent a module, a segment, or a portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that in some alternative implementations, the functions noted in the blocks can occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently or the blocks can sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and / or flow diagrams, and combinations thereof, can be implemented by special purpose hardware-based systems that perform the specified functions or operations, or combinations of special purpose hardware and computer instructions.
[0041] The units or modules described in the embodiments of the present application can be implemented in the form of software or in the form of hardware. The described units or modules can also be arranged in a processor, for example, each of the units can be a software program arranged in a computer or a mobile smart device, or can be a separately configured hardware device. In some cases, the names of these units or modules do not constitute a limitation on the units or modules themselves.
[0042] The above description is merely preferred embodiments of the present application and a description of the principles of the technology used. Those skilled in the art should understand that the scope of the application involved in the present application is not limited to the technical solutions formed by the specific combinations of the above technical features, and should also cover other technical solutions formed by any combination of the above technical features or equivalent features without departing from the concept of the present application. For example, the above features are replaced with each other to form a technical solution having similar functions disclosed in the present application (but not limited to).
Claims
1. A method for efficient management of parallel chains, characterized in that: The method comprises: Deploy a policy contract in the main chain; the policy contract is used to set transaction priorities based on several policy items, including one of the transaction initiator address, transaction recipient address, the name of the parachain to which the transaction belongs, and the contract name; The first parachain node determines whether the first parachain is in a peak transaction period based on the network conditions. If so, it rejects the transaction submitted by the business layer corresponding to the first parachain. If not, it accepts the transaction from the business layer corresponding to the first parachain and forwards it to the transaction buffer pool of the main chain. The first parachain node is a node in the first parachain; The first main chain node determines the lowest admission priority of the transaction buffer pool based on the priority screening mechanism, and each parachain of the main chain rejects transactions with a priority lower than the lowest admission priority. The priority policy mechanism includes: if the total number of pending transactions in the current transaction buffer pool with a priority higher than or equal to the floating priority is greater than a preset number of times the maximum block packaging number, then the current floating priority is the lowest admission priority. The floating priority is sequentially brought in from the priority registration set in the policy contract from high to low until the lowest admission priority is determined; the first main chain node is the current block producing node; After the first main chain node generates a block, the main chain updates the transactions in the transaction buffer pool.
2. A method for efficient management of parallel chains according to claim 1, characterized in that: The policy contract is configured with priority weights of various policy items, and the policy contract obtains the priority of the transaction based on various policy items of the transaction and the priority weights of various configured policy items.
3. A method for efficient management of parallel chains according to claim 2, characterized in that: The method for the policy contract to obtain the priority of a transaction based on each policy item of the transaction and the priority weight of each configured policy item includes: Get all the policy items of the transaction, match each policy item configured in the policy contract with all the policy items of the transaction, and set the priority of the transaction to the default priority if no match is found; If a policy item is matched, the priority of the transaction is set to the priority of the matched policy item; If multiple policy items are matched, the policy item with the highest priority weight is selected as the priority of the transaction based on the priority weights of the policy items.
4. A computer device, characterized in that: one or more processors; a memory for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors are caused to perform the method according to claim 1 , 2 , or 3 .
5. A storage medium storing a computer program, characterized in that: When the program is executed by a processor, the method according to claim 1, 2 or 3 is implemented.
Citation Information
Patent Citations
Data transmission method and device based on priority level as well as network equipment
CN102025638A
Data processing method and apparatus
CN108055556A