Multi-terminal message pushing method based on CoAP observation mechanism and related equipment

By using a multi-terminal message push method based on the CoAP observation mechanism, the CoAP server determines the target device group identifier and performs multicast or unicast, which solves the synchronization and power consumption problems in multi-terminal message push of IoT devices and improves the synchronization at the network layer and the utilization rate of device resources.

CN121486434APending Publication Date: 2026-02-06E-SURFING DIGITAL LIFE TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202511678348.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-14
Publication Date
2026-02-06

AI Technical Summary

Technical Problem

Existing multi-terminal message push solutions for IoT devices suffer from high device power consumption, large network resource consumption, poor multi-terminal message synchronization, and insufficient adaptability under unreliable networks. In particular, under HTTP polling and MQTT protocols, the server faces high concurrent pressure and synchronization is difficult to guarantee.

Method used

A multi-terminal message push method based on the CoAP observation mechanism is adopted. The CoAP server responds to the message push command, determines the message content and the target device group identifier, and encapsulates the message content into a CoAP notification message according to the multicast address of the observer list for multicast or unicast, so as to realize the synchronous push of multiple terminal devices.

Benefits of technology

This enables multiple terminal devices to receive the same network message at the same time, improving message synchronization at the network layer, reducing device power consumption and server pressure, and enhancing adaptability in unreliable networks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121486434A_ABST
    Figure CN121486434A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a multi-terminal message pushing method based on a CoAP observation mechanism and related equipment, and belongs to the technical field of Internet of Things communication. The method is applied to a CoAP server, and comprises the following steps: in response to a message pushing instruction, determining message content and a target equipment grouping identifier; determining a corresponding observer list and a multicast address of the observer list according to the target device grouping identifier, wherein the observer list comprises terminal addresses and terminal identifiers of a plurality of terminal devices; packaging the message content into a CoAP (Coordinated Access Point) notification message; and carrying out multicast on the CoAP notification message according to the multicast address so as to push the message content to a plurality of terminal devices. According to the invention, multi-terminal message synchronism can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of Internet of Things communication, and in particular to a multi-terminal message pushing method based on a CoAP observation mechanism and related equipment. BACKGROUND

[0002] At present, the multi-terminal message pushing scheme for Internet of Things devices is mainly based on HTTP polling or MQTT protocol. HTTP polling requires terminal devices to periodically (e.g., every 30 seconds) initiate HTTP requests to a server for new message queries. A large number of terminal device polling will cause a huge pressure on the server, and complete multi-terminal synchronization cannot be achieved. The MQTT protocol scheme is that terminal devices are connected to an MQTT broker server as subscribers and subscribe to a specific topic. The message platform publishes messages to the topic, and the broker forwards them to all subscribers. Compared with the HTTP polling mode, the server pressure can be reduced, and message synchronization can be achieved to a certain extent. However, the MQTT protocol is based on a publish / subscribe model, and the client needs to be connected to a central broker. The broker needs to establish a TCP long connection with each client to forward the message respectively, which increases the power consumption of the terminal device and has poor synchronization.

[0003] In order to adapt to the resource-limited scene of terminal devices, the observation mechanism of CoAP is proposed for message pushing. The CoAP observation mechanism is based on a request-response model, and the client directly subscribes to the resources of the server without a central broker. It is more suitable for resource-limited Internet of Things devices (such as low-power sensors). However, the current CoAP observation mechanism message pushing process still has the problem of poor synchronization. SUMMARY

[0004] The main purpose of the embodiments of the present application is to propose a multi-terminal message pushing method based on the CoAP observation mechanism and related equipment, aiming to improve the synchronization of multi-terminal messages.

[0005] To achieve the above purpose, one aspect of the embodiments of the present application proposes a multi-terminal message pushing method based on the CoAP observation mechanism, applied to a CoAP server, which comprises the following steps: In response to a message pushing instruction, determine the message content and the target device group identifier; According to the target device group identifier, determine the corresponding observer list and the multicast address of the observer list, wherein the observer list includes terminal addresses and terminal identifiers of multiple terminal devices; Encapsulate the message content into a CoAP notification message; The CoAP notification message is multicast according to the multicast address, so as to push the message content to a plurality of terminal devices.

[0006] In some embodiments, the method further comprises the following steps: determining whether the current network supports multicast mode; in the case that the current network supports multicast, performing the step of multicasting the CoAP notification message according to the multicast address; in the case that the current network does not support multicast, unicasting the CoAP notification message to a plurality of terminal addresses in the observer list in parallel.

[0007] In some embodiments, the message pushing instruction further comprises a transmission type, and the step of encapsulating the message content into a CoAP notification message comprises the following steps: determining a corresponding message identifier according to the transmission type, the message identifier being used to represent an acknowledgement type message or a non-acknowledgement type message; writing the message identifier into a CoAP message header and writing the message content into a CoAP message body to obtain a CoAP notification message.

[0008] In some embodiments, the method further comprises the following steps: in the case that the message of the transmission type represents an acknowledgement type message, monitoring an acknowledgement response from the terminal device; in the case that the acknowledgement response is not monitored within a preset time length of sending the CoAP notification message, retransmitting the CoAP notification message to the terminal device which does not respond by using an exponential backoff algorithm.

[0009] In some embodiments, before the step of multicasting the CoAP notification message according to the multicast address, the method further comprises the following steps: creating a retransmission queue according to the observer list, the retransmission queue comprising all terminal identifiers in the observer list; after the step of multicasting the CoAP notification message according to the multicast address, the method further comprises the following steps: in response to an acknowledgement response of the CoAP notification message from a terminal device, deleting the terminal device which responds from the retransmission queue; the step of retransmitting the CoAP notification message to the terminal device which does not respond by using an exponential backoff algorithm comprises the following steps: scheduling the retransmission queue by using an exponential backoff algorithm to retransmit the CoAP notification message to the terminal device which does not respond.

[0010] In some embodiments, the multi-terminal message pushing method based on the CoAP observation mechanism further comprises the following steps: receiving message processing feedback from the terminal device; sending the message processing feedback to the message pushing platform, so that the message pushing platform generates a message pushing report according to the message processing feedback.

[0011] In some embodiments, the multi-terminal message pushing method based on the CoAP observation mechanism further comprises the following steps: determining whether the terminal device in the observer list is abnormal; in the case that the terminal device is abnormal, deleting the terminal device from the observer list.

[0012] To achieve the above object, another aspect of the embodiment of the present application provides a multi-terminal message pushing system based on a CoAP observation mechanism, applied to a CoAP server, comprising: a receiving unit, configured to determine message content and target device group identification in response to a message pushing instruction; a matching unit, configured to determine a corresponding observer list and a multicast address of the observer list according to the target device group identification, the observer list comprising terminal addresses and terminal identifications of a plurality of terminal devices; an encapsulating unit, configured to encapsulate the message content into a CoAP notification message; a multicasting unit, configured to multicast the CoAP notification message according to the multicast address, so as to push the message content to a plurality of terminal devices.

[0013] To achieve the above object, another aspect of the embodiment of the present application provides an electronic device, comprising a memory and a processor, the memory storing a computer program, and the processor implementing the above method when executing the computer program.

[0014] To achieve the above object, another aspect of the embodiment of the present application provides a computer program product, comprising a computer program, the computer program being executed by a processor to implement the above method.

[0015] The embodiments of the present application at least have the following beneficial effects: the present application provides a multi-terminal message pushing method, system, electronic device and program product based on CoAP observation mechanism, the CoAP server of the scheme responds to the message pushing instruction, determines the message content and the target device grouping identifier, then determines the corresponding observer list and the multicast address of the observer list according to the target device grouping identifier, the observer list includes the terminal address and terminal identifier of the plurality of terminal devices, encapsulates the message content into the CoAP notification message, and multicasts the CoAP notification message according to the multicast address, so that the message content is pushed to the plurality of terminal devices, so that all the subscribed terminals receive the same network message at the same time, and the message synchronization at the network level is realized. BRIEF DESCRIPTION OF DRAWINGS

[0016] Figure 1 is a flowchart of the multi-terminal message pushing method based on the CoAP observation mechanism provided by the embodiments of the present application; Figure 2 is a flowchart of the multi-terminal message pushing method based on the CoAP observation mechanism provided by another embodiment of the present application; Figure 3 is a flowchart of step S103 in Figure 1 Figure 4 is a flowchart of the multi-terminal message pushing method based on the CoAP observation mechanism provided by another embodiment of the present application; Figure 5 is a flowchart of the multi-terminal message pushing method based on the CoAP observation mechanism provided by another embodiment of the present application; Figure 6 is a flowchart of the multi-terminal message pushing method based on the CoAP observation mechanism provided by another embodiment of the present application; Figure 7 is a flowchart of the multi-terminal message pushing method based on the CoAP observation mechanism provided by another embodiment of the present application; Figure 8 is a schematic diagram of the multi-terminal message pushing system based on the CoAP observation mechanism provided by the embodiments of the present application; Figure 9 is a schematic diagram of the hardware structure of the electronic device provided by the embodiments of the present application; Figure 10 is a schematic diagram of the application architecture provided by the embodiments of the present application; Figure 11 is a schematic diagram of the connection establishment and state maintenance process of the CoAP server and the terminal device provided by the embodiments of the present application; Figure 12 is a schematic diagram of the data transmission process of the CoAP server provided by the embodiments of the present application. DETAILED DESCRIPTION​

[0017] In order to make the purposes, technical solutions and advantages of the present application clearer, further detailed description will be made to the present application in combination with the accompanying drawings and examples. It should be understood that the specific examples described herein are only used to explain the present application, and are not used to limit the present application. When the following description refers to the accompanying drawings, the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary examples do not represent all implementations consistent with the examples of the present application, and they are only examples of devices and methods consistent with some aspects of the examples of the present application as detailed in the appended claims.

[0018] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which the present application belongs. The terms used herein are only for the purpose of describing the examples of the present application and are not intended to limit the present application.

[0019] Before the examples of the present application are described in detail, first, some nouns and terms involved in the examples of the present application are described, and the nouns and terms involved in the examples of the present application are applicable to the following explanations.

[0020] UDP (User Datagram Protocol) refers to a connectionless, unreliable transport layer communication protocol, mainly used for application scenarios with high real-time requirements but relatively low data integrity requirements, such as video streaming, voice calls, and online games.

[0021] CoAP (Constrained Application Protocol) is an application layer protocol designed for resource-constrained Internet of Things devices, running on UDP. Its core features include extremely low protocol overhead, support for multicast, provision of request / response, publish / subscribe interaction modes, and built-in retransmission mechanism to ensure reliability. It is particularly suitable for communication between devices sensitive to power consumption and bandwidth in low-power, unstable networks.

[0022] URI (Uniform Resource Identifier) refers to a string used to uniquely identify and locate resources on the Internet, such as web pages, images, files, service interfaces, etc. It provides a universal naming mechanism for resources, enabling these resources to be accurately referenced and accessed in the network.

[0023] The observation mechanism, a core extension function of the CoAP protocol, allows a client (i.e., an observer such as a terminal device) to subscribe to a certain resource (such as a URI representing a message queue) from a server. Once the state of the resource changes (such as the server having a new push message), the server will actively notify all subscribed clients of the new state, thereby achieving active and real-time message pushing from the server to the client, avoiding the waste of resources and bandwidth caused by frequent polling of the client.

[0024] The message pushing platform refers to a software system deployed in a remote cloud. The core functions of the message pushing platform of the embodiments of the present application include management and storage of message content, division of target audience, formulation of pushing strategies, and synchronization of pushing messages to terminal devices through a CoAP server interface.

[0025] The terminal device refers to a hardware device with network connection capability (such as Wi-Fi, NB-IoT, 4G / 5G) and integrated CoAP client function. In the embodiments of the present application, the terminal device can subscribe to the message resources of the platform through the CoAP observation mechanism, receive push messages, and display, play, or perform corresponding actions locally. The terminal device of the embodiments of the present application can be a smart middle screen, a smart sound box, an information bulletin board, a vehicle-mounted terminal, and the like.

[0026] Multi-terminal message synchronization refers to multiple terminal devices receiving the same push message within a time difference as short as possible (such as within 1 second), achieving the technical effect of nearly simultaneous presentation on each device.

[0027] At present, the multi-terminal message pushing scheme for Internet of Things devices is mainly based on HTTP polling or MQTT protocol, and each method is described in detail as follows: HTTP polling requires the terminal device to periodically (such as every 30 seconds) initiate an HTTP request to the server to query whether there is a new message (short polling); or initiate a pending request, and the server responds only when there is a new message (long polling). This scheme is simple in technical implementation, but has serious defects: it is difficult to balance the polling interval, the interval is long, the real-time performance is poor, the interval is short, the power consumption and server pressure are huge, in addition, a large number of devices simultaneously polling can easily cause impact on the server, and the multi-terminal message synchronization cannot be achieved.

[0028] The MQTT protocol is a widely used message push scheme. A terminal device needs to be connected to an MQTT broker as a subscriber and subscribe to a specific topic. The message platform publishes messages to the topic, which are forwarded by the broker to all subscribers. This scheme realizes active push and one-to-many distribution, which is better than the HTTP scheme. However, it is based on TCP connection and needs to maintain a long-lasting connection. For devices that frequently wake up after deep sleep, the overhead and power consumption caused by TCP three-way handshake and heartbeat packets are still significant. Moreover, the one-to-many distribution of MQTT is essentially a proxy that quickly forwards messages to multiple terminals individually. At the network level, it is not truly synchronous, and the synchronization delay and consistency of a large number of terminals are difficult to guarantee.

[0029] In summary, the current common multi-terminal message update scheme has the following problems: (1) High device power consumption and large network resource occupation: HTTP polling generates a large amount of unnecessary request / response traffic. MQTT needs to maintain TCP long connection and heartbeat, which is a heavy burden for battery-powered devices in terms of power consumption.

[0030] (2) Poor synchronization of multi-terminal messages: HTTP scheme cannot be synchronized by nature. In the MQTT scheme, the broker needs to establish independent TCP connections with each terminal and forward messages one by one. When the number of terminals is large, the last device to receive the message will have a significant delay.

[0031] (3) Poor adaptability in unreliable networks: HTTP and MQTT rely heavily on stable TCP connections. In the Internet of Things environment with frequent network interruptions and severe jitter (such as mobile cellular networks), the TCP reconnection and retransmission mechanism is complex and time-consuming, resulting in a decrease in message delivery success rate and an increase in delay.

[0032] (4) Large server concurrency pressure: HTTP polling and MQTT's maintenance of a large number of connections bring huge concurrency processing and memory overhead to the server.

[0033] To adapt to the resource-constrained scenario of terminal devices, a CoAP observation mechanism is proposed for message push. The CoAP observation mechanism is based on the request-response model, and the client establishes a UDP connection with the server (no long connection requirement). The client directly subscribes to resources from the server without the need for a central proxy, which is more suitable for resource-constrained Internet of Things devices (such as low-power sensors). However, the current CoAP observation mechanism message push process is also one-to-many forwarding of messages, and the synchronization of multi-terminal messages is poor.

[0034] In view of this, this application provides a multi-terminal message push method and related device based on the CoAP observation mechanism. This scheme is based on the CoAP observation mechanism. After receiving a message push instruction, the CoAP server identifies the message content and the target device group identifier. Then, it determines the corresponding observer list and the multicast address of the observer list based on the target device group identifier. The observer list includes the terminal addresses and terminal identifiers of multiple terminal devices. The message content is encapsulated into a CoAP notification message, and then the CoAP notification message is multicast according to the multicast address, thereby pushing the message content to multiple terminal devices. This ensures that all subscribed terminals receive the same network message at the same time, achieving network-level message synchronization.

[0035] The multi-terminal message push method based on the CoAP observation mechanism provided in this application relates to the field of Internet of Things (IoT) communication technology. This method can be applied to a CoAP server, which can be mounted on a terminal or the server itself. In some embodiments, the terminal can be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, or in-vehicle terminal, but is not limited to these. The server can be configured as an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The server can also be a node server in a blockchain network.

[0036] This application can be used in a wide variety of general-purpose or special-purpose computer system environments or configurations. Examples include: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics devices, network PCs, minicomputers, mainframe computers, and distributed computing environments including any of the above systems or devices. This application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc., that perform specific tasks or implement specific abstract data types. This application can also be practiced in distributed computing environments where tasks are performed by remote processing devices connected via a communication network. In distributed computing environments, program modules can reside in local and remote computer storage media, including storage devices.

[0037] In some embodiments, the method of this application can be applied to a three-element architecture of "terminal device-CoAP server-message push platform" to realize the entire process of "subscription → push → synchronization → confirmation". Please refer to... Figure 10 The application architecture is as follows: The terminal device includes a CoAP client module, a sleep / wake-up control module, and a message processing and feedback module. The CoAP client module is responsible for initiating observation / subscription requests, receiving CoAP notification messages, and executing the corresponding ACK response logic based on the message type (CON / NON). The sleep / wake-up control module supports two low-power modes: one is "window wake-up," where the terminal can be configured with a fixed wake-up period (e.g., waking up for 10 seconds every 5 minutes), only listening for notifications from the CoAP server during the window period; the other is "passive wake-up," where the terminal's radio frequency section maintains a low-power listening state, triggering the device to wake up and process the message when a CoAP packet is detected at the target multicast address or its own unicast address. The message processing and feedback module, after receiving the message, performs local display (e.g., displaying text on a smart screen, pop-up windows on a vehicle terminal) or action execution (e.g., playing voice on a smart speaker), and sends the processing status (e.g., "displayed" or "user clicked") back to the CoAP server via a POST request as needed.

[0038] The CoAP server is the core relay hub, comprising an observer management submodule, a multicast / unicast scheduling submodule, a reliable transmission control submodule, and a state probing submodule. The observer management submodule maintains an observer list for each resource URI (e.g., / msg / group1, / msg / car2), recording the terminal's IP address, port number, token (used to identify a unique observation relationship), and supported message types (CON / NON). After receiving instructions from the message push platform, the multicast / unicast scheduling submodule first checks whether the current network supports CoAP multicast using a pre-stored network configuration table or real-time probing. If supported, it generates a multicast notification message (with a pre-assigned multicast address, such as 224.xxxxx) and sends it; if multicast is not supported, it initiates multi-threaded parallel processing, simultaneously sending unicast notifications to all terminals in the observer list to avoid synchronization delays caused by serial forwarding. The reliable transmission control submodule maintains a retransmission queue for CON type messages based on message priority, recording the sending time and the number of retransmissions. If no ACK response is received within a preset timeout period (configurable, default 2 seconds), retransmission is triggered using an exponential backoff algorithm (e.g., 2 seconds for the first retransmission, 4 seconds for the second, up to a maximum of 5 retransmissions) until an ACK is received or the maximum number of retransmissions is reached. The status probe submodule sends empty CON probe messages to terminals in the observer list every 30 seconds. If no ACK is received for three consecutive times, the terminal is determined to be offline, removed from the observer list, and resources are released.

[0039] The message push platform, acting as the control center, includes a message management submodule, a device grouping submodule, a push strategy submodule, and a status summary submodule. The message management submodule supports message input (text, images, voice links), priority marking (high / medium / low, corresponding to important instructions / regular notifications / redundant information), and validity period settings (e.g., valid for 24 hours). The device grouping submodule creates groups based on terminal attributes (device type, geographical location, user group), with each group mapped to a unique CoAP resource URI (e.g., / msg / xx-speaker corresponds to all smart speakers in a certain region). The push strategy submodule automatically matches transmission parameters based on message priority and device grouping: high-priority messages default to CON type, immediate push, and a maximum of 5 retransmissions; medium-priority messages can choose CON / NON (user-configurable) and are pushed on a scheduled basis (e.g., daily at 8:00 AM); low-priority messages default to NON type and immediate push. The status summary submodule receives terminal feedback information forwarded by the CoAP server and generates real-time push reports, including indicators such as "number of terminals delivered / total number of target terminals", "average delivery delay", and "retransmission rate", which support visualization and data export.

[0040] Figure 1 This is an optional flowchart of a multi-terminal message push method based on the CoAP observation mechanism provided in the embodiments of this application. Figure 1 The method may include, but is not limited to, steps S101 to S104.

[0041] S101, in response to the message push command, determines the message content and the target device group identifier; S102, determine the corresponding observer list and the multicast address of the observer list according to the target device group identifier. The observer list includes the terminal address and terminal identifier of multiple terminal devices. S103, encapsulate the message content into a CoAP notification message; S104, multicast the CoAP notification message according to the multicast address to push the message content to multiple terminal devices.

[0042] In steps S101 to S104 of the embodiments of this application, the CoAP server responds to the message push instruction, determines the message content and the target device group identifier, and then determines the corresponding observer list and the multicast address of the observer list according to the target device group identifier. The observer list includes the terminal addresses and terminal identifiers of multiple terminal devices. The message content is encapsulated into a CoAP notification message, and then the CoAP notification message is multicast according to the multicast address, so that the message content is pushed to multiple terminal devices, enabling all subscribed terminals to receive the same network message at the same time, thereby realizing message synchronization at the network layer.

[0043] In step S101 of some embodiments, the message push platform sends a message push instruction, which includes message content, target device group identifier, transmission type, and message validity period. The message content can be text, image, or voice; the target device group identifier represents the device group to which the message is to be pushed, and can be represented by a resource identifier (URI), such as / msg / group1; the transmission type represents the importance of the message. Specifically, the message push platform, based on information such as message priority, timeliness, and target device group, formulates a set of rules regarding how the message is delivered (e.g., immediate push, scheduled push), the type of CoAP message used (e.g., Confirmable, Non-confirmable), and retransmission parameters, thereby interacting with the CoAP server. The CoAP server receives the message push instruction from the message push platform, parses it, and obtains the message content and target device group identifier. The CoAP server and the message push platform can be integrated in one physical space or located in different physical spaces; this embodiment does not impose specific limitations.

[0044] In step S102 of some embodiments, the CoAP server maintains different observer lists, each corresponding to a device group. The observer list includes the terminal addresses and terminal identifiers of multiple terminal devices belonging to a device group. The corresponding observer list can be determined by querying the target device group identifier. The CoAP server also pre-stores a network configuration table, which stores the multicast addresses of the observer lists. Querying the network configuration table based on the determined observer list can determine its corresponding multicast address.

[0045] Please refer to Figure 11 The CoAP server can establish a connection with the terminal device through the following process: S11. After the terminal device starts up, it sends a CoAP GET request to the CoAP server of the message push platform. The target URI of the request is a predefined message resource path (such as / msg / group1). In this request, the Observe:0 option is carried, indicating that it wants to subscribe to (observe) the changes of the resource. After accepting a subscription, the S12 CoAP server returns the current resource status (which may be an empty message) in the response, along with the Observe option and a sequence number, to establish an observation relationship.

[0046] Please continue to refer to Figure 11 The CoAP server can maintain and monitor its status through the following process: S21, the CoAP server maintains an observer list for each observed resource (i.e., device group), recording the terminal addresses that initiate observation requests and their corresponding tokens (i.e., terminal identifiers).

[0047] S22, the CoAP server receives message push instructions from the message push platform. The CoAP server identifies all observers in the resource path of the instruction and interacts with the observers.

[0048] In step S103 of some embodiments, after receiving the message push instruction and parsing the message content therein, the CoAP server encapsulates the message content into a message body according to the CoAP protocol format to obtain a CoAP notification message. The message header of the CoAP notification message can be encapsulated according to the default configuration in the CoAP server, or it can be encapsulated according to the configuration content (such as the transmission type) carried in the message push instruction.

[0049] In step S104 of some embodiments, the CoAP server sends the CoAP notification message obtained above to the multicast address of the matched observer list using the CoAP multicast method. In this method, all subscribing terminals receive the same network packet at the same time, realizing network layer synchronization, solving the problem of poor synchronization in MQTT unicast forwarding mode, and achieving efficient network layer synchronization.

[0050] According to some embodiments of this application, please refer to Figure 2 The multi-terminal message push method based on the CoAP observation mechanism in this application embodiment may also include, but is not limited to, the following steps: S201, determine whether the current network supports multicast mode; S202, If the current network supports multicast, perform the step of multicasting the CoAP notification message according to the multicast address; S203, in the absence of multicast support in the current network, performs parallel unicast of CoAP notification messages based on multiple terminal addresses in the observer list.

[0051] In this embodiment, after step S102 and in step S104, i.e. after determining the observer list corresponding to the message push command, please refer to... Figure 12The CoAP server first checks whether the current network supports CoAP multicast by using a pre-stored network configuration table or real-time probing. For example, it queries the network configuration table based on a defined list of observers. If the query result is empty, it means that the network does not support multicast; otherwise, the members in the list support multicast. If the current network (i.e., the network to which the CoAP notification message is to be sent) supports multicast, step S104 is executed. If the current network does not support multicast, the CoAP notification message is unicast in parallel based on multiple terminal addresses in the observer list to complete the message delivery and minimize the reception time difference between terminals.

[0052] According to some embodiments of this application, please refer to Figure 3 Step S103 may include, but is not limited to, the following steps: S301, determine the corresponding message identifier according to the transmission type. The message identifier is used to represent an acknowledgment message or an unacknowledgment message. S302, write the message identifier to the CoAP message header, write the message content to the CoAP message body, and obtain the CoAP notification message.

[0053] In this embodiment, please continue to refer to Figure 12 The CoAP server also determines the corresponding message identifier based on the transmission type of the message push command. If the transmission type indicates an important message, the message identifier "CON" is used to configure the corresponding fields in the CoAP message header to indicate that the terminal device needs to reply with an ACK response (i.e., an acknowledgment response). If the transmission type indicates a non-important message, the message identifier "NON" is used to configure the corresponding fields in the CoAP message header to indicate that the terminal device does not need to reply with an ACK response. This embodiment encapsulates CoAP notification messages according to the transmission type of the message push command. Subsequently, corresponding transmission mechanisms can be adopted based on the importance of the message, improving the delivery rate of important messages and reducing the network usage of non-important messages, thus reducing power consumption.

[0054] According to some embodiments of this application, please refer to Figure 4 The multi-terminal message push method based on the CoAP observation mechanism in this application embodiment may also include, but is not limited to, the following steps: S401, when the message type of the transmission represents an acknowledgment message, monitor the acknowledgment response from the terminal device; S402, if no acknowledgment response is detected within a preset time period after sending the CoAP notification message, the CoAP notification message is retransmitted to the unresponsive terminal device using an exponential backoff algorithm.

[0055] In this embodiment, please continue to refer to Figure 12When the message type of the CoAP server represents an acknowledgment message (i.e., an important message), it synchronously monitors for acknowledgment responses from terminal devices after sending the CoAP notification message. If no acknowledgment response is detected within a preset time period after sending the CoAP notification message, the CoAP notification message is retransmitted to the unresponsive terminal device, improving the reliability of message delivery. Furthermore, this embodiment employs an exponential backoff algorithm for message retransmission, i.e., a 2-second waiting interval after the first retransmission, a 4-second waiting interval after the second retransmission, and so on, with the retransmission waiting interval increasing with the number of retransmissions, up to a maximum of 5 retransmissions, to prevent offline devices from occupying the network. For non-critical messages (such as routine information broadcasts), the CoAP server uses Non-confirmable (NON) message types. Terminal devices do not need to reply with an ACK upon receiving this message, minimizing the number of communications and reducing power consumption.

[0056] Furthermore, in this embodiment, the terminal device is configured to wake up for listening only during a preset short window period or to be woken up by the radio frequency section only when a CoAP notification message is received, while remaining in sleep mode at other times, which greatly reduces power consumption.

[0057] According to some embodiments of this application, please refer to Figure 5 Before step S104, the multi-terminal message push method based on the CoAP observation mechanism in this application embodiment may also include, but is not limited to, the following steps: S501, create a retransmission queue based on the observer list, the retransmission queue includes all terminal identifiers in the observer list; After step S104, the multi-terminal message push method based on the CoAP observation mechanism in this application embodiment may also include, but is not limited to, the following steps: S501, in response to the acknowledgment response from the terminal device to the CoAP notification message, the responding terminal device is removed from the retransmission queue; Step S402 may specifically include, but is not limited to, the following steps: S402a employs an exponential backoff algorithm to schedule the retransmission queue in order to retransmit CoAP notification messages to unresponsive terminal devices.

[0058] In this embodiment, to ensure smooth retransmission for unresponsive terminal devices, after determining the observer list corresponding to the target device group identifier, a retransmission queue is created in the memory process based on the observer list. The retransmission queue includes all terminal identifiers in the observer list; that is, the process containing each terminal device in the observer list is created in memory. This embodiment creates the retransmission queue before sending the CoAP notification message. Compared to creating the retransmission queue only after confirming no acknowledgment response has been received, this embodiment reduces retransmission waiting time and improves retransmission efficiency.

[0059] After sending a CoAP notification message, the CoAP server monitors the acknowledgment responses from terminal devices. If an acknowledgment response is detected from a terminal device, the server removes the retransmission process of that terminal device from the retransmission queue based on the device's identifier, ensuring that the retransmission queue only contains processes from unresponsive terminal devices. After a preset timeout period following the sending of the CoAP notification message, the CoAP server schedules the retransmission queue to retransmit the CoAP notification message to the unresponsive terminal devices.

[0060] According to some embodiments of this application, please refer to Figure 6 The multi-terminal message push method based on the CoAP observation mechanism in this application embodiment may also include, but is not limited to, the following steps: S601, Receive message processing feedback from the terminal device; S602, the message processing feedback is sent to the message push platform so that the message push platform can generate a message push report based on the message processing feedback.

[0061] In this embodiment, after receiving a CoAP notification message, the terminal device parses the message using the CoAP protocol to obtain the subscribed message content. Then, it processes the message content according to predetermined processing logic (e.g., displaying the subscribed message on a smart screen or receiving user input), and sends an independent POST request to the CoAP server to send message processing feedback information such as message reception status or user interaction data. The CoAP server then sends the terminal device's message processing feedback to the message push platform. The message push platform summarizes the message processing feedback representing the push status and generates a push report, thereby enabling real-time monitoring of the subscribed message's processing status.

[0062] According to some embodiments of this application, please refer to Figure 7 The multi-terminal message push method based on the CoAP observation mechanism in this application embodiment may also include, but is not limited to, the following steps: S701, determine whether the terminal devices in the observer list have abnormal connections; S702: In the event of a connection error with a terminal device, the terminal device is removed from the observer list.

[0063] In this embodiment, the CoAP server can determine whether a terminal device in the observer list is experiencing connection problems by using retransmission results or sending probes. If a terminal device is found to be connected abnormally, it is removed from the observer list to automatically clean up invalid observers, freeing up server resources and improving server resource utilization and push accuracy. In one example, if no acknowledgment response is received from the terminal device after a certain number of retransmissions, the terminal device is considered to be connected abnormally. In another example, the CoAP server can also periodically send CoAP notification messages with empty message bodies and acknowledgment messages to the terminal devices in the observer list as probe messages to determine the connection status of the terminal devices.

[0064] The following example, using "an operator pushing an emergency fault notification to 1,000 smart screens within its jurisdiction," illustrates the implementation process of this method in detail: Taking "a telecom operator pushing an emergency fault notification to 1,000 smart screens within its jurisdiction" as an example, the implementation process of this method is explained in detail: I. Preliminary Preparations: 1. Equipment Deployment: All 1,000 smart screens (terminal devices) are integrated with the CoAP client, configured with the wake-up mode as "passive wake-up", and the preset subscription resource URI is / msg / operator-screen (corresponding to the operator's smart screen group). 2. Server configuration: The CoAP server is deployed on the operator's cloud, and the multicast address 224.xxxxx is assigned to the / msg / operator-screen resource. The CON message timeout (i.e., preset duration) is configured to be 2 seconds, the maximum retransmission is 5 times, and the status detection cycle is 30 seconds. 3. Platform Configuration: The message push platform will group 1,000 smart screens into the "Operator Smart Screen Group", map the resource URI / msg / operator-screen, set "Emergency Fault Notification" as a high-priority message, and match the transmission policy as "CON type, immediate push".

[0065] II. Implementation Process: 1. Subscription Phase: After 1000 smart screens are started, a CoAP GET request is sent to the CoAP server. The request header carries the "Observe: 0" option, and the target URI is / msg / operator-screen. After verifying the validity of the request, the CoAP server carries "Observe: 1" (the sequence number is initially 1) and an empty message body in the response. At the same time, it records the IP, port, and token of each terminal into the observer list of the / msg / operator-screen resource. 2. Push Trigger: Operator staff enter an "Emergency Fault Notification" (content: "The network in XX area will be under maintenance from 14:00 to 16:00, please be prepared") on the message push platform, mark the priority as "high", select "Operator Smart Screen Group", and click "Push Now"; the platform sends a push instruction to the CoAP server, including the message content, target URI / msg / operator-screen, and transmission type "CON"; 3. Synchronous Push: After receiving the instruction, the CoAP server detects that the current network supports multicast (the operator's intranet configuration supports CoAP multicast) through the multicast / unicast scheduling submodule. It then generates a CON type multicast notification message with a target address of 224.0.1.188, a fault notification content in the message body, and the sequence number is updated to 2. The server sends the message to this multicast address. After the radio frequency modules of 1000 smart screens detect the multicast message, they trigger the device to wake up, receive and parse the message. 4. Reliable Confirmation: Each smart screen parses the message as CON type and immediately replies with an ACK response to the CoAP server (carrying the corresponding Token and sequence number 2); after receiving the ACK, the reliable transmission control submodule of the CoAP server removes the terminal record from the retransmission queue; only 3 terminals fail to reply with ACK in time due to temporary weak signal. The server triggers retransmission according to the exponential backoff algorithm. After the first retransmission, 2 terminals reply with ACK, and after the second retransmission, the last terminal replies with ACK. Finally, all 1000 terminals confirm receipt. 5. Status Feedback: After the smart screen completes the message display, it sends a "Message displayed" status back to the CoAP server via a POST request. The CoAP server forwards the feedback information to the message push platform, which generates a push report: "Delivery rate 100%, average delivery delay 0.3 seconds, retransmission rate 0.3%". At the same time, the CoAP server's status detection submodule sends a probe message every 30 seconds to maintain the observation relationship with the terminal.

[0066] III. Verification of Implementation Results: Through comparative testing, this embodiment has the following improvements compared to the MQTT-based solution in a scenario with 1000 terminals: 1. Synchronization: In this embodiment, the terminal receiving time difference is ≤0.5 seconds (multicast characteristic), while the MQTT scheme has a time difference ≥3 seconds (unicast serial forwarding). 2. Power consumption: Due to "passive wake-up" and NON message ACK exemption, the daily power consumption of the terminal in this embodiment is reduced by 40% compared with the MQTT solution; 3. Server load: In this embodiment, the CoAP server has a concurrent connection count of 1 (multicast), while the MQTT server needs to maintain 1000 TCP long connections, reducing memory usage by 85%.

[0067] Please refer to Figure 8 This application also provides a multi-terminal message push system based on the CoAP observation mechanism, applied in a CoAP server, including: The receiving unit is used to determine the message content and the target device group identifier in response to the message push command; The matching unit is used to determine the corresponding observer list and the multicast address of the observer list based on the target device group identifier. The observer list includes the terminal addresses and terminal identifiers of multiple terminal devices. Encapsulation unit, used to encapsulate message content into CoAP notification message; The multicast unit is used to multicast CoAP notification messages according to the multicast address in order to push the message content to multiple terminal devices.

[0068] It is understood that the methods described in the above method embodiments are applicable to this system embodiment. The specific functions implemented in this system embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.

[0069] This application also provides an electronic device, which includes a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the above-described method. This electronic device can be any smart terminal, including tablet computers, in-vehicle computers, etc.

[0070] It is understood that the content of the above method embodiments is applicable to this device embodiment. The specific functions implemented by this device embodiment are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0071] Please see Figure 9 , Figure 9 The hardware structure of an electronic device according to another embodiment is illustrated. The electronic device includes: The processor 901 can be implemented using a general-purpose CPU (Central Processing Unit), microprocessor, application-specific integrated circuit (ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of this application. The memory 902 can be implemented as a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 902 can store the operating system and other applications. When the technical solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 902 and is called and executed by the processor 901. The input / output interface 903 is used to implement information input and output; The communication interface 904 is used to enable communication and interaction between this device and other devices. Communication can be achieved through wired means (such as USB, Ethernet cable, etc.) or wireless means (such as mobile network, WIFI, Bluetooth, etc.). Bus 905 transmits information between various components of the device (e.g., processor 901, memory 902, input / output interface 903, and communication interface 904); The processor 901, memory 902, input / output interface 903, and communication interface 904 are connected to each other within the device via bus 905.

[0072] This application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method.

[0073] It is understood that the content of the above method embodiments is applicable to this storage medium embodiment. The specific functions implemented in this storage medium embodiment are the same as those in the above method embodiments, and the beneficial effects achieved are also the same as those achieved in the above method embodiments.

[0074] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the above-described method.

[0075] It is understood that the content of the above method embodiments is applicable to the embodiments of this program product. The specific functions implemented by the embodiments of this program product are the same as those of the above method embodiments, and the beneficial effects achieved are also the same as those achieved by the above method embodiments.

[0076] Memory, as a non-transitory computer-readable storage medium, can be used to store non-transitory software programs and non-transitory computer-executable programs. Furthermore, memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one disk storage device, flash memory device, or other non-transitory solid-state storage device. In some embodiments, memory may optionally include memory remotely located relative to the processor, and these remote memories can be connected to the processor via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0077] The multi-terminal message push method and related device based on the CoAP observation mechanism provided in this application have at least one of the following beneficial effects: 1. Significantly improves multi-terminal synchronization to meet real-time scenario requirements: Through CoAP multicast technology, this embodiment can enable more than 1,000 terminals to receive messages synchronously within 0.5 seconds. The synchronization latency is reduced by more than 80% compared with the MQTT solution. It can meet the needs of scenarios with extremely high synchronization requirements, such as emergency notifications (e.g., disaster warnings, fault announcements) and scene linkage (e.g., simultaneous playback of advertisements on multiple screens in shopping malls), and solve the core pain points of existing technologies such as "large synchronization latency and poor consistency".

[0078] 2. Significantly reduce device power consumption and network resource usage: The terminal adopts a "passive wake-up" mode, which is activated only when receiving CoAP messages. The average daily power consumption is reduced by 40%-60% compared to MQTT terminals, which is especially suitable for battery-powered IoT devices (such as NB-IoT smart sensors and portable terminals), extending the device's battery life. At the same time, the NON type message ACK-free design reduces network interaction traffic by 50%, and the multicast method reduces the number of times the server sends messages (1 multicast replaces 1000 unicasts), reducing network bandwidth usage and server concurrency pressure.

[0079] 3. Enhanced adaptability in unreliable network environments: CoAP is based on the UDP protocol and does not require the maintenance of long TCP connections. In scenarios with network jitter and frequent interruptions (such as mobile cellular networks and IoT deployments in remote areas), it avoids the time-consuming problems of TCP reconnection and complex retransmission. The exponential backoff retransmission mechanism of CON messages enables message delivery success rate to reach over 99.9%, which is significantly improved compared to the HTTP solution (delivery success rate of about 90%) and the MQTT solution (delivery success rate of about 95%), ensuring that messages can still be reliably delivered in harsh network environments.

[0080] 4. Reduce server deployment costs and maintenance difficulty: The dynamic observer list maintenance mechanism eliminates the need for CoAP servers to occupy a large amount of memory for long-term connection maintenance. With a scale of 100,000 terminals, the server memory usage is reduced by more than 70% compared to MQTT servers, reducing server hardware investment costs. At the same time, the message push platform's visual reporting and automatic status summary functions simplify the monitoring and management of push effects by maintenance personnel, reducing maintenance complexity.

[0081] The embodiments described in this application are for the purpose of more clearly illustrating the technical solutions of the embodiments of this application, and do not constitute a limitation on the technical solutions provided by the embodiments of this application. As those skilled in the art will know, with the evolution of technology and the emergence of new application scenarios, the technical solutions provided by the embodiments of this application are also applicable to similar technical problems.

[0082] Those skilled in the art will understand that the technical solutions shown in the figures do not constitute a limitation on the embodiments of this application, and may include more or fewer steps than shown, or combine certain steps, or different steps.

[0083] The system embodiments described above are merely illustrative. The modules described as separate components may or may not be physically separate; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.

[0084] Those skilled in the art will understand that all or some of the steps in the methods disclosed above, as well as the functional modules / units in the systems and devices, can be implemented as software, firmware, hardware, or suitable combinations thereof.

[0085] The terms “first,” “second,” “third,” “fourth,” etc. (if present) in the specification and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms “comprising” and “having,” and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or modules is not necessarily limited to those steps or modules explicitly listed, but may include other steps or modules not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0086] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.

[0087] In the embodiments provided in this application, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the system embodiments described above are merely illustrative; for instance, the division of modules described above is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be indirect coupling or communication connection through some interfaces, devices, or units, and may be electrical, mechanical, or other forms.

[0088] The modules described above as separate components may or may not be physically separate. The components shown as modules may or may not be physical modules; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0089] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The integrated modules described above can be implemented in hardware or as software functional modules.

[0090] If the integrated module is implemented as a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes multiple instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing programs, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0091] The preferred embodiments of the present application have been described above with reference to the accompanying drawings, but this does not limit the scope of the claims of the present application. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and substance of the embodiments of the present application shall be within the scope of the claims of the present application.

Claims

1. A multi-terminal message push method based on the CoAP observation mechanism, characterized in that, When applied to a CoAP server, the method includes the following steps: In response to a push notification command, determine the message content and the target device group identifier; The corresponding observer list and the multicast address of the observer list are determined based on the target device group identifier. The observer list includes the terminal addresses and terminal identifiers of multiple terminal devices. The message content is encapsulated into a CoAP notification message; The CoAP notification message is multicast according to the multicast address to push the message content to multiple terminal devices.

2. The method according to claim 1, characterized in that, The multi-terminal message push method based on the CoAP observation mechanism also includes the following steps: Determine if the current network supports multicast. If the current network supports multicast, perform the step of multicasting the CoAP notification message according to the multicast address; In the absence of multicast support in the current network, the CoAP notification message is unicast in parallel based on multiple terminal addresses in the observer list.

3. The method according to claim 1, characterized in that, The message push instruction also includes a transmission type, and the encapsulation of the message content into a CoAP notification message includes the following steps: A corresponding message identifier is determined based on the transmission type, and the message identifier is used to represent an acknowledgment message or an unacknowledgment message; Write the message identifier into the CoAP message header and the message content into the CoAP message body to obtain the CoAP notification message.

4. The method according to claim 3, characterized in that, The multi-terminal message push method based on the CoAP observation mechanism also includes the following steps: When the message of the transmission type represents an acknowledgment message, monitor the acknowledgment response from the terminal device; If no confirmation response is detected within a preset time period after sending the CoAP notification message, the CoAP notification message is retransmitted to the unresponsive terminal device using an exponential backoff algorithm.

5. The method according to claim 4, characterized in that, Before the step of multicasting the CoAP notification message according to the multicast address, the method further includes the following steps: A retransmission queue is created based on the observer list, the retransmission queue including all terminal identifiers in the observer list; After the step of multicasting the CoAP notification message according to the multicast address, the method further includes the following steps: In response to an acknowledgment from a terminal device regarding the CoAP notification message, the responding terminal device is removed from the retransmission queue. The step of retransmitting the CoAP notification message to the unresponsive terminal device using the exponential backoff algorithm includes the following steps: An exponential backoff algorithm is used to schedule the retransmission queue in order to retransmit the CoAP notification message to the unresponsive terminal device.

6. The method according to any one of claims 1 to 5, characterized in that, The multi-terminal message push method based on the CoAP observation mechanism also includes the following steps: Receive message processing feedback from the terminal device; The message processing feedback is sent to the message push platform so that the message push platform can generate a message push report based on the message processing feedback.

7. The method according to any one of claims 1 to 5, characterized in that, The multi-terminal message push method based on the CoAP observation mechanism also includes the following steps: Determine whether the terminal devices in the observer list have abnormal connections; If the terminal device experiences a connection error, the terminal device will be removed from the observer list.

8. A multi-terminal message push system based on the CoAP observation mechanism, characterized in that, Applied to CoAP servers, including: The receiving unit is used to determine the message content and the target device group identifier in response to the message push command; The matching unit is used to determine the corresponding observer list and the multicast address of the observer list based on the target device group identifier. The observer list includes the terminal addresses and terminal identifiers of multiple terminal devices. Encapsulation unit, used to encapsulate the message content into a CoAP notification message; The multicast unit is used to multicast the CoAP notification message according to the multicast address, so as to push the message content to multiple terminal devices.

9. An electronic device, characterized in that, The electronic device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the method according to any one of claims 1 to 7.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method of any one of claims 1 to 7.

Citation Information

Patent Citations

  • A CoAP protocol notification optimization method based on multicast technology

    CN109005123A