Method and device for determining alliance chain-out block strategy, storage medium and electronic equipment

By calculating the load rate of the alliance chain nodes and dynamically adjusting the block production strategy, the problems of low efficiency and high latency in large-scale transactions are solved, and transaction processing efficiency and stability are improved.

CN119316436AActive Publication Date: 2025-01-14中国邮政储蓄银行股份有限公司
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
CN202411336199.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-24
Publication Date
2025-01-14
Estimated Expiration
2044-09-24

AI Technical Summary

Technical Problem

When handling large-scale transactions, the existing alliance chain technology has low transaction processing efficiency and high network latency, which cannot meet the performance requirements in complex scenarios.

Method used

By obtaining the operating status and transaction information of the alliance chain nodes, calculating the load rate, and dynamically adjusting the block production strategy according to the load rate, including the block production capacity and the block production time interval, to optimize the performance of the alliance chain.

Benefits of technology

While meeting the performance needs of alliance chains, it ensures network reliability, reduces resource usage, improves transaction processing efficiency and stability, and solves the problems of low transaction processing efficiency and high network latency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119316436A_ABST
    Figure CN119316436A_ABST
Patent Text Reader

Abstract

The invention provides a method and device for determining an alliance chain-out block strategy, a storage medium and electronic equipment. The method comprises the steps that a node operation state and transaction information of an alliance chain acquired by an acquisition component are acquired, the node operation state comprises a CPU utilization rate, a memory utilization rate and a network bandwidth utilization rate, and the transaction information comprises transaction processing speed information; and determining a load rate of the alliance chain according to the node operation state and the transaction information, and determining a block-out strategy of the alliance chain according to the load rate of the alliance chain. According to the method, the block-out strategy of the alliance chain is determined through the CPU utilization rate, the memory utilization rate, the network bandwidth utilization rate and the transaction processing speed, so that the transaction processing efficiency and stability of the network are improved under the conditions that the performance requirements of the alliance chain are met, the network reliability is guaranteed and the resource occupation is reduced. The problems that when an existing alliance chain technology is used for processing large-scale transactions, transaction processing efficiency is low, network delay is high, and performance requirements under complex scenes cannot be met are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of determining a block generation strategy for a consortium chain, and more specifically, to a method, device, computer-readable storage medium, and electronic device for determining a block generation strategy for a consortium chain. Background Art

[0002] Blockchain is a distributed shared ledger and database with the characteristics of decentralization, immutability, traceability, openness and transparency. In the actual application scenarios of blockchain, it is necessary to optimize the performance of blockchain system according to different scenarios, rather than blindly pursuing high performance of blockchain by modifying the system architecture at the expense of security and scalability.

[0003] Consortium chain is a type of blockchain. When processing large-scale transactions, the current consortium chain technology has problems such as low transaction processing efficiency, high network latency, and inability to meet performance requirements in complex scenarios. Summary of the invention

[0004] The main purpose of this application is to provide a method, device, computer-readable storage medium and electronic device for determining the block generation strategy of a consortium chain, so as to at least solve the problem that the existing consortium chain technology has low transaction processing efficiency, high network latency and cannot meet the performance requirements in complex scenarios when processing large-scale transactions.

[0005] In order to achieve the above-mentioned purpose, according to one aspect of the present application, a method for determining a block generation strategy of a consortium chain is provided, comprising: obtaining a collection component to collect the node operation status and transaction information of the consortium chain, wherein the collection component runs in the node server of the consortium chain in the form of a plug-in, the node operation status includes CPU usage, memory usage, and network bandwidth usage, and the transaction information includes transaction processing speed information; determining the load rate of the consortium chain according to the node operation status and the transaction information, wherein the load rate is the ratio of the current load to the full load; determining the block generation strategy of the consortium chain according to the load rate of the consortium chain, wherein the block generation strategy includes the block generation capacity of the consortium chain and the block generation time interval, and the block generation capacity represents the block generation size of the consortium chain.

[0006] Optionally, the load rate of the alliance chain is determined according to the node operation status and the transaction information, including: using an evaluation function F(x)=w1×TPS(x)+w2×CPU_usage(x)+w3×memory_usage(x)+w4×network_usage(x) to determine the load rate, wherein F(x) is the load rate of the alliance chain, TPS(x) is the transaction processing speed information, CPU_usage(x) is the CPU usage, memory_usage(x) is the memory usage, network_usage(x) is the network bandwidth usage, and w1, w2, w3 and w4 are weight coefficients respectively.

[0007] Optionally, determining the block generation strategy of the alliance chain according to the load rate of the alliance chain includes: determining whether the load rate is less than or equal to a first load threshold; when it is determined that the load rate is less than or equal to the first load threshold, determining that the current running state of the alliance chain is an idle state, adjusting the block generation capacity of the alliance chain to a first block generation capacity, and adjusting the block generation time interval of the alliance chain to a first time interval; after determining whether the load rate is less than or equal to the first load threshold, the method further includes: when it is determined that the load rate is greater than the first load threshold and the load rate is less than or equal to a second load threshold, determining that the current running state of the alliance chain is a low load state; adjusting the block generation capacity of the alliance chain to a second block generation capacity, and adjusting the block generation time interval of the alliance chain to a second time interval, wherein the second block generation capacity is greater than the first block generation capacity, the second time interval is less than the first time interval, and the second load threshold is greater than the first load threshold.

[0008] Optionally, after determining whether the load rate is less than or equal to the first load threshold, the method further includes: determining that the current operating state of the alliance chain is a high load state when the load rate is greater than the second load threshold; adjusting the block capacity of the alliance chain to a third block capacity, and adjusting the block time interval of the alliance chain to a third time interval, wherein the third block capacity is greater than the second block capacity, and the third time interval is less than the second time interval.

[0009] Optionally, after determining that the current state of the alliance chain is a low-load state, the method further includes: increasing the number of transactions of the alliance chain to a preset number, wherein the number of transactions is the number of transactions contained in each block in the alliance chain.

[0010] Optionally, before determining the block generation strategy of the alliance chain according to the load rate of the alliance chain, the method also includes: creating a state machine model, and using the state machine model to define the operating state of the alliance chain, wherein the operating state includes the idle state, the low load state and the high load state.

[0011] Optionally, obtaining the collection component to collect the node operation status and transaction information of the alliance chain includes: obtaining the collection component to collect the node operation status and the transaction information of the alliance chain according to a preset sampling frequency, wherein the preset sampling frequency is set according to alliance chain parameters, and the alliance chain parameters include block generation speed, transaction volume, and number of nodes.

[0012] According to another aspect of the present application, a device for determining a block generation strategy of a consortium chain is provided, comprising: an acquisition unit, for acquiring a node operation status and transaction information of a consortium chain collected by a collection component, wherein the collection component runs in a node server of the consortium chain in the form of a plug-in, the node operation status includes CPU usage, memory usage, and network bandwidth usage, and the transaction information includes transaction processing speed information; a first determination unit, for determining a load rate of the consortium chain according to the node operation status and the transaction information, wherein the load rate is a ratio of a current load to a full load; a second determination unit, for determining a block generation strategy of the consortium chain according to the load rate of the consortium chain, wherein the block generation strategy includes a block generation capacity and a block generation time interval of the consortium chain, and the block generation capacity represents a block generation size of the consortium chain.

[0013] According to another aspect of the present application, a computer-readable storage medium is provided, wherein the computer-readable storage medium includes a stored program, wherein when the program is running, the device where the computer-readable storage medium is located is controlled to execute any one of the methods for determining the alliance chain block generation strategy.

[0014] According to another aspect of the present application, an electronic device is provided, comprising: one or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the one or more programs include a method for executing any one of the methods for determining a consortium chain block generation strategy.

[0015] Apply the technical solution of the present application to obtain the node operation status and transaction information of the alliance chain collected by the collection component, wherein the collection component runs in the node server of the alliance chain in the form of a plug-in, the node operation status includes CPU usage, memory usage, network bandwidth usage, and transaction information includes transaction processing speed information; determine the load rate of the alliance chain according to the node operation status and transaction information, and the load rate is the ratio of the current load to the full load; determine the block generation strategy of the alliance chain according to the load rate of the alliance chain, wherein the block generation strategy includes the block generation capacity and block generation time interval of the alliance chain, and the block generation capacity represents the block generation size of the alliance chain. The block generation strategy of the alliance chain is determined by the CPU usage rate, memory usage rate, network bandwidth usage rate and transaction processing speed, so as to improve the transaction processing efficiency and stability of the network while meeting the performance requirements of the alliance chain, ensuring network reliability and reducing resource occupation. It solves the problem that the existing alliance chain technology has low transaction processing efficiency and high network latency when processing large-scale transactions, and cannot meet the performance requirements in complex scenarios. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The drawings constituting part of the present application are used to provide a further understanding of the present application. The exemplary embodiments and descriptions of the present application are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0017] Figure 1 A hardware structure block diagram of a mobile terminal for executing a method for determining a consortium chain block generation strategy provided in an embodiment of the present application is shown;

[0018] Figure 2 A flow chart of a method for determining a consortium chain block generation strategy provided in accordance with an embodiment of the present application is shown;

[0019] Figure 3 A schematic diagram of the structure of an adaptive module applied to a consortium chain provided according to an embodiment of the present application is shown;

[0020] Figure 4 A schematic diagram of the structure of a specific alliance chain block adjustment strategy provided according to an embodiment of the present application is shown;

[0021] Figure 5 A structural block diagram of a device for determining a consortium chain block generation strategy provided according to an embodiment of the present application is shown. DETAILED DESCRIPTION

[0022] It should be noted that, in the absence of conflict, the embodiments and features in the embodiments of the present application can be combined with each other. The present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0023] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.

[0024] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequential order. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present application described here. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0025] As introduced in the background technology, the existing alliance chain technology has low transaction processing efficiency and high network latency when processing large-scale transactions, and cannot meet the performance requirements in complex scenarios. In order to solve the problem that the existing alliance chain technology has low transaction processing efficiency and high network latency when processing large-scale transactions, and cannot meet the performance requirements in complex scenarios, the embodiments of the present application provide a method, device, computer-readable storage medium and electronic device for determining the alliance chain block strategy.

[0026] The technical solutions in the embodiments of the present invention will be described clearly and completely below in conjunction with the accompanying drawings in the embodiments of the present invention.

[0027] The method embodiments provided in the embodiments of the present application can be executed in a mobile terminal, a computer terminal or a similar computing device. Taking running on a mobile terminal as an example, Figure 1 1 is a hardware structure block diagram of a mobile terminal of a method for determining a consortium chain block generation strategy according to an embodiment of the present invention. Figure 1 As shown, the mobile terminal may include one or more ( Figure 1 Only one is shown in the figure) a processor 102 (the processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA) and a memory 104 for storing data, wherein the mobile terminal may also include a transmission device 106 and an input / output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1The structure shown is only for illustration and does not limit the structure of the mobile terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations are shown.

[0028] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as the computer program corresponding to the method for determining the block generation strategy of the alliance chain in the embodiment of the present invention. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, the above method is implemented. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories can be connected to the mobile terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof. The transmission device 106 is used to receive or send data via a network. The above-mentioned specific network examples may include a wireless network provided by a communication provider of the mobile terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 may be a radio frequency (RF) module, which is used to communicate with the Internet wirelessly.

[0029] In this embodiment, a method for determining a consortium chain block generation strategy running on a mobile terminal, a computer terminal or a similar computing device is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0030] Figure 2 1 is a flow chart of a method for determining a consortium chain block generation strategy according to an embodiment of the present application. Figure 2 As shown, the method comprises the following steps:

[0031] Step S201, obtaining the node running status and transaction information of the alliance chain collected by the collection component, wherein the collection component runs in the node server of the alliance chain in the form of a plug-in, the node running status includes CPU usage, memory usage, network bandwidth usage, and the transaction information includes transaction processing speed information;

[0032] Among them, the consortium chain is a distributed network based on blockchain technology, which is jointly maintained and managed by multiple independent organizations or entities. Unlike public blockchains, consortium chains usually have higher scalability and privacy, and only specific participants can access and participate in transactions and data in the network. Consortium chains are widely used in finance, supply chain management, healthcare and other fields to improve efficiency, reduce costs and enhance security.

[0033] Specifically, the collection component runs in the node server of the alliance chain in the form of a plug-in. Users can use scripts or probe programs to collect the node operation status and transaction information of the alliance chain according to customized collection strategies.

[0034] Step S202, determining the load rate of the alliance chain according to the node operation status and transaction information, where the load rate is the ratio of the current load to the full load;

[0035] Specifically, the load rate of the alliance chain is determined based on the node operation status and transaction information. This allows the load situation of the alliance chain to be accurately determined, and the block generation strategy of the alliance chain to be accurately adjusted based on the load situation.

[0036] Step S203, determining the block generation strategy of the alliance chain according to the load rate of the alliance chain, wherein the block generation strategy includes the block generation capacity and the block generation time interval of the alliance chain, and the block generation capacity represents the block generation size of the alliance chain.

[0037] Among them, the block size of the alliance chain refers to the number of transactions or data contained in each block; and the block time interval refers to the time interval for the generation of each block.

[0038] Specifically, by determining the block size and block time interval of the alliance chain according to the load rate of the alliance chain, the transaction processing efficiency and stability of the network can be improved while meeting the performance requirements of the alliance chain, ensuring network reliability and reducing resource usage.

[0039] Through this embodiment, the acquisition component acquires the node operation status and transaction information of the alliance chain, wherein the acquisition component runs in the node server of the alliance chain in the form of a plug-in, the node operation status includes CPU usage, memory usage, network bandwidth usage, and transaction information includes transaction processing speed information; the load rate of the alliance chain is determined according to the node operation status and transaction information, and the load rate is the ratio of the current load to the full load; the block generation strategy of the alliance chain is determined according to the load rate of the alliance chain, wherein the block generation strategy includes the block generation capacity and block generation time interval of the alliance chain, and the block generation capacity represents the block generation size of the alliance chain. The block generation strategy of the alliance chain is determined by the CPU usage rate, memory usage rate, network bandwidth usage rate and transaction processing speed, so that the transaction processing efficiency and stability of the network are improved while meeting the performance requirements of the alliance chain, ensuring network reliability and reducing resource occupation. It solves the problem that the existing alliance chain technology has low transaction processing efficiency and high network latency when processing large-scale transactions, and cannot meet the performance requirements in complex scenarios.

[0040] In the specific implementation process, the load rate of the alliance chain is determined according to the node operation status and transaction information, including: using the evaluation function F(x)=w1×TPS(x)+w2×CPU_usage(x)+w3×memory_usage(x)+w4×network_usage(x) to determine the load rate, where F(x) is the load rate of the alliance chain, TPS(x) is the transaction processing speed information, CPU_usage(x) is the CPU usage, memory_usage(x) is the memory usage, network_usage(x) is the network bandwidth usage, and w1, w2, w3 and w4 are weight coefficients respectively.

[0041] This method uses an evaluation function formula to accurately calculate the current load rate of the alliance chain based on the alliance chain's current transaction processing speed information, CPU utilization, memory utilization, and network bandwidth utilization.

[0042] Specifically, determining the block generation strategy of the alliance chain according to the load rate of the alliance chain includes: determining whether the load rate is less than or equal to a first load threshold; when it is determined that the load rate is less than or equal to the first load threshold, determining that the current operating state of the alliance chain is an idle state, adjusting the block generation capacity of the alliance chain to the first block generation capacity, and adjusting the block generation time interval of the alliance chain to the first time interval; after determining whether the load rate is less than or equal to the first load threshold, the method also includes: when it is determined that the load rate is greater than the first load threshold, and the load rate is less than or equal to the second load threshold, determining that the current operating state of the alliance chain is a low load state; adjusting the block generation capacity of the alliance chain to the second block generation capacity, and adjusting the block generation time interval of the alliance chain to the second time interval, wherein the second block generation capacity is greater than the first block generation capacity, the second time interval is less than the first time interval, and the second load threshold is greater than the first load threshold.

[0043] Among them, the second load threshold is greater than the first load threshold. When the alliance chain load rate is less than the first load threshold, the current operation state of the alliance chain is considered to be an idle state; when the alliance chain load rate is greater than the first load threshold and less than the second load threshold, the current operation state of the alliance chain is considered to be a low load state; when the alliance chain load rate is greater than the second load threshold, the current operation state of the alliance chain is considered to be a low load state;

[0044] The first load threshold and the second load threshold are set according to the actual performance requirements of the alliance chain.

[0045] More specifically, after determining whether the load rate is less than or equal to the first load threshold, the method also includes: when determining that the load rate is greater than the second load threshold, determining that the current operating state of the alliance chain is a high load state; adjusting the block capacity of the alliance chain to a third block capacity, and adjusting the block time interval of the alliance chain to a third time interval, wherein the third block capacity is greater than the second block capacity, and the third time interval is less than the second time interval.

[0046] Among them, the relationship between the block sizes of the three current operating states of the alliance chain is set as: high load state > low load state > idle state;

[0047] The relationship between the block time intervals of the three current operating states of the alliance chain is set as: high load state < low load state < idle state.

[0048] Furthermore, after determining that the current state of the alliance chain is a low-load state, the method also includes: increasing the number of transactions of the alliance chain to a preset number, wherein the number of transactions is the number of transactions included in each block in the alliance chain.

[0049] This method increases the block size of the alliance chain by increasing the number of transactions in each block, and better utilizes network resources to improve transaction processing speed and efficiency under low load conditions.

[0050] Furthermore, before determining the block generation strategy of the alliance chain according to the load rate of the alliance chain, the method also includes: creating a state machine model, and using the state machine model to define the operating state of the alliance chain, wherein the operating state includes an idle state, a low load state, and a high load state.

[0051] This method uses a state machine model to define the running state of the alliance chain according to the load rate, and divides the running state of the alliance chain into idle state, low load state and high load state, so that the block generation strategy of the alliance chain can be determined according to the running state of the alliance chain.

[0052] Specifically, obtaining the collection component to collect the node operation status and transaction information of the alliance chain includes: obtaining the collection component to collect the node operation status and transaction information of the alliance chain according to a preset sampling frequency, wherein the preset sampling frequency is set according to the alliance chain parameters, and the alliance chain parameters include block generation speed, transaction volume, and number of nodes.

[0053] The preset sampling frequency should be set according to actual needs and data volume. Generally speaking, a sampling frequency that is too high will increase the system burden and data storage costs, while a frequency that is too low may result in data loss or incomplete information. Therefore, when setting the preset sampling frequency, it is necessary to consider the block generation speed information, transaction volume information, node number information, and the block generation time interval of the alliance chain.

[0054] In order to enable those skilled in the art to more clearly understand the technical solution of the present application, the implementation process of the method for determining the alliance chain block generation strategy of the present application will be described in detail below in combination with specific embodiments.

[0055] At present, most of the existing blockchain performance optimization solutions improve blockchain performance by modifying consensus mechanisms, caching strategies, optimizing transaction processes, etc., which are somewhat invasive to the security and scalability of the system architecture. For example, some existing technical solutions achieve performance improvement by modifying the logic of the verification phase; some existing technical solutions optimize performance by introducing caching strategies in the blockchain architecture; some existing technical solutions optimize performance by optimizing the transaction process, pre-executing transactions and guessing the transactions packaged by the block-generating node and then verifying whether the block and the received block are consistent with each other, thereby shortening the overall transaction time; some existing technical solutions adopt layered consensus to modify the consensus mechanism, and optimize the block generation strategy through reinforcement learning based on the layered consensus to improve performance; some existing technical solutions pursue the optimal block generation strategy through deep reinforcement learning algorithms.

[0056] None of the above existing technical solutions can achieve dynamic adjustment of block generation strategies based on different business scenarios and improve the transaction processing efficiency and stability of the entire network without modifying the blockchain system architecture.

[0057] The existing technical solutions have the following disadvantages:

[0058] 1) The blockchain system cannot dynamically switch strategies based on different business scenarios during operation to improve the transaction processing efficiency and stability of the blockchain system;

[0059] 2) Some existing blockchain performance optimization solutions will change the original blockchain technology architecture, and have disadvantages such as high cost and poor compatibility.

[0060] This application aims to design a pluggable adaptive algorithm to enable the blockchain system to meet the transaction processing efficiency and stability requirements in different business scenarios without changing the current architecture of the blockchain system.

[0061] In order to overcome the deficiencies in the prior art, this embodiment designs a pluggable adaptive optimization method for the Fabric alliance chain block generation strategy. By dynamically adjusting the block generation mechanism parameters in the blockchain sorting phase, the blockchain system can meet the transaction processing efficiency and stability requirements in different scenarios.

[0062] like Figure 3 As shown in the figure, an adaptive module applied to the alliance chain Fabric is designed. This module decides whether to update the system block strategy based on the system status within a unit time interval of the blockchain network to achieve adaptive performance optimization.

[0063] The adaptive module adopts a component-based development model, splitting the system into multiple independent components. Each component has its own functions and interface specifications. By defining common interface specifications, different modules or components can be replaced with each other. During system operation, the components are loaded into the system as plug-ins. The components to be loaded can be selected through configuration files, thereby achieving system flexibility and customizability.

[0064] In this embodiment, the adaptive module includes three modules: collection, evaluation, and adjustment. The collection module collects information such as blockchain system node performance and transaction quantity according to the sampling frequency, and pushes data to the evaluation module according to the push rules; the evaluation module is used to realize performance evaluation. An evaluation model is introduced in the evaluation module to evaluate the operating status of the system during system operation. If an abnormality is detected, the evaluation model will trigger the policy adjustment mechanism; the adjustment module will realize the performance adaptation of the alliance chain Fabric by dynamically adjusting the blockchain block generation strategy based on the parameter set such as the block synchronization speed between blockchain system nodes, node performance, current transaction TPS and expected goals.

[0065] In the actual design, these collection modules run in the blockchain system in the form of components. The collection components run in the blockchain node server in the form of plug-ins. Users can collect blockchain system information through scripts or probe programs according to customized collection strategies. The evaluation component can be deployed separately on an additional server. Users can customize the evaluation model according to different business needs, so as to achieve dynamic expansion and switching of the evaluation model. The evaluation model is used to evaluate whether there is an abnormality in the current state. If the system needs to be adjusted adaptively, it is adjusted through the adjustment component. The adjustment component is deployed separately on an additional server. According to the adjustment model and the parameter set pushed by the evaluation model, the corresponding adjustment parameters are calculated, and then the blockchain transaction is sent according to the designed adjustment strategy, the blockchain block strategy is updated, and the blockchain system performance is dynamically adjusted.

[0066] This embodiment relates to a specific method for determining a consortium chain block generation strategy. Figure 4 A schematic diagram of the structure for adjusting the block generation strategy for a specific alliance chain, such as Figure 4 As shown, the method specifically includes the following contents:

[0067] Step S1: The collection component runs in the blockchain node server and collects node operation status (CPU usage, memory usage, network bandwidth usage) and transaction processing speed information according to the sampling frequency;

[0068] Step S2: The collection node pushes the collected data to the evaluation node;

[0069] Step S3: The evaluation node receives node operation status information and blockchain transaction information, aggregates and collects data, and stores it persistently in a local database;

[0070] Step S4: The evaluation node determines whether the block generation strategy of the blockchain system needs to be adjusted based on the evaluation model. If adjustment is required, the parameter set is sent to the adjustment node;

[0071] Step S5: The adjustment node uses the parameter set as the input condition of the adjustment model to calculate the system block parameters;

[0072] Step S6: The node is adjusted to send blockchain transactions according to the adjustment strategy without affecting or with little impact on the normal operation of the business, update the block generation configuration of the blockchain system, and adaptively adjust the performance of the blockchain system.

[0073] This embodiment takes into account network latency, bandwidth, and throughput, monitors indicators such as transaction volume and transaction completion rate in the network, and adopts an "adaptive block generation strategy based on a state machine" to dynamically adjust parameters such as block size, block generation interval, and number of transaction confirmations. This improves the transaction processing efficiency and stability of the network as much as possible while meeting predetermined performance requirements, ensuring network reliability, and minimizing resource usage.

[0074] Among them, the defined state machine model includes:

[0075] Design a state machine with three states: idle state (S1), low-load state (S2), and high-load state (S3). Set appropriate thresholds Fr1 and Fr2 to represent the critical points of different load states. Set appropriate thresholds Fr1 and Fr2 to represent the critical points of different load states.

[0076] Set an evaluation function F(x) to measure the current system load condition. Among them, F(x) = w1 × TPS(x) + w2 × CPU_usage(x) + w3 × memory_usage(x) + w4 × network_usage(x);

[0077] In the formula, F(x) is the load rate of the consortium chain, TPS(x) is the transaction processing speed information, CPU_usage(x) is the CPU usage rate, memory_usage(x) is the memory usage rate, network_usage(x) is the network bandwidth usage rate, and w1, w2, w3, and w4 are weight coefficients respectively.

[0078] In this embodiment, by monitoring data such as the transaction volume, number of nodes, and network latency in the network, the network load index data of the current network is obtained; based on the collected network load index data, the value of the evaluation function F(x) is calculated in real time, the load condition of the current consortium chain network is analyzed, and it is determined which operating state the current consortium chain network is in. The block production strategy of the consortium chain is adjusted according to the current operating state of the consortium chain network.

[0079] Select a suitable state for adjustment according to the load condition of the consortium chain network.

[0080] Realize the following three state transitions:

[0081] S1→S2: When F(x) ≥ Fr1 and the current state is S1, it is converted to S2;

[0082] S2→S3: When F(x) ≥ Fr2 and the current state is S2, it is converted to S3;

[0083] S3→S2: When F(x) < Fr2 and the current state is S3, it is converted to S2.

[0084] In different states, the block production parameters of the blockchain network can be adjusted through the following strategies:

[0085] (1), Idle state S1: In the idle state, the block size and block production interval can be appropriately increased to process transactions faster and reduce network congestion.

[0086] (2) Low load state S2: In the low load state, the block size can be appropriately increased and the block interval can be reduced to better utilize network resources. In addition, the number of transaction confirmations for each block can also be increased to improve transaction processing speed and efficiency.

[0087] (3) High load state S3: Under high load state, the block size can be appropriately increased and the block interval can be reduced to improve transaction processing speed.

[0088] Among them, the relationship between the block sizes in the three states is set as: S3>S2>S1; the relationship between the block time intervals in the three states is set as: S3<S2<S1. In this way, the block generation strategy of the alliance chain Fabric system can be dynamically adjusted according to different states, so that it can better adapt to the actual operation scenario and improve the overall performance and resource utilization.

[0089] This embodiment designs an adaptive adjustment module, which can optimize the block generation strategy and adjust the blockchain performance according to different business scenarios; and achieves a higher throughput without changing the core architecture of the blockchain, thereby ensuring the integrity and security of the blockchain system; through an adaptive solution based on a "state machine", the transaction processing efficiency and stability of the blockchain network are improved; and by introducing a pluggable design pattern for component design, the adaptive sub-module can be customized according to different business needs to achieve the expansion of the adaptive module.

[0090] This embodiment designs a method for determining the block generation strategy of the alliance chain, and designs an optimization scheme based on the state machine strategy, so that the blockchain system can dynamically adjust the block generation strategy based on the current business scenario and improve the performance of the blockchain system. In addition, the present invention also introduces a pluggable design mode, which can realize the dynamic switching of sub-modules by expanding the implementation of the adaptive module, effectively improving the scalability and compatibility of the blockchain system.

[0091] The embodiment of the present application also provides a device for determining the block generation strategy of the alliance chain. It should be noted that the device for determining the block generation strategy of the alliance chain in the embodiment of the present application can be used to execute the method for determining the block generation strategy of the alliance chain provided in the embodiment of the present application. The device is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware with predetermined functions. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.

[0092] The following introduces the device for determining the alliance chain block generation strategy provided in an embodiment of the present application.

[0093] Figure 5Schematic diagram of a device for determining a consortium chain block generation strategy according to an embodiment of the present application. Figure 5 As shown, the device includes: an acquisition unit 51, a first determination unit 52, and a second determination unit 53.

[0094] The acquisition unit 51 is used to acquire the node operation status and transaction information of the collection component collection alliance chain, wherein the collection component runs in the node server of the alliance chain in the form of a plug-in, the node operation status includes CPU usage, memory usage, network bandwidth usage, and the transaction information includes transaction processing speed information;

[0095] Specifically, the collection component runs in the node server of the alliance chain in the form of a plug-in. Users can use scripts or probe programs to collect the node operation status and transaction information of the alliance chain according to customized collection strategies.

[0096] A first determining unit 52 is used to determine the load rate of the alliance chain according to the node operation status and transaction information, and the load rate is the ratio of the current load to the full load;

[0097] Specifically, the load rate of the alliance chain is determined based on the node operation status and transaction information. This allows the load situation of the alliance chain to be accurately determined, and the block generation strategy of the alliance chain to be accurately adjusted based on the load situation.

[0098] The second determination unit 53 is used to determine the block generation strategy of the alliance chain according to the load rate of the alliance chain, wherein the block generation strategy includes the block generation capacity and the block generation time interval of the alliance chain, and the block generation capacity represents the block generation size of the alliance chain.

[0099] Specifically, by determining the block size and block time interval of the alliance chain according to the load rate of the alliance chain, the transaction processing efficiency and stability of the network can be improved while meeting the performance requirements of the alliance chain, ensuring network reliability and reducing resource usage.

[0100] In this embodiment, the acquisition unit is used to acquire the node operation status and transaction information of the alliance chain collected by the collection component, wherein the collection component runs in the node server of the alliance chain in the form of a plug-in, the node operation status includes CPU usage, memory usage, network bandwidth usage, and transaction information includes transaction processing speed information; the first determination unit is used to determine the load rate of the alliance chain according to the node operation status and transaction information, and the load rate is the ratio of the current load to the full load; the second determination unit is used to determine the block generation strategy of the alliance chain according to the load rate of the alliance chain, wherein the block generation strategy includes the block generation capacity and block generation time interval of the alliance chain, and the block generation capacity represents the block generation size of the alliance chain. The block generation strategy of the alliance chain is determined by the CPU usage rate, memory usage rate, network bandwidth usage rate and transaction processing speed, so that the transaction processing efficiency and stability of the network are improved while meeting the performance requirements of the alliance chain, ensuring network reliability and reducing resource occupation. It solves the problem that the existing alliance chain technology has low transaction processing efficiency and high network latency when processing large-scale transactions, and cannot meet the performance requirements in complex scenarios.

[0101] As an optional scheme, the first determination unit includes a first determination module, which is used to determine the load rate by adopting an evaluation function F(x)=w1×TPS(x)+w2×CPU_usage(x)+w3×memory_usage(x)+w4×network_usage(x), wherein F(x) is the load rate of the alliance chain, TPS(x) is the transaction processing speed information, CPU_usage(x) is the CPU usage rate, memory_usage(x) is the memory usage rate, network_usage(x) is the network bandwidth usage rate, and w1, w2, w3 and w4 are weight coefficients respectively.

[0102] Specifically, the evaluation function formula is used to accurately calculate the current load rate of the alliance chain based on the alliance chain's current transaction processing speed information, CPU utilization, memory utilization, and network bandwidth utilization.

[0103] In an optional solution, the second determination unit includes a second determination module and a third determination module, the second determination module is used to determine whether the load rate is less than or equal to the first load threshold; when it is determined that the load rate is less than or equal to the first load threshold, determine that the current operating state of the alliance chain is an idle state, adjust the block capacity of the alliance chain to the first block capacity, and adjust the block time interval of the alliance chain to the first time interval; the third determination module is used to determine whether the load rate is less than or equal to the first load threshold, and after determining that the load rate is greater than the first load threshold and the load rate is less than or equal to the second load threshold, determine that the current operating state of the alliance chain is a low load state; adjust the block capacity of the alliance chain to the second block capacity, and adjust the block time interval of the alliance chain to the second time interval, wherein the second block capacity is greater than the first block capacity, the second time interval is less than the first time interval, and the second load threshold is greater than the first load threshold.

[0104] Specifically, the second load threshold is greater than the first load threshold. When the alliance chain load rate is less than the first load threshold, the current operation state of the alliance chain is considered to be an idle state; when the alliance chain load rate is greater than the first load threshold and less than the second load threshold, the current operation state of the alliance chain is considered to be a low load state; when the alliance chain load rate is greater than the second load threshold, the current operation state of the alliance chain is considered to be a low load state;

[0105] In an optional scheme, the second determination unit also includes a fourth determination module and an adjustment module; the fourth determination module is used to determine that the current operating state of the alliance chain is a high load state after determining whether the load rate is less than or equal to the first load threshold, and when the load rate is greater than the second load threshold; the adjustment module is used to adjust the block capacity of the alliance chain to a third block capacity, and adjust the block time interval of the alliance chain to a third time interval, wherein the third block capacity is greater than the second block capacity, and the third time interval is less than the second time interval.

[0106] Specifically, the relationship between the block sizes of the three current operating states of the alliance chain is set as: high load state > low load state > idle state;

[0107] The relationship between the block time intervals of the three current operating states of the alliance chain is set as: high load state < low load state < idle state.

[0108] In an optional solution, the second determination unit also includes an increase module, which is used to increase the number of transactions in the alliance chain to a preset number after determining that the current state of the alliance chain is a low-load state, wherein the number of transactions is the number of transactions contained in each block in the alliance chain.

[0109] Specifically, the block size of the alliance chain is increased by increasing the number of transactions in each block, and in low-load conditions, network resources are better utilized to improve transaction processing speed and efficiency.

[0110] An optional solution is that the second determination unit also includes a creation module, which is used to create a state machine model before determining the block generation strategy of the alliance chain according to the load rate of the alliance chain, and use the state machine model to define the operating state of the alliance chain, wherein the operating state includes an idle state, a low load state and a high load state.

[0111] Specifically, a state machine model is used to define the running state of the alliance chain according to the load rate, and the running state of the alliance chain is divided into an idle state, a low-load state, and a high-load state, so that the block generation strategy of the alliance chain is determined according to the running state of the alliance chain.

[0112] An optional solution, the acquisition unit includes an acquisition module, which is used to acquire the node operation status and transaction information of the alliance chain according to a preset sampling frequency by the acquisition component, wherein the preset sampling frequency is set according to the alliance chain parameters, and the alliance chain parameters include block generation speed, transaction volume, and number of nodes.

[0113] Specifically, the preset sampling frequency should be set according to actual needs and data volume. Generally speaking, a sampling frequency that is too high will increase the system burden and data storage costs, while a frequency that is too low may result in data loss or incomplete information. Therefore, when setting the preset sampling frequency, it is necessary to consider the block generation speed information, transaction volume information, node number information, and the block generation time interval of the alliance chain.

[0114] The device for determining the block generation strategy of the alliance chain includes a processor and a memory. The acquisition unit, the first determination unit, the second determination unit, etc. are all stored in the memory as program units, and the processor executes the program units stored in the memory to implement the corresponding functions. The above modules are all located in the same processor; or, the above modules are located in different processors in any combination.

[0115] The processor contains a kernel, which calls the corresponding program unit from the memory. One or more kernels can be set, and the kernel parameters can be adjusted to solve the problems of low transaction processing efficiency and high network latency in the existing alliance chain technology when processing large-scale transactions, and the inability to meet the performance requirements in complex scenarios.

[0116] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

[0117] An embodiment of the present invention provides a computer-readable storage medium, which includes a stored program, wherein when the program is running, the device where the computer-readable storage medium is located is controlled to execute the method for determining the alliance chain block generation strategy.

[0118] Specifically, the method for determining the alliance chain block generation strategy includes:

[0119] Step S201, obtaining the node running status and transaction information of the alliance chain collected by the collection component, wherein the collection component runs in the node server of the alliance chain in the form of a plug-in, the node running status includes CPU usage, memory usage, network bandwidth usage, and the transaction information includes transaction processing speed information;

[0120] Step S202, determining the load rate of the alliance chain according to the node operation status and transaction information, where the load rate is the ratio of the current load to the full load;

[0121] Step S203, determining the block generation strategy of the alliance chain according to the load rate of the alliance chain, wherein the block generation strategy includes the block generation capacity and the block generation time interval of the alliance chain, and the block generation capacity represents the block generation size of the alliance chain.

[0122] An embodiment of the present invention provides a processor, which is used to run a program, wherein the method for determining a block generation strategy of a consortium chain is executed when the program is running.

[0123] Specifically, the method for determining the alliance chain block generation strategy includes:

[0124] Step S201, obtaining the node running status and transaction information of the alliance chain collected by the collection component, wherein the collection component runs in the node server of the alliance chain in the form of a plug-in, the node running status includes CPU usage, memory usage, network bandwidth usage, and the transaction information includes transaction processing speed information;

[0125] Step S202, determining the load rate of the alliance chain according to the node operation status and transaction information, where the load rate is the ratio of the current load to the full load;

[0126] Step S203, determining the block generation strategy of the alliance chain according to the load rate of the alliance chain, wherein the block generation strategy includes the block generation capacity and the block generation time interval of the alliance chain, and the block generation capacity represents the block generation size of the alliance chain.

[0127] An embodiment of the present invention provides an electronic device, the electronic device comprising a processor, a memory, and a program stored in the memory and executable on the processor, and when the processor executes the program, at least the following steps are implemented:

[0128] Step S201, obtaining the node running status and transaction information of the alliance chain collected by the collection component, wherein the collection component runs in the node server of the alliance chain in the form of a plug-in, the node running status includes CPU usage, memory usage, network bandwidth usage, and the transaction information includes transaction processing speed information;

[0129] Step S202, determining the load rate of the alliance chain according to the node operation status and transaction information, where the load rate is the ratio of the current load to the full load;

[0130] Step S203, determining the block generation strategy of the alliance chain according to the load rate of the alliance chain, wherein the block generation strategy includes the block generation capacity and the block generation time interval of the alliance chain, and the block generation capacity represents the block generation size of the alliance chain.

[0131] The devices in this article can be servers, PCs, PADs, mobile phones, etc.

[0132] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program for initializing at least the following method steps:

[0133] Step S201, obtaining the node running status and transaction information of the alliance chain collected by the collection component, wherein the collection component runs in the node server of the alliance chain in the form of a plug-in, the node running status includes CPU usage, memory usage, network bandwidth usage, and the transaction information includes transaction processing speed information;

[0134] Step S202, determining the load rate of the alliance chain according to the node operation status and transaction information, where the load rate is the ratio of the current load to the full load;

[0135] Step S203, determining the block generation strategy of the alliance chain according to the load rate of the alliance chain, wherein the block generation strategy includes the block generation capacity and the block generation time interval of the alliance chain, and the block generation capacity represents the block generation size of the alliance chain.

[0136] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.

[0137] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0138] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0139] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0140] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

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

[0142] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

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

[0144] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0145] From the above description, it can be seen that the above embodiments of the present application achieve the following technical effects:

[0146] 1) A method for determining the block generation strategy of a consortium chain of the present application includes: obtaining the node operation status and transaction information of the consortium chain collected by the collection component, wherein the collection component runs in the node server of the consortium chain in the form of a plug-in, the node operation status includes CPU usage, memory usage, and network bandwidth usage, and the transaction information includes transaction processing speed information; determining the load rate of the consortium chain according to the node operation status and transaction information, the load rate is the ratio of the current load to the full load; determining the block generation strategy of the consortium chain according to the load rate of the consortium chain, wherein the block generation strategy includes the block generation capacity and the block generation time interval of the consortium chain, and the block generation capacity represents the block generation size of the consortium chain. The block generation strategy of the consortium chain is determined by the CPU usage, memory usage, network bandwidth usage, and transaction processing speed, so as to improve the transaction processing efficiency and stability of the network while meeting the performance requirements of the consortium chain, ensuring network reliability, and reducing resource occupation. It solves the problem that the existing consortium chain technology has low transaction processing efficiency and high network latency when processing large-scale transactions, and cannot meet the performance requirements in complex scenarios.

[0147] 2) A device for determining the block generation strategy of a consortium chain of the present application comprises: an acquisition unit, which is used to acquire the node operation status and transaction information of the consortium chain collected by the collection component, wherein the collection component runs in the node server of the consortium chain in the form of a plug-in, the node operation status includes CPU usage, memory usage, and network bandwidth usage, and the transaction information includes transaction processing speed information; a first determination unit, which is used to determine the load rate of the consortium chain according to the node operation status and transaction information, and the load rate is the ratio of the current load to the full load; a second determination unit, which is used to determine the block generation strategy of the consortium chain according to the load rate of the consortium chain, wherein the block generation strategy includes the block generation capacity and the block generation time interval of the consortium chain, and the block generation capacity represents the block generation size of the consortium chain. The block generation strategy of the consortium chain is determined by the CPU usage, memory usage, network bandwidth usage, and transaction processing speed, so that the transaction processing efficiency and stability of the network are improved while meeting the performance requirements of the consortium chain, ensuring network reliability, and reducing resource occupation. The problem that the existing consortium chain technology has low transaction processing efficiency and high network latency when processing large-scale transactions, and cannot meet the performance requirements in complex scenarios is solved.

[0148] The above description is only the preferred embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A method for determining a consortium chain block generation strategy, characterized in that: include: Acquiring the node running status and transaction information of the alliance chain collected by the collection component, wherein the collection component runs in the node server of the alliance chain in the form of a plug-in, the node running status includes CPU usage, memory usage, and network bandwidth usage, and the transaction information includes transaction processing speed information; Determine the load rate of the alliance chain according to the node operation status and the transaction information, where the load rate is the ratio of the current load to the full load; The block generation strategy of the alliance chain is determined according to the load rate of the alliance chain, wherein the block generation strategy includes the block generation capacity and the block generation time interval of the alliance chain, and the block generation capacity represents the block generation size of the alliance chain.

2. The method according to claim 1, characterized in that Determining the load rate of the alliance chain according to the node operation status and the transaction information includes: The load rate is determined by using the evaluation function F(x)=w1×TPS(x)+w2×CPU_usage(x)+w3×memory_usage(x)+w4×network_usage(x), wherein F(x) is the load rate of the alliance chain, TPS(x) is the transaction processing speed information, CPU_usage(x) is the CPU usage rate, memory_usage(x) is the memory usage rate, and network_usage(x) is the network bandwidth usage rate. w1, w2, w3 and w4 are weight coefficients respectively.

3. The method according to claim 1, characterized in that Determining a block generation strategy of the alliance chain according to the load rate of the alliance chain includes: determining whether the load rate is less than or equal to a first load threshold; if it is determined that the load rate is less than or equal to the first load threshold, determining that the current running state of the alliance chain is an idle state, adjusting the block generation capacity of the alliance chain to the first block generation capacity, and adjusting the block generation time interval of the alliance chain to the first time interval; After determining whether the load rate is less than or equal to a first load threshold, the method further includes: when it is determined that the load rate is greater than the first load threshold and the load rate is less than or equal to a second load threshold, determining that the current operating state of the alliance chain is a low load state; adjusting the block capacity of the alliance chain to a second block capacity, and adjusting the block time interval of the alliance chain to a second time interval, wherein the second block capacity is greater than the first block capacity, the second time interval is less than the first time interval, and the second load threshold is greater than the first load threshold.

4. The method according to claim 3, characterized in that After determining whether the load rate is less than or equal to a first load threshold, the method further includes: When it is determined that the load rate is greater than the second load threshold, determining that the current operating state of the alliance chain is a high load state; The block production capacity of the alliance chain is adjusted to a third block production capacity, and the block production time interval of the alliance chain is adjusted to a third time interval, wherein the third block production capacity is greater than the second block production capacity, and the third time interval is less than the second time interval.

5. The method according to claim 3, characterized in that: After determining that the current state of the alliance chain is a low-load state, the method further includes: The transaction number of the alliance chain is increased to a preset number, wherein the transaction number is the transaction number contained in each block in the alliance chain.

6. The method according to claim 3, characterized in that: Before determining the block generation strategy of the alliance chain according to the load rate of the alliance chain, the method further includes: A state machine model is created, and the running state of the alliance chain is defined by using the state machine model, wherein the running state includes the idle state, the low load state, and the high load state.

7. The method according to claim 1, characterized in that Get the node operation status and transaction information of the collection component collection alliance chain, including: The acquisition component collects the node operation status and the transaction information of the alliance chain according to a preset sampling frequency, wherein the preset sampling frequency is set according to alliance chain parameters, and the alliance chain parameters include block generation speed, transaction volume, and number of nodes.

8. A device for determining a consortium chain block generation strategy, characterized in that: include: An acquisition unit, used to acquire the node operation status and transaction information of the alliance chain acquired by the acquisition component, wherein the acquisition component runs in the node server of the alliance chain in the form of a plug-in, the node operation status includes CPU usage, memory usage, and network bandwidth usage, and the transaction information includes transaction processing speed information; A first determining unit, configured to determine a load rate of the alliance chain according to the node operation state and the transaction information, wherein the load rate is a ratio of a current load to a full load; The second determination unit is used to determine the block generation strategy of the alliance chain according to the load rate of the alliance chain, wherein the block generation strategy includes the block generation capacity and the block generation time interval of the alliance chain, and the block generation capacity represents the block generation size of the alliance chain.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein when the program is executed, the device where the computer-readable storage medium is located is controlled to execute the method for determining the alliance chain block generation strategy described in any one of claims 1 to 7.

10. An electronic device, characterized in that: include: One or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the one or more programs include a method for determining the alliance chain block strategy as described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Transaction method and system based on alliance chain, server and block chain system

    CN110163756A

  • Blockchain performance optimization method, device and equipment

    CN112818055A

  • Alliance chain consensus optimization method based on communication mode structure

    CN112929186A

  • Block-out strategy adjustment method and related equipment thereof

    CN115170147A

  • Alliance chain block generation method and apparatus, electronic device, and medium

    WO2023109040A1