Performance optimization method and system for manufacturing service value contract mechanism

By analyzing the execution process of smart contracts and establishing a value bookkeeping contract execution process model, the performance bottleneck problem of smart contracts in the field of manufacturing services is solved, system throughput and transaction efficiency are improved, and efficient value transfer and value bookkeeping are achieved.

CN119047605APending Publication Date: 2024-11-29INST OF SOFTWARE - CHINESE ACAD OF SCI
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310618520.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-05-29
Publication Date
2024-11-29

AI Technical Summary

Technical Problem

Smart contracts have low execution efficiency and system performance in the manufacturing service field, especially in the process of value transfer and value bookkeeping, which affects the efficiency of value transfer and value bookkeeping between service providers and demanders.

Method used

By analyzing the core steps of the smart contract execution process, identifying the constraints that affect the system throughput, establishing a value accounting contract execution process model based on coloring Petri Network, and proposing a performance optimization plan for the manufacturing service value accounting contract system, including increasing the number of nodes and optimize network reliability to improve system throughput.

Benefits of technology

It realizes performance optimization of smart contracts, improves system throughput and transaction efficiency, and provides efficient value transfer and value accounting solutions for the manufacturing service field.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119047605A_ABST
    Figure CN119047605A_ABST
Patent Text Reader

Abstract

The invention discloses a performance optimization method and system for a manufacturing service value contract mechanism. The method comprises the following steps: analyzing a core step of an intelligent contract execution process; based on the value bookkeeping contract execution process, analyzing constraint factors influencing the throughput performance of the system in the value bookkeeping contract execution process; determining the execution efficiency of each restriction factor in a physical machine; according to the execution process of the smart contract and the execution efficiency of each restriction factor, establishing a value accounting contract execution process model based on a colored Petri network; and based on the value accounting contract execution process model, proposing a performance optimization scheme of the throughput of the manufacturing service value accounting contract system. According to the method, for a manufacturing service multi-party cooperation scene, the execution efficiency of each factor in a physical machine is measured by analyzing the constraint factors of the system throughput in the contract execution process, then a value accounting contract execution process model is established based on a colored Petri network, and finally an optimization scheme of the manufacturing service value accounting contract system throughput is provided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of smart contracts, and in particular to a performance optimization method and system for a manufacturing service value contract mechanism. Background Art

[0002] In today's digital economy, smart contracts have gradually become an important business model and value transfer mechanism. As an automated and programmable contract, smart contracts can realize functions such as automatic value transfer and value accounting through their own program logic rules. As an important application of blockchain technology, smart contracts are widely used in finance, logistics, manufacturing and other industries, providing efficient, transparent and reliable transaction solutions for commercial transactions.

[0003] However, in the process of executing smart contracts, due to their characteristics of automation, immutability, openness and transparency, their execution efficiency and system performance have become an important technical issue. In the field of manufacturing services, the performance optimization of smart contracts is particularly important, because smart contracts need to involve many factors such as the quality, delivery time, and cost of manufacturing services, and need to achieve effective value transfer and value accounting between service providers and demanders. Therefore, how to improve the execution efficiency and system performance of smart contracts has become an important issue that needs to be solved in the field of manufacturing services. Summary of the invention

[0004] In order to solve the above technical problems, the present invention provides a performance optimization method and system for a manufacturing service value contract mechanism.

[0005] The technical solution of the present invention is as follows:

[0006] A performance optimization method for a manufacturing service value contract mechanism comprises the following steps:

[0007] Analyze the core steps of the smart contract execution process;

[0008] Based on the execution process of the value accounting contract, analyze the constraints that affect the system throughput performance during the execution of the value accounting contract;

[0009] Determine the execution efficiency of each constraint on the physical machine;

[0010] According to the core steps of the smart contract execution process and the execution efficiency of various constraints on the physical machine, a value accounting contract execution process model is established based on the colored Petri net;

[0011] Based on the value accounting contract execution process model, a performance optimization scheme for the throughput of the manufacturing service value accounting contract system is proposed.

[0012] Furthermore, the core steps of the smart contract execution process include:

[0013] Contract endorsement, contract consensus and contract verification.

[0014] Furthermore, the analysis of the constraints affecting the system throughput performance during the execution of the value accounting contract includes:

[0015] Calculate the latency of each stage of the value accounting contract that needs to be tested, including: endorsement phase latency T e , sorting phase delay T o , verification and submission phase delay T c , Network transmission delay T n ;

[0016] According to the simulation model, a stable data stream is continuously sent from the starting library to the ending library, and the total delay of the value accounting contract execution process model is counted, that is, the system throughput is calculated.

[0017] Furthermore, the calculation formula for the theoretical optimal transaction throughput TPS is as follows:

[0018]

[0019] The k value is the ratio of the number of nodes providing verification and submission services to the total number of nodes. This value should be determined based on the actual execution situation and network environment. θ is the correction parameter of the formula, M is the maximum number of transactions in a block, and N is the number of nodes.

[0020] When the node has a certain failure rate, the TPS calculation formula is:

[0021]

[0022] Where P(N) is the probability function of node failure.

[0023] Furthermore, the determination of the execution efficiency of the value accounting contract on the physical machine includes:

[0024] Use Fabric Tage stress testing tool to test the execution efficiency of value accounting contracts;

[0025] Test the system throughput under different maximum block transaction numbers M.

[0026] Furthermore, the establishment of a value accounting contract execution process model based on a colored Petri net includes:

[0027] The stages involved in the execution process of the value accounting contract as the transition of the colored Petri net model;

[0028] Define a random function to simulate the failure of a node. After the node token is sent from it, the lose function determines whether it is invalid. The invalid node will no longer be able to provide services.

[0029] Define the delay function, and how the delay in the submission phase changes as the number of nodes increases;

[0030] The simulation model continuously sends a stable data stream from the starting library to the ending library, and the total delay of the value accounting contract execution process model is counted, that is, the system throughput in this experiment is calculated.

[0031] Furthermore, the proposed performance optimization solution for the throughput of the manufacturing service value accounting contract system includes:

[0032] Without considering node failure, simply increasing the number of nodes can improve system performance. When actually deploying the network, it is necessary to consider the N value corresponding to the point with the largest slope of the TPS curve and the critical N value;

[0033] When the node failure rate in the network is high or the node reliability requirement is high, model simulation shows that increasing the number of network nodes can improve system throughput;

[0034] In scenarios where the node failure rate is high, system performance is improved from multiple perspectives, including network reliability and network latency.

[0035] A performance optimization system for a manufacturing service value contract mechanism, comprising:

[0036] Smart contract analysis module, used to analyze the core steps of the smart contract execution process;

[0037] The constraint factor analysis module is used to analyze the constraint factors that affect the system throughput performance during the execution of the value accounting contract based on the execution process of the value accounting contract;

[0038] The execution efficiency measurement module is used to measure the execution efficiency of each constraint factor on the physical machine;

[0039] The model building module is used to build a value accounting contract execution process model based on the colored Petri net according to the core steps of the smart contract execution process and the execution efficiency of various constraints on the physical machine;

[0040] The performance optimization module is used to propose a performance optimization solution for the throughput of the manufacturing service value accounting contract system based on the value accounting contract execution process model.

[0041] Compared with the prior art, the present invention has the following advantages:

[0042] 1. This paper analyzes the performance indicators of the value accounting process model based on smart contracts, determines the optimization goals and proposes a calculation method for the ideal optimal transaction throughput, which provides a basis for further quantitative description and verification of the performance of the accounting process model.

[0043] 2. This invention studies the relationship between transaction throughput and load network scale, proposes a performance optimization scheme based on the collaborative scale of manufacturing enterprises, and provides a reference for optimizing the collaborative scale of manufacturing enterprises. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 A flow chart of a performance optimization method for a manufacturing service value contract mechanism according to the present invention;

[0045] Figure 2 Graph showing transaction throughput under different M values ​​obtained by simulation in an embodiment of the present invention;

[0046] Figure 3 It is a simulation experiment model used in the embodiment of the present invention;

[0047] Figure 4 A comparison diagram of the experimental and theoretical optimal results obtained by simulation in an embodiment of the present invention;

[0048] Figure 5 This is a diagram of transaction throughput under different node failure rates obtained by simulation in an embodiment of the present invention. DETAILED DESCRIPTION

[0049] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention is further described in detail below through specific implementations and in conjunction with the accompanying drawings.

[0050] In order to accurately describe the content of the present invention, the present invention explains the following terms and meanings.

[0051] State: A state is a node in a Petri net that represents a state or resource in the system. A state is usually represented by a circle and can contain tokens to represent the quantity of the resource it represents. For example, a state can represent an inventory level, a buffer space, etc.

[0052] Color set: Color set is used to describe the type of token. CPN tools provides basic color sets (such as Boolean type, integer type, etc.) and complex color sets based on basic color sets (such as arrays, Cartesian products, etc.).

[0053] Value activities: In the collaborative process of manufacturing enterprises, value activities are the basic units of user execution and the basic units of service. Value activities can be specific human activities, such as parts removal and installation, damaged parts status detection, parts transportation, parts repair, etc.

[0054] Event Book: The event book is the basic unit of the accounting process.

[0055] Value event: The content of a value event mainly includes: description information of the value event and the corresponding value activities. A value event is a relatively complete service system. Generally speaking, a value event may include multiple value activities. In the accounting process for collaboration with manufacturing companies, a value event uniquely corresponds to an event book. In the manufacturing service business, a value event can specifically be a collection of services provided by several people working together. For example, if the wear of a shield machine tool exceeds a threshold or is damaged, the equipment maintenance company staff must disassemble and replace the tool, and transport it to the manufacturing company for repair, remanufacturing or recycling.

[0056] Contract endorsement: Endorsement is to verify the correctness of smart contract execution, which requires the nodes within the organization to provide pre-execution of the smart contract. Each organization is usually composed of multiple nodes, so the endorsement stage will involve the concurrency of the network system. This concurrency phenomenon can be simulated during modeling and the problems it brings can be considered.

[0057] Contract consensus: Consensus is the process of unifying the contract execution results of different members, packaging transactions that occurred within a period of time according to certain rules and forming blocks. Since the rules of the consensus algorithm are relatively complex and are not the focus of this article, this part can be simplified when designing the model. In fact, the essence of the contract consensus process is to store multiple data in a library, and meet the first-in-first-out principle, so a queue model can be established to represent the sorting service.

[0058] Contract verification: The verification process will conduct the final check on the block content, and the blocks that pass the check will be officially written into the blockchain. Similar to the contract endorsement process, there are also multiple strategies in the verification phase, which requires designated organizations to provide nodes to confirm the results of smart contract execution, which also involves concurrency. In general, verification and submission occur on the same physical machine. When modeling, the same token can be used to represent verification and sorting nodes to simplify the model.

[0059] In one embodiment, the present invention provides a multi-party collaborative value accounting contract performance optimization method, such as Figure 1 As shown, the following steps are included:

[0060] Step S1: Analyze the core steps of the smart contract execution process;

[0061] Step S2: Based on the value accounting contract execution process, analyze the constraints that affect the system throughput performance during the value accounting contract execution process;

[0062] Step S3: Determine the execution efficiency of each constraint factor on the physical machine;

[0063] Step S4: According to the core steps of the smart contract execution process and the execution efficiency of each constraint factor on the physical machine, a value accounting contract execution process model is established based on the colored Petri net;

[0064] Step S5: Based on the value accounting contract execution process model, a performance optimization solution for the throughput of the manufacturing service value accounting contract system is proposed.

[0065] In one embodiment, the above step S1 specifically includes:

[0066] The consortium chain is the most suitable blockchain system for collaborative operation of manufacturing enterprises. Before a smart contract is deployed to the consortium chain, it usually needs to go through several steps. This step abstracts several representative stages and analyzes the characteristics of each stage from the perspective of system modeling:

[0067] (1) Contract endorsement: Endorsement is to verify the correctness of the execution of smart contracts. This process requires the nodes within the organization to provide pre-execution of the smart contract. An organization is usually composed of multiple nodes, so the endorsement stage will involve the concurrency of the network system. This concurrency phenomenon can be simulated during modeling and the problems it brings can be considered.

[0068] (2) Contract consensus: Consensus is the process of unifying the contract execution results of different members, packaging transactions that occurred within a period of time according to certain rules and forming blocks. Since the rules of the consensus algorithm are relatively complex and are not the focus of this invention, this part can be simplified when designing the model. In fact, the essence of the contract consensus process is to store multiple data in a library and meet the first-in-first-out principle. Therefore, a queue model can be established to represent the sorting service.

[0069] (3) Contract verification: The verification process will conduct the final check on the block content, and the blocks that pass the check will be officially written into the blockchain. Similar to the contract endorsement process, there are also multiple strategies in the verification phase, which requires designated organizations to provide nodes to confirm the results of smart contract execution, which also involves concurrency. In general, verification and submission occur on the same physical machine. When modeling, the same token can be used to represent the verification and sorting nodes to simplify the model.

[0070] The specific execution process of smart contracts based on alliance chains is as follows: first, the endorsement of the contract to be executed is verified, and then it is formally executed and the data content is unified through the consensus algorithm to form blocks. Then, the blocks are further checked and the correct blocks are written into the blockchain system.

[0071] In one embodiment, the above step S2 specifically includes:

[0072] Step S21: Analyze the relationship between throughput and network scale through experiments.

[0073] Table 1. Symbols

[0074] Parameter name symbol Maximum number of transactions per block M Number of nodes N Failure rate L Transaction throughput TPS Endorsement phase delay <![CDATA[T e ]]> Sorting phase delay <![CDATA[T o ]]> Verification and submission phase delay <![CDATA[T c ]]> Network transmission delay <![CDATA[T n ]]> Verification and submission phase in node scenario <![CDATA[T′ c ]]> Total delay T

[0075] Since the execution process of the blockchain network involves concurrent phenomena, multiple organizations provide nodes to endorse, verify and submit data. The more nodes there are, the higher the concurrency will be, and the maintenance efficiency of the distributed network will also be reduced. At the same time, due to the characteristics of blockchain network communication, when the number of nodes increases, the delay in its verification and submission phase will also increase. In actual production activities, the nodes in the distributed network may be unreliable, that is, there is a certain possibility of failure of the nodes. Usually we will consider increasing the scale of the network, but it will cause a waste of resources and there may be a boundary effect. Therefore, the present invention studies the relationship between throughput and network scale under the premise of a certain failure rate, and the parameters involved are shown in Table 1.

[0076] Step S22: Calculate the theoretical optimal TPS.

[0077] The throughput of the system can usually be improved by increasing concurrency. For a distributed network with N nodes, its TPS depends on the node with the smallest processing power:

[0078] TPS=f(min(TPS1,TPS2,…,TPS N )) (1)

[0079] During the experiment, the performance differences between nodes can be ignored. The calculation of TPS is shown in formula (2), where Txs is the final effective transaction volume:

[0080]

[0081] And T can be roughly regarded as the sum of the delays of each stage:

[0082] T=∑T′ c +T e +T o (3)

[0083] The sum of the delays in each stage is the product of the number of occurrences and the delay in a single stage. For example, the sum of the delays in the submission stage is:

[0084]

[0085] Since the communication protocol used by blockchain is the Gossip protocol, the characteristic of this protocol is that when a message reaches a node, the node will send the message to its visible nodes, and the nodes that receive the message will repeat this action, and eventually all nodes in the entire network will receive the message. In the submission phase, the node that receives the message will perform the submission operation again, and the submission phase will not end until all nodes have submitted and updated their local ledgers.

[0086] According to this principle, it can be found that the larger the network scale, the higher the delay in the submission phase. The delay in the submission phase is shown in formula (5):

[0087] T′ c =(1+T n )×log(N)×T c (5)

[0088] At the same time, since the nodes in the blockchain come from the same network, when a node acts as an endorsement node, it cannot perform verification and submission operations, and the sorting service is provided by a separate OSN. Therefore, let the average number of nodes that provide endorsement operations in the blockchain network be N1, and the average number of nodes that provide verification and submission operations be N2. The relationship function H satisfies:

[0089]

[0090] To sum up, the final calculation formula for the theoretical optimal TPS is as follows:

[0091]

[0092] The k value is the ratio of the number of nodes providing verification and submission services to the total number of nodes. This value should be determined based on the actual execution situation and network environment. θ is the correction parameter of the formula.

[0093] In one embodiment, the above step S3 specifically includes:

[0094] Step S31: Determine the parameters required for simulation and selectively perform measurements.

[0095] Since there are many parameters that affect the performance of the blockchain system, the most critical ones are the block time (BatchTimeout) and the block size (MaxMessageCount). If all of them are taken into consideration, the experiment will become very complicated and it will be difficult to get effective results. The maximum waiting time (BatchTimeout) of a block in the packaging process, when this threshold is exceeded, even if the transactions in the block do not reach the maximum transaction volume (MaxMessageCount), they will be packaged and enter the subsequent process. In this experiment, the main focus is on the determination of MaxMessageCount. Assuming that the system will not trigger the packaging action due to BatchTimeout, it is set to a large value in the process of measuring parameters.

[0096] Step S32: The efficiency of smart contract execution on a physical machine can be measured using the Tape stress test tool officially provided by Fabric. The tool will call the smart contract a specified number of times and count the relevant parameters. By setting different M values, where M is the maximum number of transactions in a block, the transaction throughput TPS can be obtained, such as Figure 2 shown.

[0097] It can be seen that when M ≥ 7, the growth of throughput tends to slow down and is lower than the peak value at some locations. This is because a larger M value causes subsequent operations to wait, increasing the overall latency and thus reducing the throughput.

[0098] Step S33: Based on the optimal M value determined above, the delay of each stage needs to be measured. The present invention tests the delay in a general LAN environment, as shown in Table 2.

[0099] Table 2. Test environment description

[0100]

[0101] By repeatedly sending transaction requests and analyzing the timestamps in the Docker logs, the latency of each stage is obtained, as shown in Table 3.

[0102] Table 3. Delay table of each stage

[0103] change <![CDATA[T e ]]> <![CDATA[T o ]]> <![CDATA[T c ]]> <![CDATA[T n ]]> Delay(ms) 4 12 25 3

[0104] In one embodiment, the above step S4 includes:

[0105] Step S41: The present invention constructs a simulation experiment model, such as Figure 3 As shown, by setting the corresponding delay for the transition node, the overall delay of each simulation can be obtained.

[0106] Figure 3In the example, start means start, endorse means endorsement, nodes means nodes in the blockchain, order means sorting, order completed means sorting is completed, OSN means sorting service organization, verify means verification, submit means submission, P0, P1, P2 means places connecting two transition operations, end means end, @+4 means the time delay of endorsement phase is 4 seconds, @+8 means the time delay of sorting phase is 4 seconds, and @+delay() means a custom delay function.

[0107] This model describes the steps of executing a smart contract on the blockchain. Unlike the model mentioned above, this model also describes the situation of node failure, which involves two functions:

[0108] (1) Lost function: A random function used to simulate the failure of a node. After the node token is sent from P(nodes), the lost function determines whether it is invalid. The invalid node will no longer be able to provide services. This embodiment relies on the random function implementation provided by CPN tools. The random function based on discrete distribution is used in this experiment.

[0109] (2) Delay function: Delay function describes the change pattern of the delay in the submission phase as the number of nodes increases. The calculation formula is formula (6).

[0110] Step S42: By continuously sending a stable data stream to the model, when these data are completely transmitted from P(start) to P(end), the overall delay of this simulation is counted, and the transaction throughput in this experiment can be calculated. At the same time, the number of nodes and failure rate in the experimental model are passed in as parameters, and the control variable method is used to analyze the changes of these parameters respectively.

[0111] Step S43: Simulation is performed under an ideal scenario where the failure rate is zero. Figure 4 shown.

[0112] The theoretical optimal TPS is calculated by formula (7). In a certain blockchain network, the theoretical optimal TPS can be calculated by selecting a suitable k value as a hyperparameter. It can be seen that the simulation results are generally lower than the theoretical optimal TPS, which is logical because under normal circumstances, the theoretical optimal TPS can only be used as a reference value. The execution endorsement, submission and verification between nodes cannot always meet the optimal k value. However, the two have similar changing trends. TPS will increase with the increase of network scale. When the number of nodes exceeds a certain threshold, the growth will become slow. For example, when N ≥ 28 in the theoretical optimal TPS, the growth of TPS slows down. This is because as the network scale increases, the node waits. In the simulation TPS, when N ≥ 28, TPS almost stops rising. This is because as the network scale increases, not only does the node wait time appear, but the pressure of network maintenance also increases, making it more difficult to maintain the k value at a good level.

[0113] Step S44: Simulate the situation where there is a failure in the node, and calculate the relationship between the load network scale and TPS under different failure rates, such as Figure 5 shown.

[0114] from Figure 5 As can be seen from the figure, as N continues to increase, the overall throughput is increasing. This is because the overall concurrency of the blockchain network has increased, and the number of transactions that can be processed at one time by the verification and submission nodes has increased, so the overall TPS is gradually increasing. However, it can also be observed that this performance improvement is not a linear change. For example, when L = 1%, when N increases from 8 to 12, the slope of the curve is the largest, which means that investing in nodes brings the greatest benefits, and when N ≥ 30, the rise of the curve tends to be flat, which means that investing more nodes will only increase the system throughput very little. This is caused by the oversaturation of network nodes. As the number of nodes increases, the number of nodes that need to be managed in a P2P network such as blockchain increases, making the efficiency of load network maintenance also lower. We call this value the critical N value.

[0115] As the failure rate of nodes in the network increases, TPS continues to decline. This is because the failure of nodes leads to a decrease in concurrency, which reduces performance. In addition, it can be found that when L gradually increases, the point where TPS growth tends to slow down will come earlier, that is, the critical N value is constantly decreasing. Therefore, when the node has a certain failure rate, the calculation formula for TPS is:

[0116]

[0117] Where P(N) is the probability function of node failure.

[0118] In one embodiment, the above step S5 includes: Based on the above experimental results, the present invention summarizes a performance optimization solution based on the collaboration scale of manufacturing enterprises:

[0119] (1) For the value accounting process model based on smart contracts, it is meaningful to study the performance of transaction throughput;

[0120] (2) Without considering node failure, simply increasing the number of nodes can improve system performance because concurrency is increased, but this improvement has a boundary effect. Therefore, when actually deploying the network, it is necessary to consider the N value corresponding to the point with the largest slope of the TPS curve and the critical N value;

[0121] (3) When the node failure rate is high or the node reliability requirement is high, simply increasing the number of nodes can still improve system performance. However, in scenarios where the node failure rate is high, the network scale should not be expanded blindly, because as the failure rate increases, the critical N value point will arrive earlier. System performance should be improved from multiple perspectives, such as network reliability and network latency.

[0122] Practical application scenarios of the present invention: In the manufacturing industry, multiple manufacturing companies cooperate with each other, and the companies obtain revenue after providing services. The service data and revenue data of the company cannot be tampered with. The execution process of the cooperation and the revenue data are uploaded to the blockchain for safe storage, which ensures the security of the service data and revenue data. As the number of cooperating manufacturing companies changes, the scale of the blockchain network also changes. The method of the present invention can be used to propose optimization solutions for the performance of smart contract throughput, effectiveness, etc. based on the scale of the cooperating companies in the blockchain.

[0123] The parts not described in detail in the present invention belong to the well-known technology in the art.

[0124] Another embodiment of the present invention provides a performance optimization system for a manufacturing service value contract mechanism, comprising:

[0125] Smart contract analysis module, used to analyze the core steps of the smart contract execution process;

[0126] The constraint factor analysis module is used to analyze the constraint factors that affect the system throughput performance during the execution of the value accounting contract based on the execution process of the value accounting contract;

[0127] The execution efficiency measurement module is used to measure the execution efficiency of each constraint factor on the physical machine;

[0128] The model building module is used to build a value accounting contract execution process model based on the colored Petri net according to the core steps of the smart contract execution process and the execution efficiency of various constraints on the physical machine;

[0129] The performance optimization module is used to propose a performance optimization solution for the throughput of the manufacturing service value accounting contract system based on the value accounting contract execution process model.

[0130] The specific implementation process of each module refers to the above description of the method of the present invention.

[0131] Based on the same inventive concept, another embodiment of the present invention provides a computer device (computer, server, smart phone, etc.), which includes a memory and a processor, the memory stores a computer program, the computer program is configured to be executed by the processor, and the computer program includes instructions for executing each step in the method of the present invention.

[0132] Based on the same inventive concept, another embodiment of the present invention provides a computer-readable storage medium (such as ROM / RAM, disk, CD), which stores a computer program. When the computer program is executed by a computer, it implements the various steps of the method of the present invention.

[0133] The above descriptions are only some specific implementation methods of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by any person familiar with the art within the technical scope disclosed in the present invention should be covered within the protection scope of the present invention.

Claims

1. A performance optimization method for a manufacturing service value contract mechanism, characterized in that: The following steps are involved: Analyze the core steps of the smart contract execution process; Based on the execution process of the value accounting contract, analyze the constraints that affect the system throughput performance during the execution of the value accounting contract; Determine the execution efficiency of each constraint on the physical machine; According to the core steps of the smart contract execution process and the execution efficiency of various constraints on the physical machine, a value accounting contract execution process model is established based on the colored Petri net; Based on the value accounting contract execution process model, a performance optimization scheme for the throughput of the manufacturing service value accounting contract system is proposed.

2. The method according to claim 1, characterized in that The core steps of the smart contract execution process include: Contract endorsement, contract consensus and contract verification.

3. The method according to claim 1, characterized in that The constraints that affect the system throughput performance during the analysis of the value accounting contract execution process include: Calculate the delay of each stage of the value accounting contract that needs to be tested, including: endorsement stage delay T e , sorting phase delay T o , verification and submission phase delay T c , Network transmission delay T n ; According to the simulation model, a stable data stream is continuously sent from the starting library to the ending library, and the total delay of the value accounting contract execution process model is counted, that is, the system throughput is calculated.

4. The method according to claim 3, characterized in that The calculation formula for the theoretical optimal transaction throughput TPS is as follows: The k value is the ratio of the number of nodes providing verification and submission services to the total number of nodes. This value should be determined based on the actual execution situation and network environment. θ is the correction parameter of the formula, M is the maximum number of transactions in a block, and N is the number of nodes. When the node has a certain failure rate, the TPS calculation formula is: Where P(N) is the probability function of node failure.

5. The method according to claim 1, characterized in that The determination of the execution efficiency of the value accounting contract on the physical machine includes: Use Fabric Tage stress testing tool to test the execution efficiency of value accounting contracts; Test the system throughput under different maximum block transaction numbers M.

6. The method according to claim 1, characterized in that The value accounting contract execution process model based on the colored Petri net is established, including: The stages involved in the execution process of the value accounting contract as the transition of the colored Petri net model; Define a random function to simulate the failure of a node. After the node token is sent from it, the lose function determines whether it is invalid. The invalid node will no longer be able to provide services. Define the delay function, and how the delay in the submission phase changes as the number of nodes increases; The simulation model continuously sends a stable data stream from the starting library to the ending library, and the total delay of the value accounting contract execution process model is counted, that is, the system throughput in this experiment is calculated.

7. The method according to claim 1, characterized in that The proposed manufacturing service value accounting contract system throughput performance optimization solution includes: Without considering node failure, simply increasing the number of nodes can improve system performance. When actually deploying the network, it is necessary to consider the N value corresponding to the point with the largest slope of the TPS curve and the critical N value; When the node failure rate in the network is high or the node reliability requirement is high, model simulation shows that increasing the number of network nodes can improve system throughput; In scenarios where the node failure rate is high, system performance is improved from multiple perspectives, including network reliability and network latency.

8. A performance optimization system for manufacturing service value contract mechanism, characterized in that: include: Smart contract analysis module, used to analyze the core steps of the smart contract execution process; The constraint factor analysis module is used to analyze the constraint factors that affect the system throughput performance during the execution of the value accounting contract based on the execution process of the value accounting contract; The execution efficiency measurement module is used to measure the execution efficiency of each constraint factor on the physical machine; The model building module is used to build a value accounting contract execution process model based on the colored Petri net according to the core steps of the smart contract execution process and the execution efficiency of various constraints on the physical machine; The performance optimization module is used to propose a performance optimization solution for the throughput of the manufacturing service value accounting contract system based on the value accounting contract execution process model.

9. A computer device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, the computer program is configured to be executed by the processor, and the computer program comprises instructions for executing the method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a computer, the method according to any one of claims 1 to 7 is implemented.