Zigbee scene intelligent processing method, storage medium and system

Through the combination of data conversion and the three-layer decision tree, the delay and packet loss problems of complex scenarios in the Zigbee protocol are solved, and the intelligent processing of Zigbee scenarios is realized, and the system execution efficiency and user experience are improved.

CN120498916APending Publication Date: 2025-08-15XIAMEN LEELEN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510858248.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-25
Publication Date
2025-08-15

AI Technical Summary

Technical Problem

The existing Zigbee protocol has problems such as increasing latency and increasing packet loss rate when executing complex scenarios. The control mode is rigid and cannot dynamically adapt to network state and device capabilities. The scenario priority lacks flexibility, resulting in low system execution efficiency and poor user experience.

Method used

Data conversion processing is used to convert the delay instructions into absolute timestamps, combine the three-layer decision tree to select the control mode, and optimize the scene processing through the priority preemption mechanism and differential backup technology to achieve dynamic adjustment and resource utilization improvement.

Benefits of technology

The response speed and system reliability of Zigbee scenarios are optimized, the processing efficiency and user experience in complex scenarios are improved, the recursive analysis delay and clock drift problems of nested scenarios are solved, and the intelligent control mode and dynamic adaptation of resources are realized.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120498916A_ABST
    Figure CN120498916A_ABST
Patent Text Reader

Abstract

The invention discloses a Zigbee scene intelligent processing method, a storage medium and a Zigbee scene intelligent processing system, and relates to the field of general control or regulation systems.In the method, scenes with higher priorities can be processed in time through a priority preemption mechanism; the problems of recursive analysis delay and clock drift of a nested scene are solved by removing secondary scene / group information and converting a delay instruction into an absolute timestamp, and meanwhile, a control mode is dynamically selected through three dimensional planes including a three-layer decision tree, reference equipment capability, network quality and time sequence requirements, so that the problem of resource stiffness of a fixed control mode is solved. Therefore, the response speed, the system reliability and the user experience are collaboratively optimized through multiple technologies such as a priority preemption mechanism, nested scene expansion, intelligent selection of a control mode, state storage and recovery and the like.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of general control or regulation systems, and in particular to a Zigbee scene intelligent processing method, storage medium and system. Background Art

[0002] With the popularity of smart homes, scene linkage technology based on the Zigbee protocol (such as "away mode" and "sleep mode") has become a core demand. However, existing technical solutions generally have the following problems: (1) Low reliability in complex scenarios: As the scale of devices increases, the system is limited by the Zigbee protocol's broadcast strategy (such as the upper limit on transmission frequency). When executing complex scenarios with deeply nested logic or a large number of devices, it needs to send multiple broadcast packets at a high frequency. This can easily exceed the protocol limits, resulting in increased latency and a significant increase in packet loss, which can cause scenario execution failure.

[0003] (2) Rigid control mode and poor adaptability: The system usually adopts a fixed centralized or distributed control mode, which cannot dynamically adapt to the real-time network status and device capabilities. This rigidity reduces the overall execution efficiency and operational stability of the system.

[0004] (3) Lack of dynamic adjustment of scene priorities: The system usually adopts a fixed priority processing strategy and cannot dynamically adjust the priorities of different scenes according to the current environment or user needs, which limits the flexibility and intelligence of the system.

[0005] Therefore, there is an urgent need for an intelligent processing method for Zigbee scenarios to improve system execution efficiency, resource utilization, and ultimately improve user experience. Summary of the Invention

[0006] The purpose of the present invention is to provide a Zigbee scene intelligent processing method, storage medium and system, which aims to overcome the above-mentioned problems existing in the prior art.

[0007] To achieve the purpose, the present invention provides the following technical solutions: A Zigbee scene intelligent processing method includes the following steps: Step S3: The platform detects whether the original data of the new scene contains a secondary scene and / or a secondary group; if so, executes steps S4 to S5; if not, executes step S5; Step S4, data conversion processing: The platform or gateway expands the original data, removes the secondary scene information and secondary group information in the original data, extracts and merges all devices and their action information contained in the primary scene and its secondary scenes and secondary groups, and converts the delay instructions in the original data into absolute timestamps, thereby converting the original data of the new scene into an action sequence table containing the primary scene ID, devices and their action information; the gateway parses the actions in the action sequence table and synchronizes the parsed actions to the corresponding devices; Step S5, a control mode selection mechanism based on a three-layer decision tree: the first layer of decision-making is to check whether all devices in the new scene support distributed control; the second layer of decision-making is to detect whether the quality of the Zigbee network is good; the third layer of decision-making is to analyze whether there are timing requirements for the action sequence table; if the first three layers of checks are passed, distributed control is enabled for the new scene, and the Zigbee multicast address is used to broadcast instructions carrying the new scene ID and CRC check code; if the first three layers of checks are not passed, centralized control is adopted for the new scene, and the gateway generates a unicast instruction queue in sequence.

[0008] Furthermore, it also includes a scene change monitoring mechanism: when the secondary scene and / or secondary group changes, the platform first updates the configuration data of the secondary scene and / or secondary group, and then updates the configuration data of the primary scene; the gateway only processes the secondary scene, secondary group, original data and its action sequence table through step S4 after monitoring the change of the primary scene.

[0009] Furthermore, after the data conversion process is completed in step S4 and the action sequence table is generated, the dynamic feature parameters of the action sequence table are simultaneously extracted, including the number of devices, the absolute timestamp distribution of the action, and the maximum time window span; the dynamic feature parameters are combined with the three-layer decision tree in step S5 for joint decision analysis: In the second-layer detection, the number of devices and the maximum time window span in the action sequence table are input into the second-layer network quality assessment model to dynamically adjust the network quality judgment threshold: when the number of devices is greater than N or the maximum time window span is less than T, the network quality passing standard is raised; In the third layer of analysis, the distribution density of absolute timestamps in the action sequence table is used to automatically identify timing conflict risks. If the interval between the absolute timestamps of adjacent actions is less than the preset protection delay, it is determined that a strict timing requirement exists. When distributed control is enabled, actions in the action sequence table that are continuous and have no strict timing dependencies are combined and sent using multicast instructions; when centralized control is enabled, a unicast instruction queue with a conflict avoidance mechanism is generated based on the absolute timestamp.

[0010] Furthermore, the user interaction terminal displays all scenes in the form of their original data, making it convenient for users to configure scenes.

[0011] Furthermore, in step S4, the delay instruction is converted into an absolute timestamp, specifically including: the gateway synchronizes with the cloud time server through the NTP protocol to obtain an accurate absolute time reference; at the same time, in the converted action sequence table, a time tolerance window is added to the delayed action of each device. The time tolerance window is dynamically adjusted based on the historical delay data of the Zigbee network, allowing the action to be executed within the specified time window without affecting the scene logic.

[0012] Furthermore, before step S3, the following steps are also included: Step S1: When the user interaction terminal receives a control request instruction for a new scene, it detects whether there is a current scene being executed, and compares the priority of the new scene with that of the current scene in real time; if the current scene allows interruption and the priority of the new scene is higher than that of the current scene, step S2 is executed; if the priority of the new scene is lower than or the same as that of the current scene, the new scene is added to the waiting queue, and after the current scene is executed, step S3 is executed; step S2: The user interaction terminal saves the device status of the current scene through differential backup technology; records the breakpoint position of the current scene, and sends an interruption notification; then, step S3 is executed.

[0013] Furthermore, the priority level adopts a dynamic numerical adjustment mechanism: the scenarios are divided into four categories, including emergency scenarios with a default priority value of 99, security scenarios with a default priority value of 80, comfort scenarios with a default priority value of 50, and daily scenarios with a default priority value of 30. When a scene carries a timeout mark, the priority value of the scene is automatically increased at the timeout critical point; When the preemption mechanism is triggered and it is detected that the new scene and the current scene occupy resources of the same device, the new scene is forced to preempt the device; After the preemption is completed, the device status of the interrupted scene is forcibly restored to the state before the interruption, and then the remaining actions are continued.

[0014] Further, in step S2, the differential backup technology specifically includes: using an incremental backup mechanism based on a hash algorithm, wherein the user interaction terminal calculates the hash value of the device status of the current scene, and compares it with the hash value of the last backup, and only stores the incremental data of the state change part; at the same time, when recording the breakpoint position, a timestamp is used to mark the breakpoint, and a breakpoint recovery index table is generated, which contains the scene ID, breakpoint timestamp and pointer to incremental data.

[0015] A storage medium stores a computer-readable program for implementing any of the above methods.

[0016] A Zigbee scene intelligent control system, which is used to implement any of the above methods, comprises an electrically connected user interaction terminal, a platform, a gateway and several devices, wherein the user interaction terminal is used to execute step S1, the platform is used to execute steps S3 and S5, and the gateway is used to execute steps S2 and S4.

[0017] Compared with the prior art, the present invention has the following beneficial effects: First, this invention pioneers a combination of data conversion processing and a control mode selection mechanism. By removing secondary scene / group information and converting delay instructions into absolute timestamps, this solves the problems of recursive parsing delay and clock drift in nested scenarios. Furthermore, through a three-layer decision tree, the control mode is dynamically selected based on device capabilities, network quality, and timing requirements, overcoming the resource rigidity of fixed control modes. These two mechanisms work together to optimize response speed, system reliability, and user experience.

[0018] Second, after completing the data conversion process in step S4 and generating the action sequence table, the present invention simultaneously extracts the dynamic feature parameters of the action sequence table and uses them as dynamic input to the decision tree in step S5, achieving closed-loop data flow optimization. This triple optimization process—feature parameter sharing, decision model collaboration, and control strategy feedback—strengthens the coupling between flattening processing and control decision-making, significantly improving processing efficiency and reliability in complex scenarios.

[0019] Third, when the underlying data is flattened, the user interaction terminal as the front-end still displays the nested structure of the original data, decoupling technical implementation from user experience.

[0020] Fourthly, the present invention combines data conversion processing with a control mode selection mechanism, embeds priority interruption (i.e., step S1) and differential backup (i.e., step S2) into the processing method to form a preemptive closed loop, and the differential backup in step S2 directly serves the recovery of the old scene after the new scene is preempted.

[0021] In summary, the present invention collaboratively optimizes response speed, system reliability and user experience through multiple technologies such as priority preemption mechanism, nested scene expansion, intelligent selection of control mode and state preservation and recovery. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 This is an overall framework diagram of a Zigbee scene intelligent processing method in the present invention.

[0023] Figure 2 This is the priority judgment and preemption flow chart.

[0024] Figure 3 The data conversion process flow chart for the scene.

[0025] Figure 4 A schematic diagram of the nested architecture of raw data for a leaving-home scenario.

[0026] Figure 5 Based on Figure 4 As shown, the generated action sequence table.

[0027] Figure 6 This is a schematic diagram of the updating principle of scenes and groups in the method of the present invention.

[0028] Figure 7 This is a schematic diagram of the scene level verification principle in the method of the present invention.

[0029] Figure 8 This is the expanded schematic diagram of the secondary scene and secondary group. DETAILED DESCRIPTION

[0030] The specific embodiments of the present invention are described below with reference to the accompanying drawings. In order to fully understand the present invention, many details are described below, but for those skilled in the art, the present invention can be implemented without these details.

[0031] like Figure 1 and Figure 2 As shown, a Zigbee scene intelligent processing method includes the following steps: Step S1: When the user interaction terminal receives a control request instruction for a new scene, it detects whether there is a current scene being executed, and compares the priority of the new scene with that of the current scene in real time; if the current scene allows interruption and the priority of the new scene is higher than that of the current scene, step S2 is executed; if the priority of the new scene is lower than or the same as that of the current scene, the new scene is added to the waiting queue, and after the current scene is executed, step S3 is executed.

[0032] As a preference, the priority adopts a numerical dynamic adjustment mechanism, as follows: Using numerical priorities (0-99), scenarios are divided into four categories: emergency scenarios with a default priority of 99, security scenarios with a default priority of 80, comfort scenarios with a default priority of 50, and daily scenarios with a default priority of 30. The higher the value, the higher the priority, and dynamic priority adjustment is supported: for example, security scenarios are automatically raised to 90 at night; and when a scenario carries a timeout flag, the priority of the scenario is automatically raised at the timeout threshold.

[0033] Step S2, preemption: the user interaction terminal saves the device status of the current scene through differential backup technology; records the breakpoint position of the current scene, and sends an interruption notification; then, executes the step S3.

[0034] Specifically, the differential backup technology includes: using an incremental backup mechanism based on a hash algorithm, in which the user interaction terminal calculates the hash value of the device status of the current scene, and compares it with the hash value of the last backup, and only stores the incremental data of the state change part; at the same time, when recording the breakpoint position, a timestamp is used to mark the breakpoint, and a breakpoint recovery index table is generated, which contains the scene ID, breakpoint timestamp and pointer to incremental data.

[0035] Preferably, when the preemption mechanism is triggered and a conflict is detected between the new scene and the current scene occupying the same device resources, the new scene is forced to preempt the device. After the preemption is completed, the device state of the interrupted scene is forcibly restored to the state before the interruption, and then the remaining actions are continued.

[0036] Step S3: The platform detects whether the original data of the new scene contains a secondary scene and / or a secondary group; if so, execute steps S4 to S5; if not, execute step S5.

[0037] Step S4, data conversion processing: The platform or gateway expands the original data, removes the secondary scene information and secondary group information in the original data, extracts and merges all devices and their action information contained in the main scene and its secondary scenes and secondary groups, and converts the delay instructions in the original data into absolute timestamps, thereby converting the original data of the new scene into an action sequence table containing the main scene ID, devices and their action information; the gateway parses the actions in the action sequence table and synchronizes the parsed actions to the corresponding devices.

[0038] In a specific embodiment, in the above step S4, the delay instruction is converted into an absolute timestamp, specifically including: the gateway synchronizes with the cloud time server through the NTP protocol to obtain an accurate absolute time reference; at the same time, in the converted action sequence table, a time tolerance window is added to the delayed action of each device, and the time tolerance window is dynamically adjusted based on the Zigbee network delay historical data, allowing the action to be executed within the specified time window without affecting the scene logic.

[0039] Step S5, a control mode selection mechanism based on a three-layer decision tree: the first layer of decision-making is to check whether all devices in the new scene support distributed control; the second layer of decision-making is to detect whether the quality of the Zigbee network is good; the third layer of decision-making is to analyze whether there are timing requirements for the action sequence table; if the first three layers of checks are passed, distributed control is enabled for the new scene, and the Zigbee multicast address is used to broadcast instructions carrying the new scene ID and CRC check code; if the first three layers of checks are not passed, centralized control is adopted for the new scene, and the gateway generates a unicast instruction queue in sequence.

[0040] Preferably, after the data conversion process is completed in step S4 and the action sequence table is generated, the dynamic feature parameters of the action sequence table are simultaneously extracted, including the number of devices, the absolute timestamp distribution of the actions, and the maximum time window span; the dynamic feature parameters are combined with the three-layer decision tree in step S5 for joint decision analysis, as follows: In the second-layer detection, the number of devices and the maximum time window span in the action sequence table are input into the second-layer network quality assessment model, and the network quality judgment threshold is dynamically adjusted: when the number of devices is greater than N or the maximum time window span is less than T, the network quality passing standard is improved. In the third-layer analysis, based on the distribution density of the absolute timestamps in the action sequence table, the risk of timing conflicts is automatically identified. If the absolute timestamp interval between adjacent actions is less than the preset protection delay, it is determined that a strict timing requirement exists. When distributed control is enabled, consecutive actions in the action sequence table that do not have strict timing dependencies are combined and sent using multicast instructions. When centralized control is enabled, a unicast instruction queue with a conflict avoidance mechanism is generated based on the absolute timestamps.

[0041] Preferably, the Zigbee scene intelligent processing method also includes a scene change monitoring mechanism: when the secondary scene and / or secondary group changes, the platform first updates the configuration data of the secondary scene and / or secondary group, and then updates the configuration data of the primary scene; the gateway only processes the secondary scene, secondary group, original data and its action sequence table through step S4 after monitoring the change of the primary scene.

[0042] Preferably, in the Zigbee scene intelligent processing method, the user interaction terminal displays all scenes in the form of their original data, which is convenient for users to configure the scenes.

[0043] The following further describes the dynamic priority and preemption mechanism of steps S1 and S2 in the above-mentioned Zigbee scene intelligent processing method by executing a program and giving examples.

[0044] 1. Priority Definition and Dynamic Management 1. Prioritization - Use numerical priority (0-99), the higher the value, the higher the priority, divided into four categories: - Emergency (99: such as fire alarm) - Security scenarios (80: such as illegal intrusion detection) - Comfort scenarios (50: such as constant temperature control) - Daily scenes (30: such as timed light on / off) - Supports dynamic adjustment of priority (e.g., automatically raising the priority to 90 for nighttime security scenes).

[0045] 2. Scene state tracking - Each running scenario records the following information: struct RunningScene { uint8_t scene_id; / / unique identifier of the scene uint8_t priority; / / Current priority bool is_interruptible; / / Whether interruption is allowed uint32_t action_index; / / The sequence number of the currently executed action DeviceState* saved_states; / / Device state backup pointer }.

[0046] 2. Core Logic of Preemption Judgment 1. Real-time comparison process - When a new scene is triggered, the following judgment is performed: def check_interrupt(current_scene, new_priority): if not current_scene.is_interruptible: return False# Interruption is not allowed in key scenes if new_priority>current_scene.priority: return True# High priority directly preempts if new_priority == current_scene.priority: return config_allow_fifo_interrupt()# Same priority level is handled according to the configuration policy return False.

[0047] 2. Preemption Condition Extension - Time sensitivity enhancement: If a new scene is marked with 'timeout', its priority value will be automatically increased at the timeout threshold; - Resource conflict detection: Checks whether the new scene and the current scene occupy the same device (such as controlling the same light at the same time), and forces the new scene to seize the device if there is a conflict.

[0048] 3. Preemptive Execution Process 1. Interrupt the current scene Step 1: Save the device state void save_device_states(RunningScene* scene) { scene->saved_states = malloc(sizeof(DeviceState) * MAX_DEVICES); for (int i = 0; i <active_devices; i++) { scene->saved_states[i] = zigbee_read_device_state(device_list[i]); } }.

[0049] Step 2: Record the breakpoint location scene->action_index = get_current_action_index(); / / Record the step currently executed in the action list.

[0050] Step 3: Send an outage notification zigbee_send_command( cluster=0x0005, / / Scenes cluster command=0x07, / / Interrupt Notification payload=[scene->scene_id, INTERRUPT_REASON_PRIORITY] ).

[0051] 2. Execute the new scenario Immediately initiate high-priority scenarios and issue commands using the fast channel (skipping some device status checks).

[0052] 4. Recovery Mechanism 1. Scene Queue Management - Double sorting using priority queue + timestamp: struct PendingScene { Scene* scene; uint32_t timestamp; / / request arrival time uint8_t retry_count; / / Number of retries }; / / Queue sorting rules: first in descending order of priority, then in ascending order of time for queues with the same priority bool compare_scene(PendingScene a, PendingScene b) { if (a.scene->priority != b.scene->priority) return a.scene->priority>b.scene->priority; return a.timestamp <b.timestamp; }.

[0053] 2. Breakpoint recovery process Step 1: Check device status consistency def check_state_consistency(scene): for device in scene->saved_states: current = get_device_state(device.addr) if current != scene->saved_states[device]: trigger_state_recovery(device)# Force recovery to the state before interruption Step 2: Continue with the remaining steps for (int i = scene->action_index; i <scene->action_count; i++) { execute_action(scene->actions[i]); if (check_new_interrupt()) break; / / Interruption by a higher priority is still allowed during execution }.

[0054] 3. Zigbee network fault tolerance - Use APS retransmission mechanism for critical commands (3 retries by default) - Automatic downgrade when the device is offline: def handle_device_offline(device): if device in critical_devices: trigger_backup_device(device)# Enable backup device else: mark_action_skipped(device)# Record the skipped status.

[0055] 5. Typical Workflow Examples Scene conflict example: Current scene: P=50 "movie viewing mode" (lights off, projector on); New scenario triggered: "intrusion alarm" with P=80 (turn on all lights in the house and activate the siren). Execution timing: 1. The system compares priorities (80 > 50) → preemption is allowed; 2. Save the current lighting status (brightness = 10%) and projector status (ON); 3. Execute the new scenario (intrusion alarm) immediately: Send a Zigbee group command to turn on all lights (brightness = 100%); 4. After the alarm processing is completed: - Restore the light to its original brightness (10%); - Check the projector status to see if it needs to be restarted; 5. If there is no higher priority request, continue to complete the remaining actions of "Movie Viewing Mode"; This case was tested on a resource-constrained Zigbee gateway and showed that: - Average preemption delay: <200ms (including wireless transmission time); - State storage memory usage: <1KB (50 devices differential backup); - Number of concurrent scenarios supported: ≥8 layers (limited by stack depth).

[0056] The following further describes the scene level check in step S3, the data conversion processing in step S4, and the scene change monitoring mechanism in the above-mentioned Zigbee scene intelligent processing method by way of examples.

[0057] like Figure 3 、 Figure 4 and Figure 5 As shown, Figure 4 This is a schematic diagram of the nested architecture of the original data of a leaving home scene (which does not contain a delay instruction). The leaving home scene contains multiple sub-scenes. Figure 4 The original data is converted into Figure 5 The action sequence table shown in the figure is as follows. In the converted action sequence table, the secondary group information in the original data (i.e., the original target column) is removed, and all devices contained in each secondary group (i.e., the new target column) and their action information (i.e., the action ID column, action type column, and control content column) are extracted and merged.

[0058] When the original data of the scene is submitted, the content of the submission remains unchanged, that is, it can still contain: Device, scene, group, message, arm and disarm switching and other actions.

[0059] After the original scene data is stored in the library (platform library / gateway library), it needs to be processed again. Specifically, when the original scene data contains actions of secondary scenes and / or secondary groups, it is necessary to extract the devices and their action information in the secondary scenes and secondary groups and convert them into Figure 5 The action sequence table shown.

[0060] It is necessary to monitor whether the sub-scenes and group configurations contained in the current scene have changed. If changes occur, the sub-device action information in the sub-scene and group configurations should be updated to the action sequence table.

[0061] During secondary processing of the scene (i.e., data conversion processing), user interaction terminals such as APP / front-end display it in the form of original data (i.e., the form configured by the user), making it easier for users to configure the scene.

[0062] like Figure 6 As shown, when adding a main scene or updating a secondary scene in a user interaction terminal such as an APP or front-end, after submitting the scene configuration information (i.e., original data) to the platform, the platform will perform scene level verification (see Figure 7 The gateway then expands the configuration information (i.e., converts the data), interprets the actions, and synchronizes them to the device. When a secondary scenario changes, the platform first processes the secondary scenario's configuration information. Once the configuration data is complete, the primary scenario's configuration information is updated.

[0063] like Figure 7 As shown, in this embodiment, the level of the scene is limited to: the level depth is less than 3, that is, the number of levels is limited to main scene → secondary scene → tertiary scene. When the configuration information of the scene (that is, the original data of the main scene) is submitted to the user interaction terminal such as APP and front end, the platform performs a hierarchical judgment on the configuration information: judge whether the scene also contains scenes or groups (that is, secondary scenes or secondary groups); if included, the level of the scene is increased by 1. Continue to judge whether the secondary scene contains scenes or groups (that is, tertiary scenes or tertiary groups). If included, the level continues to increase by 1 until no scenes or groups are found. If the level of the scene is less than 3, it is saved and stored normally, and the parsing action of the scene is sent to the device. If the level of the scene exceeded is greater than or equal to 3, an exception is prompted.

[0064] like Figure 8 As shown in the figure, the gateway main system scene module is the gateway main system, which is used to process the addition, deletion or modification of scenes. For example, when the gateway main system scene module receives the scene addition function command from the platform, it needs to store the original data in the database for persistence. After the storage is completed, the gateway main system scene module is responsible for data conversion processing and generating or updating the scene action table (i.e., action sequence table). Since the secondary scene may still contain secondary scenes and groups, the device actions therein should be recursively traversed (see Figure 6 ). When the gateway main system scene module determines that the scene action table (i.e., the action sequence table) has changed, it should find the secondary scenes and groups it contains, and find the corresponding device actions. In addition, when the device action contains a delay instruction, the timing of the device action needs to be reorganized and saved in the scene action table (i.e., the action sequence table). The gateway subsystem scene module is the gateway subsystem, such as the zigbee subsystem, Bluetooth subsystem, etc. The triggering of the gateway subsystem scene module depends on the data changes of the gateway main system scene module (including changes in scene configuration data). In other words, when a data change event occurs, it is first processed by the gateway main system scene module, and the gateway main system scene module then triggers the gateway subsystem scene module as needed, and the gateway subsystem scene module handles the data changes it is responsible for.

[0065] The present invention also discloses a storage medium, which stores a computer-readable program for implementing any of the above methods.

[0066] like Figure 6 、 Figure 7 and Figure 8 The present invention also discloses a Zigbee scene intelligent control system for implementing any of the above methods. The system includes an electrically connected user interaction terminal, a platform, a gateway, and several devices. The user interaction terminal is used to perform step S1, the platform is used to perform steps S3 and S5, and the gateway is used to perform steps S2 and S4. The user interaction terminal includes an app or a front-end.

[0067] The above is only a specific implementation of the present invention, but the design concept of the present invention is not limited to this. Any non-substantial changes to the present invention using this concept shall be deemed as an infringement of the protection scope of the present invention.

Claims

1. A Zigbee scene intelligent processing method, characterized by: The following steps are involved: Step S3: The platform detects whether the original data of the new scene contains a secondary scene and / or a secondary group; if so, executes steps S4 to S5; if not, executes step S5; Step S4, data conversion processing: The platform or gateway expands the original data, removes the secondary scene information and secondary group information in the original data, extracts and merges all devices and their action information contained in the primary scene and its secondary scenes and secondary groups, and converts the delay instructions in the original data into absolute timestamps, thereby converting the original data of the new scene into an action sequence table containing the primary scene ID, devices and their action information; the gateway parses the actions in the action sequence table and synchronizes the parsed actions to the corresponding devices; Step S5, a control mode selection mechanism based on a three-layer decision tree: the first layer of decision-making is to check whether all devices in the new scene support distributed control; the second layer of decision-making is to detect whether the quality of the Zigbee network is good; the third layer of decision-making is to analyze whether there are timing requirements for the action sequence table; if the first three layers of checks are passed, distributed control is enabled for the new scene, and the Zigbee multicast address is used to broadcast instructions carrying the new scene ID and CRC check code; if the first three layers of checks are not passed, centralized control is adopted for the new scene, and the gateway generates a unicast instruction queue in sequence.

2. The Zigbee scene intelligent processing method according to claim 1, characterized in that: It also includes a scene change monitoring mechanism: when the secondary scene and / or secondary group changes, the platform first updates the configuration data of the secondary scene and / or secondary group, and then updates the configuration data of the primary scene; the gateway only processes the secondary scene, secondary group, original data and its action sequence table through step S4 after monitoring the change of the primary scene.

3. The Zigbee scene intelligent processing method according to claim 1, characterized in that: After the data conversion process is completed in step S4, the action sequence table is generated. At the same time, the dynamic feature parameters of the action sequence table are extracted, including the number of devices, the absolute timestamp distribution of the actions, and the maximum time window span. The dynamic feature parameters are combined with the three-layer decision tree in step S5 for joint decision analysis: In the second-layer detection, the number of devices and the maximum time window span in the action sequence table are input into the second-layer network quality assessment model to dynamically adjust the network quality judgment threshold: when the number of devices is greater than N or the maximum time window span is less than T, the network quality passing standard is raised; In the third layer of analysis, the distribution density of absolute timestamps in the action sequence table is used to automatically identify timing conflict risks. If the interval between the absolute timestamps of adjacent actions is less than the preset protection delay, it is determined that a strict timing requirement exists. When distributed control is enabled, actions in the action sequence table that are continuous and have no strict timing dependencies are combined and sent using multicast instructions; when centralized control is enabled, a unicast instruction queue with a conflict avoidance mechanism is generated based on the absolute timestamp.

4. The Zigbee scene intelligent processing method according to claim 1, characterized in that: The user interaction terminal displays all scenes in the form of their original data, making it convenient for users to configure scenes.

5. The Zigbee scene intelligent processing method according to claim 1, characterized in that: In step S4, the delay instruction is converted into an absolute timestamp, specifically including: the gateway synchronizes with the cloud time server through the NTP protocol to obtain an accurate absolute time reference; at the same time, in the converted action sequence table, a time tolerance window is added to the delayed action of each device. The time tolerance window is dynamically adjusted based on the historical delay data of the Zigbee network, allowing the action to be executed within the specified time window without affecting the scene logic.

6. A Zigbee scene intelligent processing method according to any one of claims 1 to 5, characterized in that: Before step S3, the following steps are also included: Step S1: When the user interaction terminal receives a control request instruction for a new scene, it detects whether there is a current scene being executed, and compares the priority of the new scene with that of the current scene in real time; if the current scene allows interruption and the priority of the new scene is higher than that of the current scene, step S2 is executed; if the priority of the new scene is lower than or the same as that of the current scene, the new scene is added to the waiting queue, and after the current scene is executed, step S3 is executed; step S2: The user interaction terminal saves the device status of the current scene through differential backup technology; records the breakpoint position of the current scene, and sends an interruption notification; then, step S3 is executed.

7. The Zigbee scene intelligent processing method according to claim 6, characterized in that: Priority levels are dynamically adjusted numerically: scenarios are divided into four categories: emergency scenarios with a default priority of 99, security scenarios with a default priority of 80, comfort scenarios with a default priority of 50, and daily scenarios with a default priority of 30. When a scene carries a timeout mark, the priority value of the scene is automatically increased at the timeout critical point; When the preemption mechanism is triggered and it is detected that the new scene and the current scene occupy resources of the same device, the new scene is forced to preempt the device; After the preemption is completed, the device status of the interrupted scene is forcibly restored to the state before the interruption, and then the remaining actions are continued.

8. The Zigbee scene intelligent processing method according to claim 6, characterized in that: In step S2, the differential backup technology specifically includes: using an incremental backup mechanism based on a hash algorithm, wherein the user interaction terminal calculates the hash value of the device status of the current scene, and compares it with the hash value of the last backup, and only stores the incremental data of the state change part; at the same time, when recording the breakpoint position, a timestamp is used to mark the breakpoint, and a breakpoint recovery index table is generated, which contains the scene ID, breakpoint timestamp and pointer to incremental data.

9. A storage medium, characterized in that: A computer-readable program for implementing the method according to any one of claims 1 to 8 is stored therein.

10. A Zigbee scene intelligent processing system, characterized by: The system is used to implement the method described in any one of claims 1 to 6, and includes an electrically connected user interaction terminal, a platform, a gateway and several devices, wherein the user interaction terminal is used to execute step S1, the platform is used to execute step S3 and step S5, and the gateway is used to execute step S2 and step S4.