Extensible universal block chain performance boundary measurement method and device
By building a scalable general blockchain performance boundary measurement framework and a performance boundary construction acceleration algorithm based on pruning search, the blockchain performance measurement framework in the existing technology has solved the problems of poor scalability, insufficient universality, low accuracy and low efficiency, and achieved multi-index measurement and optimization of blockchain performance, providing positioning and optimization guidance for blockchain performance bottlenecks.
Patent Information
- Application Number
- CN202311233313.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-20
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2043-09-20
AI Technical Summary
The existing blockchain performance measurement framework cannot meet users' needs for scalability, generality, accuracy and efficiency in measurements, and it is difficult to effectively measure and optimize in a variable practical application environment.
A scalable general blockchain performance boundary measurement framework is proposed. By building a blockchain performance measurement framework composed of master nodes and slave nodes, using the adjustment of multi-configuration parameters and the performance boundary construction of acceleration algorithms based on pruning search, multi-index measurement and optimization of blockchain performance are achieved.
It realizes the scalability and versatility of blockchain performance measurement, can accurately measure blockchain performance in different environments, and guides blockchain parameter configuration through optimization strategies to improve system performance and reduce the impact on the system.
Smart Images

Figure CN119690787A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of blockchain performance measurement and performance optimization, and in particular, relates to a scalable universal blockchain performance boundary measurement method and device. Background Art
[0002] As an emerging technology, blockchain technology provides secure, transparent and efficient solutions for various industries such as finance, logistics, energy, and medical care due to its distributed ledger technology characteristics. However, as its application scope continues to expand, the performance bottleneck of blockchain has become increasingly prominent, and the performance optimization of blockchain has also attracted much attention. Compared with centralized systems, the transaction throughput and confirmation delay of blockchain are orders of magnitude different. Therefore, improving the transaction throughput of blockchain systems and reducing transaction confirmation delays are of great significance to broadening the application scenarios of blockchain.
[0003] At present, the mainstream research on blockchain performance optimization focuses on the optimization of blockchain chain data structure and blockchain consensus algorithm. Some studies introduce sharding technology into blockchain, divide the blockchain network into smaller shards to process transactions in parallel, improve blockchain throughput and reduce latency; some studies are committed to proposing new consensus algorithms to improve performance. In the development history of blockchain, PoW (Proof-of-Work), PoS (Proof-of-Stake), DPoS (Delegate Proof of Stake), Ripple Consensus and other consensus algorithms have emerged; some studies use higher-performance hardware devices, such as customized ASIC (Application Specific Integrated Circuit) to speed up transaction processing and consensus verification.
[0004] Although there are many solutions for blockchain performance optimization, these optimizations involve a core issue. Blockchain is a complex system. Changes to one part may involve multiple parts, which will inevitably affect other parts and even restrict the original performance. To accurately adjust and improve the performance of the blockchain, you need to have a deeper understanding of the blockchain system. Detailed measurement of blockchain performance helps to understand the performance limitations and bottlenecks of the blockchain, guide the direction of blockchain performance optimization, and minimize the impact on the blockchain system itself while optimizing.
[0005] However, most of the current blockchain measurement solutions have poor scalability and are developed for specific blockchain systems. In addition, most blockchains can only measure the performance peak of a system under a fixed environment (physical environment and parameter configuration). However, in actual application environments, blockchains are in a fluctuating operating environment, and a measurement solution is needed that can measure the performance of blockchains in different environments and provide optimization guidance for the current configuration. Therefore, it is urgent to propose a flexible and scalable blockchain measurement framework that can adapt to different blockchain implementations and has guiding significance for blockchain performance optimization.
[0006] Blockchain performance measurement is an important direction for the development of blockchain technology. A widely used blockchain performance measurement tool needs to meet the following four conditions:
[0007] Scalability: The measurement framework can customize measurement indicators according to user needs to achieve functional expansion;
[0008] Universality: The measurement framework should be applicable to different types of blockchain systems, lightweight and easy to port;
[0009] Accuracy: The measurement framework needs to be able to measure not only the system performance in an ideal environment, but also simulate actual application scenarios and measure the blockchain performance in different environments. The blockchain performance measured by the measurement framework must be consistent with the performance of the blockchain during actual operation.
[0010] Efficiency: While ensuring test accuracy, measurement efficiency must be ensured.
[0011] The inventors found through research that it is difficult for existing blockchain measurement tools to meet all the above conditions and they all have some shortcomings, which can be specifically divided into the following categories:
[0012] In terms of scalability, most existing blockchain performance measurement frameworks only have coarse-grained indicators such as transaction throughput and overall transaction latency. They are unable to measure fine-grained performance indicators during the operation of the blockchain, and users with needs are unable to expand new performance indicators for measurement.
[0013] In terms of versatility, the existing blockchain performance measurement framework can only support one or several specific blockchain platforms, and its versatility is not strong, which limits its practicality in a multi-chain environment.
[0014] In terms of accuracy, most measurement frameworks can only adjust workloads and network topologies, and require testing the performance peak of a system when other configurations are fixed. There are large differences between the experimental environment and the real scene, and the measurement results are of limited help to practical applications. Some measurement frameworks use simulators to measure the blockchain operating environment in a simulated real environment. Although this method can simulate a variable real environment, the results measured by the simulator are less accurate. In order to ensure the accuracy of the simulator results, a large amount of actual data is required to calibrate the simulator, resulting in a significant decrease in measurement efficiency and a significant increase in overhead.
[0015] In terms of efficiency, the above simulators can ensure efficient measurement, but their accuracy is low, and to achieve accurate simulation, huge overhead is required to calibrate the simulator. If you want to measure the actual blockchain in a complex and diverse environment that is close to reality, you need to change the configuration environment and run it multiple times. The existing measurement framework can only be deployed and run on a single machine, which also takes a lot of time and is inefficient.
[0016] To address the above issues, it is necessary to study a new blockchain measurement framework that can simultaneously meet the requirements of scalability, generality, accuracy, and efficiency.
[0017] Extract the papers previously published or patents applied for by the applicant and record the technical problems they exist.
[0018] If there is no technical solution previously disclosed by the applicant, you may select the prior art features summarized in the prior art (including published patents) (the technical features common to the present invention and the prior art) and briefly describe them using the drawings, but be careful not to directly quote the patent document numbers of patents not published by the applicant. Summary of the invention
[0019] The purpose of the present invention is to solve the problem that the existing blockchain performance measurement framework cannot meet the user's requirements for scalability, generality, accuracy and efficiency of blockchain measurement, and propose a set of scalable general blockchain performance boundary measurement framework, which measures multiple performance indicators of the running blockchain system by adjusting multiple configuration parameters, meets the requirements of scalability, generality, accuracy and efficiency, constructs blockchain performance boundaries, and can provide guidance for parameter configuration optimization of blockchains in different application scenarios.
[0020] The core of the scalable universal blockchain performance boundary measurement framework proposed in the present invention is the scalable universal blockchain performance boundary measurement framework and the acceleration algorithm based on pruning search performance boundary construction. The design of this framework and the analysis of the performance boundary construction algorithm are the key points of the present invention and protection.
[0021] Specifically, the present invention provides a scalable general blockchain performance boundary measurement method, which includes:
[0022] Step 1: Build a blockchain performance measurement framework consisting of a master node and a slave node. The slave node is provided with a startup module, a performance monitoring module and a stress testing module; the master node is provided with a control module, a data storage module and a parameter optimization module;
[0023] Step 2: setting the adjustment parameter range and initial parameter configuration in the startup module; setting the transaction type and sending rate in the stress test module; setting the data structure for monitoring performance indicators and the collection location of performance indicators in the performance monitoring module;
[0024] Step 3, the startup module deploys the test blockchain according to the parameter configuration; the stress test module sends transactions to the test blockchain according to the set transaction type and sending rate; the performance monitoring module monitors the performance indicators on the chain according to the specified collection frequency and the collection location, and sends the collected performance indicator data to the control module of the master node;
[0025] Step 4: After receiving the performance indicator data, the control module merges it with the parameter configuration sent to the slave node into a record and sends it to the data storage module of the master node; the parameter optimization module of the master node reads the historical data from the data storage module, compares it with the performance indicator data of the parameter configuration test before this optimization, determines whether it is an effective optimization to store iterative data, and updates the parameter configuration according to the optimization strategy, and sends the updated parameter configuration to the slave node, and executes step 3 again until the monitored performance indicator data reaches the preset stop condition, and records the performance indicators of the test blockchain under each parameter configuration to form the performance boundary of the test blockchain;
[0026] Step 5: Determine a set of configuration parameters that best meet the specific requirements based on the performance boundary, so as to configure the test blockchain to achieve the best performance under the specific requirements.
[0027] The scalable general blockchain performance boundary measurement method, wherein the blockchain performance measurement framework is a distributed cluster architecture, the control module distributes multiple sets of parameter configurations generated by the parameter adjustment module to the designated slave node servers, and all slave node servers execute steps 2 and 3 in parallel.
[0028] The scalable general blockchain performance boundary measurement method, wherein the optimization strategy includes:
[0029] Step 41, the user initializes the algorithm and generates a series of parameters. In the first round of iteration, the adjustment parameter range includes m parameters A 1 ,A 2 ,A 3 ,…,A m, the initial value is (α 1 ,α 2 ,α 3 ,…,α m ) and n corresponding performance indicators B 1 ,B 2 ,B 3 …B n The value is (β 1 ,β 2 ,β 3 ,…,β n ); Normalize the optimization target and set weights for each performance indicator (ω 1 ,ω 2 ,ω 3 ,…,ω n ) for weighting:
[0030]
[0031] The value of each set of parameters is used as a node in the tree, and the combination of parameters is the unique identifier of the node. The child nodes of the node are generated by adjusting the parameter combination. 0 (α 1 ,α 2 ,α 3 ,…,α m ), each parameter in each node has the same probability of being selected in each adjustment direction 01 ,p 02 ,p 03 ,…,p 0m ;
[0032] Step 42, randomly select a parameter A each time i The value of δ i is the adjustment parameter α i Step length, get the node
[0033] Step 43, determine the parameter combination N 1 The results of running β 1 Is it greater than (1+θ)β 0 , where θ is the performance error. If , then the adjustment result is considered to be effective optimization, which will improve the adjustment parameter A in the next iteration of the child node. i The probability p of the value 1i (p 1i >p 01 =p 02 =…=p 1m ), keep the adjustment probability of the remaining unadjusted parameters equal; otherwise, execute step 44;
[0034] Step 44, the child node will not be recorded, and the subsequent branches of its parent node will be pruned, and no parameter adjustment will be performed on it;
[0035] Step 45, execute step 42 again to iterate, and each time the iteration generates a node, it will search on the tree whether it exists. If it exists, it will be skipped and the parameter on the node will not be adjusted anymore; until the parameter adjustment on all nodes cannot be recorded, the current tree structure is saved, and all leaf nodes on the tree constitute the performance boundary of the test blockchain.
[0036] The scalable universal blockchain performance boundary measurement method, wherein the specific requirement is at least one specific parameter value within the adjustment parameter range.
[0037] The present invention also proposes an extensible universal blockchain performance boundary measurement device, which includes:
[0038] Module 1 is used to build a blockchain performance measurement framework consisting of a master node and a slave node. The slave node is provided with a startup module, a performance monitoring module and a stress testing module; the master node is provided with a control module, a data storage module and a parameter optimization module;
[0039] Module 2 is used to set the adjustment parameter range and initial parameter configuration in the startup module; set the transaction type and sending rate in the stress test module; set the data structure of monitoring performance indicators and the collection location of performance indicators in the performance monitoring module;
[0040] Module 3, used for the startup module to deploy the test blockchain according to the parameter configuration; the stress test module sends transactions to the test blockchain according to the set transaction type and sending rate; the performance monitoring module monitors the performance indicators on the chain according to the specified collection frequency and the collection location, and sends the collected performance indicator data to the control module of the master node;
[0041] Module 4 is used for the control module to combine the received performance indicator data with the parameter configuration sent to the slave node into a record, and send it to the data storage module of the master node; the parameter optimization module of the master node reads the historical data from the data storage module, and compares it with the performance indicator data of the parameter configuration test before the current optimization to determine whether it is an effective optimization for iterative data storage, and updates the parameter configuration according to the optimization strategy, and sends the updated parameter configuration to the slave node, and executes module 3 again until the monitored performance indicator data reaches the preset stop condition, and records the performance indicators of the test blockchain under each parameter configuration to form the performance boundary of the test blockchain;
[0042] Module 5 is used to determine a set of configuration parameters that meet the best performance under specific requirements based on the performance boundary, so as to configure the test blockchain to achieve the best performance under the specific requirements.
[0043] The scalable universal blockchain performance boundary measurement device, wherein the blockchain performance measurement framework is a distributed cluster architecture, the control module distributes multiple sets of parameter configurations generated by the parameter adjustment module to the designated slave node servers, and all slave node servers execute modules 2 and 3 in parallel.
[0044] The scalable universal blockchain performance boundary measurement device, wherein the optimization strategy includes:
[0045] Module 41, used in the first round of iteration, the adjustment parameter range includes m parameters A 1 ,A 2 ,A 3 ,…,A m , the initial value is (α 1 ,α 2 ,α 3 ,…,α m ) and n corresponding performance indicators B 1 ,B 2 ,B 3 …B n The value is (β 1 ,β 2 ,β 3 ,…,β n ); Normalize the optimization target and set weights for each performance indicator (ω 1 ,ω 2 ,ω 3 ,…,ω n ) for weighting:
[0046]
[0047] The value of each set of parameters is used as a node in the tree, and the combination of parameters is the unique identifier of the node. The child nodes of the node are generated by adjusting the parameter combination. 0 (α 1 ,α 2 ,α 3 ,…,α m ), each parameter in each node has the same probability of being selected in each adjustment direction 01 ,p 02 ,p 03 ,…,p 0m ;
[0048] Module 42, for randomly selecting a parameter A each time i The value of δ i is the adjustment parameter α i Step length, get the node
[0049] Module 43, used to determine the parameter combination N 1 The results of running β 1 Is it greater than (1+θ)β 0 , where θ is the performance error. If , then the adjustment result is considered to be effective optimization, which will improve the adjustment parameter A in the next iteration of the child node. i The probability p of the value 1i (p 1i >p 01 =p 02 =…=p 1m ), keep the adjustment probability of the remaining unadjusted parameters equal; otherwise, execute module 44;
[0050] Module 44, the child node will not be recorded, and the subsequent branches of its parent node will be pruned without any parameter adjustment;
[0051] Module 45 is used to execute module 42 again for iteration, and each time the iterative generation node is generated, it will be searched on the tree to see if it exists. If it exists, it will be skipped and the parameter on the node will no longer be adjusted; until the parameter adjustment on all nodes cannot be recorded, the current tree structure is saved, and all leaf nodes on the tree constitute the performance boundary of the test blockchain.
[0052] The scalable universal blockchain performance boundary measurement device, wherein the specific requirement is at least one specific parameter value within the adjustment parameter range.
[0053] The present invention also proposes a server, which includes the universal blockchain performance boundary measurement device.
[0054] The present invention also proposes a storage medium for storing a computer program for executing any one of the general blockchain performance boundary measurement methods.
[0055] The technical progress of the present invention is that it can be used to test any connectable blockchain, and it can achieve convenient adaptation to blockchains of different types and sizes, can adjust multiple parameters and can customize monitoring performance indicators according to user needs, and finally use the measured data to construct the blockchain performance boundary, helping users locate performance bottlenecks and optimize parameters. In view of the problem of too large search space when building performance boundaries, a performance boundary construction acceleration algorithm based on pruning search is designed, which reduces the complexity of the search space, improves operating efficiency, and avoids falling into local optimality. Compared with the existing blockchain performance measurement framework, the scalability of the system is significantly improved, and the performance boundary can be constructed to provide users with optimization direction guidance. BRIEF DESCRIPTION OF THE DRAWINGS
[0056] Figure 1 This is a diagram of the performance boundary measurement framework of the present invention;
[0057] Figure 2 The performance boundary measurement framework operation flow chart of the present invention;
[0058] Figure 3 A flow chart of an acceleration algorithm is constructed for the performance boundary of pruning search based on the present invention. DETAILED DESCRIPTION
[0059] When the inventor was researching the blockchain performance measurement framework, he found that the existing measurement framework could not meet the user's requirements for scalability, universality, accuracy, and efficiency. In response to the above requirements, the inventor proposed a blockchain performance measurement framework that follows the pluggable design principle to achieve high scalability; it uses the method of adjusting the on-chain configuration parameters to measure the real blockchain system running in different operating environments, and can obtain accurate measurement results for constructing the blockchain performance boundary, which can provide guidance for blockchain performance bottleneck positioning and performance optimization.
[0060] Aiming at the problem that most blockchain performance frameworks can only measure specific performance indicators of blockchain and have low measurement efficiency, the present invention has scalability and high efficiency. The scalability includes two aspects:
[0061] First, the measurement indicators are extensible. Users can customize the data structure and collection location of the performance indicators to be measured and add new measurement indicators according to their measurement needs.
[0062] Second, the framework is extensible. The present invention adopts the Master-worker architecture of the distributed system, which can control the parallel operation of multiple groups of test blockchains with different configurations to perform measurement work, thereby improving the efficiency of measuring blockchains with multiple parameter configurations.
[0063] In view of the problem that the current blockchain measurement framework can only support specific blockchain platforms, the present invention has universality and can be easily connected to various blockchain platforms without having a significant impact on the performance of the blockchain itself;
[0064] In order to solve the problem of too large search space due to the complex parameter configuration of the blockchain system itself when building the performance boundary, the present invention designs a probability-based pruning search algorithm to prune the search space of the configuration parameters, speed up the construction of the performance boundary, and avoid the result from falling into the local optimum based on probability selection. The present invention can realize the performance measurement of different blockchain platforms, quickly build the performance boundary of the blockchain system, and through the constructed performance boundary, it is helpful to deeply understand the blockchain system, locate the performance bottleneck, and provide guidance for the parameter configuration optimization of the blockchain in different application scenarios.
[0065] In order to achieve the scalability of the performance boundary measurement framework, the present invention adopts a multi-modular design, which is mainly composed of five modules: a startup module, a stress test module, a performance monitoring module, a control module, a data storage module, and a parameter optimization module.
[0066] 1. Start the module
[0067] In this module, users define which configuration parameters can be adjusted, and adjust the configuration parameters on the chain according to the received on-chain parameter configuration, generate a new configuration file, and start the corresponding blockchain.
[0068] 2. Stress test module
[0069] Through the client and other means, it is responsible for applying a certain load to the tested blockchain, that is, sending transactions to the blockchain at a set rate. There are setting options in the module, and users can set different transaction types and transaction sending frequencies for performance testing according to actual test needs.
[0070] 3. Performance monitoring module
[0071] This module is responsible for collecting and saving the performance indicators on the chain. Users need to first define the data structure and collection location of the on-chain performance indicators to be collected in this module according to their needs. For each defined performance indicator, there is a corresponding configuration, which can dynamically control whether to collect the indicator and the collection frequency of the performance indicator during the measurement process.
[0072] 4. Control module
[0073] This module is responsible for collecting the monitoring performance data of each slave node (worker) and sending it to the data storage module, managing and recording the operating status of each worker, and sending the new parameter combination generated by the parameter optimization module to the idle workers. The worker can be a server when running.
[0074] 5. Data storage module
[0075] Responsible for recording the parameter configurations summarized by the control module and their corresponding performance indicators into a database or file for subsequent data analysis and recording the results of each iteration of the parameter optimization module.
[0076] 6. Parameter Optimization Module
[0077] Obtain the collected parameter configuration and performance indicator pairs from the data storage module, select a specific optimization algorithm, optimize according to the historical parameter configuration, generate new configuration parameters and send them to the parameter adjustment module. The specific algorithm content in this module will be described in the next section.
[0078] The following is a system embodiment corresponding to the above method embodiment. This embodiment can be implemented in conjunction with the above embodiment. The relevant technical details mentioned in the above embodiment are still valid in this embodiment. In order to reduce repetition, they are not repeated here. Accordingly, the relevant technical details mentioned in this embodiment can also be applied in the above embodiment.
[0079] like Figure 1As shown in the figure, before the framework runs, the user needs to perform several initialization processes: in the startup module, set which configuration parameters can be adjusted and which parameters cannot be adjusted in the current environment. For example, when the node network bandwidth and network topology are fixed, the block size, the time interval between blocks, the consensus algorithm used, and the timeout time of each stage in the consensus algorithm can be adjusted; in the control module, configure the number of workers and enter the initial parameter configuration. The initial parameter configuration is that after setting the fixed and unadjustable configuration, the other parameters are all set to the default parameter configuration of the blockchain system. After setting the bandwidth of each node and the connection topology between nodes, all other parameters are set to the default configuration of the blockchain system, that is, the initial parameter configuration; set the transaction type and sending rate in the stress test module; define the data structure of the performance indicators to be monitored and the collection location of the performance indicators in the performance monitoring module. The data structure can be, for example, ID, transaction hash, current timestamp, and the location of the transaction data collected. The collection location is where a transaction needs to be detected and then recorded. For example, if you want to measure the latency of a transaction, this position refers to the two key time points when the program executes to the transaction entering the transaction pool and the transaction entering the block packaging. Collect the records of transactions running to these two places (transaction hash, transaction appearance time) and then calculate the difference between the appearance time of the same transaction at these two locations, which is the latency. In the above example, the data structure can be the transaction hash and appearance time, as well as the function in which the data is collected. The position is the execution point in the code where the transaction enters the transaction pool and the transaction is packaged into the block.
[0080] After the framework is started, the control module selects an idle worker, sends the initial parameter configuration to the startup module of the worker, and updates the worker's status. In the control module, a data structure of the current status of each worker is specially maintained. During initialization, all workers are in an idle state. After the control module distributes tasks to the workers, the status of the corresponding workers will be changed to working. After receiving the test results returned by the workers, the status of the workers will be changed to idle again.
[0081] The startup module will first deploy the test blockchain according to the received parameter configuration; the stress test module sends transactions to the test blockchain according to the pre-set settings, and can update the applied transaction load according to actual needs, including the type of transaction load sent and the sending rate; the performance monitoring module monitors the performance indicators on the chain according to the set collection switch and collection frequency, and sends the collected data to the control module; the control module receives the performance indicators from the worker, merges them with the parameter configuration sent to the worker into a record, and sends it to the data storage module in the master; the parameter optimization module reads historical data from the data storage module, compares it with the results of the parameter configuration test before this optimization, determines whether it is an effective optimization, and stores iterative data, and according to the optimization algorithm (such as the grid search algorithm: that is, traversing all possible combinations of parameters, the search complexity is too high. Gradient search algorithm: only applicable to scenarios where the function to be optimized can be derived, and the complex relationship between blockchain parameters and performance is difficult to express with specific expressions), gives a set of optimized adjustable parameter values, and sends the new parameter combination to the control module, which is distributed by the control module; the startup module updates the configuration file according to the new parameters obtained, and restarts the blockchain with the new configuration file. The above steps form a loop. During the loop, the load of the stress test and the configuration of performance monitoring can be dynamically updated and modified according to the actual needs of the user. When the monitored data reaches the stop condition of the algorithm, the iteration is stopped. The parameter optimization module will give the performance boundary of the blockchain system in the current environment.
[0082] At the same time, in order to improve the operating efficiency, the algorithm module and measurement framework adopt a distributed cluster architecture design, with the algorithm module and storage module as the master layer, running on one machine; the worker layer deploys startup, stress testing, monitoring modules and test chains on multiple machines, and the control module in the control layer can distribute multiple sets of parameters generated by the parameter adjustment module to other machines for simultaneous testing. Multi-process collaboration has solved the problem of long iteration time for each round to a certain extent.
[0083] Compared with other performance measurement frameworks, this framework has the following advantages:
[0084] Efficient and scalable. Compared with other frameworks that can only measure specific performance indicators, it can expand the number of machines measured to improve efficiency; secondly, it can customize the types of performance indicators measured to be more comprehensive.
[0085] Universality. The changes to the blockchain are small, just mark the data collection location, and it can be adapted to different types of blockchains.
[0086] Accuracy. The actual blockchain is run for measurement, rather than simulated calculations using simulators and modeling, so the measured performance indicator data is highly accurate.
[0087] To address the poor performance of traditional optimization algorithms, this application also proposes an acceleration algorithm based on pruning search to build a performance boundary:
[0088] For the optimization algorithm of configuration parameters, the performance boundary of the blockchain system can be effectively constructed by traversing all parameter combinations using the traversal method. However, the blockchain is a complex system. Although each parameter has a limited adjustable range, when there are many adjustable parameters, the space of parameter combinations is still too large, making it difficult to construct the performance boundary within the required time, which does not meet the efficiency requirements. The gradient-based optimization algorithm requires a relationship function between blockchain parameters and performance. However, the relationship between each blockchain parameter and performance is difficult to express simply with an expression, which makes the gradient-based optimization algorithm unusable. Therefore, the present invention proposes a probability-based pruning search boundary algorithm. The specific steps of the algorithm are as follows:
[0089] 1. The user initializes the algorithm and generates a series of parameters. In the first round of iteration, assume there are m adjustable parameters A 1 ,A 2 ,A 3 ,…,A m , the initial value is (α 1 ,α 2 ,α 3 ,…,α m ) and n corresponding performance indicators B 1 ,B 2 ,B 3 …B n The value is (optimization target)(β 1 ,β 2 ,β 3 ,…,β n ). Because different performance indicators have different orders of magnitude, the optimization target should be normalized according to the needs, and a weight (ω 1 ,ω 2 ,ω 3 ,…,ω n ) for weighting.
[0090]
[0091] 2. Treat each set of parameter values as a node in the tree. The combination of parameters is the unique identifier of the node. Adjusting the current parameter combination is equivalent to generating a child node of the node. In the initial state, there is only one node N. 0 (α 1,α 2 ,α 3 ,…,α m ), each parameter in each node has the same probability of being selected in each adjustment direction 01 ,p 02 ,p 03 ,…,p 0m (where p 01 Indicates that at node N 0 Adjust parameter A 1 The probability of 01 =p 02 =p 03 =…=p 0m ). Each time, a parameter A is randomly selected i The value of δ i is the adjustment parameter α i Step length, get the node
[0092] 3. According to the parameter combination N 1 The results of running β 1 If the result is greater than (1+θ)β 0 , that is, the result is better than the parent node and exceeds the set performance error θ, then the adjustment result is considered to be effective optimization, which will improve the adjustment parameter A in the next iteration of the child node. i The probability p of the value 1i (p 1i > 01 =p 02 =...=p 1m ), keeping the adjustment probabilities of the remaining unadjusted parameters equal.
[0093] 4. If the result is not an effective optimization, the child node will not be recorded, and the subsequent branches of its parent node will be pruned without any parameter adjustment.
[0094] 5. Continue to iterate. Each time a node is generated, it will be checked on the tree to see if it exists. If it exists, it will be skipped and the parameter on the node will not be adjusted. Until the parameters on all nodes can no longer be adjusted, the entire parameter optimization process forms a tree, starting from the root node N 0 The path to any leaf node is the optimized path, and all leaf nodes on this tree constitute the performance boundary of the blockchain under the current restrictive environment.
[0095] Compared with traversal, this algorithm can cut off unnecessary branch paths during the search process, has a faster search speed, fewer iterations, and can build a usable performance boundary in a shorter time. Compared with gradient-based optimization algorithms and various algorithms that require modeling, there is no need to explore the relationship between parameters and performance indicators, nor does it require a lot of computing power to build models. The computational overhead is small, and the results are obtained by running in the actual blockchain system with high accuracy. The algorithm stores the intermediate process and optimization path of the optimization in the form of a tree, which can guide the adjustment of parameters in practical applications, quickly locate bottlenecks and optimize them, and the probability-based method can also ensure that the algorithm can be optimized in multiple directions to avoid falling into local optimality.
[0096] Step s1.1 Framework initialization. Set the parameters that need to be adjusted, define the data structure of the performance indicators that need to be monitored, the data collection location, and the number of blockchain processes.
[0097] Step s1.2 sets the detection switch and monitoring frequency of the performance indicators on the chain in the performance monitoring module, and sets the weight of each performance indicator when there are multiple performance indicators.
[0098] Step s1.3 inputs the initialization parameter configuration of the blockchain system in the control module.
[0099] In step s1.4, the control module selects an idle worker, distributes the received parameter configuration to its startup module, and updates the worker's status.
[0100] Step s1.5 starts the module to generate a configuration file based on the parameter configuration and starts the blockchain.
[0101] Step s1.6 The monitoring module forms a performance index according to the preset frequency and the data on the switch acquisition chain, and sends the performance index to the control module.
[0102] Step s1.7: The control module combines the received performance indicators and the parameter configuration sent to the worker into one piece of data, records it in the data storage module, and updates the worker's status.
[0103] Step s1.8 The parameter optimization module reads the historical records from the data storage module to determine whether the end condition is met, that is, whether the probability of all parameters of all nodes on the tree constructed by the algorithm being adjusted is 0. If not, adjust the historical configuration parameters, generate the next configuration parameters, and send them to the control module; otherwise, end the parameter adjustment and output the performance boundary.
[0104] Steps s1.9 repeat steps 1.4-1.8 using the new build parameter configuration.
[0105] Finally, based on the specific needs, the performance boundary is used to find a set of configuration parameters that meet the specific needs and achieve the best performance under the specific needs. The blockchain is configured to achieve the best performance under the specific needs. A certain adjustable parameter may change during actual operation within the performance boundary. Through the performance boundary, other variable parameters can be adjusted more quickly to obtain an optimal parameter combination suitable for the current environment. For example, if a parameter is originally 0, the configuration parameter combination with the best performance can be found on the performance boundary; when the parameter changes to 1, the configuration parameter combination with the best performance when the parameter is 1 can be found on the performance boundary.
[0106] (2) Building an acceleration algorithm flow based on the performance boundary of pruning search
[0107] Step s2.1 Initialize the algorithm and define the weights ω of each performance indicator 1 ,ω 2 ,...,ω n , error θ, adjustment step length δ of each parameter 1 ,δ 2 ,...,δ m Where n is the number of performance indicators to be modified, and m is the number of adjustment parameters.
[0108] Step s2.2 reads the initial configuration and its monitored performance indicators from the data storage module and constructs the root node N of the tree 0 The combination of parameter values is used as the unique identifier of the node.
[0109] Step s2.3: According to the probability of each parameter being selected at each node, select a parameter value to modify t is the current iteration round.
[0110] Step s2.4 searches the constructed tree for Is the node identified by p? If it exists, (t-1)i Set to 0 (p (t-1)i For node N (t-1) A i The probability of parameter adjustment) is repeated in step s2.3. If it does not exist, it is sent to the idle startup module for deployment test. Wait for the monitoring module to write the result to the data storage module.
[0111] Step s2.5 reads the configuration parameters and performance indicators of the last iteration from the data storage module, and the weighted calculation result is β t , if β t >(1+θ)β t-1 , the tth round of iteration is considered to be an effective optimization, and the iteration result is written into the data storage module, and the node is saved as the child node of the previous round of iteration node, and the parameter A selected in the next round is improved. iIf it is an invalid optimization, the last adjustment record is ignored and p (t-1)i Set to 0.
[0112] Step s2.6 determines whether the probability of all parameters on all nodes being modified is 0. If so, the algorithm stops. At this time, all leaf nodes of the constructed tree are the constructed performance boundaries. If there is a non-zero probability, continue the iteration.
[0113] Step S2.7 cycles through steps S2.3-2.6.
[0114] The following is a system embodiment corresponding to the above method embodiment. This embodiment can be implemented in conjunction with the above embodiment. The relevant technical details mentioned in the above embodiment are still valid in this embodiment. In order to reduce repetition, they are not repeated here. Accordingly, the relevant technical details mentioned in this embodiment can also be applied in the above embodiment.
[0115] The present invention also proposes an extensible universal blockchain performance boundary measurement device, which includes:
[0116] Module 1 is used to build a blockchain performance measurement framework consisting of a master node and a slave node. The slave node is provided with a startup module, a performance monitoring module and a stress testing module; the master node is provided with a control module, a data storage module and a parameter optimization module;
[0117] Module 2 is used to set the adjustment parameter range and initial parameter configuration in the startup module; set the transaction type and sending rate in the stress test module; set the data structure of monitoring performance indicators and the collection location of performance indicators in the performance monitoring module;
[0118] Module 3, used for the startup module to deploy the test blockchain according to the parameter configuration; the stress test module sends transactions to the test blockchain according to the set transaction type and sending rate; the performance monitoring module monitors the performance indicators on the chain according to the specified collection frequency and the collection location, and sends the collected performance indicator data to the control module of the master node;
[0119] Module 4 is used for the control module to combine the received performance indicator data with the parameter configuration sent to the slave node into a record, and send it to the data storage module of the master node; the parameter optimization module of the master node reads the historical data from the data storage module, and compares it with the performance indicator data of the parameter configuration test before the current optimization to determine whether it is an effective optimization for iterative data storage, and updates the parameter configuration according to the optimization strategy, and sends the updated parameter configuration to the slave node, and executes module 3 again until the monitored performance indicator data reaches the preset stop condition, and records the performance indicators of the test blockchain under each parameter configuration to form the performance boundary of the test blockchain;
[0120] Module 5 is used to determine a set of configuration parameters that meet the best performance under specific requirements based on the performance boundary, so as to configure the test blockchain to achieve the best performance under the specific requirements.
[0121] The scalable universal blockchain performance boundary measurement device, wherein the blockchain performance measurement framework is a distributed cluster architecture, the control module distributes multiple sets of parameter configurations generated by the parameter adjustment module to the designated slave node servers, and all slave node servers execute modules 2 and 3 in parallel.
[0122] The scalable universal blockchain performance boundary measurement device, wherein the optimization strategy includes:
[0123] Module 41, used in the first round of iteration, the adjustment parameter range includes m parameters A 1 ,A 2 ,A 3 ,…,A m , the initial value is (α 1 ,α 2 ,α 3 ,…,α m ) and n corresponding performance indicators B 1 ,B 2 ,B 3 …B n The value is (β 1 ,β 2 ,β 3 ,…,β n ); Normalize the optimization target and set weights for each performance indicator (ω 1 ,ω 2 ,ω 3 ,…,ω n ) for weighting:
[0124]
[0125] The value of each set of parameters is used as a node in the tree, and the combination of parameters is the unique identifier of the node. The child nodes of the node are generated by adjusting the parameter combination. 0 (α 1 ,α 2 ,α 3 ,…,α m ), each parameter in each node has the same probability of being selected in each adjustment direction 01 ,p 02 ,p 03 ,…,p 0m ;
[0126] Module 42, for randomly selecting a parameter A each time i The value of δ i is the adjustment parameter α i Step length, get the node
[0127] Module 43, used to determine the parameter combination N 1 The results of running β 1 Is it greater than (1+θ)β 0 , where θ is the performance error. If , then the adjustment result is considered to be effective optimization, which will improve the adjustment parameter A in the next iteration of the child node. i The probability p of the value 1i (p 1i > 01 =p 02 =...=p 1m ), keep the adjustment probability of the remaining unadjusted parameters equal; otherwise, execute module 44;
[0128] Module 44, the child node will not be recorded, and the subsequent branches of its parent node will be pruned without any parameter adjustment;
[0129] Module 45 is used to execute module 42 again for iteration, and each time the iterative generation node is generated, it will be searched on the tree to see if it exists. If it exists, it will be skipped and the parameter on the node will no longer be adjusted; until the parameter adjustment on all nodes cannot be recorded, the current tree structure is saved, and all leaf nodes on the tree constitute the performance boundary of the test blockchain.
[0130] The scalable universal blockchain performance boundary measurement device, wherein the specific requirement is at least one specific parameter value within the adjustment parameter range.
[0131] The present invention also proposes a server, which includes the universal blockchain performance boundary measurement device.
[0132] The present invention also proposes a storage medium for storing a computer program for executing any one of the general blockchain performance boundary measurement methods.
[0133] Although the embodiments of the present invention have been disclosed as above, they are not limited to the applications listed in the specification and the implementation modes, and they can be fully applied to various fields suitable for the present invention. For those familiar with the art, additional modifications can be easily implemented. Therefore, without departing from the general concept defined by the claims and the scope of equivalents, the present invention is not limited to the specific details and the illustrations shown and described herein.
Claims
1. A scalable general blockchain performance boundary measurement method, characterized in that: include: Step 1: Build a blockchain performance measurement framework consisting of a master node and a slave node. The slave node is provided with a startup module, a performance monitoring module and a stress testing module; the master node is provided with a control module, a data storage module and a parameter optimization module; Step 2: setting the adjustment parameter range and initial parameter configuration in the startup module; setting the transaction type and sending rate in the stress test module; setting the data structure for monitoring performance indicators and the collection location of performance indicators in the performance monitoring module; Step 3, the startup module deploys the test blockchain according to the parameter configuration; the stress test module sends transactions to the test blockchain according to the set transaction type and sending rate; the performance monitoring module monitors the performance indicators on the chain according to the specified collection frequency and the collection location, and sends the collected performance indicator data to the control module of the master node; Step 4: After receiving the performance indicator data, the control module merges it with the parameter configuration sent to the slave node into a record and sends it to the data storage module of the master node; the parameter optimization module of the master node reads the historical data from the data storage module, compares it with the performance indicator data of the parameter configuration test before this optimization, determines whether it is an effective optimization to store iterative data, and updates the parameter configuration according to the optimization strategy, and sends the updated parameter configuration to the slave node, and executes step 3 again until the monitored performance indicator data reaches the preset stop condition, and records the performance indicators of the test blockchain under each parameter configuration to form the performance boundary of the test blockchain; Step 5: Determine a set of configuration parameters that best meet the specific requirements based on the performance boundary, so as to configure the test blockchain to achieve the best performance under the specific requirements.
2. The scalable general blockchain performance boundary measurement method according to claim 1, characterized in that: The blockchain performance measurement framework is a distributed cluster architecture. The control module distributes multiple sets of parameter configurations generated by the parameter adjustment module to the specified slave node servers, and all slave node servers execute steps 2 and 3 in parallel.
3. The scalable general blockchain performance boundary measurement method according to claim 1, characterized in that: The optimization strategy includes: Step 41, the user initializes the algorithm and generates a series of parameters. In the first round of iteration, the adjustment parameter range includes m parameters A1, A2, A3, ..., A m , the initial value is (α1,α2,α3,…,α m ) and n corresponding performance indicators B1, B2, B3…B n The value is (β1,β2,β3,…,β n ); Normalize the optimization target and set weights for each performance indicator (ω1,ω2,ω3,…,ω n ) for weighting: The value of each set of parameters is taken as a node in the tree, and the combination of parameters is the unique identifier of the node. The child nodes of the node are generated by adjusting the parameter combination. m ), each parameter in each node has the same probability of being selected in each adjustment direction 01 ,p 02 ,p 03 ,…,p 0m ; Step 42, randomly select a parameter A each time i The value of δ i is the adjustment parameter α i Step length, get the node Step 43, determine the result β obtained by running the parameter combination N1 1 Is it greater than (1+θ)β 0 , where θ is the performance error. If , then the adjustment result is considered to be effective optimization, which will improve the adjustment parameter A in the next iteration of the child node. i The probability of the value p 1i (p 1i >p 01 =p 02 =…=p 1m ), keep the adjustment probability of the remaining unadjusted parameters equal; otherwise, execute step 44; Step 44, the child node will not be recorded, and the subsequent branches of its parent node will be pruned, and no parameter adjustment will be performed on it; Step 45, execute step 42 again to iterate, and each time the iteration generates a node, it will search on the tree whether it exists. If it exists, it will be skipped and the parameter on the node will not be adjusted anymore; until the parameter adjustment on all nodes cannot be recorded, the current tree structure is saved, and all leaf nodes on the tree constitute the performance boundary of the test blockchain.
4. The scalable general blockchain performance boundary measurement method according to claim 1, characterized in that: The specific requirement is at least one specific parameter value within the adjustment parameter range.
5. A scalable universal blockchain performance boundary measurement device, characterized in that: include: Module 1 is used to build a blockchain performance measurement framework consisting of a master node and a slave node. The slave node is provided with a startup module, a performance monitoring module and a stress testing module; the master node is provided with a control module, a data storage module and a parameter optimization module; Module 2 is used to set the adjustment parameter range and initial parameter configuration in the startup module; set the transaction type and sending rate in the stress test module; set the data structure of monitoring performance indicators and the collection location of performance indicators in the performance monitoring module; Module 3, used for the startup module to deploy the test blockchain according to the parameter configuration; the stress test module sends transactions to the test blockchain according to the set transaction type and sending rate; the performance monitoring module monitors the performance indicators on the chain according to the specified collection frequency and the collection location, and sends the collected performance indicator data to the control module of the master node; Module 4 is used for the control module to combine the received performance indicator data with the parameter configuration sent to the slave node into a record, and send it to the data storage module of the master node; the parameter optimization module of the master node reads the historical data from the data storage module, and compares it with the performance indicator data of the parameter configuration test before the current optimization to determine whether it is an effective optimization for iterative data storage, and updates the parameter configuration according to the optimization strategy, and sends the updated parameter configuration to the slave node, and executes module 3 again until the monitored performance indicator data reaches the preset stop condition, and records the performance indicators of the test blockchain under each parameter configuration to form the performance boundary of the test blockchain; Module 5 is used to determine a set of configuration parameters that meet the best performance under specific requirements based on the performance boundary, so as to configure the test blockchain to achieve the best performance under the specific requirements. The scalable universal blockchain performance boundary measurement device is characterized in that the blockchain performance measurement framework is a distributed cluster architecture, the control module distributes multiple sets of parameter configurations generated by the parameter adjustment module to the designated slave node servers, and all slave node servers execute modules 2 and 3 in parallel. The scalable universal blockchain performance boundary measurement device is characterized in that the optimization strategy includes: Module 41 is used for adjusting the parameter range in the first round of iteration, including m parameters A1, A2, A3, ..., A m , the initial value is (α1,α2,α3,…,α m ) and m corresponding performance indicators B1, B2, B3…B n The value is (β1,β2,β3,…,β n ); Normalize the optimization target and set weights for each performance indicator (ω1,ω2,ω3,…,ω n ) for weighting: The value of each set of parameters is taken as a node in the tree, and the combination of parameters is the unique identifier of the node. The child nodes of the node are generated by adjusting the parameter combination. m ), each parameter in each node has the same probability of being selected in each adjustment direction 01 ,p 02 ,p 03 ,…,p 0m ; Module 42, for randomly selecting a parameter A each time i The value of δ i is the adjustment parameter α i Step length, get the node Module 43, used to determine the result β obtained by running the parameter combination N1 1 Is it greater than (1+θ)β 0 , where θ is the performance error. If , then the adjustment result is considered to be effective optimization, which will improve the adjustment parameter A in the next iteration of the child node. i The probability of the value p 1i (p 1i >p 01 =p 02 =…=p 1m ), keep the adjustment probability of the remaining unadjusted parameters equal; otherwise, execute module 44; Module 44, the child node will not be recorded, and the subsequent branches of its parent node will be pruned without any parameter adjustment; Module 45 is used to execute module 42 again for iteration, and each time the iterative generation node is generated, it will be searched on the tree to see if it exists. If it exists, it will be skipped and the parameter on the node will no longer be adjusted; until the parameter adjustment on all nodes cannot be recorded, the current tree structure is saved, and all leaf nodes on the tree constitute the performance boundary of the test blockchain. The scalable universal blockchain performance boundary measurement device is characterized in that the specific requirement is at least one specific parameter value within the adjustment parameter range.
6. A server, characterized in that: Including a universal blockchain performance boundary measurement device as described in claim 5.
7. A storage medium for storing a computer program for executing any one of the general blockchain performance boundary measurement methods described in claims 1-4.
Citation Information
Patent Citations
BART algorithm and super-absorption wall-based reactive power optimization method for voltage of power grid
CN103618315A
Performance monitoring and tuning system and method for distributed storage system
CN106126407A
Block chain experiment system and management method
CN111324599A
Cited By
Regional modular measurement method of design intention
CN120931594A
A regionally modular measurement method of design intent
CN120931594B