Template security distribution and verification method of detection equipment software based on decentralized network and state synchronization
Through decentralized network and state synchronization methods, utilizing P2P protocols and blockchain technology, we have achieved safe, reliable and efficient automated updates of detection equipment software, solving the single point failure, version inconsistency and security risks of traditional update methods, and improving the stability and scalability of the system.
Patent Information
- Application Number
- CN202510919939.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-04
- Publication Date
- 2025-10-14
AI Technical Summary
Existing detection equipment software updates rely on central servers or manual methods, which pose problems such as single point failure risks, performance bottlenecks, low efficiency, prone to errors, untimely updates and inconsistent versions, difficulty in tracking and verification, and physical security risks.
It adopts a decentralized network architecture, utilizes P2P protocols and cryptographic verification, and combines lightweight blockchains to record version information, enabling direct communication and automated updates between devices. It ensures the security and integrity of updates through digital signatures and hash verification, and uses the Gossip protocol to synchronize status and keep up with the latest version.
It improves the reliability and efficiency of updates, reduces operation and maintenance costs, ensures the consistency and security of the final version of the device, avoids single points of failure and manual errors, and improves the resilience and scalability of the system.
Smart Images

Figure CN120785539A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of machine vision detection equipment technology and information security technology, and in particular to a template security distribution and verification method for detection equipment software based on decentralized network and state synchronization. Background Art
[0002] Currently, updates to testing equipment software or testing templates (files that configure test items and test data) typically rely on central servers or manual updates. This model presents the following problems:
[0003] 1. For the central server model:
[0004] 1. Single point of failure risk: If the central server fails, goes down, or the network connection is interrupted, all devices that rely on it will be unable to update, seriously affecting the timeliness and reliability of updates;
[0005] 2. Performance bottleneck: When a large number of devices request updates simultaneously, the bandwidth and processing power of the central server become bottlenecks, resulting in slow updates or even failures.
[0006] 2. For manual update mode:
[0007] 1. Inefficiency and high cost: Operation and maintenance personnel are required to operate devices one by one or in batches, which is particularly time-consuming and labor-intensive for large numbers of devices or geographically dispersed devices.
[0008] 2. Error-prone: Manual operations can easily introduce errors, such as using the wrong update file version, omitting certain devices, or incomplete updates due to interruptions in operations.
[0009] 3. Untimely updates and inconsistent versions: Manual updates are often not synchronized, resulting in inconsistent software / template versions running on devices on the network for a period of time, causing compatibility issues or discrepancies in test results.
[0010] 4. Difficulty in tracking and verification: It is difficult to systematically and in real time confirm whether all target devices have been successfully updated to the specified version, lacking effective unified management and status monitoring;
[0011] 5. Physical security risk: The risk of introducing viruses or malware by using physical media such as USB flash drives.
[0012] Therefore, there is an urgent need for a new update mechanism that can overcome the drawbacks of centralized and purely manual methods, achieve more secure, reliable, and efficient software and template distribution and verification, and ensure the consistency of the final version of all devices. Summary of the Invention
[0013] The main purpose of the present application is to provide a template security distribution and verification method for detection equipment software based on a decentralized network and state synchronization, aiming to improve the reliability and resilience of updates, improve update efficiency and reduce operation and maintenance costs.
[0014] To achieve the above-mentioned purpose, the present application provides a template security distribution and verification method for detection equipment software based on a decentralized network and state synchronization,
[0015] Including,
[0016] The peer-to-peer network (P2P) architecture includes:
[0017] All machine vision detection equipment in the network is constructed as a logical peer-to-peer network; device nodes can discover each other through a local area network discovery protocol, including mDNS or DNS-SD;
[0018] Discover each other and establish direct communication connection, without forced dependence on central server for data transfer;
[0019] The authority publishing and verification based on cryptography includes:
[0020] Official signature publishing uses the unique private key of the authorized official agency to digitally sign each published software / template new version, which contains the metadata package of version number, file hash value, release timestamp, etc.
[0021] Device end verification includes:
[0022] Each detection equipment is pre-installed with the public key of the official agency; when receiving any update information or file, the device must use the public key to verify the authenticity of the signature and confirm that the information source is reliable and has not been tampered with;
[0023] Decentralized distribution protocol and transmission includes:
[0024] Specific P2P protocols are used between device nodes, which are based on Gossip protocol to announce the availability of new versions, exchange version information, request and transmit update files;
[0025] The nodes that have obtained the new version can serve as data sources to provide update data to other nodes in the network that need to share the load;
[0026] Version state synchronization and eventual consistency guarantee mechanism includes:
[0027] Authority version record: there is a lightweight blockchain-based distributed ledger trusted by all nodes in the network, which records the official published version information;
[0028] This record contains the version number of each official version, a hash summary of the file contents, and the corresponding official digital signature;
[0029] Node status notification and query: Device nodes will broadcast the version number of their currently running, verified software / template in the network through the Gossip protocol periodically or when the status changes;
[0030] Nodes can also proactively query authoritative version records to obtain the latest version information;
[0031] Update catch-up mechanism:
[0032] The device node periodically or upon triggering events, the triggering events include network connection recovery, receipt of new version notification,
[0033] Compare the locally running version to the highest version known from a neighbor or the latest official version in the authoritative version record;
[0034] If the local version is found to lag behind the known and verified official new version, the update process will be automatically triggered;
[0035] The device queries the P2P network and requests to download the missing or updated version of the software / template file;
[0036] Post-download integrity checks include:
[0037] After the device has completely downloaded the update file and before applying the update, it must calculate the hash value of the downloaded file;
[0038] Strictly compare the calculated hash value with the official hash value corresponding to the version obtained from the authoritative version record or verified metadata;
[0039] Only when the hash values are completely consistent can the actual software replacement or template application operation be performed, ensuring that the file is not damaged or tampered with during transmission and storage.
[0040] Beneficial effects of the technical solution of the present invention:
[0041] 1. Improve the reliability and resilience of updates:
[0042] ① By adopting a decentralized P2P network architecture, it eliminates dependence on a single central server, avoids single points of failure, and ensures that updates and distribution can still be carried out even if problems occur in some networks or nodes;
[0043] Enhanced security of the update process:
[0044] ② Use asymmetric encryption technology for digital signature and verification to ensure the authority and unforgeability of the source of software / template updates;
[0045] Combined with hash verification, it ensures the integrity of updated content during distribution and storage, effectively resisting tampering and malicious injection;
[0046] The decentralized P2P architecture eliminates single points of failure, making the system insensitive to single node or server failures, significantly improving the availability and stability of update services.
[0047] 2. Improve update efficiency and reduce operation and maintenance costs:
[0048] Automatically distribute updates through P2P networks, reducing bandwidth pressure on central servers and replacing tedious, error-prone manual operations, reducing labor costs and operational risks, and achieving and guaranteeing eventual consistency.
[0049] 3. Enhanced security:
[0050] The mandatory official digital signature verification mechanism ensures the authenticity of the sources of all update instructions and content, eliminating unauthorized or forged updates; the post-download hash check ensures the integrity of the data during the distribution process, effectively defending against man-in-the-middle attacks and data tampering.
[0051] 4. Guarantee eventual consistency: core state synchronization and update catch-up mechanism, combined with authoritative version records;
[0052] It ensures that all devices in the network, regardless of their network status history, will eventually be automatically and securely updated to the unified official latest version, completely solving the version inconsistency problem that is difficult to solve with traditional methods;
[0053] 5. Improved distribution efficiency and scalability: P2P transmission allows nodes to transfer data to each other. In high-density deployments or large file distribution scenarios, it can effectively utilize the total network bandwidth, share the download load, potentially increase update speeds, and easily scale as the number of devices increases;
[0054] 6. Reduce operation and maintenance costs and complexity:
[0055] The automated discovery, verification, download, and update processes significantly reduce the need for manual intervention, lowering operation and maintenance costs and operational errors, and making software / template version management for large-scale device groups easier and more controllable.
[0056] 7. In existing automated industrial machines, the number of devices is large and the collaboration between the devices is complex. When any device updates the system, there will be a difference in interactive information between the cooperating devices. The system can effectively verify the deviation of information during the update, thereby improving the collaboration of automated machinery and equipment, that is, through point-to-point, face-to-face, and information interaction between the system center and points and surfaces. BRIEF DESCRIPTION OF THE DRAWINGS
[0057] Figure 1 This is a schematic diagram of the overall system architecture;
[0058] Figure 2 Updated main flow chart for software / template;
[0059] Figure 3 This is an example sequence diagram of information interaction between nodes;
[0060] Figure 4 Schematic diagram of the data structure recorded as the authoritative version on the lightweight blockchain. DETAILED DESCRIPTION
[0061] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0062] It should be noted that if the embodiments of the present invention involve directional indications (such as up, down, left, right, front, back, top, bottom, inside, outside, vertical, horizontal, longitudinal, counterclockwise, clockwise, circumferential, radial, axial...), then the directional indications are only used to explain the relative position relationship, movement status, etc. between the components in a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indications will also change accordingly.
[0063] In addition, if there are descriptions involving "first" or "second" in the embodiments of the present invention, the descriptions of "first" or "second" are only for descriptive purposes and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" or "second" may explicitly or implicitly include at least one of such features. In addition, the technical solutions between the various embodiments can be combined with each other, but this must be based on the fact that ordinary technicians in this field can implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such a combination of technical solutions does not exist and is not within the scope of protection required by the present invention.
[0064] like Figures 1 to 4 As shown, a method for secure template distribution and verification of detection device software based on a decentralized network and state synchronization includes devices, where each machine vision detection device in the network runs a client software module;
[0065] The client software module includes:
[0066] A P2P network communication module, which is responsible for node discovery, connection establishment, and information exchange and file transfer based on the Gossi p protocol based on the mDNS network / DNS-SD network;
[0067] A cryptographic verification module stores the official public key and is responsible for verifying the received signature information and calculating and comparing the file hash value.
[0068] A status synchronization and update module, which maintains the local version status, synchronizes the status with the network, performs version comparison, triggers update catch-up, and applies updates;
[0069] A blockchain interaction module, which is responsible for querying authoritative version records and participating in the maintenance of lightweight blockchains;
[0070] Official publishing terminal, which is controlled by an authorized institution and has an official private key;
[0071] The official publishing end is used to prepare the new version of the software / template, calculate the hash, generate metadata, perform digital signatures, and publish the signed authoritative version information to the lightweight blockchain, while placing the update file package on one or more initially accessible nodes;
[0072] P2P network, the P2P network is a logical peer-to-peer network dynamically composed of all detection device nodes running the client software module;
[0073] An authoritative version recording mechanism, which is based on a lightweight blockchain distributed ledger that is shared and trusted by all nodes in the network. In this embodiment, all capable nodes participate in the bookkeeping and consensus process to achieve maximum decentralization (designated, redundant, trusted nodes can also be selected to be responsible for bookkeeping and consensus maintenance).
[0074] The account book records all officially released and signed version information.
[0075] The distributed ledger record includes the officially released version number, a hash summary of the updated file content, a release timestamp, and an official digital signature for the metadata of the record.
[0076] Specifically,
[0077] The client software module workflow includes:
[0078] S1. Initialization and network joining:
[0079] The detection device (node A) starts, loads the official public key preset in the device client software; the initial preset of the public key needs to ensure that the source is safe and reliable, and allows to update the public key securely through a trusted software update process when necessary;
[0080] S2, start the P2P client software module:
[0081] Find and discover other peer nodes (node B, node C) in the same network through the mDNS / DNS-SD protocol discovery in the local area network, establish P2P connection, form or join P2P network;
[0082] Node A starts exchanging the current software / template version information of each other with its neighbor nodes (B, C) through the Gossip protocol.
[0083] Specifically,
[0084] S3, the official releases a new template version, for example, releases a new version V1.2:
[0085] The official agency prepares a new template file template_v1.2.dat;
[0086] Calculate the hash value H2 of the file using the official release tool;
[0087] Create a metadata record containing information such as {version number: "V1.2", file hash: H2, release timestamp: T2};
[0088] Sign the metadata record using the official private key to obtain the digital signature SIG2;
[0089] Place the template_v1.2.dat file on one or more initial distribution nodes;
[0090] Publish the new record containing {version number: "V1.2", hash: H2, release timestamp: T2, signature: SIG2} as a transaction to the lightweight blockchain; after the transaction is verified and consensus is reached, it becomes part of the ledger.
[0091] Specifically,
[0092] S4, version information synchronization and discovery:
[0093] S41, node A, B, C, etc. learn that there is a new official version V1.2 record through synchronization with the blockchain or through the Gossip protocol from the synchronized nodes;
[0094] S42. Node A, assuming it is currently running V1.1, obtains the authoritative record of V1.2 {version number: "V1.2", hash: H2, release timestamp: T2, signature: SIG2}.
[0095] Specifically,
[0096] S5. Version verification and update decision:
[0097] S51. Node A uses the preset official public key to verify the validity of the signature SIG2.
[0098] S52. After verification, node A compares the version number "V1.2" in the authoritative record with the version number "V1.1" running locally.
[0099] S53. Node A finds that V1.2 is a newer version, and decides to perform an update.
[0100] Specifically,
[0101] S6. P2P file request and transfer:
[0102] Node A uses the Gossip protocol to initiate a search request for the hash H2 of the file template_v1.2.dat through the P2P network, allowing the request to spread across the network to locate the node holding the file.
[0103] Assume that node B has been updated to V1.2 through a similar process and holds the file; node A discovers that node B holds the file;
[0104] Node A initiates a file transfer request to node B;
[0105] Node B transmits the template_v1.2.dat file to node A through a P2P protocol, which is a Gossip protocol.
[0106] Specifically,
[0107] Large file transfer optimization: For software or template update files with small size, directly use the selected P2P protocol for file transfer;
[0108] However, when the machine vision software or complex template file is large, in order to improve transmission efficiency and reliability, the system can further integrate or adopt a P2P mechanism that is more suitable for large file transmission, and the P2P protocol is the BitTorrent protocol.
[0109] Specifically,
[0110] S7. Integrity check and application after downloading:
[0111] Node A receives the file completely, calculates the hash value of the received file, and obtains H_received;
[0112] The H_received is strictly compared with the official hash value H2 obtained from the authority record, and the authority record is a lightweight blockchain;
[0113] If H_received == H2, the verification is passed;
[0114] Node A performs a template application operation, and updates the local template to V1.2;
[0115] After the update is completed, node A updates its own state record to V1.2, and notifies its new state to the network through the Gossip protocol.
[0116] Specifically,
[0117] S8, offline device node D update catch-up;
[0118] S81, assuming that node D is offline before, at this time, it is restarted and joins the network;
[0119] S82, node D performs step 1 to join the network;
[0120] S83, node D synchronizes with the lightweight blockchain, or obtains the current latest official version V1.2 through Gossip from the neighbor nodes including the updated A and B;
[0121] S84, node D performs steps S4, S5 and S6, automatically completes verification, file download, check and application, and finally updates to V1.2 version, and realizes the final consistency.
[0122] In Figures 1-4 The logic cooperation and distribution method of the system can be clearly reflected, and the existing technical problems can be solved;
[0123] Meanwhile, the logic can not only be applied to detection equipment, but also can be used as a reference model of automatic mechanical equipment, so as to reduce the design time and labor cost of non-detection equipment software update, and is a good industrial software design model.
[0124] The above only describes the preferred embodiments of the present application, and does not limit the patent range of the present application, and any equivalent structural transformation, direct / indirect application in other related technical fields under the inventive concept of the present application, or the contents of the present application specification and drawings are included in the patent protection range of the present application.
Claims
1. A method for secure template distribution and verification of detection device software based on a decentralized network and state synchronization, characterized by: Including devices, each machine vision inspection device in the network runs a client software module; The client software module includes: A P2P network communication module, which is responsible for node discovery, connection establishment, and information exchange and file transfer based on the mDNS network / DNS-SD network, and the Gossip protocol; A cryptographic verification module, which stores the official public key and is responsible for verifying the received signature information and calculating and comparing the file hash value; A status synchronization and update module, which maintains the local version status, synchronizes the status with the network, performs version comparison, triggers update catch-up, and applies updates; A blockchain interaction module, which is responsible for querying authoritative version records and participating in the maintenance of lightweight blockchains; Official publishing terminal, which is controlled by an authorized institution and has an official private key; The official publishing end is used to prepare the new version of the software / template, calculate the hash, generate metadata, perform digital signatures, and publish the signed authoritative version information to the lightweight blockchain, while placing the update file package on one or more initially accessible nodes; P2P network, the P2P network is a logical peer-to-peer network dynamically composed of all detection device nodes running the client software module; An authoritative version recording mechanism based on a lightweight blockchain distributed ledger that is shared and trusted by all nodes in the network; The account book records all officially released and signed version information. The distributed ledger record includes the officially released version number, a hash summary of the updated file content, a release timestamp, and an official digital signature for the metadata of the record.
2. The method for secure template distribution and verification of detection device software based on a decentralized network and state synchronization as claimed in claim 1, characterized in that: The client software module workflow includes: S1. Initialization and network joining: After the detection device (Node A) starts up, it loads the official public key pre-installed in the device client software. The initial pre-installation of this public key must ensure that the source is secure and reliable, and allow this public key to be securely updated through a trusted software update process when necessary. S2. Start the P2P client software module: Use the local area network discovery mDNS / DNS-SD protocol to find and discover other peer nodes (node B, node C) in the same network, establish P2P connections, and form or join a P2P network; Node A begins to exchange the current software / template version information with its neighbor nodes (B, C) through the Gossip protocol.
3. The method for secure template distribution and verification of detection device software based on a decentralized network and state synchronization as claimed in claim 2, characterized in that: S3. Official release of a new template version, such as the release of new version V1.2: The official agency prepared a new template file template_v1.2.dat; Use the official publishing tool to calculate the hash value H2 of the file; Create a metadata record containing information such as {version number: "V1.2", file hash: H2, release timestamp: T2}; Sign the metadata record using the official private key to obtain a digital signature SIG2; Place the template_v1.2.dat file on one or more initial distribution nodes; A new record containing {version number: "V1.2", hash: H2, release timestamp: T2, signature: SIG2} is published as a transaction on the lightweight blockchain; after verification and consensus, the transaction becomes part of the ledger.
4. The method for secure template distribution and verification of detection device software based on a decentralized network and state synchronization as claimed in claim 3, characterized in that: S4. Version information synchronization and discovery: S41, nodes A, B, C, etc. learn that there is a new official version V1.2 record by synchronizing with the blockchain or learning from synchronized nodes through the Gossip protocol; S42. Node A, assuming it is currently running V1.1, obtains the authoritative record of V1.2 {version number: "V1.2", hash: H2, release timestamp: T2, signature: SIG2}.
5. The method for secure template distribution and verification of detection device software based on a decentralized network and state synchronization according to claim 4, characterized in that: S5. Version Verification and Update Decision: S51. Node A uses the preset official public key to verify the validity of the signature SIG2. S52. After verification, node A compares the version number "V1.2" in the authoritative record with the version number "V1.1" running locally. S53. Node A finds that V1.2 is a newer version and decides to perform an update.
6. The method for secure template distribution and verification of detection device software based on a decentralized network and state synchronization as claimed in claim 5, characterized in that: S6. P2P file request and transfer: Node A uses the Gossip protocol to initiate a search request for the hash H2 of the file template_v1.2.dat through the P2P network, allowing the request to spread across the network to locate the node holding the file. Assume that node B has been updated to V1.2 through a similar process and holds the file; Node A discovers that Node B holds the file; Node A initiates a file transfer request to node B; Node B transmits the template_v1.2.dat file to node A through a P2P protocol, which is a Gossip protocol.
7. The method for secure template distribution and verification of detection device software based on a decentralized network and state synchronization according to claim 6, characterized in that: Large file transfer optimization: For software or template update files with small size, directly use the selected P2P protocol for file transfer; When the machine vision software or complex template file is large in size, the P2P protocol is the BitTorrent protocol.
8. The method for secure template distribution and verification of detection device software based on a decentralized network and state synchronization according to claim 7, characterized in that: S7. Integrity check and application after downloading: After node A completely receives the file, it calculates the hash value of the received file and obtains H_received; Strictly compare H_received with the official hash value H2 obtained from the authoritative record, where the authoritative record is a lightweight blockchain; If H_received == H2, verification passed; Node A applies the template and updates the local template to V1.
2. After the update is completed, node A updates its own status record to V1.2 and notifies its new status to the network through the Gossip protocol.
9. The method for secure template distribution and verification of detection device software based on a decentralized network and state synchronization as claimed in claim 8, characterized in that: S8, update catch-up of offline device node D; S81. Assume that node D was offline before and is restarted and joins the network. S82, node D executes step 1 to join the network; S83. Node D learns through Gossip that the latest official version is V1.2 by synchronizing with the lightweight blockchain or from neighboring nodes, including the updated A and B. S84. Node D executes steps S4, S5, and S6, automatically completing verification, file download, checksum application, and eventually updating to version V1.2, achieving eventual consistency.