Smart contract group operation and maintenance information management method and system based on blockchain

Through the blockchain-based smart contract group operation and maintenance information management method, the operation and maintenance information of smart contracts is monitored and automatically repaired in real time, and the problems of inefficient management and difficulty in managing smart contract groups in the existing technology are solved, achieving efficient and accurate fault handling and system stability.

CN118606089BActive Publication Date: 2025-04-01HAINAN UNIV +3
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202410744026.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-11
Publication Date
2025-04-01
Estimated Expiration
2044-06-11

AI Technical Summary

Technical Problem

In the prior art, the operation and maintenance information management of smart contracts needs to be done manually, resulting in low management efficiency, prone to errors, and it is difficult to effectively manage the interactions and dependencies between smart contract groups.

Method used

The blockchain-based smart contract group operation and maintenance information management method is adopted. By obtaining the address information of the smart contract, its operation and maintenance information is monitored in real time, and faults are automatically identified and repaired, including transaction success rate, processing time, consumption, and contract calls and other operation and maintenance information.

Benefits of technology

It improves the efficiency of operation and maintenance information management of smart contracts, reduces manual intervention, improves the efficiency and accuracy of fault handling, and enhances the reliability and stability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118606089B_ABST
    Figure CN118606089B_ABST
Patent Text Reader

Abstract

The present application discloses a method and system for managing operation and maintenance information of a group of smart contracts based on blockchain, and the present application belongs to the field of blockchain technology. The method includes: monitoring the operation and maintenance information of each smart contract in real time through a preset operation and maintenance information monitoring model, and if abnormal operation and maintenance information is detected, determining whether there are multiple faulty smart contracts, and if so, determining a first automatic repair scheme, and automatically repairing each faulty smart contract according to the first automatic repair scheme; if all faulty smart contracts are repaired, then performing a verification test on each repaired faulty smart contract, and if they all meet the preset verification test standards, then deploying each repaired faulty smart contract to the blockchain. This solution can improve the efficiency and accuracy of fault handling and save costs; through verification testing, the reliability and stability of the system are improved; by prioritizing faults according to their severity, resource utilization and repair efficiency are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of blockchain technology, and in particular to a method and system for managing operation and maintenance information of a smart contract group based on blockchain. Background Art

[0002] With the widespread application of blockchain technology, smart contracts, as core components, carry key business logic and transaction rules, so the management of their operation and maintenance information becomes crucial.

[0003] In the operation and maintenance information management of smart contracts, the operation and maintenance personnel manually deploy and check the execution status, transaction records and logs of the contract in real time after deployment to ensure that the contract runs as expected. If an abnormality or failure is found, the operation and maintenance personnel need to quickly locate the problem and repair it.

[0004] However, manual operation and maintenance information management requires operation and maintenance personnel to spend a lot of time and energy to regularly check the operating status of the contract, resulting in low management efficiency and prone to errors. In addition, managing only a single smart contract may ignore the interactions and dependencies between smart contract groups, resulting in only considering local situations when solving problems, and failing to solve problems from a global perspective. Summary of the invention

[0005] This application provides a blockchain-based smart contract group operation and maintenance information management method and system, which solves the problem that manual operation and maintenance information management requires operation and maintenance personnel to spend a lot of time and energy to regularly check the operation status of the contract, resulting in low management efficiency and prone to errors. In addition, only managing a single smart contract may ignore the interaction and dependency between smart contract groups.

[0006] According to the first aspect of the present application, a method for managing operation and maintenance information of a smart contract group based on blockchain is provided, the method comprising:

[0007] Obtain the address information of each smart contract in the smart contract group, search for the corresponding smart contract in the blockchain according to the address information, and monitor the operation and maintenance information of each smart contract in real time through a preset operation and maintenance information monitoring model. If abnormal operation and maintenance information is detected, determine whether there are multiple faulty smart contracts; wherein the operation and maintenance information includes transaction success rate, processing time, consumption, and number of contract calls;

[0008] If it is determined that there are multiple faulty smart contracts, obtain abnormal operation and maintenance information of each faulty smart contract, and determine the abnormal type of the abnormal operation and maintenance information according to the abnormal operation and maintenance information and a preset abnormal type table; wherein the number of the abnormal operation and maintenance information is at least one;

[0009] Determine a first automatic repair scheme according to the abnormal type of the abnormal operation and maintenance information and a preset fault handling scheme, and automatically repair each faulty smart contract according to the first automatic repair scheme; wherein the first automatic repair scheme includes each faulty smart contract, the repair order of each faulty smart contract, and the repair method of each faulty smart contract, and the repair method includes an operation and maintenance operation sequence and repair parameters;

[0010] The repair progress of each faulty smart contract is detected in real time. If it is detected that all faulty smart contracts have been repaired, verification tests are performed on each repaired faulty smart contract. If each repaired faulty smart contract meets the preset verification test standards, the verification test is determined to be passed, and each repaired faulty smart contract is deployed to the blockchain; wherein the verification test includes functional testing, status testing, and security testing.

[0011] Further, after determining whether there are multiple faulty smart contracts, the method further includes:

[0012] If it is determined that there is a faulty smart contract, abnormal operation and maintenance information of the faulty smart contract and the abnormal type of the abnormal operation and maintenance information are obtained; wherein the number of the abnormal operation and maintenance information is at least one;

[0013] Determine a second automatic repair scheme according to the abnormal type of the abnormal operation and maintenance information and a preset fault handling scheme, and automatically repair the faulty smart contract according to the second automatic repair scheme; wherein the second automatic repair scheme includes the faulty smart contract, the operation and maintenance operation sequence, and the repair parameters;

[0014] The repair progress of the faulty smart contract is detected in real time. If it is detected that the faulty smart contract has been repaired, a verification test is performed on the faulty smart contract. If the repaired faulty smart contract meets the verification test standard, the verification test is determined to have passed; wherein the verification test includes functional testing, status testing, and security testing.

[0015] Furthermore, after verifying and testing each faulty smart contract that has been repaired, the method further includes:

[0016] If there is a faulty smart contract that has not been repaired and does not meet the preset verification test standards, the address information of the faulty smart contract is obtained and sent to the control center for the staff to repair the faulty smart contract until the faulty smart contract passes the verification test; wherein the number of the faulty smart contract is at least one, and the verification test includes functional testing, status testing and security testing.

[0017] Furthermore, the operation and maintenance information of each smart contract is monitored in real time through a preset operation and maintenance information monitoring model. If abnormal operation and maintenance information is detected, it is determined whether there are multiple faulty smart contracts, including:

[0018] Monitor the parameter operation information of each smart contract's operation and maintenance information in real time through the preset operation and maintenance information monitoring model;

[0019] Compare the parameter operation information with the corresponding preset operation abnormality threshold, and if there is parameter operation information exceeding the corresponding preset operation abnormality threshold, determine that there is abnormal operation and maintenance information;

[0020] Identify the number of abnormal operation and maintenance information. If multiple abnormal operation and maintenance information are identified, identify the faulty smart contracts corresponding to each abnormal operation and maintenance information to determine whether there are multiple faulty smart contracts.

[0021] Furthermore, after comparing the parameter operation information with the corresponding preset operation abnormality threshold, the method further includes:

[0022] If there is no parameter operation information exceeding the corresponding preset operation abnormality threshold, the parameter operation information is compared with the preset optimization standard to determine whether there is parameter operation information meeting the preset optimization standard;

[0023] If there is parameter operation information that meets the preset optimization standard, the corresponding operation and maintenance information is used as the target optimization operation and maintenance information, and the target optimization smart contract corresponding to the target optimization operation and maintenance information is determined;

[0024] A target optimization scheme is determined according to the target optimization smart contract, the target optimization operation and maintenance information, and a preset operation and maintenance information optimization scheme, and the target optimization scheme is used to optimize the target optimization smart contract, and the optimized target optimization smart contract is deployed to the blockchain.

[0025] Furthermore, after determining the target optimization smart contract corresponding to the target optimization operation and maintenance information, the method further includes:

[0026] Determine if there are multiple target optimization smart contracts;

[0027] If there are multiple target optimization smart contracts, the attribute information of each target optimization smart contract is obtained, and the first optimization order of each target optimization smart contract is determined according to the attribute information and the preset contract optimization evaluation scheme;

[0028] Obtain the target optimization operation and maintenance information corresponding to each target optimization smart contract. If there is a target optimization smart contract containing multiple target optimization operation and maintenance information, determine the business requirements of the target optimization smart contract according to the attribute information of the target optimization smart contract;

[0029] Determine a second optimization order of each target optimization operation and maintenance information in the target optimization smart contract according to the business requirements;

[0030] Accordingly, a target optimization scheme is determined according to the target optimization smart contract, the target optimization operation and maintenance information, and a preset operation and maintenance information optimization scheme, including:

[0031] Determine a target optimization plan according to the first optimization sequence, the target optimization smart contract, the second optimization sequence, the target optimization operation and maintenance information, and the preset operation and maintenance information optimization plan.

[0032] Further, after determining whether there are multiple target optimization smart contracts, the method also includes:

[0033] If there is a target optimization smart contract, obtain the target optimization operation and maintenance information corresponding to the target optimization smart contract; if there are multiple target optimization operation and maintenance information, determine the business requirements of the target optimization smart contract according to the attribute information of the target optimization smart contract;

[0034] Determine a third optimization order of each target optimization operation and maintenance information in the target optimization smart contract according to the business requirements;

[0035] Accordingly, a target optimization scheme is determined according to the target optimization smart contract, the target optimization operation and maintenance information, and a preset operation and maintenance information optimization scheme, including:

[0036] Determine a target optimization plan according to the target optimization smart contract, the third optimization order, the target optimization operation and maintenance information, and the preset operation and maintenance information optimization plan.

[0037] Furthermore, after optimizing the target optimization smart contract using the target optimization solution, the method further includes:

[0038] Perform verification testing on the optimized target optimization smart contract; wherein the verification testing includes functional testing, status testing and security testing;

[0039] Accordingly, the optimized target optimization smart contract is deployed to the blockchain, including:

[0040] If the optimized target optimization smart contract meets the verification test standard, the verification test is determined to have passed, and the optimized target optimization smart contract is deployed to the blockchain.

[0041] Furthermore, the construction process of the operation and maintenance information monitoring model includes:

[0042] Acquire historical operation and maintenance information and corresponding historical parameter operation information when an abnormal situation occurs, and create a data set according to the historical operation and maintenance information and the corresponding historical parameter operation information;

[0043] Build an operation and maintenance information monitoring model;

[0044] The data set is input into the operation and maintenance information monitoring model for training, and the training is stopped until the network converges, thereby obtaining a trained operation and maintenance information monitoring model with network parameters.

[0045] According to the second aspect of the present application, a blockchain-based smart contract group operation and maintenance information management system is provided, characterized in that the system includes:

[0046] A faulty smart contract determination module is used to obtain the address information of each smart contract in the smart contract group, search for the corresponding smart contract in the blockchain according to the address information, and monitor the operation and maintenance information of each smart contract in real time through a preset operation and maintenance information monitoring model. If abnormal operation and maintenance information is detected, it is determined whether there are multiple faulty smart contracts; wherein the operation and maintenance information includes transaction success rate, processing time, consumption, and number of contract calls;

[0047] An abnormality type determination module is used to obtain abnormal operation and maintenance information of each faulty smart contract when it is determined that there are multiple faulty smart contracts, and determine the abnormal type of the abnormal operation and maintenance information according to the abnormal operation and maintenance information and a preset abnormality type table; wherein the number of the abnormal operation and maintenance information is at least one;

[0048] A contract repair module, used to determine a first automatic repair scheme according to the abnormal type of the abnormal operation and maintenance information and a preset fault handling scheme, and automatically repair each faulty smart contract according to the first automatic repair scheme; wherein the first automatic repair scheme includes each faulty smart contract, the repair order of each faulty smart contract, and the repair method of each faulty smart contract, and the repair method includes an operation and maintenance operation sequence and repair parameters;

[0049] The contract deployment module is used to detect the repair progress of each faulty smart contract in real time. If it is detected that all faulty smart contracts have been repaired, a verification test is performed on each repaired faulty smart contract. If each repaired faulty smart contract meets the preset verification test standard, it is determined that the verification test has passed, and each repaired faulty smart contract is deployed to the blockchain; wherein the verification test includes functional testing, status testing, and security testing.

[0050] In an embodiment of the present application, the address information of each smart contract in the smart contract group is obtained, and the corresponding smart contract is searched in the blockchain according to the address information, and the operation and maintenance information of each smart contract is monitored in real time through a preset operation and maintenance information monitoring model. If abnormal operation and maintenance information is detected, it is determined whether there are multiple faulty smart contracts; if it is determined that there are multiple faulty smart contracts, the abnormal operation and maintenance information of each faulty smart contract and the abnormal type of the abnormal operation and maintenance information are obtained; wherein the number of the abnormal operation and maintenance information is at least one; a first automatic repair solution is determined according to the abnormal type of each abnormal operation and maintenance information and a preset fault handling solution, and the first automatic repair solution is used to repair the faulty smart contract. The scheme automatically repairs each faulty smart contract; wherein, the first automatic repair scheme includes the repair order of each faulty smart contract and the repair method of each faulty smart contract, and the repair method includes the operation and maintenance operation sequence and repair parameters; the repair progress of each faulty smart contract is detected in real time, and if it is detected that all faulty smart contracts have been repaired, the repaired faulty smart contracts are verified and tested, and if the repaired faulty smart contracts meet the preset verification test standards, the verification test is determined to pass, and the repaired faulty smart contracts are deployed to the blockchain; wherein, the verification test includes functional testing, status testing and security testing. Through the above-mentioned blockchain-based smart contract group operation and maintenance information management method, the repair scheme is automatically determined without manual intervention, which can improve the efficiency and accuracy of fault handling and save costs. And after the repair is completed, the smart contract is verified and tested, which improves the reliability and stability of the system. By determining the repair order, the faults can be prioritized according to their severity, improving resource utilization and repair efficiency.

[0051] It should be understood that the contents described in the Summary of the Invention are not intended to limit the key or important features of the embodiments of the present application, nor are they intended to limit the scope of the present application. Other features of the present application will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0052] The above and other features, advantages and aspects of the embodiments of the present application will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present application. In the accompanying drawings, the same or similar reference numerals represent the same or similar elements, among which:

[0053] Figure 1 It is a flowchart of a method for managing operation and maintenance information of a smart contract group based on blockchain provided in Example 1 of the present application;

[0054] Figure 2 This is a flowchart of a method for managing operation and maintenance information of a smart contract group based on blockchain provided in Example 2 of the present application;

[0055] Figure 3 It is a flowchart of the blockchain-based smart contract group operation and maintenance information management method provided in Example 3 of the present application.

[0056] Figure 4 It is a structural diagram of the blockchain-based smart contract group operation and maintenance information management system provided in Example 4 of the present application. DETAILED DESCRIPTION

[0057] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0058] In addition, the term "and / or" in this article is only a description of the association relationship between the associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.

[0059] The following, in conjunction with the accompanying drawings, describes in detail the blockchain-based smart contract group operation and maintenance information management method provided by the embodiment of the present application through specific embodiments and their application scenarios.

[0060] Embodiment 1

[0061] Figure 1 : is a flowchart of the method for managing the operation and maintenance information of a smart contract group based on blockchain provided in the first embodiment of the present application. Figure 1 As shown, the specific steps include:

[0062] S101, obtain the address information of each smart contract in the smart contract group, search for the corresponding smart contract in the blockchain according to the address information, and monitor the operation and maintenance information of each smart contract in real time through a preset operation and maintenance information monitoring model. If abnormal operation and maintenance information is detected, determine whether there are multiple faulty smart contracts; wherein the operation and maintenance information includes transaction success rate, processing time, consumption, and number of contract calls.

[0063] First of all, the usage scenario of this solution can be to use the preset operation and maintenance information monitoring model to monitor the operation and maintenance information of each smart contract in the smart contract group in real time to determine whether there is abnormal operation and maintenance information, and if it is determined that there is abnormal operation and maintenance information, lock the corresponding smart contract, and automatically repair the smart contract. After the repair is completed, the smart contract is deployed to the blockchain.

[0064] Based on the above usage scenarios, it can be understood that the executor of the present application can be a blockchain-based smart contract group operation and maintenance information management system that integrates the functions of monitoring operation and maintenance information, determining faulty smart contracts, automatically repairing faulty smart contracts, and deploying smart contracts. No excessive restrictions are made here.

[0065] In this solution, a smart contract group can refer to a set of smart contracts deployed on a blockchain. These smart contracts can be functionally related and together constitute an application, platform or service.

[0066] Smart contracts can be an automated computing code executed on the blockchain, which can contain pre-set rules and logic. Smart contracts perform specific tasks through programming, such as transferring assets, recording data, and executing logical judgments.

[0067] The address information of a smart contract can be a unique identifier used to locate and identify a specific smart contract. When each smart contract is created, it is assigned a unique address, which can be a string of numbers and letters, through which users can find and interact with it on the blockchain.

[0068] Blockchain is a decentralized distributed database technology that records a series of encrypted blocks that are linked to form an ever-growing chain structure.

[0069] The preset operation and maintenance information monitoring model can be a tool or system for real-time monitoring of the operation and maintenance information of smart contracts. It identifies and analyzes various data and information generated by smart contracts during operation based on specific algorithms and rules. Specifically, it can evaluate the operation and maintenance status of smart contracts and detect whether there are any abnormal situations by collecting the operation and maintenance information of smart contracts.

[0070] Operation and maintenance information can refer to various data and indicators generated by smart contracts during their operation. Specifically, it can include transaction success rate, processing time, consumption, and number of contract calls, etc. This information can reflect the operating status and performance of smart contracts.

[0071] The transaction success rate can be the ratio of the number of successfully executed transactions to the total number of transactions, which is used to measure the success rate of smart contract transaction execution.

[0072] Processing time can be the time required to execute a smart contract, that is, the time from the initiation of a transaction to its completion.

[0073] Consumption can be the unit required to execute smart contract operations on the blockchain. Consumption refers to the amount consumed to execute smart contract operations.

[0074] The number of contract calls can be the number of times the smart contract is called, that is, the number of times the functions or methods in the contract are executed.

[0075] Abnormal operation and maintenance information can refer to operation and maintenance information that is inconsistent with the normal operation of the smart contract. For example, a sudden drop in transaction success rate, a significant increase in processing time, and abnormal consumption are all inconsistent with the normal operation of the smart contract. Information in this situation is considered abnormal operation and maintenance information. Each faulty smart contract can have one or more abnormal operation and maintenance information.

[0076] A faulty smart contract may refer to a smart contract associated with abnormal operation and maintenance information. When abnormal operation and maintenance information is found, it is necessary to determine which smart contracts have problems. These problematic smart contracts are faulty smart contracts.

[0077] The address information of the smart contract can be obtained from the management database of the smart contract group, and the corresponding smart contract can be found on the blockchain node using the obtained smart contract address information. The operation and maintenance information of the smart contract is continuously obtained through the blockchain node. Specifically, this information can be obtained through the transaction records and block information of the smart contract. The obtained operation and maintenance information is input into the preset operation and maintenance information monitoring model. The normal range of the operation and maintenance information can be set in the preset operation and maintenance information monitoring model. If the preset operation and maintenance information monitoring model determines that a certain operation and maintenance information of a smart contract has a significant deviation from the preset normal range or threshold, it can indicate that this smart contract is a faulty smart contract. For example, a smart contract needs to consume a certain amount of virtual currency units used to pay for transaction execution costs on blockchain platforms such as Ethereum. During the operation and maintenance process, the consumption data of the smart contract will be collected in real time and input into the preset operation and maintenance information monitoring model. A normal consumption range has been preset in the model. If the consumption of the smart contract is detected to have suddenly increased and exceeded the preset normal range within a certain period of time, it can indicate that the smart contract has encountered an abnormality during execution. For example, a function may be frequently called, resulting in an increase in computing costs, or the smart contract may have encountered a malicious attack, resulting in a large amount of resource consumption. When abnormal operation and maintenance information is detected, the corresponding smart contract is determined to be a faulty smart contract. There may be multiple abnormal operation and maintenance information, and there may be several abnormal operation and maintenance information for a faulty smart contract, or multiple abnormal operation and maintenance information may correspond to different faulty smart contracts, so it is necessary to determine the number of faulty smart contracts.

[0078] Based on the above technical solution, optionally, after determining whether there are multiple faulty smart contracts, the method further includes:

[0079] If it is determined that there is a faulty smart contract, abnormal operation and maintenance information of the faulty smart contract and the abnormal type of the abnormal operation and maintenance information are obtained; wherein the number of the abnormal operation and maintenance information is at least one;

[0080] Determine a second automatic repair scheme according to the abnormal type of the abnormal operation and maintenance information and a preset fault handling scheme, and automatically repair the faulty smart contract according to the second automatic repair scheme; wherein the second automatic repair scheme includes the faulty smart contract, the operation and maintenance operation sequence, and the repair parameters;

[0081] The repair progress of the faulty smart contract is detected in real time. If it is detected that the faulty smart contract has been repaired, a verification test is performed on the faulty smart contract. If the repaired faulty smart contract meets the verification test standard, the verification test is determined to have passed; wherein the verification test includes functional testing, status testing, and security testing.

[0082] In this solution, the second automatic repair solution can be a repair solution determined for a faulty smart contract when there is a faulty smart contract.

[0083] After the specific faulty smart contract is determined, the abnormal operation and maintenance information corresponding to each faulty smart contract can be determined by monitoring the operation and maintenance information through the preset operation and maintenance information monitoring model. The abnormal type judgment condition can be set to classify each abnormal operation and maintenance information, and then the abnormal type of each abnormal operation and maintenance information can be stored using a data structure. The corresponding abnormal type is matched in the data structure according to the abnormal operation and maintenance information. And the smart contract related to it can be found according to the source of the abnormal operation and maintenance information. Specifically, the abnormal information can be associated with the corresponding smart contract by using the mapping relationship between the smart contract address and the abnormal information to determine the faulty smart contract corresponding to the abnormal operation and maintenance information. There can be one abnormal operation and maintenance information in the faulty smart contract, or there can be multiple abnormal operation and maintenance information. The matching repair method can be found according to the abnormal type in the preset fault handling scheme. Based on the matching fault handling scheme, the second automatic repair scheme can be constructed, that is, the corresponding repair method is found and automatically repaired in sequence. Specifically, the preset fault handling scheme contains repair methods corresponding to various abnormal types, and each repair method is composed of an operation and maintenance operation sequence and repair parameters. After the matching is completed, the faulty smart contract and the corresponding repair method can be combined into a second automatic repair scheme. The second automatic repair scheme can be expressed as a faulty smart contract a-repair method (operation and maintenance operation sequence and repair parameters). During the automatic repair process, all operations should be recorded in logs. Specifically, these logs may include the start time, end time, execution status, and any related error information of the repair operation. By analyzing these logs, the repair progress can be understood in real time. Then the repair progress is checked regularly to confirm that all faulty smart contracts have been repaired. Once it is detected that the faulty smart contract has been repaired, the repaired faulty smart contracts are verified and tested. Specifically, functional testing may include verifying whether the various functions of the smart contract are performed as expected, such as whether the various methods of the contract are callable and whether the parameters are processed correctly. State testing may be to verify whether the behavior of the smart contract in different states is as expected. Specifically, it may include whether the state transition is correct and whether the state update is accurate. Security testing may be to ensure that the smart contract can maintain security in various situations. Specifically, it may include checking whether there are vulnerabilities and risks.

[0084] In this solution, by automatically determining the repair plan without manual intervention, the efficiency and accuracy of fault handling can be improved, and costs can be saved. After the repair is completed, the smart contract is verified and tested, which improves the reliability and stability of the system.

[0085] On the basis of the above technical solution, optionally, the construction process of the operation and maintenance information monitoring model includes:

[0086] Acquire historical operation and maintenance information and corresponding historical parameter operation information when an abnormal situation occurs, and create a data set according to the historical operation and maintenance information and the corresponding historical parameter operation information;

[0087] Build an operation and maintenance information monitoring model;

[0088] The data set is input into the operation and maintenance information monitoring model for training, and the training is stopped until the network converges, thereby obtaining a trained operation and maintenance information monitoring model with network parameters.

[0089] Historical operation and maintenance information can refer to various operation and maintenance data of smart contracts in the past period of time.

[0090] The historical parameter operation information may be parameter information associated with the operation and maintenance information.

[0091] The data set may be a data set consisting of historical operation and maintenance information and corresponding historical parameter operation information.

[0092] It is possible to collect and organize historical operation and maintenance information and corresponding historical parameter operation information, and build a suitable data set. Specifically, it is possible to access smart contract records and other relevant data sources in the blockchain. Then, a monitoring model is built using machine learning or deep learning technology. Specifically, it can be a model based on supervised learning or unsupervised learning, which is used to analyze historical data and predict possible abnormal situations in the future. The training of the model needs to be carried out using a data set, and the parameters of the model are continuously adjusted until the model converges.

[0093] In this solution, by training the monitoring model, we can learn the patterns and regularities of historical anomalies, thereby improving the accuracy and reliability of anomaly detection.

[0094] S102: If it is determined that there are multiple faulty smart contracts, obtain abnormal operation and maintenance information of each faulty smart contract, and determine the abnormal type of the abnormal operation and maintenance information according to the abnormal operation and maintenance information and a preset abnormal type table; wherein the number of the abnormal operation and maintenance information is at least one.

[0095] The exception type table may be a database table that stores the exception type corresponding to each abnormal operation and maintenance information.

[0096] The abnormal type can refer to the specific classification or type of abnormal operation and maintenance information, which is used to describe the nature and characteristics of the abnormal situation. Specifically, it can include abnormal transaction success rate, that is, the number of failures corresponding to the transactions executed by the smart contract is too large. The processing time is too long, that is, the processing time of the smart contract exceeds the preset threshold or average processing time. Consumption abnormality, that is, the consumption of the smart contract exceeds the expected range or average value. Abnormal number of contract calls, that is, the number of times the smart contract is called exceeds the preset threshold or average value.

[0097] After the specific faulty smart contract is determined, the abnormal operation and maintenance information corresponding to each faulty smart contract can be determined by monitoring the operation and maintenance information through the preset operation and maintenance information monitoring model. The abnormal type judgment condition can be set in the abnormal type table, each abnormal operation and maintenance information can be classified, and then the abnormal type of each abnormal operation and maintenance information can be stored. Match the corresponding abnormal type in the abnormal type table according to the abnormal operation and maintenance information. And find the smart contract related to it according to the source of the abnormal operation and maintenance information. Specifically, the abnormal information can be associated with the corresponding smart contract by using the mapping relationship between the smart contract address and the abnormal information to determine the faulty smart contracts corresponding to each abnormal operation and maintenance information. For example, the abnormal operation and maintenance information of a smart contract is consumption, which is specifically manifested as a sudden surge in consumption, exceeding twice the historical average. The abnormal type can be a consumption abnormality. Each faulty smart contract can have one or more abnormal operation and maintenance information.

[0098] S103, determine a first automatic repair plan according to the abnormal type of the abnormal operation and maintenance information and a preset fault handling plan, and automatically repair each faulty smart contract according to the first automatic repair plan; wherein the first automatic repair plan includes each faulty smart contract, the repair order of each faulty smart contract, and the repair method of each faulty smart contract, and the repair method includes an operation and maintenance operation sequence and repair parameters.

[0099] The preset fault handling scheme can be a pre-established handling strategy for various types of exceptions, and specifically, can include the priority ranking of each type of exception and the repair method, etc. For example, there is an exception type of transaction success rate abnormality. After matching the preset fault handling scheme, the corresponding priority is determined to be medium priority, and the corresponding repair method is to check the contract code, adjust the price, and update the smart contract, etc.

[0100] The first automatic repair plan can be a plan that determines the corresponding priority and processing strategy for each faulty smart contract, sorts each faulty smart contract according to the priority, and executes the processing strategy of the corresponding faulty smart contract in the corresponding order. That is, the processing strategies of all faulty smart contracts are combined into the first automatic repair plan, and the processing strategies are executed in sequence to solve all faults.

[0101] The repair order can be the repair order of each faulty smart contract determined by the priority ranking of the exception type.

[0102] The repair method can be a fault resolution method for each faulty smart contract determined according to the processing strategy. The specific repair method includes an operation and maintenance operation sequence and repair parameters.

[0103] The operation sequence can be a series of operation operations performed in a specific order to resolve faults in smart contracts. Specifically, they can include interacting with smart contracts, updating configurations, and calling other services or tools. Repair parameters can be specific input values ​​or configurations required when executing the operation sequence. Specifically, they can include the contract address, which is the unique identifier of the smart contract on the blockchain, used to locate and execute operations. Function selector, which is a 4-byte hash value used to identify the smart contract function to be called. Price and limit, which is used to pay for executing operations on the blockchain. The price determines the cost per unit, while the limit limits the maximum amount that can be used for the operation. Parameter value, which is the parameter value passed to the smart contract function, is used to specify the specific behavior or conditions of the operation. The bytecode of the new version of the contract. If you want to redeploy or update the smart contract, you need to provide a new version of the contract bytecode. For example, if the abnormal operation and maintenance information of a smart contract is the transaction success rate, the operation and maintenance operation sequence may include collecting and analyzing logs to understand the cause of the failure; reviewing the contract code to find potential problems that may cause the transaction to fail; if problems are found, fix the code; if the problem cannot be solved by fixing the code, consider adjusting the price or limit; if the problem still exists, redeploy a new contract version; verify whether the newly deployed contract solves the problem. The repair parameters are the contract address: that is, the blockchain address of the smart contract; price: 30Gwei, adjusted according to the current network status and market price; limit: 4,000,000, adjusted according to the complexity of the contract; the bytecode of the new version of the contract, that is, the bytecode of the repaired contract.

[0104] In the preset fault handling scheme, the matching repair method can be found according to the exception type. Based on the matching fault handling scheme, the first automatic repair scheme can be constructed, that is, each faulty smart contract is sorted according to the priority, and then automatically repaired in order according to the corresponding repair method. Specifically, the preset fault handling scheme includes repair methods corresponding to various exception types, and each repair method is composed of an operation and maintenance operation sequence and repair parameters. After the matching is completed, each faulty smart contract can be arranged in the repair order, followed by its corresponding repair method. The first automatic repair scheme can be expressed as faulty smart contract a-the repair method corresponding to all abnormal operation and maintenance information contained in the faulty smart contract a (including the operation and maintenance operation sequence used to solve all abnormal operation and maintenance information of the faulty smart contract a and the corresponding repair parameters)-faulty smart contract b-the repair method corresponding to all abnormal operation and maintenance information contained in the faulty smart contract b (including the operation and maintenance operation sequence used to solve all abnormal operation and maintenance information of the faulty smart contract b and the corresponding repair parameters).

[0105] S104, real-time detection of the repair progress of each faulty smart contract. If it is detected that all faulty smart contracts have been repaired, verification tests are performed on each repaired faulty smart contract. If each repaired faulty smart contract meets the preset verification test standard, the verification test is determined to be passed, and each repaired faulty smart contract is deployed to the blockchain; wherein the verification test includes functional testing, status testing, and security testing.

[0106] The repair progress may refer to the status and progress of each faulty smart contract being repaired during the automatic repair process of the faulty smart contract. Specifically, the repair progress may be obtained by monitoring and recording the execution of the repair operation and evaluating the repair completion of each faulty contract.

[0107] The preset verification test standards can be the conditions or standards that need to be met when verifying the repaired smart contract. These standards can include requirements in terms of functionality, state, and security. Specifically, functionality can include whether the functions of the contract meet expectations, such as whether the contract correctly handles transaction requests and correctly performs various operations; whether the functions of the contract are complete and cover all expected requirements; whether the functions of the contract are consistent with its publicity or documentation. State requirements can include whether the behavior of the contract in different states meets expectations, such as whether the performance of the contract in normal, abnormal, and critical states is correct; whether the contract is accurate during state transitions and whether it can correctly update state variables or records. Security requirements can include whether the contract is protected by common attack methods, such as reentrancy attacks, overflow attacks, and permission control. Whether the contract follows best security practices, such as minimizing permissions, securely handling user input, and preventing potential vulnerabilities. Whether the data and assets of the contract can be stored and transmitted securely and are properly protected. Whether the contract has undergone sufficient security review and testing and has passed common security standards and certifications.

[0108] During the automatic repair process, all operations should be recorded in the log. Specifically, these logs may include the start time, end time, execution status, and any related error information of the repair operation. By analyzing these logs, the repair progress can be understood in real time. Then the repair progress is checked regularly to confirm whether all faulty smart contracts have been repaired. Once it is detected that all faulty smart contracts have been repaired, the repaired faulty smart contracts are verified and tested. Specifically, functional testing may include verifying whether the functions of the smart contract are performed as expected, such as whether the various methods of the contract can be called and whether the parameters are processed correctly. State testing may be to verify whether the behavior of the smart contract in different states is as expected. Specifically, it may include whether the state transition is correct and whether the state update is accurate. Security testing may be to ensure that the smart contract can maintain security in various situations. Specifically, it may include checking whether there are vulnerabilities and risks. If all the repaired faulty smart contracts meet the preset verification test standards, they can be deployed in the blockchain. Specifically, it may include sending the bytecode of the contract to the blockchain and creating a new contract instance on the blockchain. After deployment, it can be verified whether the contract has been successfully deployed on the blockchain network. Specifically, it can be verified through a blockchain browser or command line tool.

[0109] In an embodiment of the present application, the address information of each smart contract in the smart contract group is obtained, and the corresponding smart contract is searched in the blockchain according to the address information, and the operation and maintenance information of each smart contract is monitored in real time through a preset operation and maintenance information monitoring model. If abnormal operation and maintenance information is detected, it is determined whether there are multiple faulty smart contracts; if it is determined that there are multiple faulty smart contracts, the abnormal operation and maintenance information of each faulty smart contract and the abnormal type of the abnormal operation and maintenance information are obtained; wherein the number of the abnormal operation and maintenance information is at least one; a first automatic repair solution is determined according to the abnormal type of each abnormal operation and maintenance information and a preset fault handling solution, and the first automatic repair solution is used to repair the faulty smart contract. The scheme automatically repairs each faulty smart contract; wherein, the first automatic repair scheme includes the repair order of each faulty smart contract and the repair method of each faulty smart contract, and the repair method includes the operation and maintenance operation sequence and repair parameters; the repair progress of each faulty smart contract is detected in real time, and if it is detected that all faulty smart contracts have been repaired, the repaired faulty smart contracts are verified and tested, and if the repaired faulty smart contracts meet the preset verification test standards, the verification test is determined to pass, and the repaired faulty smart contracts are deployed to the blockchain; wherein, the verification test includes functional testing, status testing and security testing. Through the above-mentioned blockchain-based smart contract group operation and maintenance information management method, the repair scheme is automatically determined without manual intervention, which can improve the efficiency and accuracy of fault handling and save costs. And after the repair is completed, the smart contract is verified and tested, which improves the reliability and stability of the system. By determining the repair order, the faults can be prioritized according to their severity, improving resource utilization and repair efficiency.

[0110] Based on the above technical solution, optionally, after verifying and testing each faulty smart contract that has been repaired, the method further includes:

[0111] If there is a faulty smart contract that has not been repaired and does not meet the preset verification test standards, the address information of the faulty smart contract is obtained and sent to the control center for the staff to repair the faulty smart contract until the faulty smart contract passes the verification test; wherein the number of the faulty smart contract is at least one, and the verification test includes functional testing, status testing and security testing.

[0112] In this solution, the control center can be a central management node or system responsible for monitoring, managing and scheduling the operation of the system. In this solution, the control center can be a centralized management platform or system responsible for receiving and processing information from each node or module in the system, and performing corresponding scheduling and control operations as needed. After the control center receives the address information of the faulty smart contract, it can assign tasks to the corresponding staff according to the pre-set processes and rules to ensure that the faulty smart contract is repaired in a timely manner.

[0113] You can run the validation test and check if there are any faulty smart contracts that have failed the validation test. For each faulty smart contract that has failed the validation test, obtain its address information and send it to the control center through wireless communication technology. After the control center receives the address information, it assigns the task to the corresponding staff. The staff can repair the faulty smart contract until it passes the validation test. Once the repair is completed, run the validation test again, including functional testing, status testing, and security testing. If the repaired smart contract passes all tests, it can be deployed to the blockchain. Specifically, you can use the corresponding tools to connect to the target blockchain network. Use the deployment tool to deploy the repaired smart contract to the blockchain network. Specifically, it can include sending the bytecode of the contract to the blockchain and creating a new contract instance on the blockchain. After the deployment is completed, you can verify whether the contract has been successfully deployed to the blockchain network. Specifically, you can verify it through a blockchain browser or command line tool.

[0114] In this solution, the manual repair process is initiated after the automatic repair fails, which can respond to the problem in a timely manner and reduce the duration and impact of the failure.

[0115] Embodiment 2

[0116] Figure 2 : is a flowchart of a method for managing operation and maintenance information of a smart contract group based on blockchain provided in Example 2 of the present application, such as Figure 2 As shown, the specific method includes the following steps:

[0117] S201, obtain the address information of each smart contract in the smart contract group, search for the corresponding smart contract in the blockchain according to the address information, and monitor the parameter operation information of the operation and maintenance information of each smart contract in real time through a preset operation and maintenance information monitoring model; wherein the operation and maintenance information includes transaction success rate, processing time, consumption and number of contract calls.

[0118] Parameter operation information can be specific values ​​for various operation and maintenance information. Specifically, it can include real-time values ​​including transaction success rate, processing time, consumption, and number of contract calls.

[0119] The preset operation and maintenance information monitoring model can regularly obtain the operation and maintenance data of smart contracts, such as real-time information on smart contract transaction success rate, processing time, consumption, and number of contract calls, etc., through blockchain browsers or smart contract logs. This real-time information will be transmitted to the monitoring model for real-time monitoring and analysis to determine whether there are any abnormal situations.

[0120] S202, comparing the parameter operation information with the corresponding preset operation abnormality threshold, if there is parameter operation information exceeding the corresponding preset operation abnormality threshold, it is determined that there is abnormal operation and maintenance information.

[0121] The preset operation abnormality threshold may be a preset threshold of parameter operation information for each item of operation and maintenance information, and is used to determine whether there is an abnormal situation.

[0122] The parameter operation information of each operation and maintenance information can be obtained, specifically, the real-time values ​​of transaction success rate, processing time, consumption, and number of contract calls. Then, these real-time values ​​are compared with the preset operation abnormality threshold. If the real-time value of a parameter exceeds the corresponding preset threshold, it can be determined that the parameter is abnormal, thereby determining that there is abnormal operation and maintenance information. For example, the preset threshold of processing time is 5 seconds, which means that if the processing time exceeds 5 seconds, it is considered abnormal.

[0123] S203, identifying the number of abnormal operation and maintenance information. If multiple abnormal operation and maintenance information are identified, identifying the fault smart contract corresponding to each abnormal operation and maintenance information, and determining whether multiple fault smart contracts exist.

[0124] The preset operation and maintenance information monitoring model can be used to monitor the operation and maintenance information of each smart contract in real time. The operation and maintenance information of each smart contract is compared with the preset operation abnormality threshold to determine whether there is abnormal operation and maintenance information. If a certain operation and maintenance information of a smart contract exceeds the preset threshold, it is considered to be abnormal. The number of abnormal operation and maintenance information in each smart contract is recorded. For smart contracts with abnormal operation and maintenance information, they are marked as faulty smart contracts and their address information is recorded. The number of smart contracts marked as faulty is counted. If there are multiple faulty smart contracts, it is determined that there are multiple faulty smart contracts.

[0125] S204: If it is determined that there are multiple faulty smart contracts, obtain abnormal operation and maintenance information of each faulty smart contract, and determine the abnormal type of the abnormal operation and maintenance information according to the abnormal operation and maintenance information and a preset abnormal type table; wherein the number of the abnormal operation and maintenance information is at least one.

[0126] S205, determine a first automatic repair plan according to the abnormal type of the abnormal operation and maintenance information and a preset fault handling plan, and automatically repair each faulty smart contract according to the first automatic repair plan; wherein the first automatic repair plan includes each faulty smart contract, the repair order of each faulty smart contract, and the repair method of each faulty smart contract, and the repair method includes an operation and maintenance operation sequence and repair parameters.

[0127] S206, real-time detection of the repair progress of each faulty smart contract. If it is detected that all faulty smart contracts have been repaired, verification tests are performed on each repaired faulty smart contract. If each repaired faulty smart contract meets the preset verification test standard, the verification test is determined to be passed, and each repaired faulty smart contract is deployed to the blockchain; wherein the verification test includes functional testing, status testing, and security testing.

[0128] In this embodiment, by real-time monitoring of parameter operation information of operation and maintenance information and comparing it with a preset abnormal threshold, abnormal situations can be discovered in time, which helps to respond quickly and reduce losses.

[0129] Embodiment 3

[0130] Figure 3 : is a flowchart of a method for managing operation and maintenance information of a smart contract group based on blockchain provided in Example 3 of the present application, such as Figure 3 As shown, the specific method includes the following steps:

[0131] S301, obtain the address information of each smart contract in the smart contract group, search for the corresponding smart contract in the blockchain according to the address information, and monitor the parameter operation information of the operation and maintenance information of each smart contract in real time through a preset operation and maintenance information monitoring model; wherein the operation and maintenance information includes transaction success rate, processing time, consumption and number of contract calls.

[0132] S302, comparing the parameter operation information with the corresponding preset operation abnormality threshold. If there is no parameter operation information exceeding the corresponding preset operation abnormality threshold, comparing the parameter operation information with the preset optimization standard to determine whether there is parameter operation information that meets the preset optimization standard.

[0133] The preset optimization standard can be a set of predefined parameter operation information thresholds, which are used to measure whether the performance and efficiency of the smart contract need to be optimized. If a parameter operation information is lower than the corresponding threshold, it is deemed to have reached the preset optimization standard. Specifically, it can include a transaction success rate threshold, that is, the proportion of transactions successfully processed by the smart contract; a processing time threshold, that is, the average time required for the smart contract to process each transaction; a consumption threshold, that is, the average amount consumed by the smart contract to execute each transaction; a contract call count threshold, that is, the frequency or number of times the smart contract is called. For example, if the transaction success rate is lower than the corresponding transaction success rate threshold, it is deemed to have reached the preset optimization standard.

[0134] S303: If there is parameter operation information that meets the preset optimization standard, the corresponding operation and maintenance information is used as the target optimization operation and maintenance information, and the target optimization smart contract corresponding to the target optimization operation and maintenance information is determined.

[0135] The target optimization operation and maintenance information may be parameter operation information that reaches a preset optimization standard, that is, operation and maintenance information that meets the preset optimization standard.

[0136] Targeted optimization smart contracts can be smart contracts that have reached preset optimization criteria. These contracts are considered to be performing poorly or inefficiently in their current configuration and need to be improved.

[0137] On the basis of the above technical solution, optionally, after determining the target optimization smart contract corresponding to the target optimization operation and maintenance information, the method further includes:

[0138] Determine if there are multiple target optimization smart contracts;

[0139] If there are multiple target optimization smart contracts, the attribute information of each target optimization smart contract is obtained, and the first optimization order of each target optimization smart contract is determined according to the attribute information and the preset contract optimization evaluation scheme;

[0140] Obtain the target optimization operation and maintenance information corresponding to each target optimization smart contract. If there is a target optimization smart contract containing multiple target optimization operation and maintenance information, determine the business requirements of the target optimization smart contract according to the attribute information of the target optimization smart contract;

[0141] Determine a second optimization order of each target optimization operation and maintenance information in the target optimization smart contract according to the business requirements;

[0142] Accordingly, a target optimization scheme is determined according to the target optimization smart contract, the target optimization operation and maintenance information, and a preset operation and maintenance information optimization scheme, including:

[0143] Determine a target optimization plan according to the first optimization sequence, the target optimization smart contract, the second optimization sequence, the target optimization operation and maintenance information, and the preset operation and maintenance information optimization plan.

[0144] In this solution, attribute information can be the characteristics or attributes of a smart contract. Specifically, it can include the contract type. Smart contracts can be of different types, such as token contracts, voting contracts, and multi-signature contracts. Functions: The functions of a smart contract describe the specific services it provides or the functions it implements, such as transfers, voting, and asset management. Call frequency: The frequency with which a smart contract is called can affect its performance and efficiency.

[0145] The preset contract optimization evaluation plan may include indicators for evaluating the performance, security, and cost-effectiveness of smart contracts. Specifically, it may include performance evaluation, evaluating the processing speed and response time of smart contracts, and other performance indicators. Security evaluation, evaluating the vulnerabilities and security risks of smart contracts, to ensure the security of the contract. Cost-effectiveness evaluation, evaluating the execution cost and benefits of smart contracts, to ensure that the cost of the contract is controlled within a reasonable range.

[0146] The first optimization order may refer to the order of determining which of multiple target optimization smart contracts to optimize first.

[0147] Business requirements can be the specific functions and services that smart contracts need to meet. Specifically, they can include transfer functions, that is, smart contracts need to provide secure and fast transfer functions. Voting functions, that is, smart contracts need to implement reliable and fair voting functions. Asset management functions, that is, smart contracts need to manage the assets of multiple users and ensure asset security.

[0148] The second optimization order may refer to the order of determining the priority of each target optimization operation and maintenance information in the target optimization smart contract.

[0149] The attribute information of each target optimization smart contract can be queried through the address of the target optimization smart contract, and then the priority or importance order of each contract can be determined according to the attribute information of the contract and the optimization evaluation plan. For example, if some contracts have more core functions or are called more frequently, they can be ranked at a higher priority. Then, the corresponding business needs are determined according to the attributes of each contract, and the priority or importance order between the multiple operation and maintenance information involved in each contract is determined. For example, if the main optimization goal of a contract is to increase the processing speed, then the processing time may be the primary consideration. Then, the target optimization smart contract with high priority is processed first, that is, the target optimization operation and maintenance information of each target optimization smart contract with a higher ranking is matched with the corresponding optimization plan in the preset operation and maintenance information optimization plan according to the second optimization order according to the first optimization order, and the optimization plan of each target optimization operation and maintenance information of each target optimization smart contract is determined by analogy, and integrated into the target optimization plan.

[0150] In this solution, by determining the optimization order of the target smart contract and the target optimized operation and maintenance parameters, the optimization process of multiple smart contracts can be managed in an orderly manner, improving resource utilization and optimization effect.

[0151] Based on the above technical solution, optionally, after determining whether there are multiple target optimization smart contracts, the method further includes:

[0152] If there is a target optimization smart contract, obtain the target optimization operation and maintenance information corresponding to the target optimization smart contract; if there are multiple target optimization operation and maintenance information, determine the business requirements of the target optimization smart contract according to the attribute information of the target optimization smart contract;

[0153] Determine a third optimization order of each target optimization operation and maintenance information in the target optimization smart contract according to the business requirements;

[0154] Accordingly, a target optimization scheme is determined according to the target optimization smart contract, the target optimization operation and maintenance information, and a preset operation and maintenance information optimization scheme, including:

[0155] Determine a target optimization plan according to the target optimization smart contract, the third optimization order, the target optimization operation and maintenance information, and the preset operation and maintenance information optimization plan.

[0156] In this solution, the third optimization order can be the order of priority of each target optimization operation and maintenance information when there is only one target optimization smart contract and the target optimization smart contract contains multiple target optimization operation and maintenance information.

[0157] If there is a target optimization smart contract, query the target optimization operation and maintenance information of the target optimization smart contract. If there are multiple target optimization operation and maintenance information, query the attribute information of each target optimization smart contract through the address of the target optimization smart contract, and then determine the corresponding business needs according to the attributes of each contract, and determine the priority or importance order between the multiple target optimization operation and maintenance information involved in each contract. According to the priority of multiple target optimization operation and maintenance information, determine the third optimization order according to the priority, and match the corresponding optimization plan in the preset operation and maintenance information optimization plan in order, and finally form the target optimization plan of the target optimization smart contract according to the third optimization order and the corresponding optimization plan.

[0158] In this solution, by determining the optimization order of the target optimization operation and maintenance information, the optimization process of multiple operation and maintenance information can be managed in an orderly manner, thereby improving resource utilization and optimization effect.

[0159] S304, determining a target optimization plan according to the target optimization smart contract, the target optimization operation and maintenance information, and a preset operation and maintenance information optimization plan, optimizing the target optimization smart contract using the target optimization plan, and deploying the optimized target optimization smart contract to the blockchain.

[0160] The preset operation and maintenance information optimization scheme can be a strategy for optimizing the performance and efficiency of smart contracts. Specifically, it can include code optimization, that is, optimizing the smart contract code, reducing redundant or inefficient operations, and improving execution efficiency. Price adjustment, that is, adjusting prices according to consumption to improve execution efficiency or reduce costs. Algorithm improvement, that is, modifying the algorithm or logic in the smart contract to increase processing speed or reduce consumption. Resource allocation optimization, that is, adjusting the resource allocation of the smart contract to optimize processing time and consumption. Different operation and maintenance information can correspond to different optimization schemes.

[0161] For each parameter operation information, first match the corresponding threshold in the preset optimization standard. If there is parameter operation information below the corresponding threshold, the corresponding operation information is regarded as the target optimization operation information, and its corresponding target optimization smart contract is determined. Then, according to the target optimization smart contract, the target optimization operation information and the preset operation information optimization plan, the target optimization plan is determined, and the target optimization smart contract is optimized using the plan. Finally, the optimized target optimization smart contract is deployed to the blockchain.

[0162] In this embodiment, real-time monitoring of operation and maintenance information and comparison with preset optimization standards can promptly identify smart contracts with poor performance, reduce delays in problem resolution, and improve the overall operating efficiency of the blockchain.

[0163] On the basis of the above technical solution, optionally, after optimizing the target optimization smart contract using the target optimization solution, the method further includes:

[0164] Perform verification testing on the optimized target optimization smart contract; wherein the verification testing includes functional testing, status testing and security testing;

[0165] Accordingly, the optimized target optimization smart contract is deployed to the blockchain, including:

[0166] If the optimized target optimization smart contract meets the verification test standard, the verification test is determined to have passed, and the optimized target optimization smart contract is deployed to the blockchain.

[0167] In this solution, once it is detected that the target optimization smart contract has been optimized, the optimized target optimization smart contract is verified and tested. Specifically, the functional test can include verifying whether the functions of the smart contract are performed as expected, such as whether the various methods of the contract can be called and whether the parameters are processed correctly. The state test can verify whether the behavior of the smart contract in different states is as expected. Specifically, it can include whether the state transition is correct and whether the state update is accurate. Security testing can ensure that the smart contract can maintain security in various situations. Specifically, it can include checking whether there are vulnerabilities and risks. If the test standard is met, it can be deployed in the blockchain. Specifically, it can include sending the bytecode of the contract to the blockchain and creating a new contract instance on the blockchain. After the deployment is completed, it can be verified whether the contract has been successfully deployed on the blockchain network. Specifically, it can be verified through a blockchain browser or command line tool.

[0168] In this solution, by automatically determining the repair plan without manual intervention, the efficiency and accuracy of fault handling can be improved, and costs can be saved. After the repair is completed, the smart contract is verified and tested, which improves the reliability and stability of the system.

[0169] Embodiment 4

[0170] Figure 4 : is a schematic diagram of the structure of the smart contract group operation and maintenance information management system based on blockchain provided in the fourth embodiment of the present application, such as Figure 4 As shown, specifically including the following:

[0171] The faulty smart contract determination module 401 is used to obtain the address information of each smart contract in the smart contract group, search for the corresponding smart contract in the blockchain according to the address information, and monitor the operation and maintenance information of each smart contract in real time through a preset operation and maintenance information monitoring model. If abnormal operation and maintenance information is detected, it is determined whether there are multiple faulty smart contracts; wherein the operation and maintenance information includes transaction success rate, processing time, consumption, and number of contract calls;

[0172] The abnormal type determination module 402 is used to obtain abnormal operation and maintenance information of each faulty smart contract when it is determined that there are multiple faulty smart contracts, and determine the abnormal type of the abnormal operation and maintenance information according to the abnormal operation and maintenance information and a preset abnormal type table; wherein the number of the abnormal operation and maintenance information is at least one;

[0173] The contract repair module 403 is used to determine a first automatic repair scheme according to the abnormal type of the abnormal operation and maintenance information and a preset fault handling scheme, and automatically repair each faulty smart contract according to the first automatic repair scheme; wherein the first automatic repair scheme includes each faulty smart contract, the repair order of each faulty smart contract, and the repair method of each faulty smart contract, and the repair method includes an operation and maintenance operation sequence and repair parameters;

[0174] The contract deployment module 404 is used to detect the repair progress of each faulty smart contract in real time. If it is detected that all faulty smart contracts have been repaired, a verification test is performed on each repaired faulty smart contract. If each repaired faulty smart contract meets the preset verification test standard, it is determined that the verification test has passed, and each repaired faulty smart contract is deployed to the blockchain; wherein the verification test includes functional testing, status testing, and security testing.

[0175] In the embodiment of the present application, the faulty smart contract determination module is used to obtain the address information of each smart contract in the smart contract group, search the corresponding smart contract in the blockchain according to the address information, and monitor the operation and maintenance information of each smart contract in real time through a preset operation and maintenance information monitoring model. If abnormal operation and maintenance information is detected, it is determined whether there are multiple faulty smart contracts; wherein the operation and maintenance information includes transaction success rate, processing time, consumption and number of contract calls; the abnormal type determination module is used to obtain the abnormal operation and maintenance information of each faulty smart contract when it is determined that there are multiple faulty smart contracts, and determine the abnormal type of the abnormal operation and maintenance information according to the abnormal operation and maintenance information and a preset abnormal type table; wherein the number of the abnormal operation and maintenance information is at least one; the contract repair module is used to repair the faulty smart contract according to the abnormal operation and maintenance information. The first automatic repair scheme is determined according to the common type and the preset fault handling scheme, and each faulty smart contract is automatically repaired according to the first automatic repair scheme; wherein the first automatic repair scheme includes each faulty smart contract, the repair order of each faulty smart contract and the repair method of each faulty smart contract, and the repair method includes the operation and maintenance operation sequence and the repair parameter; the contract deployment module is used to detect the repair progress of each faulty smart contract in real time. If it is detected that all faulty smart contracts have been repaired, the repaired faulty smart contracts are verified and tested. If all the repaired faulty smart contracts meet the preset verification test standard, it is determined that the verification test is passed, and the repaired faulty smart contracts are deployed to the blockchain; wherein the verification test includes functional testing, status testing and security testing. Through the above-mentioned blockchain-based smart contract group operation and maintenance information management system, the repair scheme is automatically determined without manual intervention, which can improve the efficiency and accuracy of fault handling and save costs. And after the repair is completed, the smart contract is verified and tested, which improves the reliability and stability of the system. By determining the repair order, the faults can be prioritized according to their severity, improving resource utilization and repair efficiency.

[0176] The above are only preferred embodiments of the present application and the technical principles used. The present application is not limited to the specific embodiments described herein, and various obvious changes, readjustments and substitutions that can be made by those skilled in the art will not deviate from the scope of protection of the present application. Therefore, although the present application is described in more detail through the above embodiments, the present application is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present application, and the scope of the present application is determined by the scope of the claims.

[0177] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this application can be executed in parallel, sequentially or in different orders, as long as the expected results of the technical solution disclosed in this application can be achieved, and this document is not limited here.

Claims

1. A method for managing operation and maintenance information of a smart contract group based on blockchain, the method comprising: Obtain the address information of each smart contract in the smart contract group, search for the corresponding smart contract in the blockchain according to the address information, and monitor the operation and maintenance information of each smart contract in real time through the preset operation and maintenance information monitoring model. If abnormal operation and maintenance information is detected, determine whether there are multiple faulty smart contracts; If there is a faulty smart contract, obtain the abnormal operation and maintenance information of the faulty smart contract and the abnormal type of the abnormal operation and maintenance information; determine the second automatic repair plan according to the abnormal type and the preset fault handling plan, and automatically repair the faulty smart contract according to the second automatic repair plan; the second automatic repair plan includes the faulty smart contract, the operation and maintenance operation sequence and the repair parameters; detect the repair progress of the faulty smart contract in real time, if the repair is completed, verify and test the faulty smart contract, and if the verification test standard is met, the verification test passes; If there are multiple faulty smart contracts, obtain the abnormal operation and maintenance information of each faulty smart contract, and determine the abnormal type of the abnormal operation and maintenance information according to the abnormal operation and maintenance information and the preset abnormal type table; determine the first automatic repair plan according to the abnormal type and the preset fault handling plan, and automatically repair each faulty smart contract according to the first automatic repair plan; the first automatic repair plan includes each faulty smart contract, the repair order of each faulty smart contract and the repair method of each faulty smart contract, and the repair method includes the operation and maintenance operation sequence and repair parameters; detect the repair progress of each faulty smart contract in real time, if all are repaired, verify and test each repaired faulty smart contract, if all meet the verification test standards and pass the verification test, deploy each repaired faulty smart contract to the blockchain; Among them, operation and maintenance information includes transaction success rate, processing time, consumption and number of contract calls; verification tests include functional testing, status testing and security testing.

2. The method for managing operation and maintenance information of a smart contract group based on blockchain according to claim 1, characterized in that: After verifying and testing each of the repaired faulty smart contracts, the method further includes: If there is a faulty smart contract that has not been repaired and does not meet the preset verification test standards, the address information of the faulty smart contract is obtained and sent to the control center for the staff to repair the faulty smart contract until the faulty smart contract passes the verification test; wherein the number of the faulty smart contract is at least one, and the verification test includes functional testing, status testing and security testing.

3. The method for managing operation and maintenance information of a smart contract group based on blockchain according to claim 1, characterized in that: The operation and maintenance information of each smart contract is monitored in real time through the preset operation and maintenance information monitoring model. If abnormal operation and maintenance information is detected, it is determined whether there are multiple faulty smart contracts, including: Monitor the parameter operation information of each smart contract's operation and maintenance information in real time through the preset operation and maintenance information monitoring model; Compare the parameter operation information with the corresponding preset operation abnormality threshold, and if there is parameter operation information exceeding the corresponding preset operation abnormality threshold, determine that there is abnormal operation and maintenance information; Identify the number of abnormal operation and maintenance information. If multiple abnormal operation and maintenance information are identified, identify the faulty smart contracts corresponding to each abnormal operation and maintenance information to determine whether there are multiple faulty smart contracts.

4. The method for managing operation and maintenance information of a smart contract group based on blockchain according to claim 3 is characterized in that: After comparing the parameter operation information with the corresponding preset operation abnormality threshold, the method further includes: If there is no parameter operation information exceeding the corresponding preset operation abnormality threshold, the parameter operation information is compared with the preset optimization standard to determine whether there is parameter operation information meeting the preset optimization standard; If there is parameter operation information that meets the preset optimization standard, the corresponding operation and maintenance information is used as the target optimization operation and maintenance information, and the target optimization smart contract corresponding to the target optimization operation and maintenance information is determined; A target optimization scheme is determined according to the target optimization smart contract, the target optimization operation and maintenance information, and a preset operation and maintenance information optimization scheme, and the target optimization scheme is used to optimize the target optimization smart contract, and the optimized target optimization smart contract is deployed to the blockchain.

5. The method for managing operation and maintenance information of a smart contract group based on blockchain according to claim 4 is characterized in that: After determining the target optimization smart contract corresponding to the target optimization operation and maintenance information, the method further includes: Determine if there are multiple target optimization smart contracts; If there are multiple target optimization smart contracts, the attribute information of each target optimization smart contract is obtained, and the first optimization order of each target optimization smart contract is determined according to the attribute information and the preset contract optimization evaluation scheme; Obtain the target optimization operation and maintenance information corresponding to each target optimization smart contract. If there is a target optimization smart contract containing multiple target optimization operation and maintenance information, determine the business requirements of the target optimization smart contract according to the attribute information of the target optimization smart contract; Determine a second optimization order of each target optimization operation and maintenance information in the target optimization smart contract according to the business requirements; Accordingly, a target optimization scheme is determined according to the target optimization smart contract, the target optimization operation and maintenance information, and a preset operation and maintenance information optimization scheme, including: Determine a target optimization plan according to the first optimization sequence, the target optimization smart contract, the second optimization sequence, the target optimization operation and maintenance information, and the preset operation and maintenance information optimization plan.

6. The method for managing operation and maintenance information of a smart contract group based on blockchain according to claim 5 is characterized in that: After determining whether there are multiple target optimization smart contracts, the method further includes: If there is a target optimization smart contract, obtain the target optimization operation and maintenance information corresponding to the target optimization smart contract; if there are multiple target optimization operation and maintenance information, determine the business requirements of the target optimization smart contract according to the attribute information of the target optimization smart contract; Determine a third optimization order of each target optimization operation and maintenance information in the target optimization smart contract according to the business requirements; Accordingly, a target optimization scheme is determined according to the target optimization smart contract, the target optimization operation and maintenance information, and a preset operation and maintenance information optimization scheme, including: Determine a target optimization plan according to the target optimization smart contract, the third optimization order, the target optimization operation and maintenance information, and the preset operation and maintenance information optimization plan.

7. The method for managing operation and maintenance information of a smart contract group based on blockchain according to claim 4 is characterized in that: After optimizing the target optimization smart contract using the target optimization solution, the method further includes: Verify and test the optimized target optimization smart contract; Accordingly, the optimized target optimization smart contract is deployed to the blockchain, including: If the optimized target optimization smart contract meets the verification test standard, the verification test is determined to have passed, and the optimized target optimization smart contract is deployed to the blockchain.

8. The method for managing operation and maintenance information of a smart contract group based on blockchain according to claim 1, characterized in that: The construction process of the operation and maintenance information monitoring model includes: Acquire historical operation and maintenance information and corresponding historical parameter operation information when an abnormal situation occurs, and create a data set according to the historical operation and maintenance information and the corresponding historical parameter operation information; Build an operation and maintenance information monitoring model; The data set is input into the operation and maintenance information monitoring model for training, and the training is stopped until the network converges, thereby obtaining a trained operation and maintenance information monitoring model with network parameters.

9. A blockchain-based smart contract group operation and maintenance information management system, characterized in that: The system is used to execute the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Verification method and device based on block chain smart contract

    CN114780944A

  • Intelligent contract vulnerability detection method and device and electronic equipment

    CN116910759A