Intelligent cabinet multi-path lock light cooperative control method and system based on event driving
By generating lock and light event records, identifying event relationships, and constructing an event-based automaton model, the problem of inconsistent state transitions during multi-channel lock and light control in smart cabinets was solved, achieving coordinated control of lock and light control and improving the accuracy of state determination and the traceability of execution.
Patent Information
- Application Number
- CN202611399385.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-10
- Publication Date
- 2026-11-20
AI Technical Summary
In the existing smart cabinet's multi-channel lock and light control process, it is difficult to keep the event association and actual state transition consistent. This results in control requests, lock drive outputs, lock state changes, and light state changes intersecting in time. There is a lack of continuous judgment on the connection between the states of the same channel before and after and the control association between different types of events, leading to inconsistent execution states and conflicts.
By collecting information on the changes in the status of multiple locks and lights in the smart cabinet, lock and light event records are generated, the relationship between lock and light control events is identified, a multi-channel control event sequence is generated, the event sequence is called to execute lock and light control operations, an event-based automaton model of lock and light status is constructed, the execution order of control events is adjusted, and the multi-channel control event sequence is updated to achieve collaborative control.
It achieves coordination and traceability of state changes during multi-channel lock and lighting control, reduces control interference, improves the accuracy of state determination, and makes timely adjustments when there are execution deviations, avoiding the transmission of abnormal states to subsequent control events, and reducing state mismatch and execution conflicts.
Smart Images

Figure CN123145751A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of intelligent cabinet control technology, and in particular to an event-driven intelligent cabinet multi-channel lock and light coordination control method and system. Background Technology
[0002] With the development of smart parcel lockers, smart storage lockers, reagent cabinets, and multi-door cabinet devices, multi-channel electric locks and lighting are gradually evolving from independent control to centralized and interconnected control. Existing smart lockers typically receive upper-level control commands from a controller, which then drives the corresponding electric lock to open or close based on the channel number. It also uses a lock status detection interface to collect the door's open / closed status and simultaneously controls the corresponding lighting to turn on or off via independent light driver outputs. To monitor the operating status of each channel, existing control methods typically read lock feedback signals and light status at fixed intervals, or send status information to the upper-level control terminal after a lock status change, and sequentially complete the lock and light control operations for different channels based on the received control commands.
[0003] In the continuous operation of multi-channel lock and light control, control requests, lock drive outputs, lock state changes, and light state changes intertwine in time, and control events may occur simultaneously in different channels. Existing technologies primarily organize subsequent control based on the order of instruction arrival or fixed polling results, typically lacking continuous judgment regarding the connection between preceding and subsequent states within the same channel, as well as the control correlation between different types of events. When the actual lock state or light state of a certain channel does not meet the control requirements, subsequent control events may still continue to execute in the original order, leading to inconsistencies between the initial execution state and the actual state of subsequent control events. Furthermore, simply feeding back the lock opening and closing results is insufficient to reflect whether control requests, lock drive outputs, lock feedback changes, and light feedback changes have been completed according to the normal state transition relationship, making it difficult to uniformly identify and coordinate the normal state changes and execution deviations in the multi-channel lock and light control process. Summary of the Invention
[0004] In view of the aforementioned existing problems, the present invention is proposed.
[0005] Therefore, this invention provides an event-driven intelligent cabinet multi-channel lock and light collaborative control method to solve the problem that it is difficult to keep the event association and actual state transition consistent during the multi-channel lock and light control process.
[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution: In a first aspect, the present invention provides an event-driven intelligent cabinet multi-channel lock and light coordination control method, which includes, Collect information on the status changes of multiple locks and lights in the smart cabinet, mark the channel information, event type, status change information and occurrence time, and generate a lock and light event record; Based on the identification of the relationship between the light lock control events by the light lock event record, the control events are organized according to the channel correspondence, time continuity and state transition relationship to generate a multi-channel control event sequence; The multi-channel control event sequence is invoked to perform lock and light control operations, and the event identifier, execution status and status change time are processed accordingly to generate execution status data; Based on the execution state data, an event-based automaton model corresponding to the lock state and the light state is constructed, and state nodes and state transition events are matched to generate state feedback events. By adjusting the execution order of control events through status feedback events and light lock event records, updating the multi-channel control event sequence, and generating the intelligent cabinet light lock collaborative control result.
[0007] As a preferred embodiment of the event-driven intelligent cabinet multi-channel lock and light collaborative control method of the present invention, wherein: the generation of lock and light event records specifically includes: The open and closed status of each channel's electric lock is collected through the lock status detection interface, the lock control output status of the corresponding channel is obtained through the lock drive interface, and the light status and control requests are collected simultaneously to form a multi-channel lock and light operation status. When the operating status of the multi-channel light lock changes, the signal that has changed and its corresponding channel are identified to obtain the light lock event; Arrange the light-locking events according to their actual occurrence time, mark the channel information, event type, state before change and state after change for each light-locking event, and generate a light-locking event record.
[0008] As a preferred embodiment of the event-driven intelligent cabinet multi-channel lock and light collaborative control method of the present invention, the step of identifying the lock and light control event relationship specifically includes: Based on the event types marked in the light lock event log, distinguish between control request events, lock drive events, lock state events, and light state events to obtain the event type log; Select the corresponding consecutive events according to the event type based on the channel information, and compare the occurrence time of adjacent events to obtain the consecutive event group in the same channel; By comparing the state after the change of the previous event with the state before the change of the next event within the same channel continuous event group, the continuous events with interconnected states are retained, and the relationship of the light lock control event is generated.
[0009] As a preferred embodiment of the event-driven intelligent cabinet multi-channel lock and light collaborative control method of the present invention, the generation of the multi-channel control event sequence specifically includes: Arrange the control request events, lock drive events, lock status events, and light status events of the same channel according to the relationship of the light lock control events to obtain the channel control event chain; When the channel control event chain contains an unlocking event, the corresponding lock opening action and light turning action are arranged. When the channel control event chain contains a locking event, the corresponding lock closing action and light turning action are arranged to obtain the lock and light action sequence. The sequence of light-locking actions for each channel is arranged in a staggered manner according to the occurrence time, while maintaining the state connection sequence of the same channel, to generate a multi-channel control event sequence.
[0010] As a preferred embodiment of the event-driven intelligent cabinet multi-channel lock and light collaborative control method of the present invention, the execution of lock control and light control operations specifically includes: Extract event identifiers and channel information contained in the multi-channel control event sequence, determine the current control event and target channel, and obtain the channel execution instruction; According to the channel execution instruction, output the corresponding lock drive action and light drive action, collect the lock feedback status and light feedback status when the action is completed, and obtain the single-channel lock and light execution result; The control events of each channel are processed sequentially according to the multi-channel control event sequence, and the result of each single-channel light-locking execution is used to connect to the next control event to generate the multi-channel light-locking execution result.
[0011] As a preferred embodiment of the event-driven intelligent cabinet multi-channel lock and light collaborative control method of the present invention, wherein: the generation of execution status data specifically includes: Extract the state before the change of the control event corresponding to the execution result of the multi-way light lock, determine the state before the change as the execution start state, and obtain the start state record; Determine the expected execution state according to the lock state and light state required by the control event, and determine the lock feedback state and light feedback state as the actual execution state to obtain the execution state record; Execution status data is generated by using event identifiers and channel information to correspond to the start status record, execution status record, and status change time.
[0012] As a preferred embodiment of the event-driven intelligent cabinet multi-channel lock and light collaborative control method of the present invention, the construction of the event-type automaton model specifically includes: Compare the actual execution status with the expected execution status in the execution status data, and select the execution status data that matches both to obtain the normal execution status data; Arrange the control requests, lock drive outputs, lock feedback changes, and light feedback changes corresponding to the normal execution state data according to the occurrence time to obtain the normal lock and light state transition path; Extract the lock state and light state that remain unchanged between adjacent state change events within the normal lock and light state transition path, and determine the corresponding lock state and light state as a stable joint state to obtain the lock and light joint state sequence. Set the stable joint state within the lock-light joint state sequence as a state node, and set the control requests, lock drive outputs, and lock-light state changes that occur between adjacent state nodes as state transition events to obtain the node transition relationship. The node migration relationship is marked by channel information, and the state nodes and state migration events are connected according to the event sequence of the normal light-lock state migration path to construct the event-type automaton model corresponding to each channel.
[0013] As a preferred embodiment of the event-driven intelligent cabinet multi-channel lock and light collaborative control method of the present invention, wherein: the generation of status feedback events specifically includes: Match the execution start state of the current execution state data with the state nodes of the event-driven automaton model, select the state node with the same joint state as the initial state node, and obtain the migration start point of the current channel; According to the event order of the current execution state data, each current event is matched with the state migration event corresponding to the migration starting point, and the state node is switched along the successfully matched state migration event to obtain the current state migration path. When the current event matches the corresponding state transition event and the actual execution state is consistent with the state node pointed to by the state transition event, the current state transition path is marked as a normal transition path, and a normal state feedback event is generated. When the current event does not match the corresponding state transition event, mark the current event and the unfinished expected execution state. When the actual execution state is inconsistent with the state node pointed to by the corresponding state transition event, mark the actual execution state and the target state node, and generate an execution deviation record. The deviation status of the corresponding channel is marked by the execution deviation record, and an execution deviation feedback event is generated. The normal status feedback event and the execution deviation feedback event are identified as status feedback events.
[0014] The generation of the intelligent cabinet lock and light coordination control result specifically includes: The state feedback event is used to determine the direction of state change and the state transition matching result of the corresponding channel, and the channel feedback state is obtained. When the channel feedback state corresponds to the normal state feedback event, according to the state connection relationship shown in the light lock event record, the control events with the state after the previous event change as the execution condition are arranged after the corresponding feedback event to obtain a continuous control event group. When the channel feedback state corresponds to the execution deviation feedback event, the control event that has not yet been executed in the corresponding channel is retained and the control output of the channel is stopped, thus obtaining the deviation channel pending execution event group; When the actual lock state and lamp state of the deviation channel are rematched with the state node of the event-type automaton model, the event group to be executed in the deviation channel is restored to the corresponding state node, and the control events of the other channels are arranged according to the occurrence time to obtain the independent channel event group; The continuous control event group, the recovered deviation channel pending event group, and the independent channel event group are sorted and connected according to the channel information and occurrence time. The multi-channel control event sequence is updated, and the locking action of each channel is executed according to the updated multi-channel control event sequence to generate the intelligent cabinet locking and lighting collaborative control result.
[0015] Secondly, the present invention provides an event-driven intelligent cabinet multi-channel lock and light coordination control system, comprising, The event acquisition module collects information on the status changes of multiple locks and lights in the smart cabinet, marks the channel information, event type, status change information and occurrence time, and generates lock and light event records. The event orchestration module identifies the relationships between light lock control events based on the light lock event records, organizes control events according to channel correspondence, time continuity, and state transition relationships, and generates a multi-channel control event sequence. The light-locking execution module calls a multi-channel control event sequence to perform locking and light-control operations, and processes the event identifier, execution status, and status change time accordingly to generate execution status data; The status feedback module constructs an event-based automaton model corresponding to the lock state and the light state based on the execution status data, matches state nodes and state transition events, and generates status feedback events. The sequence adjustment module adjusts the execution order of control events through status feedback events and light lock event records, updates the multi-channel control event sequence, and generates the intelligent cabinet light lock collaborative control result.
[0016] The beneficial effects of this invention are as follows: By recording control requests, lock drive outputs, lock state changes, and light state changes as events, and organizing multi-channel control event sequences by combining channel correspondence, occurrence time, and state connection relationships, lock control and light control no longer rely solely on fixed instruction sequences. This maintains consistency in the control states of the same channel before and after execution, while reducing control interference caused by the crossover of events from different channels. During execution, the expected execution state is mapped to the actual lock feedback state and light feedback state. An event-driven automaton model is used to determine whether the actual state transition conforms to the normal lock-light control process, providing a clear distinction between normal state changes and execution deviations, thus improving the traceability and accuracy of state determination in the multi-channel lock-light control process. Furthermore, when an execution deviation occurs, subsequent control of the corresponding channel is stopped, and execution resumes after the actual lock state and light state again meet the state transition conditions. Other normal channels can continue to be processed according to the event relationships, thereby preventing the transmission of abnormal states to subsequent control events, reducing state mismatch and execution conflicts in multi-channel continuous control, and establishing a collaborative control relationship between the smart cabinet's multi-channel locks and lighting fixtures based on actual state feedback. Attached Figure Description
[0017] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. 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.
[0018] Figure 1 This is a flowchart of an event-driven intelligent cabinet multi-channel lock and light coordination control method.
[0019] Figure 2 This is a schematic diagram of the structure of a multi-channel lock and light collaborative control system for an intelligent cabinet.
[0020] Figure 3 This is a flowchart for collecting and recording events related to changes in the status of locked lights.
[0021] Figure 4 A flowchart for the arrangement and feedback adjustment of multi-channel light lock control events.
[0022] Figure 5 This is a schematic diagram of the combined state of the lock and light and the event transition relationship. Detailed Implementation
[0023] 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.
[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] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The phrase "in one embodiment" appearing in different places in this specification does not necessarily refer to the same embodiment, nor is it a single or selective embodiment that is mutually exclusive with other embodiments.
[0026] Reference Figures 1-5 This is one embodiment of the present invention, which provides an event-driven intelligent cabinet multi-channel lock and light collaborative control method, including the following steps: S1. Collect information on the status changes of multiple locks and lights in the smart cabinet, mark the channel information, event type, status change information and occurrence time, and generate a lock and light event record.
[0027] S1.1. During the operation of the smart cabinet, the channel information is first determined according to the actual connection relationship between each compartment and the electric lock and lighting, so that the lock status detection interface, lock drive interface and lighting output corresponding to the same compartment use the same channel information.
[0028] The lock status detection interface reads the open / closed status of the corresponding channel's electric lock, with the lock status limited to either open or closed. The lock drive interface reads the current lock control output status of the corresponding channel, which indicates whether the corresponding channel is currently executing a lock drive action. The interface also reads the lighting status of the corresponding channel's lights, with the lighting status limited to either on or off. Additionally, the interface reads the target channel and control requirements included in the control request.
[0029] Synchronous acquisition refers to the corresponding reading of the lock status, lock control output status, light status and control request of the same channel within the same acquisition cycle, and recording all information using the same time reference, thereby forming the multi-channel lock light operation status of each channel at the corresponding acquisition time.
[0030] The lock status detection interface collects the open and close status of the electric lock, the lock drive interface obtains the lock control output status, and the connection between the lighting output and the corresponding channel are all direct input and output relationships of the actual controlled object. This avoids inferring the cabinet door status or lighting status based solely on control requests, and ensures that subsequent event records simultaneously have control requirements, control outputs, and actual status information.
[0031] S1.2. The multi-channel lock lamp operating status formed at the previous acquisition time is used as the basis for comparison in judging the current status change. After obtaining the new multi-channel lock lamp operating status at the next acquisition time, the previous and subsequent states of the same signal in the same channel are compared item by item according to the channel information. When the lock status changes from closed to open or from open to closed, the change corresponding to the lock status detection interface is determined as a lock status event; when the lock control output status changes from unlocked drive action to lock drive action, or from lock drive action back to unlocked drive action, the change corresponding to the lock drive interface is determined as a lock drive event; when the light status changes from off to on or from on to off, the change corresponding to the lighting output is determined as a lamp status event; when a control request for the target channel is received, the control request is determined as a control request event.
[0032] When the corresponding signal in the same channel maintains the same state before and after, no corresponding light-locking event is generated. When two or more signals change at the same acquisition time, light-locking events are generated for each changed signal, and the same actual occurrence time and corresponding event type are retained. Even if a control request is the same as the control requirement of the previous control request, as long as it is a newly received control request, it is still recorded as a new control request event, thus avoiding the omission of control request events when the same control requirement is executed continuously. Compared with the method of periodically saving all operating states, generating light-locking events only for actual state changes and control requests can preserve the state transition process of each channel while reducing the recording of duplicate states that have not changed.
[0033] S1.3. After the light lock event is determined, the event type is marked according to the source of the changed signal: the light lock event originating from the control request is marked as the control request event, the light lock event originating from the lock drive interface is marked as the lock drive event, the light lock event originating from the lock state detection interface is marked as the lock state event, and the light lock event originating from the change in lighting output state is marked as the light state event; at the same time, the channel information to which the changed signal belongs is used as the channel information of the light lock event.
[0034] For lock status events, the pre-change state and post-change state record the open or closed state of the electronic lock before and after the change, respectively. For lock drive events, the pre-change state and post-change state record the lock control output state before and after the lock drive action occurs, respectively. For light status events, the pre-change state and post-change state record the on or off state of the light before and after the change, respectively. For control request events, the pre-change state records the lock state and light state corresponding to the target channel before the control request arrives, and the post-change state records the lock state and light state that the control request requires the target channel to achieve. Recording the event type and its preceding and following states according to the above correspondence ensures that the determination of the event type directly stems from the actual change in the signal, eliminating the need for additional identification or reasoning processing.
[0035] The actual occurrence time is recorded using the time corresponding to the current time base of the control program. For control request events, the actual occurrence time is the time when the control request is received and the target channel is determined; for lock drive events, the actual occurrence time is the time when the lock control output state changes; for lock status events, the actual occurrence time is the time when the lock status detection interface obtains the open / closed state after the change; for light status events, the actual occurrence time is the time when the light status changes from turning on to turning off.
[0036] After marking the channel information, event type, pre-change state, post-change state, and actual occurrence time, the light-locking events are arranged in chronological order according to their actual occurrence time. Light-locking events with the same actual occurrence time retain the order in which the control program actually generated the light-locking events, and their corresponding channel information is also retained. This ensures that control request events, lock drive events, lock status events, and light status events on the same channel can be continuously matched according to their actual occurrence process. All the arranged light-locking events together constitute the light-locking event record, serving as input for subsequent identification of light-locking control event relationships.
[0037] S2. Identify the relationship between light lock control events based on the light lock event record, organize the control events according to the channel correspondence, time continuity and state transition relationship, and generate a multi-channel control event sequence.
[0038] S2.1. Using the channel information, event type, pre-change state, post-change state, and actual occurrence time already marked in the light lock event log as the processing basis, read the light lock events in the light lock event log one by one. Distinguish events according to the signal source corresponding to the event type: if the event type corresponds to a control request, it is determined as a control request event; if the event type corresponds to a change in the lock drive interface output, it is determined as a lock drive event; if the event type corresponds to a change in the lock state detection interface feedback, it is determined as a lock state event; and if the event type corresponds to a change in the lighting output state, it is determined as a lamp state event. During the event type differentiation process, the channel information, pre-change state, post-change state, and actual occurrence time corresponding to each light lock event remain unchanged. Arrange the control request events, lock drive events, lock state events, and lamp state events according to the original actual occurrence time order in the light lock event log to form an event type record.
[0039] The event type in the event type record directly adopts the event type already marked in the light lock event record, and no longer infers the event category based on the status value. This ensures that the control request event, lock drive event, lock status event and light status event correspond to the actual control request, lock drive interface, lock status detection interface and lighting output respectively, and avoids the state changes of different signal sources being incorrectly classified into the same event type.
[0040] S2.2. Using the event type record as input for channel correspondence identification, select control request events, lock drive events, lock status events, and light status events belonging to the same channel one by one according to the channel information. Arrange the selected light-locking events for the same channel in ascending order of their actual occurrence time; light-locking events with the same actual occurrence time maintain the formation order already determined in the light-locking event record. After arrangement, identify two light-locking events that are adjacent in the arrangement and have no other light-locking events from the same channel in between as consecutive events, and sequentially check all adjacent positions within the same channel to form a group of consecutive events within the same channel.
[0041] For light-locking events in different channels, no consecutive event group is established within the same channel. For light-locking events whose actual occurrence time sequence differs from the recorded event sequence, the order is re-established based on the actual occurrence time already recorded in the event log before consecutive event judgment is performed. Separating light-locking events in different channels using channel information first avoids incorrectly associating lock drive actions, lock status changes, or light changes in different compartments when multiple compartments of the smart cabinet experience state changes at similar times.
[0042] S2.3. Starting from the beginning of the continuous event group in the same channel, sequentially read the changed state of the previous light lock event and the unchanged state of the next light lock event, and compare them item by item according to the state content corresponding to the two light lock events. When the changed state of the previous light lock event corresponds to the unchanged state of the next light lock event, it is determined that there is a state connection between the two light lock events, and the continuity between the two light lock events is maintained; when the changed state of the previous light lock event does not correspond to the unchanged state of the next light lock event, it is determined that there is no state connection between the two light lock events, and the continuity between the two light lock events is broken. The next light lock event is then used as the starting light lock event for subsequent state connection judgment and is compared with the next light lock event.
[0043] State correspondence means that the state formed after the execution or occurrence of a previous light-locking event can be considered a state that already existed before the occurrence of a subsequent light-locking event. For example, if the state after the change of the previous lock state event is open, and the lock state corresponding to the subsequent light-locking event was still open before the change, the two light-locking events satisfy the lock state continuity condition; if the state after the change of the previous light state event is lit, and the light state corresponding to the subsequent light-locking event was still lit before the change, the two light-locking events satisfy the light state continuity condition. For state change information that includes both lock state and light state, the lock state and light state are checked separately. If all correspondences are correct, the continuity between the two light-locking events is maintained; if any corresponding state is inconsistent, the continuity between the two light-locking events is broken.
[0044] After sequentially determining the state connection of all adjacent light-locking events within a continuous event group on the same channel, consecutive light-locking events that simultaneously satisfy the following criteria are identified as light-locking control event relationships: same channel, consecutive actual occurrence time, and seamless connection between the pre-change and post-change states. Using the actual state connection results to define light-locking control event relationships eliminates irrelevant event connections formed solely due to their similar actual occurrence times, ensuring that the organization of subsequent control events remains consistent with the actual state transition process within the same channel.
[0045] S2.4. Following the sequential connection order determined by the relationships between the lock and light control events, continuously arrange the interconnected control request events, lock drive events, lock status events, and light status events within the same channel to form a channel control event chain. In the channel control event chain, the control request event indicates the control requirement of the corresponding channel, the lock drive event indicates the lock drive action of the corresponding channel, the lock status event indicates the actual open or closed state change of the electronic lock in the corresponding channel, and the light status event indicates the actual on or off state change of the lighting in the corresponding channel.
[0046] When a control request in the channel control event chain requires the electric lock to open, or when the lock state event changes to an open state, the corresponding content is identified as an unlocking event, and the corresponding lock opening action and light turning-on action are arranged according to the state connection sequence in the channel control event chain. When a control request in the channel control event chain requires the electric lock to close, or when the lock state event changes to a closed state, the corresponding content is identified as a locking event, and the corresponding lock closing action and light turning-off action are arranged according to the state connection sequence in the channel control event chain, thus forming the lock and light action sequence for each channel. The corresponding light turns on when the lock is opened and turns off when the lock is closed, consistent with the actual linkage between lock control and light control.
[0047] After establishing the light-locking action sequence for each channel, the actual occurrence time of each channel's light-locking action sequence is used as the basis for cross-channel arrangement. The first control event that has not yet been arranged for each channel is read, and the control event with the earliest actual occurrence time is added to the multi-channel control event sequence. The next control event for the corresponding channel is then read for subsequent comparison. When control events from two or more different channels have the same actual occurrence time, they are arranged according to the formation order already preserved in the light-locking event record. Control events within the same channel always maintain the established state connection order of the channel's control event chain, and the light-locking action sequence within the same channel is not changed due to the insertion of control events from other channels. This process continues until all control events in the light-locking action sequence of each channel are arranged, generating a multi-channel control event sequence.
[0048] S3. Call the multi-channel control event sequence to perform lock and light control operations, process the event identifier, execution status and status change time accordingly, and generate execution status data.
[0049] S3.1. Read the control events one by one according to the established order of the multi-channel control event sequence, and extract the event identifier and channel information corresponding to the current control event. The event identifier is used to distinguish different control events in the multi-channel control event sequence and maintains a one-to-one correspondence with the current control event; the channel information follows the channel correspondence between the grid, electric lock, and lighting, and is used to determine the target channel corresponding to the current control event.
[0050] After reading the event identifier and channel information, the sequence of lock and light-activating actions required by the current control event is read. When the current control event corresponds to an unlocking event, the target channel, lock-opening action, and light-on action are determined as the channel execution instruction; when the current control event corresponds to a locking event, the target channel, lock-closed action, and light-off action are determined as the channel execution instruction. The channel execution instruction only applies to the target channel corresponding to the event identifier and does not change the control events that have not yet been executed on other channels in the multi-channel control event sequence.
[0051] S3.2. Select the lock drive interface and lighting output corresponding to the target channel according to the channel execution instruction. For unlocking events, the lock drive interface outputs the lock control output state corresponding to the lock opening action, and switches the lighting output corresponding to the target channel to the lit state; for locking events, the lock drive interface outputs the lock control output state corresponding to the lock closing action, and switches the lighting output corresponding to the target channel to the off state.
[0052] After the lock drive action is output, the lock status detection interface continues to read the open / closed status of the target channel's electric lock. The lock feedback status uses the stable open / closed status obtained from the lock status detection interface, where the open state indicates that the target channel's electric lock is in the open state, and the closed state indicates that the target channel's electric lock is in the closed state. For any instantaneous level changes that occur during the lock status detection interface reading process, the lock feedback status is determined only after the level has stabilized, to avoid contact bounce or transient line interference being mistaken for actual lock status changes.
[0053] Synchronously with reading the lock feedback state, the current light state corresponding to the target channel's lighting output is read. The light feedback state uses the light output state after the current light driver action is executed, where the lit state corresponds to the light being turned on and the off state corresponds to the light being turned off. The light feedback state uses the same method as the light state acquisition, without adding a separate state source. After both the lock feedback state and the light feedback state are obtained, the event identifier, channel information, lock feedback state, light feedback state, and state change time are recorded under the same control event to form a single-channel light lock execution result. Using the actual lock feedback state and the actual read light state to record the execution result, compared to the method of directly determining that the action has been completed based solely on the control command, it can distinguish between the two situations: the control output has been issued and the target state has actually been formed.
[0054] S3.3. After completing the current control event, read the next control event in the multi-channel control event sequence; if the next control event belongs to the same channel, use the lock feedback state and lamp feedback state in the current single-channel light locking execution result as the current state that can be obtained before the next control event is executed, and continue to execute according to the determined state connection order; if the next control event belongs to a different channel, keep the current single-channel light locking execution result corresponding to the current channel, and switch to the target channel corresponding to the next control event according to the determined arrangement order of the multi-channel control event sequence.
[0055] Upon completion of each control event, a single-channel light-locking execution result is generated in the same manner, maintaining a one-to-one correspondence between the single-channel light-locking execution result and the event identifier and channel information. After processing all control events in the multi-channel control event sequence, the single-channel light-locking execution results are arranged in the original order of the multi-channel control event sequence to form the multi-channel light-locking execution results. In cases where multiple channels have consecutive unlocking requirements, each target channel is still executed item by item according to the multi-channel control event sequence to avoid the lock-driving actions of multiple channels being simultaneously output, thus disrupting the established event sequence.
[0056] S3.4. Locate the corresponding control event in the multi-channel control event sequence according to the event identifier, extract the pre-change state of the control event record, and determine the pre-change state as the execution start state. The execution start state is kept consistent with the recording method of S1: when a lock state is involved, record the open or closed state; when a light state is involved, record the on or off state; when a control event involves both lock and light states, record both the lock state and light state corresponding to the control event before execution to form the start state record.
[0057] After the initial state record is determined, the expected execution state is determined based on the sequence of locking and light-holding actions required by the current control event. When the current control event is an unlocking event, the lock state in the expected execution state is unlocked and the light state is lit; when the current control event is a locking event, the lock state in the expected execution state is closed and the light state is off. The expected execution state is directly derived from the sequence of locking and light-holding actions formed by S2 and is not modified in reverse based on the actual feedback results, thus maintaining the comparability between the control requirements and the actual execution results.
[0058] Extract the lock feedback state and light feedback state from the single-channel lock-light execution result corresponding to the same event identifier, and use these as the actual execution state and light state, respectively. The actual execution state only records the state actually read after the action is completed: if the lock feedback state is open and the light feedback state is lit, record the actual execution state as "lock open, light lit"; if the lock feedback state is closed and the light feedback state is off, record the actual execution state as "lock closed, light off". If the lock feedback state or light feedback state is inconsistent with the expected execution state, still record the actual execution state according to the actual read result, without replacing the actual execution state with the expected execution state. This preserves the difference between the actual state and the expected state, providing direct data for subsequent judgment of whether state transitions are consistent based on the execution state data.
[0059] S3.5. After determining the execution start state, expected execution state, and actual execution state, use the event identifier as the basis for data correspondence within the same control event, and use channel information as the basis for data differentiation between different target channels. Map the start state record, expected execution state, actual execution state, and state change time to the same event identifier. The state change time follows the unified time base established in S1: record the state change time corresponding to the lock feedback state when the lock feedback state undergoes a stable change, and record the state change time corresponding to the lamp feedback state when the lamp feedback state changes; if the lock feedback state or lamp feedback state does not change before or after the execution of this control event, retain the actual execution state and do not fabricate new state change times.
[0060] According to the order of the multi-channel control event sequence, save the event identifier, channel information, execution start state, expected execution state, actual execution state and state change time corresponding to each control event to form execution state data.
[0061] S4. Construct an event-based automaton model corresponding to the lock state and the light state based on the execution state data, match state nodes with state transition events, and generate state feedback events.
[0062] S4.1. Read the execution status data one by one according to the event identifier and channel information, and obtain the execution start state, expected execution state, actual execution state and state change time corresponding to each control event. First, compare the lock state and light state contained in the expected execution state and the actual execution state under the same event identifier. If both the lock state and the light state are consistent, the corresponding execution status data is determined as normal execution status data; if at least one of the lock state or light state is inconsistent, the corresponding execution status data is not used for the construction of normal state transition relationship in the event-based automaton model.
[0063] In this model, the expected execution state for an unlocking event is lock open and light on, and the actual execution state is also lock open and light on, satisfying the consistency condition. Similarly, the expected execution state for a locking event is lock closed and light off, and the actual execution state is also lock closed and light off, satisfying the consistency condition. The comparison between the actual and expected execution states directly uses the generated state records, without inferring the actual execution result based on control requests or lock drive outputs. This ensures that the state transition relationships used in the event-driven automaton model originate from the completed lock-and-light control process that has received actual feedback.
[0064] S4.2. Process the normal execution status data according to the channel information, and arrange the control requests, lock drive outputs, lock feedback changes, and lamp feedback changes corresponding to the same channel in order of chronological order based on the time of the status change. Control requests use the recorded control request events, lock drive outputs use the lock control output status changes represented by the corresponding lock drive events, lock feedback changes use the open and closed status changes represented by lock status events, and lamp feedback changes use the on and off status changes represented by lamp status events.
[0065] For two or more events with the same state change time, the established order of the light lock event records is maintained, and the order of events is not changed again.
[0066] After the arrangement is completed, starting from the execution start state of the same channel, the state change process is continuously recorded according to the actual occurrence sequence of control requests, lock drive outputs, lock feedback changes, and lamp feedback changes, until the actual execution state of the corresponding control event is formed. The execution start state of the next normal execution state data in the same channel is then connected to the current actual execution state. The connection continues only if the current actual execution state is consistent with the lock state and lamp state in the next execution start state; if there is an inconsistency, the continuous connection at the current position is terminated, and the next normal execution state data is used as the starting point for the subsequent state change process. All normal execution state data in the same channel are processed sequentially to form a normal lock-lamp state transition path. Establishing a normal lock-lamp state transition path according to the actual occurrence time and actual feedback state can avoid a transition sequence that is inconsistent with the actual action of the electronic lock formed solely based on the arrangement relationship of control requests.
[0067] S4.3. Check the lock state and light state sequentially between adjacent state change events along the normal lock and light state transition path. If, after the previous state change event is completed and before the next state change event occurs, the lock state remains open or closed, and the light state remains on or off, the lock state and light state that remain unchanged between adjacent state change events are determined as a stable joint state.
[0068] Stable joint states are recorded according to the lock and light states that actually exist simultaneously within the same channel and state stage. This includes stable joint states corresponding to lock open and light on, and lock closed and light off. When other lock and light state combinations actually exist in the normal execution state data, the corresponding stable joint states are recorded according to the lock and light states that remain unchanged in the normal lock-light state transition path, without altering the actual feedback content. The stable joint states are arranged in the order of the normal lock-light state transition path, forming a lock-light joint state sequence. Each lighting output can be linked with the corresponding electronic lock state; when the lock is open, the corresponding light turns on, and when the lock is closed, the corresponding light turns off, providing a practical control basis for establishing the correspondence between lock and light states.
[0069] S4.4. Set the stable joint states in the lock-lamp joint state sequence as state nodes of the event-driven automaton model. Each state node simultaneously records the lock state and lamp state of the corresponding channel. Read the actual events that occur between adjacent state nodes in the normal lock-lamp state transition path, and set the control requests, lock drive outputs, lock feedback changes, and lamp feedback changes as state transition events in the actual order of occurrence.
[0070] The state transition process uses the previous state node as the starting point and the next state node as the ending point, connecting them with the actual state transition events that occur between them to form a node transition relationship. For example, if the stable joint state in the previous state node is "lock closed, light off," and the normal lock-light state transition path subsequently includes an unlock control request, a lock unlocking action, and changes in lock and light feedback, ultimately forming a stable joint state of "lock open, light on," then the state node corresponding to "lock closed, light off" is used as the starting point, and the state node corresponding to "lock open, light on" is used as the ending point. The actual control requests, lock drive outputs, and lock-light state changes that occur in between are set as the corresponding state transition events. The locking process connects the state nodes corresponding to "lock open, light on" and "lock closed, light off" in the same way.
[0071] Each node's migration relationship continues to be marked with the corresponding channel information to avoid cross-matching when different channels have the same lock and light states. Each state node and state migration event is continuously connected according to the event sequence of the already determined normal lock / light state migration path until all normal lock / light state migration paths for the same channel are connected, thus constructing the event-driven automaton model for that channel. Event-driven automaton models for other channels are constructed using the same processing method.
[0072] S4.5. After the event-driven automaton model is constructed, the current execution state data is used as the state transition matching object. First, the channel information of the current execution state data is read, and an event-driven automaton model with consistent channel information is selected. Then, the execution start state of the current execution state data is obtained, and the lock state and light state in the execution start state are combined to form the current joint state. This joint state is then checked against the lock state and light state recorded by each state node of the corresponding channel's event-driven automaton model. When the lock state and light state are consistent, the corresponding state node is determined as the initial state node, and the initial state node is used as the transition starting point for the current channel.
[0073] When the execution start state and all state nodes cannot form a joint state consistent with the lock state and the light state, no current state transition path is established, and an execution deviation record is formed according to the situation where the current event cannot match the corresponding state transition event, thereby avoiding continuing to process along the normal transition relationship when there is no valid transition start point.
[0074] After determining the migration starting point, matching is performed item by item according to the actual occurrence order of the events corresponding to the current execution state data. The event type and state change information of the current event are mapped to the light lock event record by the event identifier. First, it is checked whether the current event and the state migration event associated with the migration starting point belong to the same channel. Then, it is checked whether the event types are consistent. Subsequently, it is checked whether the state before and after the change in the current event record are consistent with the state change relationship in the corresponding state migration event record. When the channel information, event type, and corresponding state change relationship are all consistent, the current event and the corresponding state migration event are successfully matched, and the system switches to the next state node pointed to by the successfully matched state migration event. The switched state node is used as the new migration starting point to continue matching the next current event, thus forming the current state migration path.
[0075] S4.6. During the formation of the current state transition path, the event matching result and the actual execution state are judged separately. If the current event successfully matches the corresponding state transition event, and the lock state and light state in the actual execution state obtained after the current event is executed are consistent with the lock state and light state in the state node pointed to by the state transition event, the current state transition process satisfies the normal lock and light state transition relationship. After all the events corresponding to the current execution state data have completed the above matching, the current state transition path is marked as a normal transition path, and a normal state feedback event is formed using event identifier, channel information, actual execution state, and state change time.
[0076] Normal state feedback events are formed based on the completion of actual state transitions, rather than solely on the occurrence of lock drive outputs. Therefore, the control outputs can be correlated with the actual states reached by the electric locks and lighting fixtures. The method of generating active feedback only after the actual lock state changes also corresponds to the actual lock state event-driven feedback method.
[0077] When there is an inconsistency between the current event and the state transition event associated with the migration starting point in terms of channel information, event type, or corresponding state change relationship, it is determined that the current event does not match the corresponding state transition event. The unmatched current event is recorded, and the unfinished expected execution state is recorded according to the expected execution state of the current control event, thus forming an execution deviation record.
[0078] If the current event can match the corresponding state transition event, but the lock state or light state in the actual execution state is inconsistent with the corresponding state in the state node pointed to by the state transition event, the actual execution state and the target state node pointed to by the corresponding state transition event are recorded to form an execution deviation record.
[0079] When the current event is not matched and the actual execution status has not reached the corresponding expected execution status, the execution deviation record retains the current event, the unfinished expected execution status, and the actual execution status, so that the inconsistency of events and the inconsistency of status can remain corresponding within the same channel.
[0080] The deviation status of the corresponding channel is marked according to the channel information in the execution deviation record, and an execution deviation feedback event is formed using the event identifier, channel information, execution deviation record, and status change time. The normal status feedback event and the execution deviation feedback event are jointly determined as the status feedback event.
[0081] S5. Adjust the execution order of control events by recording status feedback events and light lock events, update the multi-channel control event sequence, and generate the intelligent cabinet light lock collaborative control result.
[0082] S5.1. Read the status feedback events according to the channel information, and obtain the event identifier, actual execution status, status change time, and status transition matching result corresponding to each status feedback event. The status transition matching result is determined according to the formation type of the status feedback event: the status transition matching is successful for normal status feedback events, and the status transition matching fails for execution deviation feedback events.
[0083] The direction of state change is determined based on the execution start state and actual execution state recorded in the state feedback event of the same channel. If the lock is closed and the light is off in the execution start state, and the lock is open and the light is on in the actual execution state, the direction of state change is determined to be unlocking and light turning on. If the lock is open and the light is on in the execution start state, and the lock is closed and the light is off in the actual execution state, the direction of state change is locking and light turning off. If the actual execution state has not reached the state node pointed to by the corresponding state transition event, the actual execution state and the target state node in the execution deviation feedback event are retained, and the incomplete state change is not judged as a normal state change direction.
[0084] The channel information, state change direction, and state transition matching results are recorded to form the channel feedback state. The state change direction and state transition matching results are directly determined using the obtained execution start state, actual execution state, and state transition results, avoiding the need to judge whether subsequent control events can continue to be executed solely based on control requests.
[0085] S5.2. When a channel feedback state corresponds to a normal state feedback event, the actual execution state in the normal state feedback event is used as the starting point for the state connection of subsequent control events in the corresponding channel. The control event that has not yet been executed in the corresponding channel is selected from the lock event record according to the channel information. First, the control event with the earliest actual occurrence time after the normal state feedback event is read. The actual execution state corresponding to the normal state feedback event is checked item by item against the state before the change in the control event. When both the lock state and the light state correspond to each other, the control event is deemed to satisfy the state connection relationship where the state after the change of the previous event is used as the execution condition, and the control event is arranged after the normal state feedback event.
[0086] After completing the state connection judgment for a control event, the changed state of the already arranged control events is used as the basis for the next judgment, and then compared with the unchanged state of the next control event in the same channel. If both the lock state and the light state are consistent, the next control event continues to be arranged; if the lock state or the light state is inconsistent, the continuous arrangement of the current position is terminated. The control events that have not yet been executed in the corresponding channel are processed in the same way, and the control events that continuously satisfy the state connection relationship are formed into a continuous control event group.
[0087] The continuous control event group only retains control events within the same channel that can connect the state after the previous event changes to the state before the next event changes. This ensures that after a normal state feedback event is formed, subsequent control events that are consistent with the current actual lock state and light state can continue to be executed, avoiding the continued execution of lock actions that are inconsistent with the current state based solely on the order in which control events are received.
[0088] S5.3. When the channel feedback state corresponds to the execution deviation feedback event, based on the channel information in the execution deviation feedback event, determine the control events that have not yet been executed for the corresponding channel in the current multi-channel control event sequence. Keep the original event identifier, occurrence time, and connection order of the same channel state of the control events that have not yet been executed unchanged, and continuously retain the control events that have not yet been executed starting from the current execution position to form a deviation channel pending execution event group, and stop the deviation channel from continuing to output lock drive action and lamp drive action.
[0089] After the deviation channel stops controlling the output, the actual lock and light states of the deviation channel continue to be acquired according to the existing state acquisition methods of the lock state detection interface and lighting output. The event group to be executed in the deviation channel remains in an inactive state until the actual lock and light states are rematched with the state nodes of the event-based automaton model, and does not continue to output subsequent light-locking actions to the deviation channel according to the original multi-channel control event sequence; other channels that have not formed execution deviations do not change their already acquired actual lock and light states due to the deviation channel stopping its control output. Adopting a channel-by-channel control output stopping method avoids the situation where subsequent control events of the same channel are continuously executed after a deviation has occurred in the previous state transition, preventing subsequent light-locking actions from being established on an incorrect execution start state.
[0090] S5.4. Perform state node matching on the actual lock state and lamp state continuously acquired by the deviation channel. First, select the event-type automaton model for the corresponding channel according to the channel information. Then, compare the actual lock state, lamp state and the stable joint state recorded by each state node. When the actual lock state is consistent with the lock state in the state node and the actual lamp state is consistent with the lamp state in the same state node, determine the state node of the event-type automaton model to be rematched with the actual lock state and lamp state of the deviation channel, and use the successfully matched state node as the state connection position for the deviation channel to resume control.
[0091] Starting from the beginning of the deviance channel's pending event group, the pre-change states of control events are checked according to the original order. If the pre-change state of a control event matches the lock and light states recorded by a successfully matched state node, the deviance channel's pending event group is restored starting from the corresponding control event. Control events in the deviance channel's pending event group that cannot form a state connection with a successfully matched state node at the beginning are not included in the restored execution order to avoid continuing execution from control events inconsistent with the current actual state. If the actual lock and light states cannot simultaneously match the same state node, the deviance channel's pending event group remains in an unexecuted state.
[0092] Simultaneously, control events that have not yet been executed are selected according to the channel information, excluding the deviation channel and the corresponding channels that have formed continuous control event groups, and arranged in order of occurrence time. When the occurrence times are the same, the established event formation order of the light lock event records is maintained to form independent channel event groups. Independent channel event groups maintain the original connection order of the same channel state for each channel, so that while the deviation channel is waiting for the state to recover, the other channels can still maintain an independent light lock control process according to the actual occurrence time.
[0093] S5.5. The continuous control event group, the recovered deviation channel pending event group, and the independent channel event group are used as the objects for updating the multi-channel control event sequence. First, the channels to which each control event belongs are distinguished according to the channel information. Within the same channel, the established state connection order of the continuous control event group, the recovered deviation channel pending event group, or the independent channel event group is maintained. Between different channels, the control event records are arranged in a cross-order manner according to their occurrence time.
[0094] During the specific arrangement process, the first control event that has not yet been arranged in the continuous control event group, the recovered deviation channel pending event group, and the independent channel event group is read respectively. The occurrence time of each first control event is compared, and the control event with the earliest occurrence time is added to the updated multi-channel control event sequence. After a control event is arranged, the next control event in the corresponding event group is read and compared with the first control event that has not yet been arranged in other event groups. When control events from two or more different channels have the same occurrence time, they are arranged according to the event formation order already determined in the light lock event record. The established state connection order between control events in the same channel is not changed due to the insertion of control events from other channels. Channel information differentiation and occurrence time comparison are continuously performed until all executable control events in the continuous control event group, the recovered deviation channel pending event group, and the independent channel event group are arranged, and the multi-channel control event sequence is updated.
[0095] The target channel is determined item by item according to the updated multi-channel control event sequence, and the locking action of each channel is completed according to the lock driving action and the light driving action execution method. The subsequent control events corresponding to the normal state feedback event continue to be executed according to the state connection relationship. The subsequent control events corresponding to the execution deviation feedback event resume execution after the actual lock state and light state are rematched with the event-type automaton model state node. The control events of the remaining channels are executed independently according to the occurrence time, generating the intelligent cabinet lock and light collaborative control result.
[0096] This embodiment also provides an event-driven intelligent cabinet multi-channel lock and light coordination control system, including: The event acquisition module collects information on the status changes of multiple locks and lights in the smart cabinet, marks the channel information, event type, status change information and occurrence time, and generates lock and light event records. The event orchestration module identifies the relationships between light lock control events based on the light lock event records, organizes control events according to channel correspondence, time continuity, and state transition relationships, and generates a multi-channel control event sequence. The light-locking execution module calls a multi-channel control event sequence to perform locking and light-control operations, and processes the event identifier, execution status, and status change time accordingly to generate execution status data; The status feedback module constructs an event-based automaton model corresponding to the lock state and the light state based on the execution status data, matches state nodes and state transition events, and generates status feedback events. The sequence adjustment module adjusts the execution order of control events through status feedback events and light lock event records, updates the multi-channel control event sequence, and generates the intelligent cabinet light lock collaborative control result.
[0097] In summary, this invention organizes the multi-channel lock and light control process of the smart cabinet using an event-driven approach. Corresponding events are generated only when there are actual changes in control requests, lock drive outputs, lock states, or light states. This allows the control process to focus on valid state changes, reducing the repetitive collection, judgment, and transmission of a large number of unchanged states during fixed-cycle polling. By maintaining the correspondence between control requests, executed actions, and feedback results through event identifiers, channel information, and occurrence times, the locking and lighting actions of different channels can be tracked independently. Even when multiple channel control requests occur concurrently, the continuity of events and execution order within each channel are maintained. Furthermore, by combining the stable joint state of lock and light states and the state transition relationship to provide feedback on the execution process, the lock actions, lighting linkage, and actual state changes form a complete event loop. This improves the traceability of the multi-channel lock and light control process and preserves the normal control process of other channels when an abnormal state occurs in a single channel, enhancing the control stability and resource utilization efficiency of the smart cabinet during continuous multi-channel operation.
[0098] 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. An event-driven intelligent cabinet multi-channel lock and light collaborative control method, characterized in that: include, Collect information on the status changes of multiple locks and lights in the smart cabinet, mark the channel information, event type, status change information and occurrence time, and generate a lock and light event record; Based on the identification of the relationship between the light lock control events by the light lock event record, the control events are organized according to the channel correspondence, time continuity and state transition relationship to generate a multi-channel control event sequence; The multi-channel control event sequence is invoked to perform lock and light control operations, and the event identifier, execution status and status change time are processed accordingly to generate execution status data; Based on the execution state data, an event-based automaton model corresponding to the lock state and the light state is constructed, and state nodes and state transition events are matched to generate state feedback events. By adjusting the execution order of control events through status feedback events and light lock event records, updating the multi-channel control event sequence, and generating the intelligent cabinet light lock collaborative control result.
2. The event-driven intelligent cabinet multi-channel lock and light collaborative control method as described in claim 1, characterized in that: The generation of the light lock event record specifically includes: The open and closed status of each channel's electric lock is collected through the lock status detection interface, the lock control output status of the corresponding channel is obtained through the lock drive interface, and the light status and control requests are collected simultaneously to form a multi-channel lock and light operation status. When the operating status of the multi-channel light lock changes, the signal that has changed and its corresponding channel are identified to obtain the light lock event; Arrange the light-locking events according to their actual occurrence time, mark the channel information, event type, state before change and state after change for each light-locking event, and generate a light-locking event record.
3. The event-driven intelligent cabinet multi-channel lock and light collaborative control method as described in claim 2, characterized in that: The identification of the light lock control event relationships specifically includes: Based on the event types marked in the light lock event log, distinguish between control request events, lock drive events, lock state events, and light state events to obtain the event type log; Select the corresponding consecutive events according to the event type based on the channel information, and compare the occurrence time of adjacent events to obtain the consecutive event group in the same channel; By comparing the state after the change of the previous event with the state before the change of the next event within the same channel continuous event group, the continuous events with interconnected states are retained, and the relationship of the light lock control event is generated.
4. The event-driven intelligent cabinet multi-channel lock and light collaborative control method as described in claim 3, characterized in that: The generation of the multi-channel control event sequence specifically includes: Arrange the control request events, lock drive events, lock status events, and light status events of the same channel according to the relationship of the light lock control events to obtain the channel control event chain; When the channel control event chain contains an unlocking event, the corresponding lock opening action and light turning action are arranged. When the channel control event chain contains a locking event, the corresponding lock closing action and light turning action are arranged to obtain the lock and light action sequence. The sequence of light-locking actions for each channel is arranged in a staggered manner according to the occurrence time, while maintaining the state connection sequence of the same channel, to generate a multi-channel control event sequence.
5. The event-driven intelligent cabinet multi-channel lock and light collaborative control method as described in claim 4, characterized in that: The execution of lock and light control operations specifically includes: Extract event identifiers and channel information contained in the multi-channel control event sequence, determine the current control event and target channel, and obtain the channel execution instruction; According to the channel execution instruction, output the corresponding lock drive action and light drive action, collect the lock feedback status and light feedback status when the action is completed, and obtain the single-channel lock and light execution result; The control events of each channel are processed sequentially according to the multi-channel control event sequence, and the result of each single-channel light-locking execution is used to connect to the next control event to generate the multi-channel light-locking execution result.
6. The event-driven intelligent cabinet multi-channel lock and light collaborative control method as described in claim 5, characterized in that: The generated execution status data specifically includes: Extract the state before the change of the control event corresponding to the execution result of the multi-way light lock, determine the state before the change as the execution start state, and obtain the start state record; Determine the expected execution state according to the lock state and light state required by the control event, and determine the lock feedback state and light feedback state as the actual execution state to obtain the execution state record; Execution status data is generated by using event identifiers and channel information to correspond to the start status record, execution status record, and status change time.
7. The event-driven intelligent cabinet multi-channel lock and light collaborative control method as described in claim 6, characterized in that: The construction of the event-driven automaton model specifically includes: Compare the actual execution status with the expected execution status in the execution status data, and select the execution status data that matches both to obtain the normal execution status data; Arrange the control requests, lock drive outputs, lock feedback changes, and light feedback changes corresponding to the normal execution state data according to the occurrence time to obtain the normal lock and light state transition path; Extract the lock state and light state that remain unchanged between adjacent state change events within the normal lock and light state transition path, and determine the corresponding lock state and light state as a stable joint state to obtain the lock and light joint state sequence. Set the stable joint state within the lock-light joint state sequence as a state node, and set the control requests, lock drive outputs, and lock-light state changes that occur between adjacent state nodes as state transition events to obtain the node transition relationship. The node migration relationship is marked by channel information, and the state nodes and state migration events are connected according to the event sequence of the normal light-lock state migration path to construct the event-type automaton model corresponding to each channel.
8. The event-driven intelligent cabinet multi-channel lock and light collaborative control method as described in claim 7, characterized in that: The generation of status feedback events specifically includes: Match the execution start state of the current execution state data with the state nodes of the event-driven automaton model, select the state node with the same joint state as the initial state node, and obtain the migration start point of the current channel; According to the event order of the current execution state data, each current event is matched with the state migration event corresponding to the migration starting point, and the state node is switched along the successfully matched state migration event to obtain the current state migration path. When the current event matches the corresponding state transition event and the actual execution state is consistent with the state node pointed to by the state transition event, the current state transition path is marked as a normal transition path, and a normal state feedback event is generated. When the current event does not match the corresponding state transition event, mark the current event and the unfinished expected execution state. When the actual execution state is inconsistent with the state node pointed to by the corresponding state transition event, mark the actual execution state and the target state node, and generate an execution deviation record. The deviation status of the corresponding channel is marked by the execution deviation record, and an execution deviation feedback event is generated. The normal status feedback event and the execution deviation feedback event are identified as status feedback events.
9. The event-driven intelligent cabinet multi-channel lock and light collaborative control method as described in claim 8, characterized in that: The generation of the intelligent cabinet lock and light coordination control result specifically includes: The state feedback event is used to determine the direction of state change and the state transition matching result of the corresponding channel, and the channel feedback state is obtained. When the channel feedback state corresponds to the normal state feedback event, according to the state connection relationship shown in the light lock event record, the control events with the state after the previous event change as the execution condition are arranged after the corresponding feedback event to obtain a continuous control event group. When the channel feedback state corresponds to the execution deviation feedback event, the control event that has not yet been executed in the corresponding channel is retained and the control output of the channel is stopped, thus obtaining the deviation channel pending execution event group; When the actual lock state and lamp state of the deviation channel are rematched with the state node of the event-type automaton model, the event group to be executed in the deviation channel is restored to the corresponding state node, and the control events of the other channels are arranged according to the occurrence time to obtain the independent channel event group; The continuous control event group, the recovered deviation channel pending event group, and the independent channel event group are sorted and connected according to the channel information and occurrence time. The multi-channel control event sequence is updated, and the locking action of each channel is executed according to the updated multi-channel control event sequence to generate the intelligent cabinet locking and lighting collaborative control result.
10. An event-driven intelligent cabinet multi-channel lock and light coordination control system, based on the event-driven intelligent cabinet multi-channel lock and light coordination control method according to any one of claims 1 to 9, characterized in that: include, The event acquisition module collects information on the status changes of multiple locks and lights in the smart cabinet, marks the channel information, event type, status change information and occurrence time, and generates lock and light event records. The event orchestration module identifies the relationships between light lock control events based on the light lock event records, organizes control events according to channel correspondence, time continuity, and state transition relationships, and generates a multi-channel control event sequence. The light-locking execution module calls a multi-channel control event sequence to perform locking and light-control operations, and processes the event identifier, execution status, and status change time accordingly to generate execution status data; The state feedback module constructs an event-based automaton model corresponding to the lock state and the light state based on the execution state data, matches state nodes with state transition events, and generates state feedback events. The sequence adjustment module adjusts the execution order of control events through status feedback events and light lock event records, updates the multi-channel control event sequence, and generates the intelligent cabinet light lock collaborative control result.
