Blockchain-based methods for operation and maintenance work order storage and full-process traceability management
By constructing a three-stage evidence storage architecture, the problems of invalid data solidification and single traceability dimension in operation and maintenance work order evidence storage are solved, realizing efficient and multi-dimensional operation and maintenance work order evidence storage and traceability, and ensuring the immutability and credibility of data.
Patent Information
- Application Number
- CN202611400243.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-10
- Publication Date
- 2026-11-17
- Estimated Expiration
- 2046-09-10
AI Technical Summary
Existing technologies lack a phased design for review and solidification in the storage of maintenance work orders, resulting in the solidification of invalid status data and a single traceability dimension, leading to low efficiency.
A three-stage progressive architecture of temporary evidence storage, candidate evidence storage, and final evidence storage is constructed. Temporary and candidate evidence storage records are generated through verification by a single confirmation node and review by multiple confirmation nodes. These records are then confirmed through consensus on the blockchain network and finally written into the main chain and fingerprint index side chain to form a traceability chain.
It effectively avoids the solidification of invalid state data, realizes multi-dimensional operation and maintenance auditing and efficient traceability, and ensures the immutability and reliability of data.
Smart Images

Figure CN122926510B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of blockchain data storage technology, and in particular to a blockchain-based method for storing and managing maintenance work orders and achieving full-process traceability. Background Technology
[0002] As enterprises become increasingly digitalized, maintenance work orders, as the core carrier of maintenance operations, have become crucial for security compliance and accountability through complete recording and traceable auditing of status changes. Blockchain technology, with its decentralized and immutable characteristics, offers a new technological path for the reliable storage of maintenance data. Currently, related solutions mainly follow two paths: one is to directly store maintenance operation records on the blockchain; the other is to embed hash associations of status changes into blockchain transactions, constructing temporal associations through chained references of transaction hash values. However, neither of these solutions resolves the structural contradiction between the flexibility of evidence storage and auditing and the irreversibility of evidence storage.
[0003] Taking patent application CN112712433B, "A Data State Management and Query Method and Blockchain Device Based on Blockchain," as an example, this technical solution achieves hash association by setting the hash value of the previous state change transaction in the transaction. Blockchain nodes verify the state change based on preset operation rules, and the transaction is considered successful once the verification is passed. However, its state change verification and on-chaining are the same process. Once a transaction is on the chain, it cannot be removed, lacking a business-level pre-approval mechanism. It cannot prevent the solidification of invalid state data, and the verification dimensions are limited to data format and state migration path, without involving multi-dimensional verification such as operator permissions and the business integrity of state data. In addition, the chain association achieved through transaction hash values is at the transaction level, not a verifiable traceable chain at the state data level. Verification of the integrity of historical states requires traversing all transactions, which is inefficient.
[0004] Taking patent application CN121997383A, "Method and System for Auditing Operations of Computing Servers Based on Blockchain and IoT," as an example, this technical solution constructs a structured event chain by uniformly collecting operation and maintenance behaviors, and then sequentially uploads the data to the chain for evidence storage after digital signature, forming a chain of responsibility evidence. However, it lacks an independent review mechanism before evidence storage. All collected data is uploaded to the chain regardless of its business validity, resulting in a large amount of invalid evidence on the chain. Furthermore, it only supports vertical tracing by time dimension and does not establish horizontal correlation indexes across work orders and operators. Multi-dimensional tracing requires traversing the entire amount of on-chain data. Summary of the Invention
[0005] The purpose of this section is to outline some aspects of the embodiments of the present invention and to briefly introduce some preferred embodiments. Some simplifications or omissions may be made in this section, as well as in the specification abstract and the title of the invention, to avoid obscuring the purpose of this section, the specification abstract, and the title of the invention. Such simplifications or omissions shall not be used to limit the scope of the invention.
[0006] In view of the common technical problems of existing technologies, such as the lack of a phased design for the review and solidification process and the single traceability dimension, this invention is proposed.
[0007] To address the aforementioned technical problems, this invention provides the following technical solution: In response to a status change event of an operation and maintenance work order, the current status data of the operation and maintenance work order is written into a temporary notarization area. A single confirmation node verifies the current status data. Upon successful verification, a temporary notarization record is generated. During the generation of the temporary notarization record, the operation fingerprint corresponding to the status change event is extracted and persistently stored. The current status data is copied into a candidate notarization area. Multiple pre-designated confirmation nodes review the current status data. Upon successful review, the anchor hash value of the current status data is calculated, generating a candidate notarization record. The candidate notarization record is submitted to the blockchain network for consensus confirmation. The transaction hash value corresponding to the candidate notarization record is obtained as the status node hash. Upon successful consensus, the candidate notarization record is written into the blockchain main chain, and the operation fingerprint is associated with the status node hash and written into the fingerprint index side chain. The status node hash is stored as the pre-anchor field of the next status change event in the next candidate notarization record, forming a traceability chain sequentially linked based on the status node hash.
[0008] In a preferred embodiment of the present invention, the verification includes data format verification, timestamp validity verification, and state transition path validity verification; the individual confirmation node is dynamically selected by the system based on the hash value of the work order identifier modulo the length of the confirmation node list.
[0009] In a preferred embodiment of the present invention, the audit includes a status data consistency audit, an operation permission legality audit, and a status migration business rule audit; if the status data consistency audit, the operation permission legality audit, and the status migration business rule audit all pass, the audit is deemed to have passed.
[0010] As a preferred embodiment of the present invention, the current state data in the temporary evidence storage area remains in its original storage state until the preset retention period expires and then is automatically cleared.
[0011] As a preferred embodiment of the present invention, the state node hash is the transaction hash value of the transaction corresponding to the candidate evidence record on the main blockchain, and the transaction hash value serves as the final on-chain evidence index of the candidate evidence record after consensus confirmation and writing to the main blockchain.
[0012] In a preferred embodiment of the present invention, the fingerprint index sidechain is an independent subchain anchored to the main blockchain; the block header of the fingerprint index sidechain includes a main chain anchoring field, which is used to store the state node hash value of the main blockchain to achieve cross-chain anchoring.
[0013] In a preferred embodiment of the present invention, the consensus node of the fingerprint index sidechain obtains the latest confirmed state node hash value from the blockchain main chain through a cross-chain read interface and writes it into the block header of a new block of the fingerprint index sidechain.
[0014] In a preferred embodiment of the present invention, when a rollback is detected in the main blockchain, the fingerprint index sidechain marks the hash of the anchored but rolled-back abandoned state node as rolled-back, and re-anchors the latest block of the current sidechain with the latest state node hash value of the main chain after the rollback.
[0015] As a preferred embodiment of the present invention, the fingerprint index sidechain constructs a key-value index using the operation fingerprint as the key and the status node hash as the value. When the same operation fingerprint corresponds to multiple status node hashes, they are arranged in ascending order according to the status change timestamp. The operation fingerprint is used to uniquely identify the executing entity and operation context of this status change operation. The fingerprint index sidechain is used to support cross-work order traceability retrieval based on operation behavior.
[0016] As a preferred embodiment of the present invention, the verification of the traceability chain includes: starting from the latest status node hash of the maintenance work order, querying and obtaining the corresponding candidate evidence record from the blockchain main chain, parsing the preceding anchor field and anchor hash value stored in the candidate evidence record; recursively querying the previous candidate evidence record using the parsed preceding anchor field as a query index until the preceding anchor field is equal to the initial anchor root value; during the recursive process, concatenating the preceding anchor field in the current candidate evidence record with the current status data and performing a hash operation, comparing the operation result with the anchor hash value recorded in the current candidate evidence record; if all candidate evidence records pass the verification, the traceability chain is determined to be complete.
[0017] The beneficial effects of this invention are as follows: By constructing a three-stage progressive architecture of temporary evidence storage, candidate evidence storage, and final evidence storage, this invention embeds the business review process into the evidence storage process. Status changes that fail the review in the candidate evidence storage stage do not enter the final evidence storage, effectively preventing invalid state data from being solidified into the blockchain. This fundamentally solves the structural contradiction between the irreversibility of evidence storage and the flexibility of operation and maintenance review. Furthermore, by decoupling the anchor hash value calculated off-chain from the hash of the state node stored on-chain, it not only utilizes the off-chain hash chain to achieve efficient traceability and verification at the business level, but also relies on on-chain evidence storage to provide tamper-proof ownership protection. Any tampering with historical state data will be immediately detected due to hash verification failure.
[0018] In addition, by constructing a fingerprint index sidechain independent of the main chain, this invention establishes a horizontal association index across work orders using operation fingerprints as keys, thereby achieving dual traceability capabilities of vertical full-process and horizontal full association. This significantly improves the efficiency of multi-dimensional query and compliance inspection in operation and maintenance audits while ensuring the credibility of the stored evidence data. Attached Figure Description
[0019] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort. Wherein: Figure 1 This is a flowchart of the temporary evidence storage and verification stage as shown in this invention.
[0020] Figure 2 This is a flowchart illustrating the candidate evidence storage and review stages of this invention.
[0021] Figure 3 This is a flowchart illustrating the formation stage of the blockchain evidence storage and traceability chain as shown in this invention. Detailed Implementation
[0022] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, the specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments.
[0023] Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without inventive effort should fall within the scope of protection of this invention.
[0024] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and those skilled in the art can make similar extensions without departing from the spirit of the invention. Therefore, the invention is not limited to the specific embodiments disclosed below.
[0025] According to an embodiment of the present invention, in combination Figures 1-3 The flowchart shown illustrates a blockchain-based method for maintaining and recording maintenance work orders and ensuring full-process traceability, including: S1: In response to a status change event in an operation and maintenance work order, the current status data of the work order is written to a temporary notarization area. A single confirmation node verifies the current status data. If the verification is successful, a temporary notarization record is generated. During the generation of the temporary notarization record, the operation fingerprint corresponding to the status change event is extracted and persistently stored. S2: The current status data is copied to a candidate notarization area. Multiple pre-designated confirmation nodes review the current status data. If the review is successful, the anchor hash value of the current status data is calculated, and a candidate notarization record is generated. S3: The candidate notarization record is submitted to the blockchain network for consensus confirmation. The transaction hash value corresponding to the candidate notarization record is obtained as the status node hash. After consensus is achieved, the candidate notarization record is written to the main blockchain, and the operation fingerprint is associated with the status node hash and written to the fingerprint index sidechain. S4: The status node hash is stored as the pre-order anchor field of the next status change event in the next candidate notarization record, forming a traceability chain linked sequentially based on the status node hash.
[0026] The operation fingerprint is used to uniquely identify the executing entity and operation context of this status change operation, and the fingerprint index sidechain is used to support cross-work order traceability retrieval based on operation behavior.
[0027] In some embodiments, the blockchain-based operation and maintenance work order storage and full-process traceability management method provided by the present invention includes the following steps in step S1: Step S101: In response to the status change event of the maintenance work order, extract the work order identifier, target status data, operator identifier and status change timestamp carried by the status change event.
[0028] It should be noted that the status change event is an event notification proactively pushed to this evidence storage system by the work order system through the application programming interface when it detects that the maintenance personnel have performed a status reversal operation on the work order. The status change event carries at least the work order identifier, the operator identifier, the target status data after the reversal, and the event trigger time. The current status data is the target status data after the reversal, and its type is the status enumeration value under the corresponding maintenance work order business type, such as, but not limited to, pending, processing, pending acceptance, completed, rejected, etc.
[0029] The status change timestamps are provided uniformly by the system time service. As one implementation, the system time service synchronizes with the standard time source based on the Network Time Protocol (NTP) to ensure time consistency across the entire system.
[0030] In some embodiments, when the same maintenance work order undergoes multiple status changes within a preset time precision, the status change timestamp is automatically appended with an incrementing sequence number generated by a system counter. The system counter is a globally incrementing counter to ensure that the timestamps generated by different work orders within the system are unique under the same time precision.
[0031] The system counter is a persistent counter, and its current value is persistently stored in the system database after each allocation. When the system restarts, the previously saved counter value is read from the persistent storage and incremented again to ensure the continuity and uniqueness of the sequence number before and after the system restart, and to avoid timestamp hash collisions caused by counter reset.
[0032] The preset time precision is at the millisecond level. That is, if the same work order undergoes multiple status changes within the same millisecond, an incrementing sequence number (such as -01, -02, etc.) will be appended to the end of the timestamp of each change starting from the second one. This ensures that the status change timestamps of the same work order under the same time precision are unique and avoids hash collisions.
[0033] The incrementing sequence number and the status change timestamp are combined to form a complete timestamp field. In subsequent steps S102, when combining the temporary evidence data packets, and in step S204, when concatenating them for hash calculation, the complete timestamp field carrying the incrementing sequence number is used as the value of the status change timestamp.
[0034] Step S102: Combine the current status data, work order identifier, and complete status change timestamp carrying an incrementing sequence number into a temporary evidence storage data packet, and write the temporary evidence storage data packet into the temporary evidence storage area.
[0035] In some embodiments, the temporary storage area is a cache area designated in the system memory, or a separately deployed key-value database (such as Redis), used to temporarily store state change data that has not yet been fully verified.
[0036] Step S103: A single confirmation node reads the temporary evidence data packet and verifies the temporary evidence data packet.
[0037] In some embodiments, a single confirmation node is dynamically selected by the system based on the hash value of the work order identifier modulo the length of the confirmation node list, so as to ensure that the status change request of the same work order is processed by the same confirmation node and to ensure the consistency of the verification status. The confirmation node list is a fixed list pre-configured during system initialization, arranged lexicographically by the IDs of each confirmation node. Once determined, the list remains unchanged during system operation. Each confirmation node has an online or offline status. A confirmation node in the online status is one that sends a heartbeat response to the system master node within a preset heartbeat timeout threshold (e.g., within 30 seconds) and is not marked as offline. The modulo operation targets the fixed node list, not the current number of online nodes. When the confirmation node hit by the modulo operation is offline, the system starts from the next position after the hit node in the fixed list and searches sequentially according to lexicographical order, selecting the first online confirmation node as the confirmation node for this verification. If no online node is found after traversing to the end of the fixed list, the traversal continues from the beginning of the list until it returns to the next position after the hit node. If no online confirmation node is found after traversing all nodes in the fixed list, it is determined that there is no available confirmation node, the status change verification process is terminated, and an error response indicating that the confirmation node is unavailable is returned to the work order system.
[0038] The system maintains the online status record of each confirmation node through a periodic heartbeat detection mechanism. When the original confirmation node hit by the modulo operation recovers from the offline state to the online state, the system will reassign the status change verification of the same work order (i.e., with the same work order identifier) to the original confirmation node to ensure the stability of the modulo mapping relationship. The alternative confirmation node temporarily selected during the offline period of the original confirmation node will only undertake the verification task when the original confirmation node is offline.
[0039] The verification includes data format verification, timestamp validity verification, and state transition path validity verification.
[0040] Specifically, data format validation is used to verify whether the work order identifier conforms to the preset numbering rules and whether the current status data is a preset valid status enumeration value. As one embodiment, the preset numbering rules are the numbering formats defined by the work order system, such as YYYYMMDD-XXXXX or REGION-TYPE-SEQUENCE format, and regular expression matching is used during validation. The preset valid status enumeration value is the set of all allowed status values for that work order type. For example, for the work order type "Equipment Repair," the valid status enumeration value is {Pending Dispatch, Accepted, Under Repair, Pending Acceptance, Completed, Cancelled}. During validation, the current status data is compared with the set; if they match, the validation passes; otherwise, the format is deemed invalid.
[0041] Furthermore, the timestamp validity check verifies whether the difference between the state change timestamp and the current system time is within a preset error threshold range. In some embodiments, the preset error threshold range is ±5 seconds. This threshold is set based on the synchronization accuracy of the system time service (NTP). If the system time service synchronization accuracy is within ±1 second, the threshold is set to ±5 seconds to account for network transmission latency. If the timetamp exceeds this threshold, it is determined to be invalid, thus preventing replay attacks using expired or forged timestamps. By validating the state change timestamps, replay attacks on historical state change data and the risk of clock tampering can be effectively prevented.
[0042] The state transition path validity check is used to verify whether the transition path from the previous state to the current state is in a preset state transition path table when a maintenance work order has a previous state record. In some embodiments, the preset state transition path table is a directed acyclic graph defined in the work order system configuration, with states as nodes and valid transition paths as directed edges, such as pending → processing, processing → pending acceptance, pending acceptance → completed, processing → rejected, rejected → pending. The state transition path validity check is implemented by querying whether there is a directed edge in the directed graph pointing from the previous state node to the current state node. When the maintenance work order is created for the first time and there is no previous state record, the state transition path validity check is skipped.
[0043] It should be noted that the previous status record is the previous business status of the operation and maintenance work order on the work order system side. It is used for the legality verification of the state transition path at the business level. It is different from the previous final evidence record that has been completed on the chain on the evidence storage system side. The two serve two different purposes: business rule verification and chain hash association, respectively.
[0044] Step S104: If all three verifications above pass, the temporary evidence data packet is deemed to have passed verification, a temporary evidence record is generated, and the status of the temporary evidence record is marked as temporarily effective.
[0045] If any of the data format validation, timestamp validity validation, or state transition path validity validation fails, the validation is deemed unsuccessful, the generation of a temporary evidence record is refused, the evidence storage process for this state change is terminated, and an error response containing the reason for failure is returned to the work order system. As one example, the reason for failure is returned in a structured data format, such as JSON: {"code":"VALIDATION_FAILED","reason":"Illegal state transition path: Pending → Completed","failed_item":"state_migration"}.
[0046] In some embodiments, temporary evidence records are stored in key-value pairs, where the key is a combination of the work order identifier and the status change timestamp, and the value is the current status data, the verification pass flag, and the verification time. After being generated, temporary evidence records are stored in the temporary evidence storage area, awaiting processing in the candidate evidence storage stage.
[0047] Step S105: At the same time or after generating the temporary evidence record, extract the operation fingerprint corresponding to the state change event and persistently store the operation fingerprint in the system database.
[0048] If the status change evidence storage process corresponding to the temporary evidence storage record fails and terminates during the verification or audit phase, the operation fingerprint that has been persistently stored in step S105 is marked as evidence storage failure in the system database, and the failure timestamp and failure reason are recorded for subsequent operation and maintenance audits to trace the evidence storage failure reason.
[0049] Specifically, fingerprint extraction includes the following sub-steps: Step S1051: Collect an operation-related information set from the status change event. This set includes at least: the operator's identifier for executing the current status change event, the operator's digital certificate serial number, the IP address of the operating terminal, the operation occurrence time, the operation type code for this status change, and the work order identifier of the maintenance work order. The operator's identifier originates from the digital signature certificate carried by the status change event. This digital signature certificate is issued by a unified certificate authentication center within the system, ensuring that the operator's identifier used in the operation permission legitimacy verification and the operator's identifier used to generate the operation fingerprint originate from the same trusted identity authentication system.
[0050] Once the mapping relationship between operator identifiers and operation fingerprints is written into the system database, it is marked as undeletable and unmodifiable to ensure long-term traceability. Changes in the status of an operator's digital certificate (such as certificate expiration or revocation) do not affect the personnel-level retrieval capability of the stored operation fingerprints. When searching, the operator identifier is used as the query condition, and the system maps it to the corresponding operation fingerprint and then queries it in the fingerprint index side chain.
[0051] Step S1052: Combine the fields in the collected operation association information set into a string according to the preset concatenation order. The preset concatenation order is: work order identifier | operator identifier | digital certificate serial number | IP address | operation occurrence time | operation type code, where "|" is the separator.
[0052] Step S1053: Input the concatenated string into a cryptographic hash function for hash operation to obtain a fixed-length hash value as the operation fingerprint.
[0053] It should be noted that the operation fingerprint is persistently stored after the temporary evidence record is generated. The operation fingerprint that passes the review and achieves successful consensus is written into the fingerprint index sidechain to achieve on-chain evidence storage; the operation fingerprint that fails the review or consensus is retained in the system database for off-chain traceability query during operation and maintenance audit.
[0054] In some embodiments, the blockchain-based operation and maintenance work order storage and full-process traceability management method provided by the present invention includes the following steps in step S2: Step S201: After the temporary evidence record is generated, the system copies the current status data in the temporary evidence area to the candidate evidence area.
[0055] It should be noted that copy-write is used here instead of cut-and-paste. The current status data in the temporary evidence storage area remains in its original storage state until the preset retention period expires, after which it is automatically cleaned up. The preset retention period is calculated from the time the temporary evidence record is generated, and the preset retention period is longer than the estimated maximum time required to perform candidate evidence review. For example, it can be set based on the P99 quantile of historical review times, or configured by the system administrator to a fixed value, such as 24 hours, to ensure that the current status data can be used for consistency verification during the review process.
[0056] If the review process is blocked due to an abnormality and fails to complete within the preset retention period, the temporary evidence record will be cleared, and the corresponding status change evidence process will automatically terminate because it cannot complete the status data consistency review, and a timeout error will be returned to the work order system.
[0057] It is evident that the retention of data in the temporary evidence storage area provides a redundant window for fault recovery and data traceability, avoiding the loss of original data due to abnormalities in the candidate evidence storage area review process.
[0058] In step S202, multiple confirmation nodes independently review the current status data in the candidate evidence storage area.
[0059] In some embodiments, the multiple confirmation nodes consist of three confirmation nodes. These three confirmation nodes are pre-authorized master audit nodes in the blockchain network, maintained by different business audit entities (such as operations manager, security auditor, and quality manager) to form a multi-party checks and balances audit mechanism. Each of the three confirmation nodes independently reads the current state data and associated temporary evidence storage data packets from the candidate evidence storage area and executes the following audit process. The audit process of any one node is unaffected by interference or influence from other nodes.
[0060] Before calling the confirmation nodes to perform the audit, the system first checks the online status of each confirmation node: the system sends a heartbeat detection request to each confirmation node, and confirmation nodes that receive a heartbeat response within a preset heartbeat timeout threshold (e.g., 30 seconds) and are not marked as offline are considered as online and available nodes; for confirmation nodes that do not respond within the preset heartbeat timeout threshold, the system marks them as temporarily offline and records the offline timestamp.
[0061] If a temporary offline node exists among the three confirmation nodes, the system waits for a preset waiting time (e.g., 60 seconds) and then checks again. If all nodes return to online within the preset waiting time, the review process continues. If an offline node still exists after the timeout, the system attempts to select a temporary replacement node from the pre-configured pool of alternative review nodes according to their priority order to replace the offline node in the review. If there are no available nodes in the pool of alternative review nodes, the system terminates the current evidence storage process and returns a review failure response containing the offline node identifier to the work order system.
[0062] The single confirmation node performing verification and the multiple confirmation nodes performing audit are different sets of nodes. The single confirmation node is dynamically selected from the list of confirmation nodes pre-configured during system initialization, while the multiple confirmation nodes are a pre-specified fixed set of audit nodes. The two are configured separately during system initialization and maintained independently.
[0063] The three verification nodes are pre-assigned by the system during initialization based on the roles configured for the business auditing entities. The identity information and public key certificates of each verification node are pre-stored in the system configuration database. When the system invokes a verification node to perform an audit, it calls the audit service interface of each verification node according to the node list in the configuration database. Each of the three verification nodes is maintained by a different business auditing entity (e.g., operations manager, security auditor, quality administrator) with its own independent audit service instance.
[0064] The audit includes auditing the consistency of status data, the legality of operation permissions, and the business rules for status migration. The consistency verification of status data includes verifying whether the current status data in the candidate evidence storage area is completely consistent with the current status data in the temporary evidence storage data packet. Specifically, the hash value of the current status data in the candidate evidence storage area is compared byte by byte with the hash value of the current status data in the temporary evidence storage data packet. If they are consistent, the verification is successful; otherwise, it is determined that the data has been tampered with or that a transmission error has occurred during the copying and association process.
[0065] It should be noted that by verifying the consistency of data in both zones, errors or malicious tampering can be effectively prevented during the transmission of data between the temporary evidence storage area and the candidate evidence storage area, thus ensuring the integrity and authenticity of the evidence storage data.
[0066] The operation permission validity verification includes verifying whether the operator executing the status change event has the permission to change the status. The operator identifier used for operation permission validity verification is the same identifier used to generate the operation fingerprint in step S105, and both originate from the digital signature certificate carried by the status change event.
[0067] As one embodiment, the system has a preset operator permission table. This permission table is indexed by the operator's identifier and records the operator's permission flags for different status change operations under different work order types. During the review, the system checks whether the operator has the operation permission to change the current work order from the previous status to the current status. If the operator has the permission, the review is approved; otherwise, the operator is deemed to have insufficient permissions.
[0068] The review of status transition business rules includes: verifying whether the current status data meets the predefined status constraints for the corresponding business type of the maintenance work order. The status constraints are additional verification rules based on the business type. For example, for a maintenance work order of equipment replacement type, it verifies whether the current status data contains the replaced equipment asset number and the old part replacement processing record when the status changes to completed. If the necessary additional data is missing, the business rule review is deemed unsuccessful.
[0069] Among them, the state constraints are stored in the system configuration database in the form of rule scripts. The rule scripts are written in scripting languages such as Groovy or JavaScript. The system dynamically loads and executes the rule scripts through the script engine to complete the verification.
[0070] System administrators can add, modify, or delete status constraints through the management interface. The modified rule scripts are stored in the system configuration database after the version number is incremented. The system reads the latest version of the rule script each time it performs a status migration business rule review, and the new rules can take effect without restarting the system.
[0071] Among them, maintenance work orders of different business types (such as equipment repair, equipment replacement, system upgrade, network change, etc.) are configured with corresponding sets of status constraints. The system queries the configuration database and loads the corresponding rule scripts to perform verification based on the business type of the current maintenance work order.
[0072] After each confirmation node completes all the above review items, the system summarizes the review conclusions of each node; if all participating nodes determine that the review is passed, the review result is passed; if any node determines that the review is failed, the review result is failed; if the review fails, the evidence storage process for this status change is terminated, and a review failure response is returned to the work order system.
[0073] After each confirmation node completes all the above review items and determines that all items have passed, it uses its own private key to digitally sign the review result data, generating a review signature. The review result data must include at least the current status data, the work order identifier, the status change timestamp, and the review conclusions of each confirmation node. Each confirmation node returns its generated review signature to the system. The system collects all three review signatures and stores them together for use in generating candidate evidence records later.
[0074] It should be noted that the state transition business rule review combines the underlying state flow with the compliance of the high-level business, ensuring that the state changes carried by the evidence record are also legal and valid in terms of business semantics, and avoiding the defect of incomplete business data due to path verification alone.
[0075] Step S203: If any confirmation node returns a failure signal, mark the current status data in the candidate evidence storage area as failure, record the node identifier and reason for failure of the confirmation node that returned the failure signal, terminate the evidence storage process for this status change, and return an audit failure response containing a summary of audit results to the work order system.
[0076] In some embodiments, the audit results are summarized as structured data, which includes the audit conclusion (pass / fail) of each confirmation node, the identifier of the failed node and its corresponding failure reason code.
[0077] It can be seen that by recording the detailed review results of all review nodes and returning the summary information to the work order system, it is easier for maintenance personnel to quickly locate the specific reasons for review failures and improve the efficiency of manual intervention.
[0078] Step S204: If all confirmed nodes have passed the review, the system calculates the anchor hash value of the current status data.
[0079] Specifically, the preceding anchor field corresponding to the previous final evidence record of the maintenance work order is read, and the preceding anchor field and the standardized byte sequence of the current status data are concatenated in a preset order and then hashed to obtain the anchor hash value.
[0080] The standardized byte sequence of the current status data is generated by the serialization rules uniformly configured during system initialization. The serialization rules use the exact same serialization method as the byte sequence read by each confirmation node when reviewing the current status data in step S202. As one example, the serialization rule is: after arranging the current status data alphabetically by field name, it is serialized into a byte array using a UTF-8 encoded JSON compact format (without extra spaces or newlines between fields).
[0081] Hash operations are performed directly using standardized byte sequences to ensure that the byte data on which the hash operation is based is completely consistent with the byte data verified by each node during the audit phase.
[0082] The preset order is configured uniformly by the system during initialization. All status change records of the same maintenance work order must be spliced in the same preset order throughout the entire lifecycle to ensure that the calculation method of all anchored hash values in the traceability chain is consistent and reproducible.
[0083] As one embodiment, the concatenation method involves using the preceding anchor field as a prefix and the serialized byte stream of the current status data as a suffix for byte-level concatenation. If the maintenance work order is the first time it has been stored and there is no previous final storage record, the preceding anchor field is taken from the system's preset initial anchor root value. The concatenated byte sequence is then input into a hash function for computation.
[0084] The length of the anchor hash value is consistent with the output length of the hash algorithm used (for example, the output is 32 bytes when using the SHA-256 algorithm).
[0085] If the maintenance work order is the first time it is registered and there is no previous final registration record, the preceding anchor field is taken from the system's preset initial anchor root value. The initial anchor root value is set once during system initialization and remains unchanged during system operation. As one example, the initial anchor root value is a fixed-length hash value (e.g., a 32-byte hash value output using the SHA-256 algorithm) obtained by concatenating the system's unique identifier (such as the globally unique instance ID assigned during system deployment) with the initialization timestamp during system initialization. This hash value is persistently stored in the system configuration database for all maintenance work orders registered for the first time to share and reference. After the same system restarts at different times, the generated initial anchor root value remains consistent because the system's unique identifier remains unchanged, ensuring the integrity of the traceability chain before and after the system restart.
[0086] When there are multiple deployment instances in the system (such as primary and backup data centers or development, testing, and production environments), the initial anchor root values of all instances are uniformly distributed by the system configuration center to ensure the consistency of the initial anchor root values between different instances, so as to support cross-instance data traceability and backup recovery scenarios.
[0087] If the current business status of an operation and maintenance work order has changed, but the corresponding evidence storage record fails to generate the previous final evidence storage record due to failure of review or consensus failure, then when the next status change triggers the evidence storage process, the system will use the last successfully uploaded final evidence storage record as the previous final evidence storage record, and the preceding anchor field will be taken from the corresponding value of that record. The business status on the work order system side and the evidence storage status on the evidence storage system side are maintained independently, and the two maintain eventual consistency in business logic, but intermediate inconsistent states are allowed during the failure of the evidence storage process.
[0088] It should be noted that by concatenating the previous anchor field (i.e. the on-chain hash value of the previous state) with the current state data and performing a hash operation, a hash chain structure is formed. Any tampering with any historical state data will cause a cascading change in all subsequent anchor hash values. This allows any tampering with the proven historical data to be detected by recalculating the hash value level by level along the traceability chain, thus achieving full-process traceability and verification.
[0089] Step S205: Generate candidate evidence records.
[0090] In some embodiments, the candidate evidence record is a structured data packet, containing at least the following data fields: work order identifier, standardized byte sequence of current status data, anchor hash value, previous anchor field (i.e., the status node hash or initial anchor root value corresponding to the previous final evidence record), status change timestamp, operator identifier associated with the status change event, and the audit signature of each of the three confirmation nodes. The standardized byte sequence of the current status data is completely consistent with the byte sequence used for hash calculation in step S204, ensuring a verifiable correspondence between the status data carried in the candidate evidence record and the hash calculation result.
[0091] After serializing the data packet containing the above fields into a preset format (such as JSON or Protocol Buffers), a candidate evidence record is generated for subsequent submission to the blockchain network for consensus confirmation. The beneficial effect is that by incorporating the anchor hash value and preceding anchor fields into the candidate evidence record data structure, the candidate evidence record itself carries all the relevant information for chain-like tracing. The blockchain main chain only needs to store the transaction hash value corresponding to this record to achieve complete tracing, eliminating the need for additional storage of work order business data and reducing the storage overhead of the blockchain main chain.
[0092] In some embodiments, the blockchain-based operation and maintenance work order storage and full-process traceability management method provided by the present invention includes the following steps in step S3: Step S301: Submit the candidate evidence record to the blockchain network.
[0093] In some embodiments, the system encapsulates candidate evidence records into blockchain transactions, and the data payload of the transaction contains a serialized byte stream of all data fields of the candidate evidence records.
[0094] In some embodiments, if the data volume of the serialized byte stream of the candidate evidence record exceeds the transaction data payload limit allowed by the blockchain network, the candidate evidence record is stored in an off-chain distributed storage system, and the hash value of the storage address of the candidate evidence record in the distributed storage system is used as the data payload of the transaction.
[0095] The distributed storage system includes the InterPlanetary File System (IPFS) or similar decentralized storage protocols. The system retrieves complete candidate evidence records from the distributed storage system by addressing the storage address hash value. For IPFS, the storage address hash value is the Content Identifier (CID). The system uses the CID to call the IPFS get operation to pull the original data block from the distributed nodes. The distributed storage system adopts a multi-replica storage strategy, storing candidate evidence records on at least three different storage nodes, with each storage node belonging to a different fault domain, to ensure data redundancy and high availability. The retention period of candidate evidence records in the distributed storage system is consistent with the retention period of the corresponding evidence records on the blockchain main chain, to ensure long-term traceability.
[0096] While storing candidate evidence records in the distributed storage system, the system maintains a mapping table in the local system database between the hash values of off-chain storage addresses and the hash values of state nodes. This mapping table uses the state node hash as the primary key and the storage address hash value and storage timestamp as fields, providing auxiliary recovery clues when retrieval in the distributed storage system fails. Records in the mapping table are only marked as valid after receiving an on-chain confirmation message from the blockchain main chain. If off-chain storage fails or on-chain confirmation times out, the entire record is rolled back and added to the retry queue.
[0097] If retrieval from the distributed storage system fails, the system automatically retryes three times, with retry intervals increasing exponentially (1 second, 2 seconds, 4 seconds). If all retries fail, the system checks the storage timestamp of the candidate evidence record according to the local mapping table. If the storage time is within a preset recoverable window (e.g., within 30 days), a data recovery task is triggered to attempt to recover the candidate evidence record from other storage copies or backup media. If the storage time exceeds the recoverable window or the recovery task fails, the candidate evidence record is determined to be unrecoverable, the traceability verification is terminated, and a structured error report containing the work order identifier, status node hash, and failure reason is returned. When using off-chain distributed storage, the transaction data payload is the storage address hash value of the candidate evidence record in the distributed storage system. The transaction hash value is the transaction hash value obtained after hashing the transaction containing the storage address hash value as the data payload through the blockchain network. This transaction hash value serves as the status node hash of the candidate evidence record on the blockchain main chain.
[0098] Step S302: After submission, obtain the hash of the state node corresponding to the candidate evidence record.
[0099] It should be noted that the state node hash is the transaction hash value of the evidence storage transaction corresponding to the candidate evidence storage record on the main blockchain. This transaction hash value is generated and returned by the blockchain network when the candidate evidence storage record is submitted to the blockchain network. In some embodiments, after receiving a transaction submitted by the system, the blockchain network calculates and returns the transaction hash value (Tx Hash) of the transaction when the transaction enters the transaction pool. The transaction hash value is calculated by the blockchain network based on the transaction data content using a hash algorithm (such as SHA-256) consistent with the main chain. After consensus is passed and the candidate evidence storage record is written to the main blockchain, the transaction hash value serves as the final on-chain evidence storage index of the candidate evidence storage record.
[0100] Upon completion of the submission operation, the system synchronously receives the transaction hash value returned by the blockchain network and temporarily stores it as the hash of the pending state node associated with the current candidate evidence record. Leveraging the blockchain network's characteristic of returning transaction hash values when a transaction is submitted to the transaction pool, the system can pre-obtain the unique index identifier of the candidate evidence record in the blockchain network before consensus is achieved. This facilitates the rapid establishment of the association mapping between the main chain record and local business data after consensus confirmation.
[0101] Step S303: The blockchain network confirms the candidate evidence records through consensus.
[0102] In some embodiments, the blockchain network employs a practical Byzantine fault-tolerant consensus algorithm or the Raft consensus algorithm to reach consensus on transactions containing candidate notarization records.
[0103] Specifically, the consensus process includes: the master node broadcasts the candidate block containing the transaction to other consensus nodes, each consensus node verifies the transaction in the block (verification includes the legality of the transaction format, the validity of the transaction signature, and the integrity of the transaction payload), and after the verification is passed, each node returns a confirmation message. When more than two-thirds of the confirmation messages are collected, the candidate block is confirmed as a valid block, and the transaction is officially written into the blockchain main chain.
[0104] Step S304: After consensus is reached, the candidate evidence record is written into the main blockchain.
[0105] In some embodiments, after consensus is reached, the block containing the candidate evidence record is appended to the end of the main blockchain chain, and the candidate evidence record becomes an immutable evidence record on the main blockchain chain. The system receives the final confirmation message returned by the blockchain network, which includes the block height and block hash, and marks the hash of the pending state node temporarily stored in step S302 as confirmed, while recording the block height corresponding to the hash of the state node.
[0106] If consensus confirmation fails, the system will roll back the candidate evidence storage record to the candidate evidence storage area and mark it as a consensus failure, record the failure timestamp, and initiate a retry mechanism to resubmit the candidate evidence storage record to the blockchain network at preset intervals. In some embodiments, the preset interval is set to 30 seconds. If the retry count reaches a preset threshold and still fails, the evidence storage process will be terminated and the candidate evidence storage record will be transferred to the exception queue.
[0107] In some embodiments, the preset threshold is 3 attempts. If consensus is still not achieved after 3 retries, the candidate evidence record is transferred to the exception queue, and an alarm notification is generated and sent to the system administrator. The administrator then manually intervenes to investigate the blockchain network status and decides whether to resubmit or perform manual compensation. The exception queue is a persistent storage queue maintained by the system (e.g., implemented based on Kafka or RabbitMQ) used to temporarily store candidate evidence records that failed to be uploaded to the chain due to network failures, consensus timeouts, or other abnormal reasons, facilitating subsequent compensation retries and fault tracing.
[0108] If the system restarts or experiences a network interruption after obtaining the transaction hash value but before receiving the final consensus confirmation result, the state node hash will be in a pending confirmation state. Upon system restart, it scans all candidate evidence records marked as pending confirmation in local persistent storage, initiates a transaction status query to the blockchain network using the transaction hash value, and if the query result indicates that the transaction has been uploaded to the chain, it marks the pending confirmation state node hash as confirmed and updates the work order evidence status table. If the query result indicates that the transaction does not exist, it resets the candidate evidence record to a resubmitable state and adds it to the retry queue.
[0109] It should be noted that by setting up retry mechanisms and exception queues, the fault tolerance and recoverability of the evidence storage process in unstable blockchain network scenarios are improved, avoiding the permanent loss of evidence storage data due to a single consensus failure.
[0110] Step S305: After consensus is reached, read the operation fingerprint that has been persistently stored in step S105 from the system database and verify the integrity of the operation fingerprint.
[0111] It should be noted that since the operation fingerprint is generated and persistently stored when the state change event is triggered (step S105), this step only performs read and integrity verification operations and does not regenerate the operation fingerprint, so as to ensure that the fingerprint data is completely consistent with the operation context collected when the state change event occurs.
[0112] Integrity verification specifically includes: reading the stored operation fingerprint from the system database, combining the persistently stored operation association information in the system database into a string according to the same preset concatenation order as in step S1052, performing a hash operation using the same cryptographic hash function as in step S1053 to obtain a verification value, comparing the verification value with the operation fingerprint read from the system database, and if they match, the verification is successful; otherwise, it is determined that the operation fingerprint has been tampered with or the data is corrupted.
[0113] It should be noted that by combining multi-dimensional information such as operator identification, digital certificate serial number, operating terminal IP address, operation time and operation type, and performing hash operation to generate operation fingerprint, the operation fingerprint is unique, unforgeable and traceable. Changes in any element will result in completely different operation fingerprints, thereby accurately anchoring the responsible party and operation context of each state change operation, providing a reliable cryptographic basis for subsequent operation auditing and traceability.
[0114] Step S306: Associate the operation fingerprint with the state node hash and write it into the fingerprint index sidechain.
[0115] In some embodiments, the fingerprint index sidechain is an independent blockchain subchain anchored to the main blockchain chain. The fingerprint index sidechain operates independently of the main blockchain chain, adopts the same Practical Byzantine Fault Tolerance consensus algorithm as the main chain, and the consensus nodes are deployed independently with a number of no less than four.
[0116] When generating a new block, the consensus node of the fingerprint index sidechain actively reads the latest confirmed state node hash value from the blockchain main chain before each new block is generated, and writes the value into the main chain anchor field in the block header of the new block to realize the cross-chain anchoring relationship between the main chain and the sidechain.
[0117] The fingerprint index sidechain communicates with the main blockchain through a cross-chain read interface, which is based on the JSON-RPC protocol. The sidechain consensus node obtains the transaction hash value in the latest block of the main chain by calling the main chain's getBlockByNumber or getTransactionReceipt interface.
[0118] When the main blockchain does not produce a new block within the block production interval of the sidechain, the main chain anchor field of multiple consecutive blocks in the sidechain shares the same state node hash value, and the blocks in the sidechain still maintain a chain relationship through the sidechain's own hash pointer.
[0119] Among them, the consensus nodes of the fingerprint index sidechain detect whether the main chain has rolled back by listening to the chain rollback event of the main chain or by periodically comparing the latest block hash value of the main chain. Specifically, if the latest block hash value of the main chain read this time does not have a parent-child inheritance relationship with the previous block hash value of the main chain recorded locally on the sidechain, it is determined that the main chain has rolled back.
[0120] When a main chain rollback is detected, the sidechain consensus node obtains the latest state node hash value of the main chain after the rollback, marks the state node hash in the sidechain block header that was anchored but abandoned by the rollback as rolledback state, and re-anchors the main chain anchoring field in the block header of the latest block of the current sidechain with the latest state node hash value of the main chain after the rollback, thus realizing the re-anchoring of the sidechain with the main chain after the rollback; the blocks in the sidechain that have been marked as "rollback" retain their historical records for auditing and tracing the details of the rollback event.
[0121] The sidechain transactions of the fingerprint index sidechain adopt the same format as the main chain transactions, which includes at least the transaction sender address, transaction receiver address, transaction payload, and sender digital signature; the transaction payload is a serialized byte stream of key-value pairs constructed by operation fingerprint and state node hash; after receiving the sidechain transaction, the sidechain consensus node first verifies the validity of the transaction signature, then verifies the legality of the format of the operation fingerprint in the transaction payload, and after the verification is passed, it packages the transaction and writes it into the new block of the sidechain.
[0122] When the main blockchain does not produce a new block within the sidechain block production interval, the main chain anchor field of multiple consecutive blocks in the sidechain shares the same state node hash value. Specifically, in addition to the hash pointer of the preceding block in the fingerprint index sidechain, the block header of each block also contains a main chain anchor field. This field stores the main chain state node hash value corresponding to the current block of the fingerprint index sidechain, thus binding the sidechain block to the main chain's notified transaction. When it is necessary to verify the integrity and timeliness of an operation fingerprint, it can be confirmed whether the operation fingerprint has been tampered with by comparing whether the main chain state node hash stored in the sidechain block header matches the hash value of the actual transaction in the corresponding block of the main chain.
[0123] In some embodiments, the fingerprint index sidechain data structure uses the operation fingerprint as the key and the associated state node hash list as the value to construct an association index between the operation fingerprint and the state node hash.
[0124] Specifically, the associated writing method is as follows: the operation fingerprint read from the system database and the state node hash obtained in step S302 are used to construct a key-value pair, where the key is the operation fingerprint and the value is the state node hash. This key-value pair is then submitted to the fingerprint index sidechain as a sidechain transaction. After the consensus node of the fingerprint index sidechain verifies the sidechain transaction, it is packaged and written into the new block of the sidechain.
[0125] The fingerprint index sidechain constructs a key-value index using operation fingerprints as keys and a list of state node hashes as values. When the same operation fingerprint corresponds to multiple state node hashes, the new state node hash is appended to the end of the list corresponding to that key, and the list is arranged in ascending order by state change timestamp. Multiple sidechain transactions with the same operation fingerprint as the key are packaged sequentially according to transaction time during the sidechain consensus process. The append operations of each transaction do not conflict and do not require locking.
[0126] As can be seen, by associating the operation fingerprint with the state node hash and writing it into the fingerprint index sidechain, the operator's identity information is bound to the on-chain evidence record, which meets the business compliance requirements of full traceability of operation and maintenance. Any state change can be traced back to the specific operator and its operation context. Furthermore, by using an independent sidechain to store fingerprint index data, this embodiment of the invention avoids the main chain storage expansion caused by storing a large amount of operator association information on the main chain. At the same time, relying on the blockchain characteristics of the sidechain, the fingerprint index data is also guaranteed to be tamper-proof. Moreover, the cross-verification of sidechain data and main chain evidence data can be achieved through the main chain state node hash stored in the block header.
[0127] The index is built using the operation fingerprint as the key, which supports fast retrieval by operator or operation behavior, and facilitates efficient querying by personnel, time period or operation type during subsequent auditing.
[0128] In some embodiments, the blockchain-based operation and maintenance work order storage and full-process traceability management method provided by the present invention includes the following steps in step S4: Step S401: Record the status node hash as the latest evidence storage anchor point for the maintenance work order.
[0129] In some embodiments, a work order storage status table is maintained. The work order storage status table uses the work order identifier as the primary key and includes at least the following fields: work order identifier, latest status node hash, latest status data, latest status change timestamp, and last update time. After the candidate storage record passes consensus and is written to the blockchain main chain in step S3, the system obtains the status node hash and updates the latest status node hash field of the corresponding work order record in the work order storage status table.
[0130] The latest status node hash is the transaction hash value of the latest status change record of the work order on the main blockchain, and it is used as the preceding anchor field when calculating the anchor hash value for the next status change of the work order.
[0131] It should be noted that the preceding anchor field is the hash value of the state node on the main blockchain representing the previous state's notation record. This serves both as a unique index of the previous state on the chain and as a reference pointer in the chained hash operation. By using the state node hash as the preceding anchor field for the next state change, each state change notation record points to the previous notation record via a cryptographic hash pointer. Any tampering with a historical state change record will render all subsequent state node hashes unverifiable.
[0132] In step S402, in response to a new status change event occurring in an operation and maintenance work order, the system reads the latest status node hash from the work order certificate status table as the pre-anchor field for the new status change event.
[0133] Specifically, when the same maintenance work order undergoes a status change again and triggers a new round of evidence preservation process, before executing the anchor hash value calculation in step S2, the system first queries the work order evidence preservation status table to read the latest status node hash of the work order. If the read is successful, the latest status node hash is used as the preceding anchor field for this round of anchor hash value calculation; if the read fails or is empty (indicating that the work order does not have a record in the work order evidence preservation status table), the current status change is determined to be the first evidence preservation, and the preceding anchor field is taken from the system's preset initial anchor root value.
[0134] In some embodiments, the preceding anchor field is concatenated with the current state data and then hashed to generate a new anchor hash value. This new anchor hash value is reviewed by multiple nodes and written into a new candidate notarization record, ultimately being uploaded to the blockchain to obtain a new state node hash. The new state node hash is then updated again in the work order notarization status table, serving as the preceding anchor field for subsequent state changes.
[0135] Step S403: A traceability chain is formed based on the sequential linking of state node hashes.
[0136] It should be noted that the traceability chain is a chain-like data structure composed of all historical status change records of the same maintenance work order, linked sequentially by the status change time through a preceding anchor field and a hash pointer to the anchor hash value. Each node in the traceability chain corresponds to a status change record, and each node contains at least: the status data of this status change, the anchor hash value of this status change, the hash of the status node after this status change is added to the chain, and a preceding anchor field pointing to the previous status record. The head of the traceability chain is the initial anchor root value at the time of the first notarization, and the tail is the hash of the status node corresponding to the latest status change record, thus forming a complete traceability path from the first notarization to the latest status change.
[0137] In some embodiments, the verification process for the traceability chain is as follows: Step S4031: Obtain the latest status node hash of the maintenance work order from the work order storage status table as the starting point for verification.
[0138] Step S4032: Based on the latest state node hash, query and obtain the corresponding candidate evidence record from the blockchain main chain, and parse the preceding anchor field and anchor hash value in the candidate evidence record.
[0139] Step S4033: Using the parsed preceding anchor field as the query index, recursively query the previous candidate evidence record until the preceding anchor field is equal to the initial anchor root value, thus completing the traversal of all historical evidence records.
[0140] Step S4034: During the recursive process, the integrity of each candidate evidence record is verified level by level: the previous anchor field in the current record is concatenated with the current state data and then hashed. The hash operation is then performed to compare whether the result of the operation is consistent with the anchor hash value in the current record. If all records pass the verification, the traceability chain is determined to be complete and has not been tampered with.
[0141] If the traceability chain verification terminates during the recursive process due to the irrecoverability of the candidate evidence record (e.g., loss of off-chain storage data), the system generates a structured error report containing the following fields: the status node hash corresponding to the failed node, the work order identifier associated with the failed candidate evidence record, the timestamp of the failure, and the failure reason code. Simultaneously, an alarm notification is generated and sent to the system administrator for manual investigation. The administrator attempts to recover the candidate evidence record from system backups or other copies in distributed storage. If recovery is successful, the traceability chain verification is re-executed. If recovery fails, the candidate evidence record is marked as permanently lost and recorded in the system audit log.
[0142] It can be seen that by using the blockchain transaction hash value (state node hash) obtained after each state change is recorded on the chain as the preceding anchor field for the next state change, and constructing a chain traceability structure using hash pointers, complete and continuous traceability of the state changes throughout the entire lifecycle of the maintenance work order is achieved. If any state change record is tampered with or deleted, the hash verification between all preceding anchor fields and anchor hash values after that record will fail, thus enabling the tampering behavior to be detected immediately during traceability verification. Moreover, the chain verification of the traceability chain does not rely on a full traversal of the main blockchain. It only needs to trace back along the hash pointer from the latest state node hash to complete the verification of all historical records. It has a time complexity of O(n) and a space complexity of O(1), which is highly efficient and especially suitable for maintenance scenarios with a large number of records and frequent compliance audits.
[0143] In addition, the traceability chain decouples the anchor hash value calculated off-chain from the transaction hash value (state node hash) stored on-chain. The off-chain anchor hash value is used to build the traceability logic and fast verification at the business level, while the on-chain state node hash is used to provide tamper-proof evidence and confirmation of rights. The two are mapped together through the preceding anchor field, forming a two-layer verification architecture of off-chain verification logic + on-chain evidence and confirmation of rights, which takes into account both traceability efficiency and data credibility.
[0144] The method also includes one or more processors and memory.
[0145] The memory is used to store operable instructions that, when executed by one or more processors, cause one or more processors to perform operations. These operations include the processes of the blockchain-based operation and maintenance work order storage and full-process traceability management method described in the foregoing embodiments, especially... Figure 1 The flowchart of the method is shown.
[0146] Other aspects disclosed in the embodiments of the present invention also propose a computer-readable medium for storing software, the software including instructions executable by one or more computers, the instructions causing the one or more computers to perform operations, including the processes of the blockchain-based operation and maintenance work order storage and full-process traceability management method of the foregoing embodiments, especially... Figure 1 The flowchart of the method is shown.
[0147] It should be recognized that embodiments of the present invention may be implemented or carried out by computer hardware, a combination of hardware and software, or by computer instructions stored in a non-transitory computer-readable storage medium.
[0148] The method can be implemented using standard programming techniques, including a non-transitory computer-readable storage medium configured with a computer program, wherein the storage medium is configured such that the computer operates in a specific and predefined manner.
[0149] Each program can be implemented in a high-level procedural or object-oriented programming language to communicate with the computer system; however, if necessary, the program can be implemented in assembly or machine language.
[0150] In any case, the language can be either compiled or interpreted.
[0151] Furthermore, for this purpose, the program can run on a programmed application-specific integrated circuit.
[0152] The processes (or variations and / or combinations thereof) described herein can be executed under the control of one or more computer systems configured with executable instructions, and can be implemented by hardware or a combination thereof as code (e.g., executable instructions, one or more computer programs, or one or more applications) that commonly executes on one or more processors. A computer program comprises multiple instructions that can be executed by one or more processors.
[0153] Furthermore, the method can be implemented in any suitable type of computing platform, including but not limited to personal computers, minicomputers, mainframes, workstations, networked or distributed computing environments, standalone or integrated computer platforms, or in communication with charged particle tools or other imaging devices.
[0154] Various aspects of the present invention can be implemented in machine-readable code stored on a non-transitory storage medium or device, whether portable or integrated into a computing platform, such as a hard disk, optical read and / or write storage medium, RAM, ROM, etc., such that it can be read by a programmable computer, and when the storage medium or device is read by the computer, it can be used to configure and operate the computer to perform the processes described herein.
[0155] Furthermore, machine-readable code, or parts thereof, can be transmitted via wired or wireless networks.
[0156] When such media includes instructions or programs that combine with a microprocessor or other data processor to implement the steps described above, the invention described herein includes these and other different types of non-transitory computer-readable storage media.
[0157] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.
Claims
1. A blockchain-based method for storing and managing maintenance work orders with full-process traceability, characterized by: include: In response to the status change event of the maintenance work order, the current status data of the maintenance work order is written to the temporary evidence storage area. A single confirmation node verifies the current status data. After the verification is successful, a temporary evidence record is generated. When the temporary evidence record is generated, the operation fingerprint corresponding to the status change event is extracted and persistently stored. The current status data is copied and written to the candidate evidence storage area. Multiple pre-designated confirmation nodes review the current status data. After the review is passed, the anchor hash value of the current status data is calculated to generate a candidate evidence storage record. Specifically, the preceding anchor field corresponding to the previous final evidence storage record of the maintenance work order is read. The preceding anchor field and the standardized byte sequence of the current status data are concatenated in a preset order and then hashed to obtain the anchor hash value. The preceding anchor field is the hash of the state node or the initial anchor root value corresponding to the previous final evidence record. The candidate evidence record is submitted to the blockchain network for consensus confirmation. The transaction hash value corresponding to the candidate evidence record is obtained as the state node hash. After the consensus is passed, the candidate evidence record is written into the blockchain main chain, and the operation fingerprint is associated with the state node hash and written into the fingerprint index side chain. The state node hash is stored as the preceding anchor field for the next state change event in the next candidate evidence record, forming a traceability chain linked sequentially based on the state node hash.
2. The blockchain-based operation and maintenance work order storage and full-process traceability management method as described in claim 1, characterized in that: The verification includes data format verification, timestamp validity verification, and state transition path validity verification; The individual confirmation node is dynamically selected by the system based on the hash value of the identifier of the maintenance work order and modulo the length of the confirmation node list.
3. The blockchain-based operation and maintenance work order storage and full-process traceability management method as described in claim 1, characterized in that: The audit includes auditing the consistency of status data, auditing the legality of operation permissions, and auditing the business rules for status migration. If the status data consistency audit, the operation permission legality audit, and the status migration business rule audit are all passed, then the audit is deemed to have passed.
4. The blockchain-based method for operation and maintenance work order storage and full-process traceability management as described in claim 1, characterized in that: The current status data in the temporary evidence storage area will remain in its original storage state until the preset retention period expires, after which it will be automatically cleared.
5. The blockchain-based operation and maintenance work order storage and full-process traceability management method as described in claim 1, characterized in that: The state node hash is the transaction hash value of the transaction corresponding to the candidate evidence record on the blockchain main chain. After consensus confirmation and writing to the blockchain main chain, the transaction hash value serves as the final on-chain evidence index of the candidate evidence record.
6. The blockchain-based method for operation and maintenance work order storage and full-process traceability management as described in claim 1, characterized in that: The fingerprint index sidechain is an independent subchain anchored to the main blockchain chain; The block header of the fingerprint index sidechain includes a main chain anchoring field, which is used to store the state node hash value of the blockchain main chain to achieve cross-chain anchoring.
7. The blockchain-based operation and maintenance work order storage and full-process traceability management method as described in claim 6, characterized in that: The consensus node of the fingerprint index sidechain obtains the latest confirmed state node hash value from the blockchain main chain through the cross-chain read interface and writes it into the block header of the new block of the fingerprint index sidechain.
8. The blockchain-based method for operation and maintenance work order storage and full-process traceability management as described in claim 6, characterized in that: When a rollback is detected on the main blockchain, the fingerprint index sidechain marks the hash of the anchored but rolled-back abandoned state node as rolled-back and re-anchors the latest block of the current sidechain with the latest state node hash value of the main chain after the rollback.
9. The blockchain-based method for operation and maintenance work order storage and full-process traceability management as described in claim 1, characterized in that: The fingerprint index sidechain constructs a key-value index using the operation fingerprint as the key and the state node hash as the value. When the same operation fingerprint corresponds to multiple state node hashes, they are arranged in ascending order according to the state change timestamp. The operation fingerprint is used to uniquely identify the executing entity and operation context of this status change operation, and the fingerprint index sidechain is used to support cross-work order traceability retrieval based on operation behavior.
10. The blockchain-based method for operation and maintenance work order storage and full-process traceability management as described in claim 1, characterized in that: The verification of the traceability chain includes: Starting from the latest status node hash of the maintenance work order, query and obtain the corresponding candidate evidence record from the blockchain main chain, and parse the pre-anchor field and anchor hash value stored in the candidate evidence record; The preceding anchor field obtained from the parsing is used as the query index to recursively query the previous candidate evidence record until the preceding anchor field is equal to the initial anchor root value. During the recursive process, the preceding anchor field in the current candidate evidence record is concatenated with the current state data and then hashed. The hash operation is then performed to compare whether the result of the operation is consistent with the anchor hash value recorded in the current candidate evidence record. If all candidate evidence records pass verification, the traceability chain is deemed complete.
Citation Information
Patent Citations
A blockchain-based data state management and query method and blockchain device
CN112712433B
Computing power server operation and maintenance auditing method and system based on block chain and Internet of Things
CN121997383A
Method for constructing one-main-chain multi-side-chain block chain architecture
CN110233802A
On-chain and off-chain data collaborative storage method and system
CN118210855A
