A method for lock lifecycle tracing and comparative analysis based on event chains and state snapshots

By combining event chains and state snapshots, lock lifecycle events are recorded and automatically compared, solving the problem of missing state snapshots in lock lifecycle tracing and achieving efficient lock performance change analysis.

CN123118058APending Publication Date: 2026-11-17TAIYOULIAN INTELLIGENT TECHNOLOGY (SHANGHAI) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611140856.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-30
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

In existing technologies, smart lock lifecycle events lack state snapshot records, making it impossible to restore the true state at the moment of the event during tracing. Furthermore, the lack of cross-time point state comparison analysis results in low efficiency, especially making it difficult to determine the trend of lock performance changes after repair.

Method used

It adopts a combination of event chain and state snapshot method, writes the current state snapshot when recording each life cycle event, and automatically compares the two comparison time points through the front-end interface, calculates the amount of change and marks the differences, and supports event type filtering and timeline display.

Benefits of technology

It enables efficient traceability and automated comparative analysis of the lock's lifecycle. Operators can reconstruct the true situation at the moment of the event without manual comparison, and automatically mark the differences, thus improving the visualization and analysis efficiency of lock performance changes.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123118058A_ABST
    Figure CN123118058A_ABST
Patent Text Reader

Abstract

This invention discloses a method for lock lifecycle traceability and comparative analysis based on event chains and state snapshots, belonging to the field of smart lock quality traceability technology. The method includes: when a lock experiences a lifecycle event, writing the current event record into the event chain record, and simultaneously writing a complete state snapshot of the lock at that moment; the event chain forms a linked list structure through preceding event identifiers; the front end displays all event records sequentially in a timeline manner, with each event associated with a corresponding state snapshot; after the operator selects a first comparison time point and a second comparison time point, the system outputs the state snapshots corresponding to the two time points side-by-side; automatically comparing the values ​​of the same monitoring dimensions in the two state snapshots, calculating the changes, highlighting the differences, and summarizing and outputting them. This invention achieves complete traceability of the state at each event moment through the associated storage of event chains and state snapshots, and significantly improves the efficiency of lock lifecycle state comparative analysis through automatic difference comparison at two time points, eliminating the need for manual page-turning and item-by-item comparison.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of smart lock quality traceability technology, specifically to a lock lifecycle traceability and comparative analysis method based on event chains and state snapshots. Background Technology

[0002] Smart locks go through multiple stages during use, including manufacturing, installation, inspection, maintenance, and disposal. The test records, maintenance records, and status change information generated at each stage are stored in different systems. When it is necessary to trace the complete history of a lock, operators need to manually switch between multiple systems to query and piece together fragmented records from each stage, which is inefficient and prone to missing key events. While some existing systems provide a time-sorted event list, they suffer from the following shortcomings: First, event records only store information about the event itself, lacking a complete snapshot of the lock's state at the time of the event, making it impossible to reconstruct the lock's true condition at the moment of the event during subsequent tracing. Second, there is a lack of a comparative analysis mechanism between state snapshots; operators must manually compare state data from different time points to determine the trend of lock performance changes, a cumbersome and error-prone process. Especially after a lock has undergone repair, the event list alone makes it difficult to intuitively assess the degree of improvement in key lock indicators before and after repair. Summary of the Invention

[0003] This invention aims to provide a method for tracing and comparing the lifecycle of locks based on event chains and state snapshots, solving the technical problems of the lack of state snapshot records for lock lifecycle events and the low efficiency of cross-time point state comparison analysis in the prior art. To achieve the above objectives, the present invention provides the following technical solution: A method for tracing and comparing the lifecycle of locks based on event chains and state snapshots includes the following steps: Step 1: When the lock experiences a lifecycle event, write the current event record into the event chain record, and at the same time write the complete state snapshot of the lock at the current moment into the associated state snapshot table of the event. The event chain record shall at least include the event type, the time of the event occurrence, and the identifier of the preceding event, and the state snapshot shall at least include the current stage of the lock and the cumulative running time. Step 2: The front-end traceability interface loads the event chain records of the specified lock and displays all event records from the factory event to the latest event in chronological order in a timeline manner. Each event record is associated with a state snapshot at the corresponding moment. Step 3: The front-end traceability interface provides an entry point for selecting comparison points. After the operator selects the first comparison time point and the second comparison time point on the timeline, they initiate a comparison request. The system outputs the first state snapshot corresponding to the first comparison time point and the second state snapshot corresponding to the second comparison time point side by side. Step 4: The system automatically compares the values ​​of the same monitoring dimensions in the first state snapshot and the second state snapshot, calculates the change in each dimension, marks the dimensions with changes exceeding the preset threshold or with changes in state as difference items, and summarizes and outputs all difference items and their corresponding change directions. Furthermore, the event chain record forms a linked list structure through the preceding event identifier, which points to the record number of the previous life cycle event of the lock, and is used to reconstruct the complete event sequence relationship. Furthermore, the status snapshot is written under the following triggering conditions: the first status snapshot is written when the lock leaves the factory, the status snapshot is written after each inspection or test, the status snapshot is written after each maintenance, and the status snapshot is written every time the status changes (including but not limited to scrapping, rework, and restarting production); the status snapshot includes at least one or more of the following: lock cylinder status, surface wear ratio, firmware version information, battery power, and communication signal strength. Furthermore, in step three, after the operator selects the first comparison time point and the second comparison time point, the system displays in a pop-up window the number of lock records involved in this comparison, the life cycle dimension range, and the number of monitoring indicators expected to be involved. After the operator confirms, the system generates a comparison view. Furthermore, the automatic comparison method described in step four is as follows: calculate the difference or compare the state of the field values ​​with the same field name in the first state snapshot and the second state snapshot; calculate the difference for numeric fields; determine whether a state transition has occurred for enumerated fields; and determine whether a truth flip has occurred for Boolean fields; mark the fields whose difference exceeds the preset change threshold or whose state transition has occurred as difference items. Furthermore, the system also supports filtering by event type in the event type filter panel. The front-end traceability interface only displays the event records corresponding to the selected event type. The event types include at least the factory type, installation type, inspection type, maintenance type, and scrap type. After filtering, the front-end interface synchronously updates the timeline display and refreshes the total event count of the current lock. A lock lifecycle tracing and comparative analysis system based on event chains and state snapshots includes: The event chain record module is used to write an event chain record when the lock experiences a life cycle event. The event chain record includes at least the event type, the event occurrence time, the preceding event identifier, and the associated lock identifier. The preceding event identifier is used to form the complete event chain list structure of the lock. The state snapshot recording module is used to synchronously write a complete state snapshot of the lock at the current moment when an event occurs. The state snapshot includes at least the current stage of the lock and the cumulative running time. The timeline display module is used to arrange and display all event records of a specified lock in chronological order in a timeline format, with each event record associated with a snapshot of its status at the corresponding moment. The comparison analysis module is used to receive the first comparison time point and the second comparison time point selected by the operator, output the first state snapshot corresponding to the first comparison time point and the second state snapshot corresponding to the second comparison time point side by side, and automatically compare the values ​​of the same monitoring dimension in the two state snapshots, calculate the change, and mark the dimension with the change exceeding the preset threshold or the state change as the difference item for highlighting. The event type filtering module is used to filter event records displayed on the timeline by event type. This invention, through the associated storage of event chain records and state snapshots, ensures that each lifecycle event carries complete state information of the lock at the time of the event. Operators can reconstruct the true state of the event without switching to other systems during tracing. Through dual-comparison time point selection and an automatic difference comparison mechanism, operators only need to select two time points to obtain the changes in key lock indicators between the two time points. Differences are automatically marked and highlighted, eliminating the need for manual page-by-page comparison. The event chain forms a linked list structure using preceding event identifiers. Even if event records are scattered and written at different times, the complete chronological relationship can be reconstructed through pointers, solving the problem of sorting and associating fragmented event records. Attached Figure Description Figure 1 This is a schematic diagram illustrating the relationship between the event chain and the state snapshot in an embodiment of the present invention.

[0004] Figure 2 This is a timing diagram for dual-time-node comparison analysis in an embodiment of the present invention. The meanings of the markings in the diagram are as follows: 101 - Factory Outgoing Event, 102 - Installation Event, 103 - Inspection Event, 104 - Repair Event, 105 - Re-inspection Event; 106-Factory snapshot S1, 107-Installation snapshot S2, 108-Inspection snapshot S3, 109-Maintenance snapshot S4, 110-Re-inspection snapshot S5; 201 - Retrieve lock operation, 202 - Trace request, 203 - Query event chain record, 204 - Return event chain and snapshot, 205 - Return timeline data, 206 - Display timeline; 207 - Select the factory exit event as the first comparison point; 208 - Select the maintenance event as the second comparison point; 209 - Perform the comparison operation. 210 - A confirmation window pops up; 211 - Confirm execution. 212 - Read S1 snapshot, 213 - Read S4 snapshot, 214 - Automatically compare fields, 215 - Return comparison results; 216 - Display snapshots S1 and S4 side by side; 217 - Highlight the differences; 218 - Summarize the changes. Figure 2 The meanings of the markers are as follows: 201-201- Operator selects the first comparison time point; 202-202- Selects the second comparison time point to initiate a comparison request; 203-203- Pop-up confirmation window displays records and indicators; 204-204- Outputs the first and second snapshots side by side; 205-205- Automatically compares values ​​of the same monitoring dimensions; 206-206- Calculates the changes in each dimension and marks the differences; 207-207- Summarizes and outputs the differences and the direction of change. Detailed Implementation The present invention will now be described in further detail with reference to the accompanying drawings and specific embodiments. Example In this embodiment, a smart lock with model number LQ-900S and identification number LS-2026-A0731 has undergone complete lifecycle management since it left the factory. like Figure 1 As shown, when the lock leaves the factory, the event chain recording module writes the factory event record (such as...) into the lifecycle event chain list. Figure 1 As shown in mark 101), the event type is "factory exit," the event occurrence time is "2026-03-12 09:22:15," the operator is "Engineer Zhao," and the preceding event identifier is empty (because this is the first event). Simultaneously, the status snapshot recording module writes the first status snapshot to the lifecycle status snapshot table (e.g., ...). Figure 1 As shown in mark 106, the lock cylinder status is recorded as "normal", the surface wear ratio is 0%, the firmware version is v2.1.3, the battery level is 100%, the communication signal strength is good, and the cumulative running time is 0 hours. After installation and multiple inspections, maintenance personnel discovered wear on the lock cylinder during one inspection and performed repairs on June 15, 2026. Upon completion of the repairs, the system recorded a "Repair" event (e.g., ...). Figure 1 As shown in marker 104), the preceding event identifier points to the most recent inspection event (e.g., Figure 1 The record number (as shown by marker 103) is also written. A status snapshot at the time of maintenance completion (e.g., ...) is also written. Figure 1 As shown in mark 109, the lock cylinder status is recorded as "replaced", the surface wear rate is 0%, the firmware version is updated to v2.2.0, and the cumulative running time is 180 hours. like Figure 1As shown, the event chain records form a linked list structure through preceding event identifiers. The preceding event identifier for the factory departure event (marked 101) is empty; the preceding event identifier for the installation event (marked 102) points to the factory departure event; the preceding event identifier for the inspection event (marked 103) points to the installation event; the preceding event identifier for the maintenance event (marked 104) points to the inspection event; and the preceding event identifier for the re-inspection event (marked 105) points to the maintenance event. Each event chain record points to the corresponding state snapshot (marked 106 to 110) through association relationships, forming a one-to-one mapping between events and state snapshots. When quality management personnel search for the lock on the lifecycle traceability page, the timeline display module arranges event records in chronological order, such as manufacturing (marked 101), installation (marked 102), inspection (marked 103), maintenance (marked 104), and re-inspection (marked 105). Each event is accompanied by a snapshot of the corresponding time and key fields. Example In this embodiment, the operator needs to determine the performance changes of lock LS-2026-A0731 before and after maintenance. For example... Figure 2 As shown, the operator retrieves the lock ID (e.g., ...) on the traceability page. Figure 2 As shown in mark 201), the front-end traceability interface requests the traceability lifecycle (e.g., Figure 2 As shown in marker 202, a traceback is initiated to the backend event and snapshot service. The backend queries the lifecycle event linked list and the lifecycle state snapshot table storage table (e.g., ...). Figure 2 (As shown in mark 203), returns all event chain records and associated state snapshots (such as...) Figure 2 As shown in mark 204), the front end is displayed in a timeline format (e.g., Figure 2 (As shown in markings 205 and 206). The operator selects the factory departure event as the first comparison point on the timeline (e.g., ...). Figure 2 (As shown in mark 207), select the maintenance event as the second comparison time point (e.g.) Figure 2 As shown in mark 208), click the "Perform Comparison" button (as shown in the image). Figure 2 (As shown in mark 209). The system pops up a confirmation window (such as...). Figure 2 As shown in the middle (marked 210), this comparison is for one lock record, the life cycle dimensions are lock cylinder status and surface wear, and it is expected to involve two monitoring indicators. After the operator confirms (e.g.) Figure 2 (As shown in mark 211), the system generates a comparison view. The backend reads the state snapshot S1 from the factory (e.g., ...). Figure 2 (as shown in mark 212) and the status snapshot S4 at the time of maintenance (as shown in mark 212) Figure 2 (As shown in mark 213), automatically compare the field values ​​with the same field name in the two state snapshots (such as...). Figure 2As shown in marker 214), the comparison results are returned (e.g. Figure 2 (As shown in mark 215). like Figure 2 As shown, the front end displays factory snapshot S1 and maintenance snapshot S4 side-by-side (as indicated by label 216). The change of lock cylinder status from "normal" to "replaced" is highlighted as a difference (as indicated by label 217), the firmware version change from v2.1.3 to v2.2.0 is highlighted as a difference, and the battery level drop from 100% to 67% (a difference of 33%, exceeding the preset threshold of 20%) is also highlighted as a difference. The bottom summary output (as indicated by label 218) shows: a lock cylinder replacement and firmware upgrade occurred, and the battery level decreased by 33 percentage points.

Claims

1. A method for tracing and comparing the lifecycle of locks based on event chains and state snapshots, characterized in that, Includes at least the following steps: When a lock experiences a lifecycle event, the current event record is written to the event chain record, and at the same time, a complete state snapshot of the lock at the current moment is written to the associated state snapshot table of the event. The event chain record shall at least include the event type, the time of the event occurrence, and the identifier of the preceding event, and the state snapshot shall at least include the current stage of the lock and the cumulative running time. The front-end traceability interface loads the event chain records of the specified lock and displays all event records in chronological order in a timeline manner. Each event record is associated with a state snapshot at the corresponding moment. After the operator selects the first comparison time point and the second comparison time point on the timeline, the system initiates a comparison request. The system outputs the first state snapshot corresponding to the first comparison time point and the second state snapshot corresponding to the second comparison time point side by side. The system automatically compares the values ​​of the same monitoring dimensions in the first state snapshot and the second state snapshot, calculates the change in each dimension, marks the dimensions with changes exceeding the preset threshold or with changes in state as difference items, and summarizes and outputs all difference items and their corresponding change directions.

2. The method according to claim 1, characterized in that, The event chain records form a linked list structure through the preceding event identifier, which points to the record number of the previous life cycle event of the lock, and is used to reconstruct the complete sequence of events.

3. The method according to claim 1, characterized in that, The status snapshot is written under the following triggering conditions: the first status snapshot is written when the lock leaves the factory, a status snapshot is written after each inspection or test, a status snapshot is written after each maintenance, and a status snapshot is written every time the status changes; the status snapshot contains at least one or more of the following: lock cylinder status, surface wear ratio, firmware version information, battery level, and communication signal strength.

4. The method according to claim 1, characterized in that, In step three, after the operator selects the first and second comparison time points, the system displays the number of lock records involved in this comparison, the life cycle dimension range, and the number of monitoring indicators expected to be involved in the pop-up window. After the operator confirms, the system generates a comparison view.

5. The method according to claim 1, characterized in that, The automatic comparison method described in step four is as follows: calculate the difference or compare the state of the field values ​​with the same field name in the first state snapshot and the second state snapshot. For numeric fields, calculate the difference; for enumerated fields, determine whether a state transition has occurred; and for Boolean fields, determine whether a truth flip has occurred. Fields whose difference exceeds a preset change threshold or whose state has transitioned are marked as difference items.

6. The method according to claim 1, characterized in that, The system also supports filtering by event type in the event type filter panel. The front-end traceability interface only displays the event records corresponding to the selected event type. The event types include at least the factory type, installation type, inspection type, maintenance type and scrap type. After filtering, the front-end interface synchronously updates the timeline display and refreshes the total event count of the lock.

7. A lock lifecycle tracing and comparative analysis system based on event chains and state snapshots, characterized in that, include: The event chain record module is used to write an event chain record when the lock experiences a life cycle event. The event chain record includes at least the event type, the event occurrence time, the preceding event identifier, and the associated lock identifier. The preceding event identifier is used to form the complete event chain list structure of the lock. The state snapshot recording module is used to synchronously write a complete state snapshot of the lock at the current moment when an event occurs. The state snapshot includes at least the current stage of the lock and the cumulative running time. The timeline display module is used to arrange and display all event records of a specified lock in chronological order in a timeline format, with each event record associated with a snapshot of its status at the corresponding moment. The comparison analysis module is used to receive the first comparison time point and the second comparison time point selected by the operator, output the first state snapshot corresponding to the first comparison time point and the second state snapshot corresponding to the second comparison time point side by side, and automatically compare the values ​​of the same monitoring dimension in the two state snapshots, calculate the change, and mark the dimension with the change exceeding the preset threshold or the state change as the difference item for highlighting.

8. The system according to claim 4, characterized in that, It also includes an event type filtering module, which is used to filter the event records displayed on the timeline by event type. After filtering, the timeline display module updates synchronously.

9. The system according to claim 4, characterized in that, After selecting a comparison time point, the comparison analysis module first outputs a confirmation window displaying the number of records and monitoring indicators involved in this comparison. The comparison view is then generated after the operator confirms the selection.

10. The system according to claim 4, characterized in that, When writing a state snapshot, the state snapshot recording module records at least the lock cylinder state, surface wear ratio, firmware version information, and cumulative runtime. When automatically comparing, the comparison and analysis module marks fields whose changes exceed a preset change threshold and enumerated fields that have undergone state transitions as difference items and highlights them. The change direction of each difference item is marked in the summary result of the difference items.