Equipment communication method and device, equipment, medium and product

By dynamically loading a second communication protocol and performing firmware hot updates, the problems of compatibility and high maintenance costs of communication modules for smart home devices are solved. This enables stable and efficient communication and rapid switching of devices in different network environments, extends the device's battery life, and reduces maintenance costs.

CN121333832APending Publication Date: 2026-01-13GREE ELECTRIC APPLIANCE INC OF ZHUHAI +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511586010.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-31
Publication Date
2026-01-13

AI Technical Summary

Technical Problem

Existing smart home device communication modules suffer from poor adaptability, high maintenance costs, and low upgrade efficiency. In particular, they cannot support dynamic function expansion in edge computing architectures, which affects user experience and system stability.

Method used

By receiving target protocol stack information sent by edge nodes, a second communication protocol is dynamically loaded, enabling flexible switching between low-power and normal-power modes for device nodes. It supports firmware hot updates and automatic recovery under abnormal conditions, and utilizes the computing power of IoT edge nodes to achieve remote dynamic loading and on-demand upgrades of communication modules.

Benefits of technology

It enables stable and efficient communication between device nodes in different network environments, extends battery life, reduces maintenance costs, and can quickly switch to normal power consumption mode for efficient communication when needed, ensuring the continuity and reliability of device functions.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121333832A_ABST
    Figure CN121333832A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides an equipment communication method and device, equipment, a medium and a product, and is applied to the technical field of smart home, and the method comprises the steps: receiving target protocol stack information which is sent by an edge node and aims at a communication module, and building a communication interface of a second communication protocol according to the target protocol stack information; in response to the trigger event, switching from the low power consumption mode to the normal power consumption mode; wherein in the low power consumption mode, the device node communicates with the edge node by adopting a first communication protocol; and in the normal power consumption mode, calling a communication interface of a second communication protocol, and adopting the second communication protocol to communicate with the cloud node. Through the embodiment of the invention, the communication interface of the second communication protocol is dynamically established according to the target protocol stack information provided by the edge node, and efficient and stable communication can be realized when the equipment node needs to carry out large-data-volume or high-real-time communication with the cloud node.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of smart home technology, and in particular to a method, apparatus, device, medium and product for device communication. Background Technology

[0002] Currently, smart homes have become an indispensable part of people's daily lives. These devices use built-in communication modules to achieve network connectivity, enabling interconnection between devices and data interaction with cloud servers, providing users with a convenient and intelligent living experience. However, with the continuous evolution of communication protocols and the diversification of device application scenarios, communication modules suffer from problems such as poor compatibility. Summary of the Invention

[0003] In view of the above problems, a method, apparatus, device, medium, and product for device communication are proposed to overcome or at least partially solve the above problems, including: A device communication method, applied to a device node, the method comprising: Receive target protocol stack information for the communication module sent by the edge node, and establish a communication interface for the second communication protocol based on the target protocol stack information; In response to a triggering event, the device node switches from a low-power mode to a normal-power mode; wherein, in the low-power mode, the device node communicates with the edge node using a first communication protocol. In the normal power consumption mode, the communication interface of the second communication protocol is invoked, and the second communication protocol is used to communicate with the cloud node.

[0004] Optionally, in the low-power mode, the device node communicates with the edge node using a first communication protocol, including: in the low-power mode, the device node sends a heartbeat data packet to the edge node using the first communication protocol; In the normal power consumption mode, calling the communication interface of the second communication protocol and communicating with the cloud node using the second communication protocol includes: in the normal power consumption mode, calling the communication interface of the second communication protocol and sending service data packets to the cloud node using the second communication protocol.

[0005] Optionally, the device node is a security camera, the edge node is a home gateway, the triggering event is the security system detecting a suspicious intrusion event, and the service data packet is the video stream collected by the security camera in the normal power consumption mode.

[0006] Optionally, based on the target protocol stack information, a communication interface for the second communication protocol is established, including: The target protocol stack information is loaded into the reserved runtime loading area, and a communication interface for the second communication protocol is established through dynamic linking.

[0007] Optionally, before receiving the target protocol stack information for the communication module sent by the edge node, the following is also included: Send key information about the communication module in the device node to the edge node.

[0008] Optionally, the communication module is provided with a main operating area and a backup operating area, and the method further includes: Receive firmware upgrade data sent by the edge node, and load the new version firmware into the spare operating area of ​​the communication module according to the firmware upgrade data; After the task in the main running area is detected to be completed, switch to the new firmware version in the backup running area.

[0009] Optionally, after detecting the completion of a task in the primary running area and switching to the new firmware version in the backup running area, the method further includes: When an abnormality is detected in the new firmware version, the firmware is rolled back to the main running area.

[0010] An apparatus for device communication, the apparatus comprising: The communication interface establishment module is used to receive target protocol stack information for the communication module sent by the edge node, and establish a communication interface for the second communication protocol based on the target protocol stack information. A power consumption mode switching module is used to switch from a low power consumption mode to a normal power consumption mode in response to a trigger event; wherein, in the low power consumption mode, the device node communicates with the edge node using a first communication protocol; The second communication protocol communication module is used to call the communication interface of the second communication protocol in the normal power consumption mode and communicate with the cloud node using the second communication protocol.

[0011] An electronic device 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 method described above.

[0012] A computer-readable storage medium, characterized in that a computer program is stored on the computer-readable storage medium, and the computer program, when executed by a processor, implements the method described above.

[0013] A computer program product includes a computer program that, when executed by a processor, implements the method described above.

[0014] The embodiments of the present invention have the following advantages: In some embodiments of the present invention, by receiving target protocol stack information for the communication module sent by the edge node, and establishing a communication interface for the second communication protocol based on the target protocol stack information, the device node switches from a low-power mode to a normal power mode in response to a trigger event. In the low-power mode, the device node communicates with the edge node using the first communication protocol. In the normal power mode, the device node calls the communication interface of the second communication protocol and communicates with the cloud node using the second communication protocol. This achieves dynamic establishment of the communication interface for the second communication protocol based on the target protocol stack information provided by the edge node. The flexible communication switching of the device node in different power modes not only reduces the power consumption of the device node and extends its battery life, but also ensures that when the device node needs to perform large-scale or high-real-time communication with the cloud node, it can quickly switch to the normal power mode, achieving efficient and stable communication using the second communication protocol. Attached Figure Description

[0015] To more clearly illustrate the technical solution of the present invention, the accompanying drawings used in the description of the present invention will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0016] Figure 1 This is a flowchart of the steps of a device communication method provided in some embodiments of the present invention; Figure 2 This is a flowchart of the steps of a second method for device communication provided in some embodiments of the present invention; Figure 3 This is a flowchart of the steps of a device communication method three provided in some embodiments of the present invention; Figure 4 This is a structural block diagram of a device communication apparatus provided in some embodiments of the present invention. Detailed Implementation

[0017] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, the present invention 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 the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.

[0018] In related technologies, a fixed image delivery model is adopted, and all functional modules must be packaged into complete firmware. Especially in edge computing architecture, the distribution of device nodes is wide and the maintenance cost is high. This means that subsequent changes to the device protocol stack require a complete reinstallation and cannot support dynamic function expansion on the edge side. This leads to a series of problems such as low efficiency in remote module upgrades, service interruption during the upgrade process, and poor protocol compatibility, which affect user experience and system stability.

[0019] Based on this, this invention proposes a device communication method, including remote dynamic loading, firmware hot update, and intelligent switching functions, to realize on-demand loading of protocol stacks, seamless firmware upgrades, and automatic recovery mechanisms in abnormal states during the operation of the communication module. It utilizes the computing power of IoT edge nodes to achieve remote dynamic loading of the communication module, enabling the device to load different communication protocol stacks on demand during operation, thereby flexibly adapting to various network environments, improving device compatibility, and solving the flexibility deficiency caused by relying on static architectures.

[0020] Reference Figure 1 The diagram illustrates a flowchart of a device communication method provided by some embodiments of the present invention, applied to a device node.

[0021] In some embodiments of the present invention, the device node is a security camera.

[0022] In practical applications, this security camera can load different communication protocol stacks as needed without interrupting service, thus flexibly adapting to various network environments. For example, when the network environment of the security camera changes or a triggering event is detected, there is no need to reinstall the entire firmware; simply loading the corresponding communication protocol stack enables rapid switching of the communication protocol stack, ensuring that the security camera maintains stable and efficient communication capabilities in different network environments.

[0023] Meanwhile, the device also supports firmware hot updates, allowing for seamless firmware upgrades without affecting the normal operation of the security camera, further improving the device's performance and security. When the security camera malfunctions after using a new firmware version, the device can promptly roll back to the main firmware partition, restoring normal operation and reducing maintenance costs and downtime.

[0024] Specifically, it may include the following steps: Step 101: Receive the target protocol stack information for the communication module sent by the edge node, and establish the communication interface of the second communication protocol according to the target protocol stack information.

[0025] In some embodiments of the present invention, the edge node is a home gateway.

[0026] As some examples, the edge node can be any device or system with communication capabilities that can interact with security cameras, including but not limited to home gateways.

[0027] Among them, the home gateway is a crucial device edge node in edge computing. It is located at the very end of the network and directly connects and manages smart home devices. It can jointly form a hierarchical edge architecture with the "edge cloud" deployed in the metropolitan computer room (such as the server of the cloud security platform). The home gateway can be responsible for executing local tasks that require millisecond-level responses (such as protocol switching and linkage control), enabling the regional edge cloud to handle more complex aggregation analysis (such as multi-household security warnings and video storage).

[0028] In practical applications, the communication module refers to a key component integrated in devices such as security cameras for realizing wireless communication functions between devices. It can support multiple communication protocols and, through interaction with edge nodes (such as home gateways), achieve the transmission and protocol adaptation of device data.

[0029] As some examples, the target protocol stack information can be any protocol stack-related information that meets communication requirements, including but not limited to protocol stack parameters based on different network modes (such as 4G, 5G, Wi-Fi, etc.), protocol stack configurations optimized for specific business scenarios, etc. These information can indicate the specific type and parameter settings of the communication protocol stack that needs to be loaded or switched, so that the security camera can accurately establish the communication interface of the second communication protocol and achieve stable and efficient communication in different network environments. Among them, the edge node can dynamically send the target protocol stack information according to the actual network environment or trigger event where the security camera is located.

[0030] In practical applications, the communication module can dynamically adjust the communication interface according to the target protocol stack information to ensure the stable operation of the device in different network environments or when a trigger event is detected.

[0031] For example, when the security camera needs to switch the communication protocol, the communication module will complete data interaction with the edge node / cloud node through the established second communication protocol interface, thereby ensuring the continuity of device functions. Among them, the object connected by the second communication protocol interface can be adjusted according to actual needs.

[0032] As some examples, the second communication protocol and the first communication protocol can be communication protocols of different types or the same type but with different parameter configurations. Among them, the second communication protocol is to enhance the adaptability of the device in different network environments and the stability of communication. When the first communication protocol cannot meet the communication requirements due to changes in the network environment or adjustments in business requirements, the device can ensure the continuity and efficiency of communication by loading or switching to the second communication protocol.

[0033] In practical applications, because device nodes need to pre-store and maintain target protocol stack information for a long time, they consume more power to listen to the network and require more expensive chips to store and run it, which sacrifices the device's long battery life advantage. Therefore, to achieve "on-demand activation," the Wi-Fi hardware in the device node can be completely put into sleep mode, and only remotely woken up by the gateway in an emergency to inject the keys and instructions required for connection.

[0034] For example, when a device node first connects or triggers an alarm, the edge node can securely transmit and permanently store the target protocol stack information (such as the complete configuration of the Wi-Fi connection, including network keys, authentication certificates, server addresses, etc.) in a protected, independent storage area within the device node. When the device node triggers an alarm again, it can quickly load the target protocol stack information from local storage and autonomously connect to the communication interface of the second communication protocol, without the edge node needing to retransmit the entire information, thus achieving a much faster switchover. The edge node only needs to retransmit the updated target protocol stack information when the network configuration itself changes (such as a change in the Wi-Fi password).

[0035] In some embodiments of the present invention, establishing a communication interface for a second communication protocol based on the target protocol stack information includes: loading the target protocol stack information into a reserved runtime loading area, and establishing a communication interface for the second communication protocol through dynamic linking.

[0036] In practical applications, the reserved runtime loading area can be a specific storage area pre-allocated within the device node. This area has independent access permissions and protection mechanisms, used to quickly load and run target protocol stack information when needed. This area can be set up during device manufacturing or system initialization to ensure stable and secure storage and retrieval of critical communication protocol data during device operation. In this way, the device can autonomously switch and rebuild communication protocols without relying on continuous intervention from external nodes, thereby improving communication reliability and efficiency.

[0037] As examples, the target protocol stack information may include a protocol stack image file. Edge nodes can send the required target protocol stack information to device nodes through a secure channel. Device nodes extract the protocol stack image file, load the protocol stack image file into the reserved runtime loading area according to the communication module, and establish a communication interface with the main program through dynamic linking to achieve immediate activation of the protocol stack.

[0038] In practical applications, edge nodes, acting as intelligent decision centers, can dynamically determine the protocol stack requirements of device nodes by integrating multi-dimensional information: First, they receive the hardware capability list reported by device nodes in real time (such as support for LoRa / Bluetooth protocol types), and respond to business instructions issued by the cloud (such as requiring a switch to high-definition video streaming transmission); Second, they intelligently analyze the network environment (channel congestion, signal strength) and device node status (battery level, load). When insufficient bandwidth or excessive power consumption is detected, they automatically extract the optimal protocol stack from the local image library (such as switching the smart door lock from ZigBee (low-power, low-rate, short-range wireless communication protocol) to the lower-power NB-IoT (Narrowband Internet of Things, a low-power wide-area network technology based on cellular networks)), and accurately send it to the device nodes through a secure channel to achieve adaptive matching between communication strategies and business scenarios.

[0039] The protocol stack image file is a highly self-contained security software package that can contain executable code segments (protocol state machine, hardware abstraction layer driver), dynamic linking information (symbol table and relocation table), security metadata (digital signature, hash tree checksum, and certificate chain), and descriptor headers (protocol version, hardware dependencies, and API interface specifications). The protocol stack image file can be differentially compressed and encapsulated. When distributed from edge nodes, only incremental modules need to be transmitted. During loading, the communication module of the device node injects the protocol stack into the reserved runtime loading area using relocation technology and binds it to the main program symbols. Finally, after successful security verification, it is activated and runs, achieving seamless dynamic expansion of protocol capabilities.

[0040] As examples, dynamic linking refers to the instantaneous establishment of communication interfaces through dynamic symbol binding technology. For instance, after the protocol stack image file is loaded into memory, its internal exported symbol table (containing the addresses of functions such as connect and publish) is matched with the import interface table reserved by the main program in the device node; the loader uses a relocation engine to fill the memory addresses of the protocol stack functions into the function pointer jump table of the main program in real time, forming a bidirectional call channel. The entire process does not require recompiling the main program, enabling the main program to gain the ability to call the new protocol stack, achieving millisecond-level dynamic adaptation of the communication interface.

[0041] In some embodiments of the present invention, before receiving the target protocol stack information for the communication module sent by the edge node, the method further includes: sending key information of the communication module in the device node to the edge node.

[0042] As examples, key information may include the current firmware version, supported protocol types, and operating status of the communication module in the device node. For instance, this includes all communication protocol types supported by the communication module, hardware configuration details (such as chip model and memory capacity), the current firmware version number, and the unique identifier of the device node.

[0043] When device nodes send this critical information to edge nodes, the device nodes can use encrypted transmission to ensure the security and integrity of the information during transmission.

[0044] In practical applications, such as Figure 2 The communication module can perform initialization and status reporting. After the device node is powered on, the communication module can first perform hardware self-test (including core components such as memory, communication interface, and encryption engine), and then establish a trusted connection with the edge node through the secure handshake protocol (using two-way authentication DTLS1.3). The communication module actively reports key information.

[0045] When edge nodes receive this critical information, they can perform detection and make decisions, such as protocol stack updates and / or firmware updates.

[0046] Step 102: In response to a trigger event, switch from low power mode to normal power mode; wherein, in the low power mode, the device node communicates with the edge node using a first communication protocol.

[0047] In some embodiments of the present invention, the triggering event is the detection of a suspicious intrusion event by the security system.

[0048] As examples, security systems can be built into device nodes or external systems independent of the device nodes. Security systems can detect suspicious intrusion events in various ways, such as using infrared sensors to detect heat changes caused by human movement, or using cameras to capture abnormal movements or object movements in footage.

[0049] When these sensors or cameras detect suspicious behavior that matches preset rules, an alarm signal is triggered and transmitted to the device node. Upon receiving this trigger signal, the device node can switch from low-power mode to normal-power mode.

[0050] In low-power mode, in order to save power, the device node uses the first communication protocol to communicate with the edge node in a relatively simple and low-data-volume manner, such as periodically sending heartbeat packets indicating that the device status is normal.

[0051] After switching to normal power consumption mode, the device node can process data with higher performance and faster speed, and use the second communication protocol to communicate efficiently and stably with the edge node. It can then transmit detailed information about suspicious intrusion events to the edge node in a timely manner, so that the edge node can further analyze and process the data and take corresponding countermeasures, such as sending alarm notifications to users or activating recording functions, thereby effectively ensuring the reliability and timeliness of the security system.

[0052] For example, in a smart home scenario, when the home security system detects suspicious intrusion signs, door and window sensors and cameras that originally used ZigBee low-power communication need to immediately start high-definition video streaming for real-time monitoring. At this time, the home gateway, acting as an edge node, quickly and dynamically sends the Wi-Fi protocol stack (target protocol stack information) to these device nodes. Within milliseconds, the device nodes switch to high-speed communication mode (i.e., establish a communication interface for the second communication protocol) and transmit the high-definition video stream to the security platform in the cloud node in real time. After the alarm is cleared, the devices automatically fall back to ZigBee (low-power mode), which not only ensures security emergency response but also maximizes the battery life of battery-powered devices.

[0053] As examples, the target protocol stack information may also include algorithm information, and triggering events may be abnormal changes in environmental parameters, such as temperature, humidity, or light intensity exceeding preset safety thresholds. Triggering events may also include changes in the device's own state, such as low battery, device malfunction, or abnormal restart.

[0054] For example, in smart agriculture, soil sensors (device nodes) deployed in the fields normally report basic data using the LoRa protocol (a low-power wide-area network wireless communication protocol based on radio frequency technology). However, when a weather satellite predicts an impending rare hailstorm, the cloud can remotely send new identification algorithms through edge nodes, allowing the sensors to immediately switch modes, analyze impact sound waves in real time to confirm the disaster, and activate the field's defense network. This enables the device nodes to dynamically respond to unforeseen events, gaining unprecedented new capabilities through software updates, thus breaking the limitations of pre-built hardware functions and achieving on-demand intelligent scheduling of global resources.

[0055] In some embodiments of the present invention, in the low-power mode, the device node communicates with the edge node using a first communication protocol, including: in the low-power mode, the device node sends a heartbeat data packet to the edge node using the first communication protocol.

[0056] In practical applications, in low-power mode, the device is basically in a sleep state and can not transmit any video or data. It is only briefly and periodically woken up to send a heartbeat data packet to the edge node to ensure that the device node has not been disconnected.

[0057] As examples, the first communication protocol can be a low-power, low-data-volume communication method used to maintain basic connections between device nodes and edge nodes. This first communication protocol can employ a simplified data packet structure and an adaptive transmission rate adjustment mechanism to extend device uptime and ensure connection stability. The heartbeat packet can be a very simple data structure containing only the device identifier, timestamp, and a simple status code (such as online, asleep, etc.) to inform the edge node of the device node's current status.

[0058] After receiving a heartbeat data packet, the edge node can parse and record it to confirm the online status of the device node. If no heartbeat data packet is received within a preset time, the edge node can determine that the device node is offline and take corresponding measures, such as retrying the connection or sending a notification to the user. Simultaneously, the heartbeat data packet can also serve as a trigger condition to start or adjust other functions of the device node. For example, when the edge node receives multiple consecutive "sleep" state heartbeat packets from the device node, it can determine that the device node is in deep sleep mode. If an alarm signal from a security system is received at this time, the edge node can immediately send a wake-up command to the device node, prompting it to quickly switch to normal power consumption mode to deal with emergencies.

[0059] Step 103: In the normal power consumption mode, the communication interface of the second communication protocol is invoked, and the second communication protocol is used to communicate with the cloud node.

[0060] In practical applications, under normal power consumption mode, the device node possesses complete communication functions and data processing capabilities. At this time, the device can establish a stable connection with the cloud node by calling the communication interface of the second communication protocol, achieving efficient data transmission and command interaction. This mode supports real-time response to cloud commands while ensuring the integrity and timeliness of data transmission, providing a reliable guarantee for the stable operation of the device in complex environments.

[0061] In some embodiments of the present invention, in the normal power consumption mode, calling the communication interface of the second communication protocol and communicating with the cloud node using the second communication protocol includes: in the normal power consumption mode, calling the communication interface of the second communication protocol and sending service data packets to the cloud node using the second communication protocol.

[0062] In some embodiments of the present invention, the service data packet is a video stream collected by the security camera in the normal power consumption mode.

[0063] As examples, business data packets can also contain various types of data, such as the device's current operating status information, collected environmental data, or user-defined parameters. By sending these business data packets, cloud nodes can obtain detailed information about the device in a timely manner, thereby making accurate decisions and issuing appropriate instructions to ensure that the device operates according to expected requirements and specifications. This also facilitates centralized management and monitoring of the entire system.

[0064] In normal power consumption mode, after calling the communication interface of the second communication protocol, the device node can communicate directly with the security platform in the cloud node, instead of going through the edge node. This allows the edge node to act as a "command and control center" rather than a "data relay station." It only needs to make decisions and issue switching instructions and securely transmit network keys within milliseconds before it can exit the data transmission path.

[0065] For example, in normal power consumption mode, after the device node calls the communication interface of the second communication protocol, the high-definition video stream generated by the device node at high speed can be directly uploaded to the Internet through the Wi-Fi router and reach the cloud node, thereby minimizing the transmission path, reducing latency, avoiding edge nodes from becoming bandwidth bottlenecks, and ensuring the ultimate real-time performance of the monitoring screen.

[0066] In some embodiments of the present invention, the communication module is provided with a main operating area and a backup operating area, and the method further includes: receiving firmware upgrade data sent by the edge node, and loading the new version firmware into the backup operating area of ​​the communication module according to the firmware upgrade data; and switching the new version firmware in the backup operating area after detecting that the task in the main operating area has been completed.

[0067] In practical applications, the primary operating area is used for the currently running firmware program to perform various tasks, while the backup operating area is a pre-configured area for firmware upgrades. When an edge node sends firmware upgrade data, the device node's communication module can receive this data and load it into the backup operating area.

[0068] As examples, firmware upgrade data may contain the complete code or differential upgrade package of the new firmware version. After receiving this data, the communication module of the device node will parse and process it according to preset rules. If it is complete code, it can be directly loaded into the standby running area; if it is a differential upgrade package, it can be compared and merged with the current firmware version in the main running area to generate the new firmware version before being loaded into the standby running area.

[0069] During the loading process, the communication module can perform integrity and security checks on the firmware data to ensure the reliability and stability of the new firmware version. After the current task in the main running area is completed, the communication module can seamlessly switch to the backup running area and start the new firmware version.

[0070] As examples, when a device node needs to undergo a firmware upgrade, the edge node can transmit the new firmware version in encrypted chunks to the upgrade cache of the communication module. After the communication module completes integrity verification and decryption in the background, it loads the new firmware into the backup running area and seamlessly switches to the new firmware version after the main running area task is completed. The entire process does not interrupt the device's external services. This allows the communication module to complete the upgrade while maintaining normal operation, without affecting user experience.

[0071] In some embodiments of the present invention, after detecting that a task in the main running area has been completed and switching to a new version of firmware in the backup running area, the method further includes: when an abnormal operation of the new version of firmware is detected, rolling back to the firmware in the main running area.

[0072] As examples, new firmware malfunctions refer to situations where the new firmware encounters errors, crashes, fails to perform functions properly, or is incompatible with hardware during startup or operation.

[0073] like Figure 2 When the communication module intelligently detects an anomaly in the operation of the new firmware version, for example by monitoring key firmware operation indicators (such as error records in system logs, response time of functional modules, and abnormal feedback of hardware status), it will immediately trigger the rollback mechanism. This rollback mechanism can switch the currently running firmware back to a previously stable firmware version in the main runtime area, ensuring that the device node can quickly recover to a normal working state and avoid problems such as device function interruption or data loss due to firmware upgrade failure, thereby ensuring the continuity and reliability of device operation.

[0074] As examples, the rollback mechanism can be a pre-defined rollback strategy. For example, an initial warning phase → a second degradation phase → a third rollback phase.

[0075] During the initial warning phase, the communication module will issue an initial warning signal when it detects a minor anomaly in the new firmware version, such as a slight increase in the response time of some non-critical functional modules that does not affect the overall basic functionality.

[0076] During the secondary downgrade phase, if the abnormal situation persists or worsens after the initial warning, such as intermittent failures in critical functional modules that are not yet completely inoperable, the rollback mechanism will execute a secondary downgrade operation. This downgrades the new firmware version to a relatively stable intermediate version that still includes some new features. This allows for further observation and troubleshooting of problems while ensuring the device's basic functions operate normally, and avoids potential functional loss from directly rolling back to the old version.

[0077] During the third rollback phase, if the anomaly is not effectively resolved after two downgrades, or if a more serious failure occurs, such as the complete loss of critical device functions or frequent system crashes affecting normal device operation, the rollback mechanism will perform a third rollback operation. This completely switches the currently running firmware back to the previously stable firmware version in the main runtime environment, ensuring that the device node can quickly and completely recover to normal operating status, minimizing the loss of device functionality and data due to firmware upgrade failure.

[0078] In practical applications, the communication module can have a built-in dual firmware partition structure. The primary partition runs the current firmware version, while the backup partition is used for loading the new firmware version. After the firmware upgrade is complete, the module monitors the running status of the new version through a heartbeat mechanism. If an anomaly is detected (such as communication interruption, response delay, etc.), it automatically rolls back to the primary partition firmware to ensure continuous device operation. This addresses the situation where it is impossible to revert to the old firmware version after an upgrade, and only the new firmware version can be upgraded. Through the above embodiment, if problems occur in the new firmware version, it is possible to revert to the old version without affecting user operation.

[0079] As some examples, such as Figure 2 The device nodes can record logs and provide remote feedback. Key operations during the entire firmware loading and upgrade process are recorded in local logs and uploaded to cloud nodes periodically for remote monitoring and fault analysis.

[0080] In the above embodiments, precise dynamic loading of the target protocol stack information is achieved through secure differential transmission. Edge nodes only issue differentiated protocol components (such as updating the TLS encryption module separately). The communication module completes atomic assembly in a memory-isolated runtime loading area and achieves millisecond-level docking with the main program through a symbol relocation engine. Firmware upgrades employ double-buffered hot migration technology. Edge nodes can divide the new firmware into encrypted blocks and attach Merkle tree (hash tree) verification nodes. After the communication module completes block-by-block verification in the background, it achieves seamless service updates through state snapshot saving and pointer jump switching. The device node system can have a built-in three-dimensional health monitoring system to continuously evaluate communication quality, system performance, and service indicators. When an anomaly is detected, a gradient rollback strategy is automatically triggered (first warning → second degradation → third rollback), and an intelligent diagnostic report containing stack traces and register snapshots is generated to ensure that the device recovers to a stable state within 30 seconds after an upgrade failure.

[0081] In some embodiments of the present invention, by receiving target protocol stack information for the communication module sent by the edge node, and establishing a communication interface for the second communication protocol based on the target protocol stack information, the device node switches from a low-power mode to a normal power mode in response to a trigger event. In the low-power mode, the device node communicates with the edge node using the first communication protocol. In the normal power mode, the device node calls the communication interface of the second communication protocol and communicates with the cloud node using the second communication protocol. This achieves dynamic establishment of the communication interface for the second communication protocol based on the target protocol stack information provided by the edge node. The flexible communication switching of the device node in different power modes not only reduces the power consumption of the device node and extends its battery life, but also ensures that when the device node needs to perform large-scale or high-real-time communication with the cloud node, it can quickly switch to the normal power mode, achieving efficient and stable communication using the second communication protocol.

[0082] Reference Figure 3 The diagram illustrates a flowchart of another device communication method provided by some embodiments of the present invention, applied to a device node.

[0083] In some embodiments of the present invention, the device node is a security camera.

[0084] In practical applications, this security camera can load different communication protocol stacks as needed without interrupting service, thus flexibly adapting to various network environments. For example, when the network environment of the security camera changes or a triggering event is detected, there is no need to reinstall the entire firmware; simply loading the corresponding communication protocol stack enables rapid switching of the communication protocol stack, ensuring that the security camera maintains stable and efficient communication capabilities in different network environments.

[0085] Meanwhile, the device also supports the firmware hot update function, enabling seamless firmware upgrades without affecting the normal operation of the security camera, thereby further enhancing the device's performance and security. When the security camera experiences abnormal conditions with the new version of the firmware, the device can promptly roll back to the main partition firmware to restore the normal operation of the device, reducing maintenance costs and downtime.

[0086] Specifically, it can include the following steps: Step 301: Send the key information of the communication module in the device node to the edge node.

[0087] In some embodiments of the present invention, the edge node is a home gateway.

[0088] As some examples, the edge node can be any device or system with communication capabilities and capable of data interaction with the security camera, including but not limited to home gateways.

[0089] Among them, the home gateway is a crucial device edge node in edge computing. It is located at the end of the network and directly connects and manages smart home devices. It can jointly form a hierarchical edge architecture with the "edge cloud" (such as the server of the cloud security platform) deployed in the metropolitan computer room. The home gateway can be responsible for executing local tasks that require millisecond-level responses (such as protocol switching and linkage control), enabling the regional edge cloud to handle more complex aggregation analysis (such as multi-household security warnings and video storage).

[0090] In practical applications, the communication module refers to a key component integrated in devices such as security cameras for realizing wireless communication functions between devices. It can support multiple communication protocols and achieve device data transmission and protocol adaptation through interaction with the edge node (such as a home gateway).

[0091] As some examples, the key information can include the current firmware version, supported protocol types, and operating status of the communication module in the device node, etc. For example, all communication protocol types supported by the communication module, detailed hardware configuration (such as chip model, memory capacity), the current firmware version number, and the unique identifier of the device node, etc.

[0092] When the device node sends this key information to the edge node, the device node can adopt encrypted transmission to ensure the security and integrity of the information during transmission.

[0093] In practical applications, such as Figure 2The communication module can perform initialization and status reporting. After the device node is powered on, the communication module can first perform hardware self-test (including core components such as memory, communication interface, and encryption engine), and then establish a trusted connection with the edge node through the secure handshake protocol (using two-way authentication DTLS 1.3). The communication module actively reports key information.

[0094] When edge nodes receive this critical information, they can perform detection and make decisions, such as protocol stack updates and / or firmware updates.

[0095] Step 302: Receive the target protocol stack information for the communication module sent by the edge node, and establish a communication interface for the second communication protocol based on the target protocol stack information.

[0096] As examples, the target protocol stack information can be any protocol stack-related information that meets communication requirements, including but not limited to protocol stack parameters based on different network standards (such as 4G, 5G, Wi-Fi, etc.) and protocol stack configurations optimized for specific business scenarios. This information indicates the specific type and parameter settings of the communication protocol stack that needs to be loaded or switched, so that the security camera can accurately establish the communication interface of the second communication protocol and achieve stable and efficient communication in different network environments. The edge node can dynamically send the target protocol stack information based on the actual network environment of the security camera or triggered events.

[0097] In practical applications, the communication module can dynamically adjust the communication interface according to the target protocol stack information to ensure stable operation of the device in different network environments or when a triggering event is detected.

[0098] For example, when a security camera needs to switch communication protocols, the communication module will interact with edge nodes / cloud nodes through a second communication protocol interface to ensure the continuity of device functionality. The objects connected to the second communication protocol interface can be adjusted according to actual needs.

[0099] As examples, the second communication protocol can be a different type from the first communication protocol, or the same type but with different parameter configurations. The second communication protocol is designed to enhance the device's adaptability and communication stability in different network environments. When the first communication protocol cannot meet communication requirements due to changes in the network environment or adjustments in service needs, the device can load or switch to the second communication protocol to ensure continuous and efficient communication.

[0100] In practical applications, because device nodes need to pre-store and maintain target protocol stack information for a long time, they consume more power to listen to the network and require more expensive chips to store and run it, which sacrifices the device's long battery life advantage. Therefore, to achieve "on-demand activation," the Wi-Fi hardware in the device node can be completely put into sleep mode, and only remotely woken up by the gateway in an emergency to inject the keys and instructions required for connection.

[0101] For example, when a device node first connects or triggers an alarm, the edge node can securely transmit and permanently store the target protocol stack information (such as the complete configuration of the Wi-Fi connection, including network keys, authentication certificates, server addresses, etc.) in a protected, independent storage area within the device node. When the device node triggers an alarm again, it can quickly load the target protocol stack information from local storage and autonomously connect to the communication interface of the second communication protocol, without the edge node needing to retransmit the entire information, thus achieving a much faster switchover. The edge node only needs to retransmit the updated target protocol stack information when the network configuration itself changes (such as a change in the Wi-Fi password).

[0102] In some embodiments of the present invention, establishing a communication interface for a second communication protocol based on the target protocol stack information includes: loading the target protocol stack information into a reserved runtime loading area, and establishing a communication interface for the second communication protocol through dynamic linking.

[0103] In practical applications, the reserved runtime loading area can be a specific storage area pre-allocated within the device node. This area has independent access permissions and protection mechanisms, used to quickly load and run target protocol stack information when needed. This area can be set up during device manufacturing or system initialization to ensure stable and secure storage and retrieval of critical communication protocol data during device operation. In this way, the device can autonomously switch and rebuild communication protocols without relying on continuous intervention from external nodes, thereby improving communication reliability and efficiency.

[0104] As examples, the target protocol stack information may include a protocol stack image file. Edge nodes can send the required target protocol stack information to device nodes through a secure channel. Device nodes extract the protocol stack image file, load the protocol stack image file into the reserved runtime loading area according to the communication module, and establish a communication interface with the main program through dynamic linking to achieve immediate activation of the protocol stack.

[0105] In practical applications, edge nodes, acting as intelligent decision centers, can dynamically determine the protocol stack requirements of device nodes by integrating multi-dimensional information: First, they receive the hardware capability list reported by device nodes in real time (such as support for LoRa / Bluetooth protocol types), and respond to business instructions issued by the cloud (such as requiring a switch to high-definition video streaming transmission); Second, they intelligently analyze the network environment (channel congestion, signal strength) and device node status (battery level, load). When insufficient bandwidth or excessive power consumption is detected, they automatically extract the optimal protocol stack from the local image library (such as switching the smart door lock from ZigBee (low-power, low-rate, short-range wireless communication protocol) to the lower-power NB-IoT (Narrowband Internet of Things, a low-power wide-area network technology based on cellular networks)), and accurately send it to the device nodes through a secure channel to achieve adaptive matching between communication strategies and business scenarios.

[0106] The protocol stack image file is a highly self-contained security software package that can contain executable code segments (protocol state machine, hardware abstraction layer driver), dynamic linking information (symbol table and relocation table), security metadata (digital signature, hash tree checksum, and certificate chain), and descriptor headers (protocol version, hardware dependencies, and API interface specifications). The protocol stack image file can be differentially compressed and encapsulated. When distributed from edge nodes, only incremental modules need to be transmitted. During loading, the communication module of the device node injects the protocol stack into the reserved runtime loading area using relocation technology and binds it to the main program symbols. Finally, after successful security verification, it is activated and runs, achieving seamless dynamic expansion of protocol capabilities.

[0107] As examples, dynamic linking refers to the instantaneous establishment of communication interfaces through dynamic symbol binding technology. For instance, after the protocol stack image file is loaded into memory, its internal exported symbol table (containing the addresses of functions such as connect and publish) is matched with the import interface table reserved by the main program in the device node; the loader uses a relocation engine to fill the memory addresses of the protocol stack functions into the function pointer jump table of the main program in real time, forming a bidirectional call channel. The entire process does not require recompiling the main program, enabling the main program to gain the ability to call the new protocol stack, achieving millisecond-level dynamic adaptation of the communication interface.

[0108] Step 303: In response to a trigger event, switch from low power mode to normal power mode; wherein, in the low power mode, the device node communicates with the edge node using a first communication protocol.

[0109] In some embodiments of the present invention, the triggering event is the detection of a suspicious intrusion event by the security system.

[0110] As examples, security systems can be built into device nodes or external systems independent of the device nodes. Security systems can detect suspicious intrusion events in various ways, such as using infrared sensors to detect heat changes caused by human movement, or using cameras to capture abnormal movements or object movements in footage.

[0111] When these sensors or cameras detect suspicious behavior that matches preset rules, an alarm signal is triggered and transmitted to the device node. Upon receiving this trigger signal, the device node can switch from low-power mode to normal-power mode.

[0112] In low-power mode, in order to save power, the device node uses the first communication protocol to communicate with the edge node in a relatively simple and low-data-volume manner, such as periodically sending heartbeat packets indicating that the device status is normal.

[0113] After switching to normal power consumption mode, the device node can process data with higher performance and faster speed, and use the second communication protocol to communicate efficiently and stably with the edge node. It can then transmit detailed information about suspicious intrusion events to the edge node in a timely manner, so that the edge node can further analyze and process the data and take corresponding countermeasures, such as sending alarm notifications to users or activating recording functions, thereby effectively ensuring the reliability and timeliness of the security system.

[0114] For example, in a smart home scenario, when the home security system detects suspicious intrusion signs, door and window sensors and cameras that originally used ZigBee low-power communication need to immediately start real-time monitoring with high-definition video streaming. At this time, the home gateway, acting as an edge node, quickly and dynamically sends the Wi-Fi protocol stack (target protocol stack information) to these device nodes. Within milliseconds, the device nodes switch to high-speed communication mode (i.e., establish a communication interface for the second communication protocol) and transmit the high-definition video stream to the security platform in the cloud node in real time. After the alarm is cleared, the devices automatically fall back to ZigBee low-power mode, which not only ensures security emergency response but also maximizes the battery life of battery-powered devices.

[0115] As examples, the target protocol stack information may also include algorithm information, and triggering events may be abnormal changes in environmental parameters, such as temperature, humidity, or light intensity exceeding preset safety thresholds. Triggering events may also include changes in the device's own state, such as low battery, device malfunction, or abnormal restart.

[0116] For example, in smart agriculture, soil sensors (device nodes) deployed in the fields normally report basic data using the LoRa protocol (a low-power wide-area network wireless communication protocol based on radio frequency technology). However, when a weather satellite predicts an impending rare hailstorm, the cloud can remotely send new identification algorithms through edge nodes, allowing the sensors to immediately switch modes, analyze impact sound waves in real time to confirm the disaster, and activate the field's defense network. This enables the device nodes to dynamically respond to unforeseen events, gaining unprecedented new capabilities through software updates, thus breaking the limitations of pre-built hardware functions and achieving on-demand intelligent scheduling of global resources.

[0117] In some embodiments of the present invention, in the low-power mode, the device node communicates with the edge node using a first communication protocol, including: in the low-power mode, the device node sends a heartbeat data packet to the edge node using the first communication protocol.

[0118] In practical applications, in low-power mode, the device is basically in a sleep state and can not transmit any video or data. It is only briefly and periodically woken up to send a heartbeat data packet to the edge node to ensure that the device node has not been disconnected.

[0119] As examples, the first communication protocol can be a low-power, low-data-volume communication method used to maintain basic connections between device nodes and edge nodes. This first communication protocol can employ a simplified data packet structure and an adaptive transmission rate adjustment mechanism to extend device uptime and ensure connection stability. The heartbeat packet can be a very simple data structure containing only the device identifier, timestamp, and a simple status code (such as online, asleep, etc.) to inform the edge node of the device node's current status.

[0120] After receiving a heartbeat data packet, the edge node can parse and record it to confirm the online status of the device node. If no heartbeat data packet is received within a preset time, the edge node can determine that the device node is offline and take corresponding measures, such as retrying the connection or sending a notification to the user. Simultaneously, the heartbeat data packet can also serve as a trigger condition to start or adjust other functions of the device node. For example, when the edge node receives multiple consecutive "sleep" state heartbeat packets from the device node, it can determine that the device node is in deep sleep mode. If an alarm signal from a security system is received at this time, the edge node can immediately send a wake-up command to the device node, prompting it to quickly switch to normal power consumption mode to deal with emergencies.

[0121] Step 304: In the normal power consumption mode, the communication interface of the second communication protocol is invoked, and the second communication protocol is used to communicate with the cloud node.

[0122] In practical applications, under normal power consumption mode, the device node possesses complete communication functions and data processing capabilities. At this time, the device can establish a stable connection with the cloud node by calling the communication interface of the second communication protocol, achieving efficient data transmission and command interaction. This mode supports real-time response to cloud commands while ensuring the integrity and timeliness of data transmission, providing a reliable guarantee for the stable operation of the device in complex environments.

[0123] In some embodiments of the present invention, in the normal power consumption mode, calling the communication interface of the second communication protocol and communicating with the cloud node using the second communication protocol includes: in the normal power consumption mode, calling the communication interface of the second communication protocol and sending service data packets to the cloud node using the second communication protocol.

[0124] In some embodiments of the present invention, the service data packet is a video stream collected by the security camera in the normal power consumption mode.

[0125] As examples, business data packets can also contain various types of data, such as the device's current operating status information, collected environmental data, or user-defined parameters. By sending these business data packets, cloud nodes can obtain detailed information about the device in a timely manner, thereby making accurate decisions and issuing appropriate instructions to ensure that the device operates according to expected requirements and specifications. This also facilitates centralized management and monitoring of the entire system.

[0126] In normal power consumption mode, after calling the communication interface of the second communication protocol, the device node can communicate directly with the security platform in the cloud node, instead of going through the edge node. This allows the edge node to act as a "command and control center" rather than a "data relay station." It only needs to make decisions and issue switching instructions and securely transmit network keys within milliseconds before it can exit the data transmission path.

[0127] For example, in normal power consumption mode, after the device node calls the communication interface of the second communication protocol, the high-definition video stream generated by the device node at high speed can be directly uploaded to the Internet through the Wi-Fi router and reach the cloud node, thereby minimizing the transmission path, reducing latency, avoiding edge nodes from becoming bandwidth bottlenecks, and ensuring the ultimate real-time performance of the monitoring screen.

[0128] Step 305: Receive firmware upgrade data sent by the edge node, and load the new version firmware into the backup running area of ​​the communication module according to the firmware upgrade data; after detecting that the task in the main running area has been completed, switch the new version firmware in the backup running area.

[0129] In practical applications, the primary operating area is used for the currently running firmware program to perform various tasks, while the backup operating area is a pre-configured area for firmware upgrades. When an edge node sends firmware upgrade data, the device node's communication module can receive this data and load it into the backup operating area.

[0130] As examples, firmware upgrade data may contain the complete code or differential upgrade package of the new firmware version. After receiving this data, the communication module of the device node will parse and process it according to preset rules. If it is complete code, it can be directly loaded into the standby running area; if it is a differential upgrade package, it can be compared and merged with the current firmware version in the main running area to generate the new firmware version before being loaded into the standby running area.

[0131] During the loading process, the communication module can perform integrity and security checks on the firmware data to ensure the reliability and stability of the new firmware version. After the current task in the main running area is completed, the communication module can seamlessly switch to the backup running area and start the new firmware version.

[0132] As examples, when a device node needs to undergo a firmware upgrade, the edge node can transmit the new firmware version in encrypted chunks to the upgrade cache of the communication module. After the communication module completes integrity verification and decryption in the background, it loads the new firmware into the backup running area and seamlessly switches to the new firmware version after the main running area task is completed. The entire process does not interrupt the device's external services. This allows the communication module to complete the upgrade while maintaining normal operation, without affecting user experience.

[0133] In some embodiments of the present invention, after detecting that a task in the main running area has been completed and switching to a new version of firmware in the backup running area, the method further includes: when an abnormal operation of the new version of firmware is detected, rolling back to the firmware in the main running area.

[0134] As examples, new firmware malfunctions refer to situations where the new firmware encounters errors, crashes, fails to perform functions properly, or is incompatible with hardware during startup or operation.

[0135] like Figure 2 When the communication module intelligently detects an anomaly in the operation of the new firmware version, for example by monitoring key firmware operation indicators (such as error records in system logs, response time of functional modules, and abnormal feedback of hardware status), it will immediately trigger the rollback mechanism. This rollback mechanism can switch the currently running firmware back to a previously stable firmware version in the main runtime area, ensuring that the device node can quickly recover to a normal working state and avoid problems such as device function interruption or data loss due to firmware upgrade failure, thereby ensuring the continuity and reliability of device operation.

[0136] As examples, the rollback mechanism can be a pre-defined rollback strategy. For example, an initial warning phase → a second degradation phase → a third rollback phase.

[0137] During the initial warning phase, the communication module will issue an initial warning signal when it detects a minor anomaly in the new firmware version, such as a slight increase in the response time of some non-critical functional modules that does not affect the overall basic functionality.

[0138] During the secondary downgrade phase, if the abnormal situation persists or worsens after the initial warning, such as intermittent failures in critical functional modules that are not yet completely inoperable, the rollback mechanism will execute a secondary downgrade operation. This downgrades the new firmware version to a relatively stable intermediate version that still includes some new features. This allows for further observation and troubleshooting of problems while ensuring the device's basic functions operate normally, and avoids potential functional loss from directly rolling back to the old version.

[0139] During the third rollback phase, if the anomaly is not effectively resolved after two downgrades, or if a more serious failure occurs, such as the complete loss of critical device functions or frequent system crashes affecting normal device operation, the rollback mechanism will perform a third rollback operation. This completely switches the currently running firmware back to the previously stable firmware version in the main runtime environment, ensuring that the device node can quickly and completely recover to normal operating status, minimizing the loss of device functionality and data due to firmware upgrade failure.

[0140] In practical applications, the communication module can have a built-in dual firmware partition structure. The primary partition runs the current firmware version, while the backup partition is used for loading the new firmware version. After the firmware upgrade is complete, the module monitors the running status of the new version through a heartbeat mechanism. If an anomaly is detected (such as communication interruption, response delay, etc.), it automatically rolls back to the primary partition firmware to ensure continuous device operation. This addresses the situation where it is impossible to revert to the old firmware version after an upgrade, and only the new firmware version can be upgraded. Through the above embodiment, if problems occur in the new firmware version, it is possible to revert to the old version without affecting user operation.

[0141] As some examples, such as Figure 2 The device nodes can record logs and provide remote feedback. Key operations during the entire firmware loading and upgrade process are recorded in local logs and uploaded to cloud nodes periodically for remote monitoring and fault analysis.

[0142] In the above embodiments, precise dynamic loading of the target protocol stack information is achieved through secure differential transmission. Edge nodes only issue differentiated protocol components (such as updating the TLS encryption module separately). The communication module completes atomic assembly in a memory-isolated runtime loading area and achieves millisecond-level docking with the main program through a symbol relocation engine. Firmware upgrades employ double-buffered hot migration technology. Edge nodes can divide the new firmware into encrypted blocks and attach Merkle tree (hash tree) verification nodes. After the communication module completes block-by-block verification in the background, it achieves seamless service updates through state snapshot saving and pointer jump switching. The device node system can have a built-in three-dimensional health monitoring system to continuously evaluate communication quality, system performance, and service indicators. When an anomaly is detected, a gradient rollback strategy is automatically triggered (first warning → second degradation → third rollback), and an intelligent diagnostic report containing stack traces and register snapshots is generated to ensure that the device recovers to a stable state within 30 seconds after an upgrade failure.

[0143] In some embodiments of the present invention, by receiving target protocol stack information for the communication module sent by the edge node, and establishing a communication interface for the second communication protocol based on the target protocol stack information, the device node switches from a low-power mode to a normal power mode in response to a trigger event. In the low-power mode, the device node communicates with the edge node using the first communication protocol. In the normal power mode, the device node calls the communication interface of the second communication protocol and communicates with the cloud node using the second communication protocol. This achieves dynamic establishment of the communication interface for the second communication protocol based on the target protocol stack information provided by the edge node. The flexible communication switching of the device node in different power modes not only reduces the power consumption of the device node and extends its battery life, but also ensures that when the device node needs to perform large-scale or high-real-time communication with the cloud node, it can quickly switch to the normal power mode, achieving efficient and stable communication using the second communication protocol.

[0144] 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 the present invention are not limited to the described order of actions, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions involved are not necessarily essential to the embodiments of the present invention.

[0145] Reference Figure 4 The diagram shows a structural schematic of a device communication apparatus provided in some embodiments of the present invention, which is applied to a device node.

[0146] Specifically, it can include the following modules: The communication interface establishment module 401 is used to receive target protocol stack information for the communication module sent by the edge node, and establish a communication interface for the second communication protocol based on the target protocol stack information. The power consumption mode switching module 402 is used to switch from a low power consumption mode to a normal power consumption mode in response to a trigger event; wherein, in the low power consumption mode, the device node communicates with the edge node using a first communication protocol; The second communication protocol communication module 403 is used to call the communication interface of the second communication protocol in the normal power consumption mode and communicate with the cloud node using the second communication protocol.

[0147] In some embodiments of the present invention, the power consumption mode switching module 402 includes: A heartbeat data packet sending submodule is used in the low-power mode to send heartbeat data packets from the device node to the edge node using a first communication protocol. The second communication protocol communication module 403 includes: The service data packet sending submodule is used to call the communication interface of the second communication protocol in the normal power consumption mode and send service data packets to the cloud node using the second communication protocol.

[0148] In some embodiments of the present invention, the device node is a security camera, the edge node is a home gateway, the triggering event is the security system detecting a suspicious intrusion event, and the service data packet is the video stream collected by the security camera in the normal power consumption mode.

[0149] In some embodiments of the present invention, the communication interface establishment module 401 includes: The target protocol stack information loading submodule is used to load the target protocol stack information into the reserved runtime loading area and establish the communication interface of the second communication protocol through dynamic linking.

[0150] In some embodiments of the present invention, the apparatus further includes: The key information sending module sends key information of the communication module in the device node to the edge node.

[0151] In some embodiments of the present invention, the communication module is provided with a main operating area and a backup operating area, and the device further includes: A firmware loading device is used to receive firmware upgrade data sent by the edge node and load the new version firmware into the spare operating area of ​​the communication module according to the firmware upgrade data. The task detection device is used to switch to a new firmware version in the backup running area after detecting that a task has been completed in the main running area.

[0152] In some embodiments of the present invention, the apparatus further includes: A firmware rollback device is used to roll back to the firmware in the main running area when an abnormality is detected in the new version of firmware.

[0153] In some embodiments of the present invention, by receiving target protocol stack information for the communication module sent by the edge node, and establishing a communication interface for the second communication protocol based on the target protocol stack information, the device node switches from a low-power mode to a normal power mode in response to a trigger event. In the low-power mode, the device node communicates with the edge node using the first communication protocol. In the normal power mode, the device node calls the communication interface of the second communication protocol and communicates with the cloud node using the second communication protocol. This achieves dynamic establishment of the communication interface for the second communication protocol based on the target protocol stack information provided by the edge node. The flexible communication switching of the device node in different power modes not only reduces the power consumption of the device node and extends its battery life, but also ensures that when the device node needs to perform large-scale or high-real-time communication with the cloud node, it can quickly switch to the normal power mode, achieving efficient and stable communication using the second communication protocol.

[0154] Some embodiments of the present invention also provide an electronic device, including 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 method described above.

[0155] Some embodiments of the present invention also provide a computer-readable storage medium on which a computer program is stored, and which, when executed by a processor, implements the method described above.

[0156] Some embodiments of the present invention also provide a computer program product, including a computer program that, when executed by a processor, implements the method described above.

[0157] 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.

[0158] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.

[0159] 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.

[0160] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, apparatus, or computer program products. Therefore, embodiments of the present invention can take the form of entirely hardware embodiments, entirely software embodiments, or embodiments combining software and hardware aspects. Furthermore, embodiments of the present invention 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.

[0161] Embodiments of the present invention are described with reference to flowchart illustrations and / or block diagrams of methods, terminal devices (systems), and computer program products according to embodiments of the invention. It will 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 and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0162] 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.

[0163] 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.

[0164] Although preferred embodiments of the present invention 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 invention.

[0165] 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 the aforementioned element.

[0166] The above provides a detailed description of the method, apparatus, device, medium, and product for device communication. Specific examples have been used to illustrate the principles and implementation methods of the present invention. The descriptions of the above embodiments are only for the purpose of helping to understand the method and core ideas of the present invention. 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 the present invention. Therefore, the content of this specification should not be construed as a limitation of the present invention.

Claims

1. A method of device communication, the method comprising: The method applied to a device node comprises: receiving target protocol stack information for a communication module sent by an edge node, and establishing a communication interface of a second communication protocol according to the target protocol stack information; switching from a low-power mode to a normal power mode in response to a trigger event; wherein in the low-power mode, the device node communicates with the edge node using a first communication protocol; in the normal power mode, invoking the communication interface of the second communication protocol to communicate with a cloud node using the second communication protocol.

2. The method of claim 1, wherein, In the low-power mode, the device node communicates with the edge node using the first communication protocol, comprising: in the low-power mode, the device node sends a heartbeat data packet to the edge node using the first communication protocol; in the normal power mode, invoking the communication interface of the second communication protocol to communicate with a cloud node using the second communication protocol, comprising: in the normal power mode, invoking the communication interface of the second communication protocol to send a service data packet to the cloud node using the second communication protocol.

3. The method of claim 2, wherein, The device node is a security camera, the edge node is a home gateway, the trigger event is that a security system detects a suspicious intrusion event, and the service data packet is a video stream collected by the security camera in the normal power mode.

4. The method of claim 1, wherein, According to the target protocol stack information, the communication interface of the second communication protocol is established, comprising: loading the target protocol stack information to a reserved runtime loading area, and establishing the communication interface of the second communication protocol through dynamic linking.

5. The method of claim 1, wherein, Before receiving the target protocol stack information for the communication module sent by the edge node, further comprising: sending key information of the communication module in the device node to the edge node.

6. The method according to any one of claims 1 to 5, characterized in that, The communication module is provided with a main running area and a backup running area, and the method further comprises: receiving firmware upgrade data sent by the edge node, and loading a new version of firmware to the backup running area of the communication module according to the firmware upgrade data; after detecting that the task in the main running area is completed, switching the new version of firmware in the backup running area.

7. The method of claim 6, wherein, After detecting that the task in the main running area is completed, and after switching the new version of firmware in the backup running area, further comprising: when detecting that the new version of firmware runs abnormally, rolling back to the firmware in the main running area.

8. An apparatus for device communication, the apparatus comprising: The device comprises: a communication interface establishment module for receiving target protocol stack information for a communication module sent by an edge node, and establishing a communication interface of a second communication protocol according to the target protocol stack information; a power mode switching module for switching from a low-power mode to a normal power mode in response to a trigger event; wherein in the low-power mode, the device node communicates with the edge node using a first communication protocol; a second communication protocol communication module for, in the normal power mode, invoking the communication interface of the second communication protocol to communicate with a cloud node using the second communication protocol.

9. An electronic device, comprising: A computer program product comprising computer executable instructions for implementing the method according to any one of claims 1 to 7 when executed at a processor.

10. A computer-readable storage medium, characterized in that, A computer program product comprising computer executable instructions for implementing the method according to any one of claims 1 to 7 when executed at a processor.

11. A computer program product, characterised in that, A computer program product comprising computer executable instructions for implementing the method according to any one of claims 1 to 7 when executed at a processor.