Cooperation method and device between devices, electronic device and storage medium
By using a device collaboration method based on wireless ad hoc networks and semantic data packet transmission, the problems of response delay and network dependency caused by centralized control in smart home systems are solved, enabling efficient and flexible collaboration between devices.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- GREE ELECTRIC APPLIANCE INC OF ZHUHAI
- Filing Date
- 2025-12-18
- Publication Date
- 2026-04-28
AI Technical Summary
Existing smart home systems suffer from problems such as high response latency, strong network dependence, and poor flexibility in inter-device collaboration due to reliance on centralized control.
Through a collaborative approach between devices, wireless ad hoc networks and semantic data packet transmission are employed to establish communication connections between devices. Control commands are generated and corresponding actions are executed using target data packets. Attenuation factors and priority mechanisms are introduced to optimize command processing.
It enables real-time collaboration between devices, reduces response latency, decreases network dependence, and improves system flexibility and scalability.
Smart Images

Figure CN121934401A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the technical field of device collaboration, specifically relating to a method, apparatus, electronic device, and storage medium for device collaboration. Background Technology
[0002] Existing smart home systems employ a centralized control architecture, relying on a central server or cloud platform for device coordination and policy execution. This architecture suffers from issues such as response latency, making it difficult to achieve real-time collaboration between devices. Summary of the Invention
[0003] In view of the above problems, a method, apparatus, electronic device, and storage medium for inter-device collaboration is proposed to overcome or at least partially solve the above problems, including: A method for inter-device collaboration, wherein the devices communicate with each other, the method comprising: The first device receives a target data packet broadcast by the second device; the target data packet is a semantic state description generated by the second device for the second device. Based on the target data packet, generate a first control command for the first device; In response to the first control command, execute the first control action corresponding to the first control command.
[0004] In some embodiments, the target data packet includes a first timestamp of the generation of the target data packet, and the step of generating a first control command for the first device based on the target data packet includes: Based on the first timestamp, determine the current effective strength of the target data packet; When the current effective intensity is greater than the intensity threshold, a first control command is generated for the first device.
[0005] In some embodiments, the target data packet further includes an attenuation factor and an initial effective strength of the target data packet, and determining the current effective strength of the target data packet based on the first timestamp includes: Calculate the time difference based on the second timestamp and the first timestamp of the received target data packet; The current effective intensity is calculated based on the attenuation factor, the initial effective intensity, and the time difference.
[0006] In some embodiments, the target data package includes a target priority, and the method further includes: Determine whether the target priority is greater than the priority threshold; When the target priority is greater than the priority threshold, the step of generating a first control instruction for the first device based on the target data packet is executed. When the target priority is not greater than the priority threshold, the target data packet is discarded.
[0007] In some embodiments, the method further includes: When the first device comes back online, it requests the cached data packet of the second device from the second device via a broadcast request.
[0008] In some embodiments, the step of executing a first control action corresponding to the first control command in response to the first control command includes: Determine the first instruction priority of the first control instruction and the second instruction priority of the control instruction corresponding to the control action currently being executed by the first device; When the priority of the first instruction is higher than the priority of the second instruction, the first control action corresponding to the first control instruction is executed; When the priority of the first instruction is not higher than the priority of the second instruction, the first control instruction is suspended.
[0009] In some embodiments, generating a first control command for the first device based on the target data packet includes: Identify other data elements of the same type as the target data element packet; The first control instruction is generated based on the other data element packages and the target data element package.
[0010] In some embodiments, the target data packet includes region hierarchy information, and generating a first control command for the first device based on the target data packet includes: Determine whether the region hierarchy information matches the first device; When the region hierarchy information matches the first device, the first control command is generated; When the region hierarchy information does not match the first device, the target data packet is discarded.
[0011] In some embodiments, the first device and the second device constitute a wireless ad hoc network.
[0012] This application embodiment also provides a device for inter-device collaboration, enabling communication between devices, the device comprising: A receiving module is used for the first device to receive a target data element packet broadcast by the second device; the target data element packet is a semantic state description generated by the second device for the second device. The generation module is used to generate a first control command for the first device based on the target data packet; The execution module is used to respond to the first control command and execute the first control action corresponding to the first control command.
[0013] In some embodiments, the target data packet includes a first timestamp of the target data packet generation, and the generation module is configured to determine the current effective strength of the target data packet based on the first timestamp; when the current effective strength is greater than an intensity threshold, generate a first control command for the first device.
[0014] In some embodiments, the target data packet further includes an attenuation factor and an initial effective strength of the target data packet. The generation module is configured to calculate a time difference based on a second timestamp and a first timestamp of the received target data packet; and to calculate the current effective strength based on the attenuation factor, the initial effective strength, and the time difference.
[0015] In some embodiments, the target data packet includes a target priority. The generation module is further configured to determine whether the target priority is greater than a priority threshold; when the target priority is greater than the priority threshold, the step of generating a first control instruction for the first device based on the target data packet is executed; when the target priority is not greater than the priority threshold, the target data packet is discarded.
[0016] In some embodiments, the online module is configured to obtain the cached data packet of the second device from the second device by broadcasting a request when the first device re-enters the network.
[0017] In some embodiments, the execution module is configured to determine a first instruction priority of the first control instruction and a second instruction priority of the control instruction corresponding to the control action currently being executed by the first device; when the first instruction priority is higher than the second instruction priority, execute the first control action corresponding to the first control instruction; when the first instruction priority is not higher than the second instruction priority, postpone the first control instruction.
[0018] In some embodiments, the generation module is configured to determine other data elements of the same type as the target data element package; and generate the first control instruction based on the other data elements and the target data element package.
[0019] In some embodiments, the target data packet includes regional hierarchy information, and the generation module is used to determine whether the regional hierarchy information matches the first device; when the regional hierarchy information matches the first device, the first control command is generated; when the regional hierarchy information does not match the first device, the target data packet is discarded.
[0020] In some embodiments, the first device and the second device constitute a wireless ad hoc network.
[0021] This application also provides an electronic device, including a processor, a memory, and a computer program stored in the memory and capable of running on the processor. When the computer program is executed by the processor, it implements the above-described inter-device collaboration method.
[0022] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described inter-device collaboration method.
[0023] The embodiments of this application have the following advantages: In this embodiment, a first device receives a target data packet broadcast by a second device; the target data packet is a semantic state description generated by the second device for the second device; based on the target data packet, a first control command is generated for the first device; in response to the first control command, a first control action corresponding to the first control command is executed. This embodiment solves the technical problems in existing smart home systems, such as high response latency, strong network dependence, and poor inter-device coordination flexibility caused by reliance on centralized control. Attached Figure Description
[0024] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which: Figure 1 This is a flowchart illustrating the steps of a device collaboration method according to an embodiment of this application; Figure 2 This is a flowchart illustrating the steps of another device collaboration method according to an embodiment of this application; Figure 3 This is a flowchart illustrating the steps of another device collaboration method according to an embodiment of this application; Figure 4 This is a flowchart illustrating the steps of another device collaboration method according to an embodiment of this application; Figure 5 This is a flowchart illustrating the steps of another device collaboration method according to an embodiment of this application; Figure 6 This is a schematic diagram of a scenario according to an embodiment of this application; Figure 7 This is a schematic diagram of the structure of a device collaboration device according to an embodiment of this application. Detailed Implementation
[0025] To make the above-mentioned objectives, features, and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0026] In related technologies, some decentralized solutions attempt to enable device communication through local gateways, but they still rely on centralized policy processing mechanisms and fail to achieve device-level autonomous decision-making and localized responses.
[0027] Meanwhile, existing communication data structures are mostly command messages, lacking semantic expression of environmental states, resulting in insufficient system flexibility and scalability.
[0028] Based on this, the embodiments of this application propose a device collaboration method that can solve the technical problems in existing smart home systems, such as high response latency, strong network dependence, and poor device collaboration flexibility caused by reliance on centralized control.
[0029] Reference Figure 1 The diagram illustrates a flowchart of a device collaboration method according to an embodiment of this application, which may include the following steps: Step 101: The first device receives the target data packet broadcast by the second device; the target data packet is a semantic state description generated by the second device for the second device.
[0030] In the embodiments of this application, the devices can communicate with each other; for example, the devices may include at least a first device and a second device, and may also include a third device, a fourth device, etc., which are not limited in this embodiment of the application.
[0031] To avoid the system's heavy reliance on network connectivity and to prevent system functionality limitations in the event of a network outage or server crash, the first and second devices can form a wireless ad hoc network. A wireless ad hoc network is a type of distributed communication network that requires no pre-existing infrastructure. Devices (nodes) within the network autonomously discover, negotiate network formation, and dynamically maintain the topology via wireless signals. Its core characteristics are decentralization, self-organization, and multi-hop transmission.
[0032] For example, the network topology of a wireless ad hoc network can use a wireless mesh network protocol (such as Zigbee 3.0 or Thread) as the physical and link layer basis, or it can be implemented using an optimized Wi-Fi Aware or BLE Mesh. This application embodiment does not limit this.
[0033] It should be noted that, in addition to the first and second devices, the wireless ad hoc network may also include a third device, a fourth device, etc., and the embodiments of this application do not impose any restrictions on this.
[0034] The following mainly describes the collaboration method between devices from the perspective of the first device; of course, this collaboration method can also be implemented by the second device, the third device, etc.
[0035] For the first device, it can receive target data packets broadcast by the second device from the environment; the target data packets can be semantic state descriptions generated by the second device for the second device.
[0036] For example, data pheromone packets can refer to a semantic environmental state broadcast communication paradigm that mimics biological pheromones. This paradigm can replace the traditional command-response model, thereby enabling decentralized collaboration among devices and strong privacy protection, significantly improving system response speed and reducing network load.
[0037] In some embodiments, when the sensors of the second device detect a change in the state of the second device or an internal event occurs, they can invoke the data element generator module to encode the physical event (such as "motion detected") into a data element packet conforming to a standard format according to a defined mapping table.
[0038] For example, the second device is a living room infrared sensor device; assuming the living room infrared sensor device (ID: sensor_living_room_001) detects motion: Looking up the mapping table: Event type → motion_active (predefined mapping), intensity → 0.85 (directly using sensor output), attenuation factor → 0.1 (assuming a calculated value of 0.1), fill fields: Timestamp=2025-12-08 14:30:00, Zone ID=living_room_1, Publisher ID=sensor_living_room_001. Generate target data package: { "Header":"v1.0,data_pheromone", "Publisher ID":"sensor_living_room_001", "Timestamp":"2025-12-08 14:30:00", "Zone ID":"Living Room_1", "Event Type":"motion_active", Intensity: 0.85, Attenuation Factor: 0.1 } After generating the target data packet, the second device can broadcast it through the network interface.
[0039] For the first device, the data packet interpreter listening module of the first device can continuously capture data packets circulating in the network; after the second device broadcasts the target data packet, the first device can receive the target data packet broadcast by the second device.
[0040] Step 102: Generate a first control command for the first device based on the target data package.
[0041] After obtaining the target data packet, the first device can decrypt it (if necessary) and verify its validity. Next, the target data packet can be analyzed and identified, and based on the analysis and identification results, a first control command can be generated to control the first device.
[0042] Step 103: In response to the first control command, execute the first control action corresponding to the first control command.
[0043] After generating the first control command, the first device can respond to the first control command by first determining the first control action corresponding to the first control command; for example, if the first device is a smart lamp, the first control action can be an action such as turning off the light or turning on the light.
[0044] After the first control action is determined, all devices can respond to the first control command and execute the first control action; thus, the coordinated control between devices is completed.
[0045] For the first device, after executing the first control action, it can also generate a data packet and broadcast it to the environment. The steps are similar to those of the second device in generating the target data packet, and will not be described again in this embodiment.
[0046] In this embodiment, a first device receives a target data packet broadcast by a second device; the target data packet is a semantic state description generated by the second device for the second device; based on the target data packet, a first control command is generated for the first device; in response to the first control command, a first control action corresponding to the first control command is executed. This embodiment solves the technical problems in existing smart home systems, such as high response latency, strong network dependence, and poor inter-device coordination flexibility caused by reliance on centralized control.
[0047] Reference Figure 2 The diagram illustrates a flowchart of a device collaboration method according to an embodiment of this application, which may include the following steps: Step 201: The first device receives the target data packet broadcast by the second device.
[0048] In some embodiments, when the sensors of the second device detect a change in the state of the second device or an internal event, they can invoke a data element packet generator module to encode the physical event (such as "motion detected") into a target data element packet conforming to a standard format, according to a defined mapping table. After generating the target data element packet, the second device can broadcast it through a network interface.
[0049] For the first device, the data packet interpreter listening module of the first device can continuously capture data packets circulating in the network; after the second device broadcasts the target data packet, the first device can receive the target data packet broadcast by the second device.
[0050] Step 202: The target data packet includes the first timestamp of the target data packet generation; based on the first timestamp, determine the current effective strength of the target data packet.
[0051] To accurately prevent false triggering caused by signal delay or residue, make the system behavior more in line with the physical world, and reduce redundant calculations and power consumption, this application introduces a dynamic intensity attribute that simulates the decay of biological pheromones into the data pheromone packet, and establishes the concept of information timeliness.
[0052] Specifically, when the second device generates the target data packet, it can attach the first timestamp of the target data packet and then broadcast it through the network interface.
[0053] After receiving the target data packet, the first device can determine the current effective strength of the target data packet based on the time of receipt and the first timestamp. The current effective strength is related to the time when the first device receives the target data packet. Specifically, the later the first device receives the target data packet, the weaker the current effective strength; the earlier the first device receives the target data packet, the stronger the current effective strength.
[0054] Step 203: When the current effective intensity is greater than the intensity threshold, generate a first control command for the first device.
[0055] After determining the current effective strength of the target data packet, the first device can compare the current effective strength with the strength threshold.
[0056] If the current effective strength of the target data packet is less than the strength threshold, the target data packet can be determined to be invalid; at this time, the first device can discard the target data packet.
[0057] Conversely, if the current effective strength of the target data packet is greater than the strength threshold, the target data packet can be determined to be invalid; at this time, the first device can put the target data packet into the "data packet queue to be processed".
[0058] For the first device, it can obtain the target data packet from the "data packet queue to be processed" and generate a first control command for the first device based on the target data packet.
[0059] For example, the first device can identify and analyze the target data packet, and generate a first control command based on the result of the identification and analysis to trigger the first device to perform a first control action.
[0060] Step 204: Determine the first instruction priority of the first control instruction and the second instruction priority of the control instruction corresponding to the control action currently being executed by the first device.
[0061] After generating the first control command, in order to avoid command execution conflicts, this application can first determine the first priority of the first control command and the second command priority of the control commands corresponding to other control actions currently being executed by the first device. The command priority can be set according to the actual situation for different control commands. This application embodiment does not limit how to set the priority of the control commands.
[0062] In some embodiments of this application, the target data packet includes a data packet priority; based on this, the first instruction priority can be determined in the following manner: The first instruction priority of the first control instruction is determined based on the data packet priority.
[0063] In some embodiments, an optional priority field can be defined in the data package structure; different data package priorities can be set for different types of data packages.
[0064] After receiving the target data packet, the first device can determine the first instruction priority of the first control instruction based on the data packet priority in the target data packet; that is, the higher the data packet priority, the higher the first instruction priority; the lower the data packet priority, the lower the first instruction priority. This application embodiment does not impose any restrictions on this.
[0065] Step 205: When the priority of the first instruction is higher than that of the second instruction, execute the first control action corresponding to the first control instruction.
[0066] In some embodiments, after determining the first instruction priority and the second instruction priority, the first instruction priority and the second instruction priority can be compared; if the first instruction priority is higher than the second instruction priority, the control action of the control instruction corresponding to the second instruction priority can be suspended, and the first control action corresponding to the first control instruction can be executed.
[0067] For example, steps 204-206 can be executed only when the first control instruction corresponding to the first instruction priority conflicts with the control instruction corresponding to the second instruction priority; when the two control instructions do not conflict, the first control action corresponding to the first control instruction can be executed directly.
[0068] In another example, steps 204-206 can also be executed when the first control instruction corresponding to the first instruction priority does not conflict with the control instruction corresponding to the second instruction priority. This application embodiment does not limit this.
[0069] Step 206: When the priority of the first instruction is not higher than the priority of the second instruction, the first control instruction is suspended.
[0070] Conversely, if the priority of the first instruction is not higher than that of the second instruction, the first control action corresponding to the first control instruction can be postponed until the control instruction corresponding to the priority of the second instruction is completed.
[0071] In this embodiment, a first device receives a target data packet broadcast by a second device. The target data packet includes a first timestamp indicating its generation. Based on the first timestamp, the current effective strength of the target data packet is determined. When the current effective strength is greater than a strength threshold, a first control command is generated for the first device. A first command priority and a second command priority corresponding to the control action currently being executed by the first device are determined. When the first command priority is higher than the second command priority, the first control action corresponding to the first control command is executed. When the first command priority is not higher than the second command priority, the first control command is suspended. This embodiment solves the technical problems in existing smart home systems, such as high response latency, strong network dependence, and poor inter-device coordination flexibility caused by centralized control.
[0072] Reference Figure 3 The diagram illustrates a flowchart of a device collaboration method according to an embodiment of this application, which may include the following steps: Step 301: The first device receives the target data packet broadcast by the second device.
[0073] In some embodiments, when the sensors of the second device detect a change in the state of the second device or an internal event, they can invoke a data element packet generator module to encode the physical event (such as "motion detected") into a target data element packet conforming to a standard format, according to a defined mapping table. After generating the target data element packet, the second device can broadcast it through a network interface.
[0074] For the first device, the data packet interpreter listening module of the first device can continuously capture data packets circulating in the network; after the second device broadcasts the target data packet, the first device can receive the target data packet broadcast by the second device.
[0075] Step 302: The target data packet also includes the attenuation factor and initial effective strength of the target data packet; calculate the time difference based on the second timestamp and the first timestamp of the received target data packet.
[0076] To accurately prevent false triggering caused by signal delay or residue, make the system behavior more in line with the physical world, and reduce redundant calculations and power consumption, this application introduces a dynamic intensity attribute that simulates the decay of biological pheromones into the data pheromone packet, and establishes the concept of information timeliness.
[0077] Specifically, when the second device generates the target data packet, it can attach the first timestamp of the target data packet and then broadcast it through the network interface.
[0078] Based on the first timestamp, the target data packet may also include the attenuation factor and initial effective strength of the target data packet; this attenuation factor and initial effective strength can be generated by a second device when the target data packet is generated. The attenuation factor can refer to a floating-point number representing the rate attenuation of the data packet's strength over time, which can be uniformly set within the system according to the type of data packet. The initial effective strength can refer to the original strength value set by the publisher when the data packet is first created and broadcast.
[0079] After obtaining the target data packet, the first device can identify and analyze it to determine the attenuation factor, initial effective strength, and first timestamp.
[0080] After determining the first timestamp, the first device can calculate the time difference between the second timestamp and the first timestamp based on the second timestamp of the target data packet it received. For example, the difference between the second timestamp and the first timestamp can be calculated to obtain the time difference.
[0081] Step 303: Calculate the current effective intensity based on the attenuation factor, the initial effective intensity, and the time difference.
[0082] After determining the attenuation factor, initial effective strength, and time difference, the current effective strength of the target data packet currently received by the first device can be calculated based on the attenuation factor, initial effective strength, and time difference.
[0083] For example, the current effective strength can be calculated using the following formula: Effective_Intensity=Initial_Intensity*e^(-λ*(Current_Time-Timestamp)); Where Effective_Intensity is the current effective intensity, which decreases over time; Initial_Intensity is the initial effective intensity; λ is the decay factor; Current_Time is the second timestamp; and Timestamp is the first timestamp.
[0084] Step 304: When the current effective intensity is greater than the intensity threshold, generate a first control command for the first device.
[0085] After determining the current effective strength of the target data packet, the first device can compare the current effective strength with the strength threshold.
[0086] If the current effective strength of the target data packet is less than the strength threshold, the target data packet can be determined to be invalid; at this time, the first device can discard the target data packet.
[0087] Conversely, if the current effective strength of the target data packet is greater than the strength threshold, the target data packet can be determined to be invalid; at this time, the first device can put the target data packet into the "data packet queue to be processed".
[0088] For the first device, it can obtain the target data packet from the "data packet queue to be processed" and generate a first control command for the first device based on the target data packet.
[0089] For example, the first device can identify and analyze the target data packet, and generate a first control command based on the result of the identification and analysis to trigger the first device to perform a first control action.
[0090] Step 305: Determine the first instruction priority of the first control instruction and the second instruction priority of the control instruction corresponding to the control action currently being executed by the first device.
[0091] After generating the first control command, in order to avoid command execution conflicts, this application can first determine the first priority of the first control command and the second command priority of the control commands corresponding to other control actions currently being executed by the first device. The command priority can be set according to the actual situation for different control commands. This application embodiment does not limit how to set the priority of the control commands.
[0092] Step 306: When the priority of the first instruction is higher than that of the second instruction, execute the first control action corresponding to the first control instruction.
[0093] In some embodiments, after determining the first instruction priority and the second instruction priority, the first instruction priority and the second instruction priority can be compared; if the first instruction priority is higher than the second instruction priority, the control action of the control instruction corresponding to the second instruction priority can be suspended, and the first control action corresponding to the first control instruction can be executed.
[0094] Step 307: When the priority of the first instruction is not higher than the priority of the second instruction, the first control instruction is suspended.
[0095] Conversely, if the priority of the first instruction is not higher than that of the second instruction, the first control action corresponding to the first control instruction can be postponed until the control instruction corresponding to the priority of the second instruction is completed.
[0096] In this embodiment, a first device receives a target data packet broadcast by a second device. The target data packet also includes an attenuation factor and an initial effective strength. A time difference is calculated based on the second timestamp and the first timestamp of the received target data packet. The current effective strength is calculated based on the attenuation factor, the initial effective strength, and the time difference. When the current effective strength is greater than a strength threshold, a first control command is generated for the first device. A first command priority and a second command priority corresponding to the control action currently being executed by the first device are determined. When the first command priority is higher than the second command priority, the first control action corresponding to the first control command is executed. When the first command priority is not higher than the second command priority, the first control command is suspended. This embodiment solves the technical problems in existing smart home systems, such as high response latency, strong network dependence, and poor inter-device coordination flexibility caused by centralized control.
[0097] Reference Figure 4The diagram illustrates a flowchart of another device-to-device collaboration method according to an embodiment of this application, which may include the following steps: Step 401: The first device receives the target data packet broadcast by the second device.
[0098] In some embodiments, when the sensors of the second device detect a change in the state of the second device or an internal event, they can invoke a data element packet generator module to encode the physical event (such as "motion detected") into a target data element packet conforming to a standard format, according to a defined mapping table. After generating the target data element packet, the second device can broadcast it through a network interface.
[0099] For the first device, the data packet interpreter listening module of the first device can continuously capture data packets circulating in the network; after the second device broadcasts the target data packet, the first device can receive the target data packet broadcast by the second device.
[0100] Step 402: Identify other data packets of the same type as the target data packet.
[0101] In some embodiments, multiple devices in a real-world environment may simultaneously broadcast similar or related "data element packets." To improve the accuracy of the system response, a fusion mechanism for multi-source data element packets is introduced.
[0102] Specifically, after receiving multiple data packets, the first device can identify other data packets of the same type as the target data packet.
[0103] Step 403: Generate the first control command based on the other data element packages and the target data element package.
[0104] After determining other data elements, the current environmental state can be comprehensively judged based on the other data elements and the target data elements by weighted average or maximum value selection. Then, based on the comprehensively judged current environmental state, a first control command for the first device can be generated.
[0105] In some embodiments, before generating the first control instruction, a determination of the current effective strength of the target data packet can be performed; when the current effective strength is greater than the strength threshold, the first control instruction is generated based on the target data packet.
[0106] Step 404: Determine the first instruction priority of the first control instruction and the second instruction priority of the control instruction corresponding to the control action currently being executed by the first device.
[0107] After generating the first control command, in order to avoid command execution conflicts, this application can first determine the first priority of the first control command and the second command priority of the control commands corresponding to other control actions currently being executed by the first device. The command priority can be set according to the actual situation for different control commands. This application embodiment does not limit how to set the priority of the control commands.
[0108] Step 405: When the priority of the first instruction is higher than that of the second instruction, execute the first control action corresponding to the first control instruction.
[0109] In some embodiments, after determining the first instruction priority and the second instruction priority, the first instruction priority and the second instruction priority can be compared; if the first instruction priority is higher than the second instruction priority, the control action of the control instruction corresponding to the second instruction priority can be suspended, and the first control action corresponding to the first control instruction can be executed.
[0110] Step 406: When the priority of the first instruction is not higher than the priority of the second instruction, the first control instruction is suspended.
[0111] Conversely, if the priority of the first instruction is not higher than that of the second instruction, the first control action corresponding to the first control instruction can be postponed until the control instruction corresponding to the priority of the second instruction is completed.
[0112] In this embodiment, a first device receives a target data packet broadcast by a second device; determines other data packets of the same type as the target data packet; generates a first control instruction based on the other data packets and the target data packet; determines a first instruction priority of the first control instruction and a second instruction priority of the control instruction corresponding to the control action currently being executed by the first device; when the first instruction priority is higher than the second instruction priority, executes the first control action corresponding to the first control instruction; when the first instruction priority is not higher than the second instruction priority, postpones the first control instruction. This embodiment solves the technical problems in existing smart home systems caused by centralized control, such as high response latency, strong network dependence, and poor inter-device coordination flexibility.
[0113] Reference Figure 5 The diagram illustrates a flowchart of another device-to-device collaboration method according to an embodiment of this application, which may include the following steps: Step 501: The first device receives the target data packet broadcast by the second device.
[0114] In some embodiments, when the sensors of the second device detect a change in the state of the second device or an internal event, they can invoke a data element packet generator module to encode the physical event (such as "motion detected") into a target data element packet conforming to a standard format, according to a defined mapping table. After generating the target data element packet, the second device can broadcast it through a network interface.
[0115] For the first device, the data packet interpreter listening module of the first device can continuously capture data packets circulating in the network; after the second device broadcasts the target data packet, the first device can receive the target data packet broadcast by the second device.
[0116] Step 502: The target data package includes regional hierarchical information. Determine whether the regional hierarchical information matches the first device.
[0117] In some embodiments, a multi-level zone division mechanism is introduced to enhance system flexibility and scalability. The device can divide the home space into different levels of zones (e.g., floors, rooms, sub-zones) based on physical location or user-defined criteria. Each "data element package" contains zone hierarchy information, enabling the device to achieve cross-zone collaborative control based on zone hierarchy matching strategy rules.
[0118] Specifically, after obtaining the target data packet, the first device can first identify and analyze the target data packet to obtain regional hierarchical information.
[0119] After obtaining the regional hierarchy information, it can be determined whether the first device matches the regional hierarchy information, that is, whether the region where the first device is located matches the regional hierarchy information.
[0120] Step 503: When the regional hierarchy information matches the first device, generate the first control command.
[0121] If the region where the first device is located matches the region hierarchy information, then a first control command to control the first device can be generated based on the target data packet.
[0122] Step 504: When the regional hierarchy information does not match the first device, discard the target data packet.
[0123] Conversely, if the region where the first device is located matches the region hierarchy information, then the target data packet can be considered unrelated to the first device; in this case, the first device can discard the target data packet.
[0124] Step 505: Determine the first instruction priority of the first control instruction and the second instruction priority of the control instruction corresponding to the control action currently being executed by the first device.
[0125] After generating the first control command, in order to avoid command execution conflicts, this application can first determine the first priority of the first control command and the second command priority of the control commands corresponding to other control actions currently being executed by the first device. The command priority can be set according to the actual situation for different control commands. This application embodiment does not limit how to set the priority of the control commands.
[0126] Step 506: When the priority of the first instruction is higher than that of the second instruction, execute the first control action corresponding to the first control instruction.
[0127] In some embodiments, after determining the first instruction priority and the second instruction priority, the first instruction priority and the second instruction priority can be compared; if the first instruction priority is higher than the second instruction priority, the control action of the control instruction corresponding to the second instruction priority can be suspended, and the first control action corresponding to the first control instruction can be executed.
[0128] Step 507: When the priority of the first instruction is not higher than the priority of the second instruction, the first control instruction is suspended.
[0129] Conversely, if the priority of the first instruction is not higher than that of the second instruction, the first control action corresponding to the first control instruction can be postponed until the control instruction corresponding to the priority of the second instruction is completed.
[0130] In this embodiment, a first device receives a target data packet broadcast by a second device. The target data packet includes regional hierarchical information. The device determines whether the regional hierarchical information matches the first device. When the regional hierarchical information matches the first device, a first control command is generated. When the regional hierarchical information does not match the first device, the target data packet is discarded. A first command priority and a second command priority corresponding to the control action currently being executed by the first device are determined. When the first command priority is higher than the second command priority, the first control action corresponding to the first control command is executed. When the first command priority is not higher than the second command priority, the first control command is suspended. This embodiment solves the technical problems in existing smart home systems caused by centralized control, such as high response latency, strong network dependence, and poor inter-device coordination flexibility.
[0131] In some embodiments of this application, the target data packet includes a target priority; based on this, any of the above embodiments may further include the following steps: Determine whether the target priority is greater than the priority threshold; if the target priority is greater than the priority threshold, execute the step of generating a first control command for the first device based on the target data packet; If the target priority is not greater than the priority threshold, discard the target data packet.
[0132] In some embodiments, in environments with a large number of devices, to avoid resource waste caused by devices listening to all data packets, the system introduces a data packet priority labeling and selective listening mechanism. Each "data packet" can carry a priority label (such as priority_level:high / medium / low) when broadcast, and devices can selectively listen to data packets of specific priorities according to local policies.
[0133] Specifically, when generating the target data package, a target priority can be set in the target data package, which can represent the priority of the target data package.
[0134] After receiving the target data packet, the first device can first identify and analyze the target data packet and determine the target priority of the target data packet.
[0135] After determining the target priority of the target data packet, it can be determined whether the target priority is greater than the priority threshold. This priority threshold may be different for different devices. Specifically, it can be set according to the data packets that the device needs to monitor. This application embodiment does not limit this.
[0136] If the target priority is greater than the priority threshold, then the target data packet can be determined to be the data packet being monitored by the first device; at this time, the first device can further execute the step of generating the first control command based on the target data packet.
[0137] Conversely, if the target priority is not greater than the priority threshold, it can be determined that the target data packet is not a data packet being monitored by the first device; in this case, the first device can discard the target data packet.
[0138] In some embodiments of this application, any of the above embodiments may further include the following steps: When the first device comes back online, it requests the cached data packet from the second device via a broadcast request.
[0139] In some embodiments, to address situations where inter-device communication is unstable or devices are temporarily offline, the system introduces a device state synchronization and data packet caching mechanism. Each device maintains a local "data packet cache" to temporarily store data packet records from the most recent period. When a device comes back online, it can request cached data packets from other devices via broadcast to restore state consistency.
[0140] Specifically, after the first device comes back online, it can request the data packets stored in the data packet cache that the second device maintains locally through a broadcast request.
[0141] Reference Figure 6 The diagram illustrates a scenario according to an embodiment of this application; as shown below. Figure 6 As shown: This application embodiment constructs a fully decentralized smart home device network, in which devices communicate through standardized information units called "data packets" and make autonomous decisions based on local preset strategies.
[0142] The network topology uses wireless mesh network protocols (such as Zigbee 3.0 or Thread) as the physical and link layer foundation. Optimized Wi-Fi Aware or BLE Mesh can also be used.
[0143] All devices form a single, purely local peer-to-peer network. Communication between devices can primarily use IPv6 multicast or protocol-defined broadcast. Each device has the capability to broadcast and receive data packets. To ensure data link layer security, DTLS or AES-128-CCM encryption technologies can be used at the network layer. Each device joining the network must undergo secure pairing via physical means (such as pressing a button or scanning a QR code) to obtain a network key, ensuring the data link layer security of the entire data packet network.
[0144] The data format uses a lightweight binary encoding format (such as CBOR or a custom TLV structure) to define the data element packet to reduce network load. A standard data element packet contains the following fields: Header: Contains the data packet version number and type identifier. It identifies the data packet format and compatibility. Version number: Ensures different devices can correctly parse the data packet structure (avoiding compatibility issues caused by protocol upgrades). Type identifier: Distinguishes the communication category of the data packet (such as environment status broadcast, policy update), guiding the device's processing logic.
[0145] Publisher ID: A unique identifier for the device that published the data packet. It enables the receiving device to identify the publisher of the event (e.g., "living room sensor"), and is used for policy matching (e.g., responding only to events from specific devices) and security verification (preventing spoofed data packets).
[0146] Timestamp: The time when the data element packet was generated. It serves as the baseline time point (Current_Time - Timestamp) for the decay model, used to calculate the current effective intensity. It avoids interference from older events (e.g., "motion events from 10 minutes ago" no longer trigger actions).
[0147] Zone ID: Identifies the physical or logical area (e.g., "Living Room_1") associated with a data packet. It locates events to a specific area (e.g., "Living Room_1"), enabling devices to make decisions based on zone policies. Event Type: Identifies the core type of the event (e.g., "motion_active", "door_open"). Enables the device to understand "what the event is".
[0148] Intensity (Initial Effective Intensity): A floating-point number representing the intensity or confidence level of the event. It reflects the reliability of the event (e.g., a motion detection intensity of 0.8 indicates "high-confidence motion") and is used for policy threshold judgment (e.g., triggering an action only if Effective_Intensity > 0.5). It also helps avoid false triggers (e.g., weak motion does not trigger lights).
[0149] Attenuation Factor: A floating-point number that defines the rate at which the strength of a data packet decays over time. It controls the rate at which a data packet "expires" (e^(-λ×time)). A high attenuation factor (λ=0.5) indicates that the data packet expires quickly, while a low attenuation factor (λ=0.01) indicates that the data packet remains valid indefinitely.
[0150] Payload: Optional additional data (such as temperature and humidity values). Carries additional environmental data to enrich the event context. Optional fields (such as temperature and humidity values) provide detailed information about the event. Define an optional Priority field in the data packet structure. Higher-priority data packets (such as security alarms) can interrupt or override actions triggered by lower-priority data packets.
[0151] Attenuation Algorithm: An attenuation calculation function is implemented in the data packet interpreter of each device. An exponential attenuation model can be used: Effective_Intensity = Initial_Intensity * e^(-λ * (Current_Time - Timestamp)), where Effective_Intensity is the current effective intensity, which decreases over time; Initial_Intensity is the initial intensity, the original intensity value set by the publisher when the data packet is first created and broadcast; λ is the attenuation factor, uniformly set across the entire system according to the data packet type; Current_Time is the time when the device receives the data packet; and Timestamp is the timestamp embedded in the data packet. Subsequent judgments are only triggered when the effective intensity exceeds the threshold set in the device's policy; e is a constant.
[0152] When the device's sensors detect a change in state or an internal event, the data element packet generator module is invoked. This module encodes the physical event (such as "motion detected") into a data element packet conforming to a standard format according to a predefined mapping table, appends the current timestamp and intensity value, and then broadcasts it through the network interface.
[0153] The data packet interpreter listening module continuously captures data packets circulating in the network. This module decrypts the packets (if necessary), verifies their validity, and calculates their current strength. When the strength exceeds the listening threshold, the data packet is placed into a "pending data packet queue".
[0154] The local policy execution engine retrieves data packets from the queue and matches them against the device's pre-configured policy library. Matching involves the device determining, based on its own role (e.g., living room light, door lock) and preset rules, whether the current environmental event requires it to perform an action. The device autonomously determines whether to execute an action based on the received environmental event semantics (data packets) and its local pre-configured policies, without relying on a central server or cloud. Upon successful matching, the preset "Action" is executed directly (e.g., SET_LIGHT(80%)). The strategy is defined using a natural language-like or simplified script, and after compilation, it is stored in the device's Flash memory as bytecode. Its basic logic is: IF <condition>THEN <action>.
[0155] Condition: Represents a condition, and multiple conditions can be combined, such as: [DataPheromone_Type]=='X', [DataPheromone_Zone]=='Y', [Effective_Intensity]>0.5, [Local_Sensor_Value]<50.
[0156] Action: Represents an action that controls the local effector, such as SET_LIGHT(80%) or PLAY_SOUND("welcome.mp3").
[0157] Subsequent actions are triggered only when all conditions are met simultaneously: the event type of the data packet matches a preset value (e.g., the event type is 'motion detection'); the region associated with the data packet matches a preset region (e.g., the region identifier is 'living room_1'); the effective strength of the data packet is higher than a set threshold (e.g., greater than 0.5); and the local sensor reading of the device is lower than a set threshold (e.g., the temperature sensor reading is less than 50).
[0158] When all the above conditions are met, the device will execute locally preset control operations, such as adjusting the light brightness to 80% or playing the specified welcome sound effect file 'welcome.mp3'.
[0159] Most data packets in existing technologies are instructional or command-based, such as "turn on the light" or "set the air conditioner to 26 degrees Celsius." They employ a "request-response" or "central command issuance" model, relying on central node coordination. Furthermore, most lack built-in timeliness mechanisms, being processed immediately upon receipt, which can easily lead to delays or false triggers. In contrast, the "data pheromone packet" in this invention focuses on semantics and state description. Instead of directly issuing commands, it broadcasts "environmental event + intensity + timeliness" information (e.g., "someone is reading in the study, intensity 0.8, attenuation coefficient 0.1"). It adopts a "biopheromone-style broadcasting" paradigm, where devices autonomously publish their status, and other devices make autonomous decisions based on local policies, achieving decentralized collaboration. A time decay model is introduced, enabling the system to automatically expire information, avoiding interference from old information. Furthermore, there is no central node; devices are completely equal, and the offline status of any device does not affect overall collaboration. The system possesses strong fault tolerance and self-healing capabilities.
[0160] This application constructs a lightweight communication protocol framework based on the concept of "data packets," which is a reconstruction of existing communication protocols rather than a simple encapsulation or invocation. This application utilizes existing wireless protocols as the foundation for the physical and link layers (such as Zigbee 3.0, Thread, BLE Mesh, and Wi-Fi Aware), but does not directly reuse their upper-layer communication semantics and data structures. Instead, it defines a completely new data packet structure with field semantics different from existing protocols and proposes a communication mechanism of "data packet broadcasting + local policy matching + dynamic attenuation calculation."
[0161] In this embodiment, to enhance the system's flexibility and scalability, a multi-level area division mechanism is introduced. The device can divide the home space into different levels of areas (e.g., floors, rooms, sub-areas) based on physical location or user-defined criteria. Each "data package" contains area hierarchy information, enabling the device to achieve cross-area collaborative control based on area hierarchy matching strategy rules.
[0162] For example, ZoneID (zone identifier): identifies the physical or logical zone associated with the data packet (e.g., '1st floor_living room_1'). Zone levels are separated by underscores (e.g., floor_room_sub-zone), and the device can parse the hierarchical structure. When using a matching strategy, the device supports wildcard matching based on zone level, such as ==: exact match (e.g., [ZoneID]=='1st floor_living room_1'), and LIKE: hierarchical wildcard matching (e.g., [ZoneID]LIKE '1st floor_%' → matches all 1st floor zones).
[0163] After receiving the data packet, the device parses the hierarchical string of ZoneID (such as '1st floor_living room_1') and uses wildcards (such as 'LIKE 1st floor_%') in the policy conditions to match the zone level and trigger cross-zone actions. For example, the living room motion event (Zone: 1st floor_living room_1) is matched by the study room device's policy [ZoneID]LIKE '1st floor_%', thus causing the study room lights to dim.
[0164] In this embodiment, in a real-world environment, multiple devices may simultaneously broadcast similar or related "data packets." To improve the accuracy of the system response, a multi-source data packet fusion mechanism is introduced. After receiving multiple "data packets" of the same type, the device comprehensively judges the current environmental state by weighted averaging or selecting the maximum value.
[0165] Considering that various local communication protocols (such as Zigbee, Thread, and Bluetooth Mesh) may be used in a home environment, this application introduces a communication protocol adaptation module in its implementation. This module is located between the data packet interpreter and the wireless communication module, and is responsible for converting the format of the "data packet" between different protocols to ensure that devices in heterogeneous networks can recognize and respond to each other.
[0166] Since each device has an independent local policy library, multiple policies may simultaneously meet the triggering conditions, leading to conflicting behavior. Therefore, a policy conflict detection and prioritization mechanism is introduced in the implementation. Before executing a policy, the system (the device's internal "local policy execution engine" – i.e., the device's own software system) performs rule matching and conflict detection, and determines the final policy to be executed based on preset priorities (such as time priority, event type priority, and user-specified priority).
[0167] To address unstable communication between devices or temporary device offline situations, the system introduces a device state synchronization and data packet caching mechanism. Each device maintains a local "data packet cache" to temporarily store data packet records from the most recent period. When a device comes back online, it can request cached data packets from other devices via broadcast to restore state consistency.
[0168] In environments with a large number of devices, to avoid resource waste caused by devices listening to all data packets, the system introduces a data packet priority labeling and selective listening mechanism. Each "data packet" can carry a priority label (such as priority_level:high / medium / low) when broadcast, and devices can selectively listen to data packets of specific priorities according to local policies.
[0169] It should be noted that, for the sake of simplicity, the method embodiments are all described as a series of actions. However, those skilled in the art should understand that the embodiments of this application are not limited to the described order of actions, because according to the embodiments of this application, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily required by the embodiments of this application.
[0170] Reference Figure 7 The diagram illustrates a structural schematic of a device for inter-device collaboration according to an embodiment of this application. The devices are connected for communication and may include the following modules: The receiving module 701 is used for the first device to receive the target data element packet broadcast by the second device; the target data element packet is a semantic state description generated by the second device for the second device. The generation module 702 is used to generate a first control command for the first device based on the target data packet; The execution module 703 is used to respond to the first control command and execute the first control action corresponding to the first control command.
[0171] In some embodiments, the target data packet includes a first timestamp of the target data packet generation, and the generation module 702 is used to determine the current effective strength of the target data packet based on the first timestamp; when the current effective strength is greater than the strength threshold, a first control command is generated for the first device.
[0172] In some embodiments, the target data packet further includes an attenuation factor and an initial effective strength of the target data packet. The generation module 702 is used to calculate the time difference based on the second timestamp and the first timestamp of the received target data packet; and to calculate the current effective strength based on the attenuation factor, the initial effective strength and the time difference.
[0173] In some embodiments, the target data packet includes a target priority. The generation module 702 is further configured to determine whether the target priority is greater than a priority threshold. When the target priority is greater than the priority threshold, the step of generating a first control instruction for the first device based on the target data packet is executed. When the target priority is not greater than the priority threshold, the target data packet is discarded.
[0174] In some embodiments, the online module is configured to request the cached data packet of the second device from the second device by broadcasting a request when the first device re-enters the network.
[0175] In some embodiments, the execution module 703 is configured to determine a first instruction priority of the first control instruction and a second instruction priority of the control instruction corresponding to the control action currently being executed by the first device; when the first instruction priority is higher than the second instruction priority, the first control action corresponding to the first control instruction is executed; when the first instruction priority is not higher than the second instruction priority, the first control instruction is suspended.
[0176] In some embodiments, the generation module 702 is used to determine other data elements of the same type as the target data element package; and to generate a first control instruction based on the other data elements and the target data element package.
[0177] In some embodiments, the target data packet includes regional hierarchical information. The generation module 702 is used to determine whether the regional hierarchical information matches the first device; when the regional hierarchical information matches the first device, a first control command is generated; when the regional hierarchical information does not match the first device, the target data packet is discarded.
[0178] In some embodiments, the first device and the second device constitute a wireless ad hoc network.
[0179] In this embodiment, a first device receives a target data packet broadcast by a second device; the target data packet is a semantic state description generated by the second device for the second device; based on the target data packet, a first control command is generated for the first device; in response to the first control command, a first control action corresponding to the first control command is executed. This embodiment solves the technical problems in existing smart home systems, such as high response latency, strong network dependence, and poor inter-device coordination flexibility caused by reliance on centralized control.
[0180] This application also provides an electronic device, including a processor, a memory, and a computer program stored in the memory and capable of running on the processor. When the computer program is executed by the processor, it implements the above-described inter-device collaboration method.
[0181] This application also provides a computer-readable storage medium on which a computer program is stored, and when the computer program is executed by a processor, it implements the above-described inter-device collaboration method.
[0182] As the device embodiment is basically similar to the method embodiment, the description is relatively simple, and relevant parts can be found in the description of the method embodiment.
[0183] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on the differences from other embodiments. The same or similar parts between the various embodiments can be referred to each other.
[0184] Those skilled in the art will understand that embodiments of this application can be provided as methods, apparatus, or computer program products. Therefore, embodiments of this application can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, embodiments of this application can take the form of computer program products implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0185] This application describes embodiments with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of this application. It should be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing terminal device to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing terminal device, generate instructions for implementing the flowchart illustrations. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0186] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing terminal device to operate in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0187] These computer program instructions can also be loaded onto a computer or other programmable data processing terminal equipment, causing a series of operational steps to be performed on the computer or other programmable terminal equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable terminal equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0188] Although preferred embodiments of the present application have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments as well as all changes and modifications falling within the scope of the embodiments of the present application.
[0189] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or terminal device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or terminal device. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or terminal device that includes said element.
[0190] The foregoing has provided a detailed description of a device collaboration method, apparatus, electronic device, and storage medium. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.< / action> < / condition>
Claims
1. A method for inter-device collaboration, characterized in that, The method for inter-device communication connection includes: The first device receives a target data packet broadcast by the second device; the target data packet is a semantic state description generated by the second device for the second device. Based on the target data packet, generate a first control command for the first device; In response to the first control command, execute the first control action corresponding to the first control command.
2. The method according to claim 1, characterized in that, The target data packet includes a first timestamp generated by the target data packet. The step of generating a first control command for the first device based on the target data packet includes: Based on the first timestamp, determine the current effective strength of the target data packet; When the current effective intensity is greater than the intensity threshold, a first control command is generated for the first device.
3. The method according to claim 2, characterized in that, The target data packet also includes an attenuation factor and an initial effective strength. Determining the current effective strength of the target data packet based on the first timestamp includes: Calculate the time difference based on the second timestamp and the first timestamp of the received target data packet; The current effective intensity is calculated based on the attenuation factor, the initial effective intensity, and the time difference.
4. The method according to claim 1, characterized in that, The target data package includes target priorities, and the method further includes: Determine whether the target priority is greater than the priority threshold; When the target priority is greater than the priority threshold, the step of generating a first control instruction for the first device based on the target data packet is executed. When the target priority is not greater than the priority threshold, the target data packet is discarded.
5. The method according to claim 1, characterized in that, The method further includes: When the first device comes back online, it requests the cached data packet of the second device from the second device via a broadcast request.
6. The method according to claim 1, characterized in that, The step of responding to the first control command and executing the first control action corresponding to the first control command includes: Determine the first instruction priority of the first control instruction and the second instruction priority of the control instruction corresponding to the control action currently being executed by the first device; When the priority of the first instruction is higher than the priority of the second instruction, the first control action corresponding to the first control instruction is executed; When the priority of the first instruction is not higher than the priority of the second instruction, the first control instruction is suspended.
7. The method according to claim 1, characterized in that, The step of generating a first control command for the first device based on the target data packet includes: Identify other data elements of the same type as the target data element packet; The first control instruction is generated based on the other data element packages and the target data element package.
8. The method according to claim 1, characterized in that, The target data packet includes regional hierarchical information. The step of generating a first control command for the first device based on the target data packet includes: Determine whether the region hierarchy information matches the first device; When the region hierarchy information matches the first device, the first control command is generated; When the region hierarchy information does not match the first device, the target data packet is discarded.
9. The method according to claim 1, characterized in that, The first device and the second device form a wireless ad hoc network.
10. A device for inter-device collaboration, characterized in that, Inter-device communication connection, the apparatus comprising: A receiving module is used for the first device to receive a target data element packet broadcast by the second device; the target data element packet is a semantic state description generated by the second device for the second device. The generation module is used to generate a first control command for the first device based on the target data packet; The execution module is used to respond to the first control command and execute the first control action corresponding to the first control command.
11. An electronic device, characterized in that, It includes a processor, a memory, and a computer program stored in the memory and capable of running on the processor, wherein the computer program, when executed by the processor, implements the inter-device coordination method as described in any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium, which, when executed by a processor, implements the inter-device collaboration method as described in any one of claims 1 to 9.