[go: up one dir, main page]

WO2015042979A1 - Message processing method, and related apparatus and system - Google Patents

Message processing method, and related apparatus and system Download PDF

Info

Publication number
WO2015042979A1
WO2015042979A1 PCT/CN2013/084774 CN2013084774W WO2015042979A1 WO 2015042979 A1 WO2015042979 A1 WO 2015042979A1 CN 2013084774 W CN2013084774 W CN 2013084774W WO 2015042979 A1 WO2015042979 A1 WO 2015042979A1
Authority
WO
WIPO (PCT)
Prior art keywords
message
multicast
observer
server
resource
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2013/084774
Other languages
French (fr)
Chinese (zh)
Inventor
杨晖
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to PCT/CN2013/084774 priority Critical patent/WO2015042979A1/en
Publication of WO2015042979A1 publication Critical patent/WO2015042979A1/en
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/02Details
    • H04L12/16Arrangements for providing special services to substations
    • H04L12/18Arrangements for providing special services to substations for broadcast or conference, e.g. multicast
    • H04L12/1886Arrangements for providing special services to substations for broadcast or conference, e.g. multicast with traffic restrictions for efficiency improvement, e.g. involving subnets or subdomains

Definitions

  • the present invention relates to the field of network technologies, and in particular, to a message processing method and related apparatus and system.
  • the status of various resources is recorded on the observer server (implemented by content in the application layer), and the client needs to send a message including the status of the specific resource to the server to know the current status of the specific resource.
  • the devices that are the observer servers are all wireless low-power devices. These devices are in a dormant state most of the time, so they cannot respond to polling requests in time. Therefore, in the prior art, the control of the Internet of Things items is realized by the observer mode.
  • the observer service mode specifically includes an observer client and an observer server.
  • the push model requires a subscription interface for requesting a response to a change in a specific resource in the observer server.
  • the push model is derived from the observer pattern in the design pattern (observer Pattern), for example, assuming that the specific resource in the observer server is the current temperature value, the subscription mechanism is as follows: Observer client (observer Client) to the observer server (observer The server sends a subscription request for the temperature (the temperature of the specific resource is the temperature obtained by the sensor), and the observer server registers the subscription after receiving the subscription request. After the subscription is successfully registered, the observer server immediately sends the current status. To the observer client, once the content (ie, temperature) to which the observer server is subscribed changes, the currently changed state is immediately sent to the observer client.
  • the observer mode is very widely used, and the observer server device is mostly a wireless sensor device.
  • the observer server device deploying the observer mode when the observer server device deploying the observer mode receives the multicast message, the observer server not only needs to send a status change message to the observer client, but also needs to send a multicast message to the multicast message.
  • the sender sends a multicast confirmation message.
  • the observer server needs to send at least two reply messages, one of which is sent to the observer client, and the other is sent to the multicast sender, which increases the load on the observer server.
  • the embodiments of the present invention provide a message processing method and related apparatus and system thereof, so as to reduce signaling overhead and reduce the load of the observer server.
  • a first aspect provides a message processing method, comprising: a multicast initiating device transmitting a multicast message to a viewer server, wherein the multicast message includes a network address of the multicast originating device and an operation instruction for a resource of the observer server, such that The observer server updates the current state of the resource according to the operation instruction, and sends a state change message to the observer client, the state change message includes the network address of the multicast originating device and the current state after the resource update; the multicast originating device receives the observer client a response message sent by the terminal, the response message including an identifier of the observer server, wherein the response message is sent by the observer client after receiving the state change message sent by the observer server; the multicast initiating device acquires the observer server from the response message Identifies to confirm that the Observer server has obtained the multicast message.
  • the network address of the multicast originating device in the multicast message is set in an option field in a standard COAP message.
  • the multicast message and the state change message further include a latest acknowledgement time, and the latest acknowledgement time is used to indicate that the multicast originating device confirms that the observer server obtains the multicast message. The latest time that can be accepted.
  • the latest acknowledgement time in the multicast message is set in an option field in the standard COAP message.
  • the multicast message and the state change message further include a latest acknowledgement time, where the latest acknowledgement time is used to indicate that the multicast originating device confirms that the observer server obtains the multicast message The latest time that can be accepted.
  • the latest acknowledgement time in the multicast message and the state change message is set in an option field in the standard COAP message.
  • a third aspect provides a message processing method, comprising: an observer client acquiring an identifier of an observer server; and an observer client receiving a state change message sent by the observer server, wherein the state change message includes a network address of the multicast initiator and The current state of the resource of the observer server after updating; the observer client sends a response message to the multicast originating device according to the network address of the multicast originating device, wherein the response message includes an identifier of the observer server such that the multicast originating device receives the response message Obtain the identity of the observer server to confirm that the observer server has obtained the multicast message.
  • the identifier of the observer server is the network address of the observer server.
  • the multicast message and the state change message further include a latest acknowledgement time, and the latest acknowledgement time is used to indicate that the multicast originating device confirms that the observer server obtains the multicast message. The latest time that can be accepted.
  • the latest acknowledgement time in the multicast message and the state change message is set in an option field in the standard COAP message.
  • the observer client sends a response message to the multicast originating device according to the network address of the multicast originating device before the latest acknowledgement time.
  • the method before the observer client receives the state change message sent by the observer server, the method further includes: the observer client establishes an observer mode relationship with the observer server, where the observation Establishing an observer mode relationship between the client and the observer server includes: the observer client sends a standard COAP query message to the observer server, and the standard COAP query message includes the resource identifier corresponding to the resource to be queried, so that the observer server identifies the resource according to the resource. Subscribe to the resource for registration, query the current state of the resource, and send a standard COAP response message to the observer client, where the standard COAP response message includes the current state of the resource.
  • the network address of the multicast originating device in the multicast message is set in an option field in the standard COAP message.
  • the identifier of the observer server is the network address of the observer server.
  • the multicast message and the state change message include a latest acknowledgement time, and the latest acknowledgement time is used to indicate that the multicast originating device confirms that the observer server obtains the multicast message. The latest time that can be accepted.
  • the latest acknowledgement time in the multicast message is set in an option field in the standard COAP message.
  • a fifth aspect provides an observer server, comprising: a second receiving module, configured to receive a multicast message sent by a multicast initiating device, where the multicast message includes a network address of the multicast initiating device and a resource for the observer server.
  • An operation instruction configured to update a current state of the resource according to the operation instruction; and a second sending module, configured to send a state change message to the observer client, where the state change message includes a network address of the multicast initiator and a resource update The current state.
  • the network address of the multicast originating device in the status change message is set in an option field in a standard COAP message.
  • the multicast message and the state change message further include a latest acknowledgement time, where the latest acknowledgement time is used to indicate that the multicast originating device confirms that the observer server obtains the multicast message The latest time that can be accepted.
  • the latest acknowledgement time in the multicast message and the state change message is set in an option field in the standard COAP message.
  • the sixth aspect provides an observer client, including: an identifier obtaining module, configured to acquire an identifier of the observer server; and a third receiving module, configured to receive a state change message sent by the observer server, where the state change message includes multicasting a network address of the initiating device and a current state after the resource is updated; the third sending module is configured to send a response message to the multicast initiating device according to the network address of the multicast initiating device, where the response message includes an identifier of the observer server, so that the multicasting The initiating device obtains the identity of the observer server from the response message to confirm that the observer server obtained the multicast message.
  • the identifier of the observer server is a network address of the observer server.
  • the multicast message and the state change message further include a latest acknowledgement time, where the latest acknowledgement time is used to indicate that the multicast originating device confirms that the observer server obtains the multicast message The latest time that can be accepted.
  • the latest acknowledgement time in the multicast message and the state change message is set in an option field in the standard COAP message.
  • the third sending module sends a response message to the multicast originating device according to the network address of the multicast originating device before the latest acknowledgement time.
  • the identifier of the observer server in the response message is set in an option field in the standard COAP message.
  • the third sending module is further configured to send a standard COAP query message to the observer server before the third receiving module receives the state change message sent by the observer server, the standard COAP query
  • the message includes a resource identifier corresponding to the resource to be queried, so that the observer server subscribes the resource according to the resource identifier, queries the current state of the resource, and sends a standard COAP response message to the observer client, where the standard COAP response message includes the resource.
  • the current state; the third receiving module is further configured to receive a standard COAP response message.
  • a seventh aspect provides a message processing system, including: a multicast initiating device, comprising: a first sending module, configured to send a multicast message to a viewer server, where the multicast message includes a network address of the multicast initiating device and is directed to an observer An operation instruction of the resource of the server; the observer server, comprising: a second receiving module, configured to receive a multicast message sent by the multicast initiating device; a resource processing module, configured to update a current state of the resource according to the operation instruction; and a second sending module For transmitting a status change message to the observer client, where the status change message includes a network address of the multicast originating device and a current status after the resource is updated; the observer client includes: an identifier obtaining module, configured to acquire the observer server The third receiving module is configured to receive a status change message sent by the observer server, and the third sending module is configured to send a response message to the multicast originating device according to the network address of the multicast originating device, where the
  • the network address of the multicast initiating device in the multicast message is set in an option field in the standard COAP message; the network address of the multicast initiating device in the state change message is set in The option field in the standard COAP message; the identity of the observer server in the response message is set in the option field in the standard COAP message.
  • the third sending module is configured to send a standard COAP query message to the observer server, the standard COAP query message.
  • the resource identifier module is configured to: perform a subscription registration on the resource according to the resource identifier, and query the current state of the resource; and a second sending module, configured to send a standard COAP response message to the observer client, where The standard COAP response message includes a current state of the resource, and a third receiving module is configured to receive the standard COAP response message.
  • the multicast message and the state change message further include a latest acknowledgement time, and the latest acknowledgement time is used to indicate that the multicast originating device confirms that the observer server obtains the multicast message. The latest time that can be accepted.
  • the latest acknowledgement time in the multicast message and the status change message is set in an option field in the standard COAP message.
  • the third sending module sends a response message to the multicast originating device according to the network address of the multicast originating device before the latest acknowledgement time.
  • the eighth aspect provides a multicast initiation apparatus, including a network interface, a memory, a processor, and a bus, a network interface, a memory, and a processor and a bus connection, wherein: the network interface is configured to send a multicast message to the observer server, where The multicast message includes a network address of the multicast originating device and an operation instruction for the resource of the observer server to cause the observer server to update the current state of the resource according to the operation instruction and send a status change message to the observer client, the status change message The network address of the multicast originating device and the current state after the resource update; the network interface is further configured to receive a response message sent by the observer client, where the response message includes an identifier of the observer server, where the response message is the observer client
  • the program is sent after receiving the status change message sent by the observer server; the program is configured to store the identifier of the observer server from the response message to confirm that the observer server acquires the multicast message; the processor is configured
  • the network address of the multicast originating device in the multicast message is set in an option field in the standard COAP message.
  • the identifier of the observer server is the network address of the observer server.
  • the multicast message and the state change message further include a latest acknowledgement time, where the latest acknowledgement time is used to indicate that the multicast originating device confirms that the observer server obtains the multicast message The latest time that can be accepted.
  • the latest acknowledgement time in the multicast message is set in an option field in the standard COAP message.
  • a ninth aspect provides a viewer server, including a network interface, a memory, a processor, and a bus, a network interface, a memory, and a processor and a bus connection, wherein: the network interface is configured to receive a multicast message sent by the multicast originating device, The multicast message includes a network address of the multicast originating device and an operation instruction for a resource of the observer server, a memory for storing the program, a program for updating a current state of the resource according to the operation instruction, and a processor for running the program; The network interface is configured to send a status change message to the observer client, where the status change message includes a network address of the multicast originating device and a current status after the resource is updated.
  • the network address of the multicast originating device in the status change message is set in an option field in a standard COAP message.
  • the multicast message and the state change message further include a latest acknowledgement time, and the latest acknowledgement time is used to indicate that the multicast originating device confirms that the observer server obtains the multicast message. The latest time that can be accepted.
  • the latest acknowledgement time in the multicast message and the state change message is set in an option field in the standard COAP message.
  • a tenth aspect provides an observer client, comprising a memory, a network interface, and a bus, wherein the memory and the network interface are respectively connected to the bus, wherein: the memory is used to store a program, the program is used to obtain an identifier of the observer server; the processor, And a network interface, configured to receive a state change message sent by the observer server, where the state change message includes a network address of the multicast originating device and a current state after the resource is updated; the network interface is further configured to start according to the multicast The network address of the device sends a response message to the multicast originating device, wherein the response message includes an identity of the observer server such that the multicast originating device obtains the identity of the observer server from the response message to confirm that the observer server obtained the multicast message.
  • the identifier of the observer server is a network address of the observer server.
  • the multicast message and the state change message further include a latest acknowledgement time, and the latest acknowledgement time is used to indicate that the multicast originating device confirms that the observer server obtains the multicast message. The latest time that can be accepted.
  • the latest acknowledgement time in the multicast message and the state change message is set in an option field in the standard COAP message.
  • the third sending module sends a response message to the multicast originating device according to the network address of the multicast originating device before the latest acknowledgement time.
  • the identifier of the observer server in the response message is set in an option field in the standard COAP message.
  • the network interface is further configured to send a standard COAP query message to the observer server before receiving the state change message sent by the observer server, where the standard COAP query message includes the resource to be queried.
  • the network interface is further configured to send a standard COAP query message to the observer server before receiving the state change message sent by the observer server, where the standard COAP query message includes the resource to be queried.
  • the network interface Further used to receive standard COAP response messages.
  • the eleventh aspect provides a message processing system, comprising the multicast transmitting apparatus according to any one of the first to fourth possible implementation manners of the eighth aspect, the ninth aspect, and the first aspect of the ninth aspect An observer client of any one of the third possible implementations and the observer client of any of the first to sixth possible implementations of the tenth aspect.
  • an embodiment of the present invention provides a message processing method and related apparatus and system.
  • the observer server After receiving a multicast message sent by a multicast sending apparatus, the observer server only needs to send a status change message to the observer client. End, and the observer client sends a response message to the multicast transmitting device for confirmation. Since the observer server does not need to separately send a response message to the multicast transmitting device and sends a status change message to the observer client, the signaling can be reduced. Overhead, reducing the load on the observer server.
  • FIG. 1 is a schematic structural diagram of a first embodiment of a message processing system according to the present invention.
  • FIG. 2 is a flow chart of a first embodiment of a message processing method of the present invention
  • FIG. 3 is a schematic diagram of a data structure of a CoAP protocol stack
  • FIG. 4 is a schematic diagram of a data format of a standard COAP message
  • FIG. 5 is a schematic diagram of a data structure of an option field of a standard COAP message
  • FIG. 6 is a data interaction diagram of a second embodiment of a message processing method according to the present invention.
  • FIG. 7 is a data interaction diagram of a third embodiment of a message processing method according to the present invention.
  • FIG. 9 is a flowchart of a fifth embodiment of a message processing method according to the present invention.
  • FIG. 10 is a flowchart of a sixth embodiment of a message processing method according to the present invention.
  • FIG. 11 is a schematic structural diagram of a first embodiment of a multicast initiating apparatus according to the present invention.
  • FIG. 12 is a schematic structural diagram of a first embodiment of an observer server according to the present invention.
  • Figure 13 is a schematic structural view of a first embodiment of an observer server of the present invention.
  • FIG. 14 is a schematic structural diagram of a second embodiment of a message processing system according to the present invention.
  • FIG. 15 is a schematic structural diagram of a second embodiment of a multicast initiating apparatus according to the present invention.
  • Figure 16 is a schematic structural view of a second embodiment of the observer server of the present invention.
  • Figure 17 is a block diagram showing the structure of a second embodiment of the viewer client of the present invention.
  • FIG. 1 is a schematic structural diagram of a first embodiment of a message processing system according to the present invention.
  • the message processing system of the present invention includes a multicast originating device 10, an observer server 20, and an observer client. 30.
  • the multicast originating device 10 establishes a wireless network connection with the observer server 20, and the observer server establishes a wireless network connection with the observer client 30, of course, in an alternative implementation of the present invention.
  • the multicast originating device 10 and the observer server 20 can also establish a wired network connection
  • the observer server and the observer client 30 can also establish a wired network connection, which is not limited by the present invention.
  • the viewer server 20 device is preferably a wireless sensor device
  • the observer client 30 is preferably a terminal device
  • the multicast originating device 10 is preferably a terminal device or server.
  • FIG. 2 is a flowchart of a first embodiment of a message processing method according to the present invention. As shown in FIG. 3, the message processing method of the present invention includes the following steps:
  • Step 401 The observer client 30 acquires the identity of the observer server 20.
  • the identifier of the observer server 20 is used to identify the observer server 20, which may be, for example, the network address of the observer server 20 or other identification code that can be used for identification.
  • the observer client 30 may specifically acquire and record the identifier of the observer server 20 in advance.
  • the specific manner of obtaining the identifier may include: the user manually inputs the identifier of the observer server 20 to the observer client 30, and the observer client.
  • the terminal 30 pre-stores the identity of the observer server 20 or transmits its identity to the viewer client 30 or the like by the observer server 20.
  • Step 402 The multicast originating device 10 transmits a multicast message to the observer server 20.
  • the multicast message includes the network address of the multicast originating device 10 and an operation instruction for the resources of the observer server 20.
  • the resources described herein are provided by the observer server 20, which includes temperature, lights, brightness, etc., and the observer server 20 is provided with various types of sensors or controlled devices, such as temperature sensors, lights, brightness sensors, etc., as needed. Instructions are used to operate the above sensors or controlled devices, such as turning them on or off.
  • Step 403 The observer server 20 receives the multicast message, updates the current state of the resource according to the operation instruction, and sends a status change message to the observer client 30.
  • the status change message includes a network address of the multicast originating device 10 and a current status after the resource is updated.
  • Step 404 The observer client 30 receives the status change message and sends a response message to the multicast originating device 10 according to the network address of the multicast originating device 10.
  • the response message includes the identity of the observer server 20.
  • Step 405 The multicast initiating device 10 receives the response message, and acquires the identifier of the observer server 20 from the response message to confirm that the observer server 20 acquires the multicast message.
  • the multicast message, the status change message, and the response message may be obtained by modifying the standard COAP message.
  • CoAP Constrained Application Protocol
  • Restricted Application Protocol Restricted Nodes
  • HTTP Hypertext Transfer Protocol
  • HTTP Hypertext Transfer Protocol
  • URI Uniform Resource Identifier, the universal resource identifier
  • GET query
  • PUT modify
  • POST add
  • DELETE delete
  • FIG. 3 is a schematic diagram of a data structure of a COAP protocol stack.
  • the CoAP protocol stack includes a request/response layer, a service layer, and a UDP (User Datagram).
  • the transport layer of the COAP protocol stack uses UDP (User Datagram) Protocol, User Datagram Protocol) protocol. Due to the unreliability of UDP transmission, the COAP protocol adopts a two-layer structure, defines a transaction mechanism with retransmission, and provides functions such as resource discovery and resource description.
  • FIG. 4 is a schematic diagram of a data format of a standard COAP message.
  • the standard COAP message includes a header, a payload field, and an option field, where the header includes V (Version, version) field, T (Type, type) field, OC (Option Count, number of options) field, e message type (Cod) field, and message number (Message ID) field.
  • V Version, version
  • T Type, type
  • OC Option Count, number of options
  • e message type (Cod) field e message type (Cod) field
  • message ID message number
  • the V field indicates the version number of the COAP protocol
  • the OC field indicates the number of optional options following the packet header
  • the T field indicates the message type of the message
  • the message type field indicates the type of the message (including the request message, response).
  • the message number field indicates the message number, used for repeated message detection, matching message type, and so on.
  • the multicast message, the state change message, and the response message may be obtained by modifying an existing standard COAP message.
  • the multicast originating device 10 may set the network address of the multicast originating device 10.
  • An option field in the standard COAP message is set to generate a multicast message;
  • the observer server 20 can set the network address of the multicast originating device 10 in an option field in the standard COAP message to generate a status change message;
  • the observer client 30 The network address of the watcher server 20 can be set in an option field in a standard COAP message to generate a response message.
  • the multicast originating device 10 may define an option variable as Mcast in an option field in a standard COAP message.
  • Subfield of option, and the option variable is Mcast
  • the network address of the multicast originating device 10 is recorded in the subfield of the option, thereby generating a multicast message;
  • the observer server 20 may define the option variable as Mcast in the option field in the standard COAP message.
  • Subfield of option, and the option variable is Mcast
  • the network address of the observer server 20 is recorded in the subfield of the option, thereby generating a state change message;
  • the observer client 30 can define the option variable as Mcast in the option field in the standard COAP message.
  • a subfield of option, and the network address of the observer server 20 is recorded in a subfield whose option variable is Mcast option, thereby generating a state change message.
  • the multicast message and the status change message further include a latest acknowledgement time, and the latest acknowledgement time is used to indicate the latest time that the multicast originating device can accept when confirming that the observer server acquires the multicast message.
  • the observer client 30 sends a response message according to the latest confirmation time in the received status change message, before the latest confirmation time, and stops sending the response message when the current time is later than the latest latest confirmation time, due to the timeout In the case of the case, the response message is stopped, so the network bandwidth can be effectively saved.
  • the observer client 30 may further define a time tolerance subfield in the option field of the response message for recording the latest time to complete the multicast acknowledgement.
  • the multicast transmitting apparatus 10 determines whether the reception time exceeds the latest time, and if so, determines that the observer server 20 does not receive the multicast message, and if not, determines that the observer server 20 receives the multicast message. To achieve the function of timeout judgment.
  • the multicast transmitting apparatus 10 may further define, in the multicast message, an identifier using the multicast confirmation method of the present invention, such as "ION" of step 5 in FIG. It is ensured that the observer server 20 adopts the multicast confirmation method of the present invention after receiving the multicast message, instead of using "NON” or "CON" supported in the prior art.
  • the method may further include the observer client 30 establishing an observer mode relationship with the observer server 20, wherein the observer client 30 establishes an observation with the observer server 20.
  • the pattern relationship can be achieved in the following ways:
  • the observer client 30 sends a standard COAP query message to the observer server 20.
  • the standard COAP query message includes the resource identifier corresponding to the resource to be queried, so that the observer server 20 subscribes to the resource according to the resource identifier, and queries the current state of the resource. And send a standard COAP response message to the observer client 30, where the standard COAP response message includes the current state of the resource.
  • COAP query message and the standard COAP response message are existing standards, and the specific format thereof will be described in detail below.
  • FIG. 6 is a data interaction diagram of a message processing method according to a second embodiment of the present invention.
  • the multicast message is generally sent in a broadcast manner, that is, in a broadcast manner.
  • two observer servers 20 are provided to illustrate that the multicast transmitting device transmits the multicast message to the plurality of observer servers, and only one observer The client sends a response message to the multicast transmitting device to cause the multicast transmitting device to confirm that the plurality of observer servers respectively receive the multicast message.
  • the viewer client 30 first establishes an observer mode relationship with the observer server 20 and the observer server 20', respectively, and the multicast originating device 10 transmits a multicast message, the observer server 20 and the observer server 20' The multicast messages are respectively received, and the status change message is respectively sent to the observer client 30. After receiving the status change message, the observer client 30 sends a response message to the multicast originating device 10 to cause the multicast originating device 10 to confirm the observer.
  • the server 20 acquires a multicast message.
  • the second embodiment of the message processing method of the present invention specifically includes the following steps:
  • Step 1 The observer client 30 sends a standard COAP query message to the observer server 20'.
  • the standard COAP query message is specifically: COAP CON (GET, uri-path: light, Token: 0x3c, Observe: Empty).
  • COAP indicates compliance with the COAP standard
  • CON indicates a verifiable message
  • GET indicates a REST-based query operation method
  • uri-path is an option defined by the standard COAP message, indicating that the target resource light (light) is looked up from the observer server 20'
  • the Token is a token that establishes an observation mode relationship, and then sends a status change message to carry the same Token
  • Observe is also an option defined by the standard COAP message, indicating that it is an observation mode relationship message, and the option value of the option is empty to indicate the application. Establish an observation mode relationship.
  • Step 2 The observer server 20' subscribes to the resource according to the resource identifier, queries the current state of the resource, and sends a standard COAP response message to the observer client 30.
  • the standard COAP response message is specifically: COAP NON (2.05 Content Token: 0x3c Observe: 12 Payload: OFF).
  • this type of message is a standard COAP response message, and NON means a message that does not need to be confirmed;
  • 2.05 Content is a response message carrying the content of the message, and OFF indicates that the content of the resource Light is off.
  • Step 3 The observer client 30 sends a standard COAP query message to the observer server 20.
  • the standard COAP query message is specifically: COAP CON (GET, uri-path: light, Token: 0x4a, Observe: Empty).
  • COAP CON GET, uri-path: light, Token: 0x4a, Observe: Empty.
  • the data format of the standard COAP query message is the same as that described in step 1, and details are not described herein.
  • Step 5 The multicast initiating device 10 sends a multicast message to the observer server 20 and the observer server 20.
  • MI indicates the network address of the multicast transmitting device, which is set in the custom sub-option field whose option variable is Mcast option.
  • Step 6 After receiving the multicast message, the observer server 20 sends a status change message to the observer client 30.
  • the status change message is specifically: COAP. NON(2.05 Content Token: 0x4a Observe: 12 Payload: ON Mcast option: MI).
  • the ON instruction operates on the resource Light such that the state of the resource light changes, the state change message is obtained based on the improvement of the standard COAP message, and the MI represents the network address of the multicast transmitting device. Its setting in the option variable is defined as Mcast In the suboption field of option.
  • Step 8 The observer client 30 sends a response message to the multicast originating device 10 after receiving the status change message sent by the observer server 20, respectively.
  • the response message is specifically: COAP NON (2.04 Changed) Mcast option: MR1, MR2.2.04 Changed is a response message indicating a change in state.
  • MR1 represents the network address of the observer server 20, and MR2 represents the network address of the observer server 20'.
  • MR1 and MR2 are set in the option variable Mcast Option in the custom suboption field.
  • the multicast initiating device 10 acquires a response message including the network address MR1 of the observer server 20 and the network address MR2 of the observer server 20' from the observer client 30 after the multicast transmission of the multicast message. , thereby confirming that the received observer server 20 and the observer server 20' respectively receive the multicast message.
  • the observer server After receiving the multicast message sent by the multicast transmitting device, the observer server only needs to send a status change message to the observer client, and the observer client sends a response message to the multicast transmitting device for confirmation, since the observer server does not need to The response message is respectively sent to the multicast transmitting apparatus, and the status change message is sent to the observer client, so that the signaling overhead can be reduced and the load of the observer server can be reduced.
  • the multicast message and the status change message further include a latest acknowledgement time, and the latest acknowledgement time is used to indicate the latest time that the multicast originating device can accept when confirming that the observer server acquires the multicast message.
  • the observer client 30 sends a response message according to the latest confirmation time in the received status change message, before the latest confirmation time, and stops sending the response message when the current time is later than the latest latest confirmation time, due to the timeout In the case of the case, the response message is stopped, so the network bandwidth can be effectively saved.
  • the multicast transmitting apparatus 10 can further define the identifier of the multicast confirmation method of the present invention in the multicast message, such as "ION" of step 5 in FIG. It is ensured that the observer server 20 adopts the multicast confirmation method of the present invention after receiving the multicast message, instead of using "NON” or "CON" supported in the prior art.
  • FIG. 7 is a data interaction diagram of a third embodiment of the message processing method according to the present invention.
  • two observer servers 20 are provided, and two An observer client 30, thereby indicating that the multicast transmitting device multicast message is sent to the plurality of observer servers, and the plurality of observer clients respectively send the response message to the multicast transmitting device to cause the multicast transmitting device to confirm The case where multiple observer servers receive multicast messages respectively.
  • the viewer client 30 first establishes an observer mode relationship with the observer server 20, the observer client 30' first establishes an observer mode relationship with the observer server 20', and the multicast originating device 10 transmits the multicast mode.
  • the message, the observer server 20 and the observer server 20' respectively receive the multicast message, the observer server 20 sends a status change message to the observer client 30, and the observer server 20' sends a status change message to the observer client 30'
  • the observer client 30 sends a response message to the multicast initiating device 10.
  • the observer client 30' sends a response message to the multicast initiating device 10 to cause the multicast initiating device. 10 Confirm that the observer server 20 and the observer server 20' acquire the multicast message.
  • FIG. 7 the second embodiment of the message processing method of the present invention specifically includes the following steps:
  • Step 1 The observer client 30' sends a standard COAP query message to the observer server 20'.
  • the standard COAP query message is specifically: COAP CON (GET, uri-path: light, Token: 0x3c, Observe: empty).
  • Step 2 The observer server 20' subscribes to the resource according to the resource identifier, queries the current state of the resource, and sends a standard COAP response message to the observer client 30'.
  • the standard COAP response message is specifically: COAP NON (2.05 Content Token: 0x3c Observe: 12 Payload: OFF).
  • Step 3 The observer client 30 sends a standard COAP query message to the observer server 20.
  • the standard COAP query message is specifically: COAP CON (GET, uri-path: light, Token: 0x4a, Observe: empty).
  • Step 4 The observer server 20 subscribes to the resource according to the resource identifier, queries the current state of the resource, and sends a standard COAP response message to the observer client 30.
  • the standard COAP response message is specifically: COAP. NON (2.05 Content Token: 0x4a Observe: 12 Payload: OFF).
  • Step 5 The multicast initiating device 10 sends a multicast message to the observer server 20 and the observer server 20'.
  • Step 6 After receiving the multicast message, the observer server 20 sends a status change message to the observer client 30.
  • the status change message is specifically: COAP. NON(2.05 Content Token: 0x4a Observe: 12 Payload: ON Mcast option: MI).
  • Step 7 After receiving the multicast message, the observer server 20' sends a status change message to the observer client 30'.
  • the status change message is specifically: COAP. NON(2.05 Content Token: 0x3c Observe: 12 Payload: ON Mcast option: MI).
  • Step 8 After receiving the status change message sent by the observer server 20, the observer client 30 sends a response message to the multicast originating device 10.
  • the response message sent by the observer client 30 is specifically: COAP NON (2.04 Changed) Mcast option: MR1.
  • Step 9 The observer client 30' receives the status change message sent by the observer server 20' and sends a response message to the multicast originating device 10.
  • the response message sent by the observer client 30' is specifically: COAP NON (2.04 Changed) Mcast option: MR2.
  • the multicast originating apparatus 10 acquires the network address MR1 of the observer server 20 and the network address MR2 of the observer server 20', thereby confirming that the received observer server 20 and the observer server 20' respectively receive the multicast message.
  • the multicast initiating device 10 acquires a response message including the network address MR1 of the observer server 20 from the observer client 30 after broadcasting the multicast message, and acquires an observation from the observer client 30'.
  • the response message of the network address MR2 of the server 20' confirms that the received observer server 20 and the observer server 20' respectively receive the multicast message.
  • the observer server After receiving the multicast message sent by the multicast transmitting device, the observer server only needs to send a status change message to the observer client, and the observer client sends a response message to the multicast transmitting device for confirmation, since the observer server does not need to The response message is respectively sent to the multicast transmitting apparatus, and the status change message is sent to the observer client, so that the signaling overhead can be reduced and the load of the observer server can be reduced.
  • the multicast message and the status change message further include a latest acknowledgement time, and the latest acknowledgement time is used to indicate the latest time that the multicast originating device can accept when confirming that the observer server acquires the multicast message.
  • the observer client 30 sends a response message according to the latest confirmation time in the received status change message, before the latest confirmation time, and stops sending the response message when the current time is later than the latest latest confirmation time, due to the timeout In the case of the case, the response message is stopped, so the network bandwidth can be effectively saved.
  • the multicast transmitting apparatus 10 can further define the identifier of the multicast confirmation method of the present invention in the multicast message, such as "ION" of step 5 in FIG. It is ensured that the observer server 20 adopts the multicast confirmation method of the present invention after receiving the multicast message, instead of using "NON” or "CON" supported in the prior art.
  • FIG. 8 is a flowchart of a fourth embodiment of a message processing method according to the present invention. It should be noted that, in this embodiment, the multicast initiating device is used as the step execution subject. As shown in FIG. 8, the message processing method of the present invention includes the following steps:
  • Step 501 The multicast originating device sends a multicast message to the observer server.
  • the multicast message includes a network address of the multicast originating device and an operation instruction for the resource of the observer server, so that the observer server updates the current state of the resource according to the operation instruction after receiving the multicast message.
  • Step 502 The multicast originating device receives the response message sent by the observer client.
  • the response message includes the identity of the observer server.
  • Step 503 The multicast initiating device acquires the identifier of the observer server from the response message to confirm that the observer server acquires the multicast message.
  • the response message is sent by the observer client after receiving the state change message sent by the observer server, and the observer server sends a state change message to the observer client after receiving the multicast message, and the state change message includes multicast.
  • the network address of the originating device and the current state after the resource is updated.
  • the network address of the multicast originating device in the multicast message is set in an option field in a standard COAP message.
  • the identifier of the observer server is the network address of the observer server.
  • the multicast message and the status change message further include a latest acknowledgement time, and the latest acknowledgement time is used to indicate the latest time that the multicast originating device can accept when confirming that the observer server acquires the multicast message.
  • the latest acknowledgement time in the multicast message is set in the option field in the standard COAP message.
  • the number of observer servers may be one or plural, and the number of observer clients may be one or plural.
  • the present invention does not limit this, but it is worth noting that when the number of observer servers is In the plural, since each observer server only needs to send a signaling (ie, a status response message) to the observer client, it is not necessary to separately send the signaling to the multicast initiator and the observer client twice, so Save signaling bandwidth and power consumption of the observer client itself.
  • the observer server After receiving the multicast message sent by the multicast transmitting device, the observer server only needs to send a status change message to the observer client, and the observer client sends a response message to the multicast transmitting device for confirmation, since the observer server does not need to The response message is respectively sent to the multicast transmitting apparatus, and the status change message is sent to the observer client, so that the signaling overhead can be reduced and the load of the observer server can be reduced.
  • FIG. 9 is a flowchart of a fifth embodiment of a message processing method according to the present invention. It should be noted that the embodiment is described by using the observer server as the step execution subject. As shown in FIG. 8, the message processing method of the present invention includes the following steps:
  • Step 601 The observer server receives the multicast message sent by the multicast originating device.
  • the multicast message includes a network address of the multicast originating device and an operation instruction for a resource of the observer server.
  • Step 602 The observer server updates the current state of the resource according to the operation instruction.
  • Step 603 The observer server sends a status change message to the observer client, where the status change message includes the network address of the multicast originating device and the current status after the resource is updated.
  • the network address of the multicast originating device in the status change message is set in an option field in a standard COAP message.
  • the multicast message and the status change message further include a latest acknowledgement time, and the latest acknowledgement time is used to indicate the latest time that the multicast originating device can accept when confirming that the observer server acquires the multicast message.
  • the number of observer servers may be one or plural, and the number of observer clients may be one or plural.
  • the present invention does not limit this, but it is worth noting that when the number of observer servers is In the plural, since each observer server only needs to send a signaling (ie, a status response message) to the observer client, it is not necessary to separately send the signaling to the multicast initiator and the observer client twice, so Save signaling bandwidth and power consumption of the observer client itself.
  • the observer server After receiving the multicast message sent by the multicast transmitting device, the observer server only needs to send a status change message to the observer client, and the observer client sends a response message to the multicast transmitting device for confirmation, since the observer server does not need to The response message is respectively sent to the multicast transmitting apparatus, and the status change message is sent to the observer client, so that the signaling overhead can be reduced and the load of the observer server can be reduced.
  • FIG. 10 is a flowchart of a sixth embodiment of a message processing method according to the present invention. It should be noted that, in this embodiment, the observer client is used as the step execution subject. As shown in FIG. 10, the message processing method of the present invention includes the following steps:
  • Step 601 The observer client acquires the identifier of the observer server.
  • Step 602 The observer client receives a state change message sent by the observer server.
  • the status change message includes a network address of the multicast originating device and a current status after the resource is updated;
  • Step 603 The observer client sends a response message to the multicast originating device according to the network address of the multicast originating device, where the response message includes an identifier of the observer server, so that the multicast initiating device acquires the identifier of the observer server from the response message to confirm The observer server gets the multicast message.
  • the latest acknowledgement time in the multicast message and the status change message is set in the option field in the standard COAP message.
  • the method further comprises: the observer client establishing an observer mode relationship with the observer server, specifically, the observer client sends a standard COAP query message to the observer server, the standard COAP query message Include the resource identifier corresponding to the resource to be queried, so that the observer server subscribes the resource according to the resource identifier, queries the current state of the resource, and sends a standard COAP response message to the observer client, where the standard COAP response message includes the resource. Current status.
  • the number of observer servers may be one or plural, and the number of observer clients may be one or plural.
  • the present invention does not limit this, but it is worth noting that when the number of observer servers is In the plural, since each observer server only needs to send a signaling (ie, a status response message) to the observer client, it is not necessary to separately send the signaling to the multicast initiator and the observer client twice, so Save signaling bandwidth and power consumption of the observer client itself.
  • the observer server After receiving the multicast message sent by the multicast transmitting device, the observer server only needs to send a status change message to the observer client, and the observer client sends a response message to the multicast transmitting device for confirmation, since the observer server does not need to The response message is respectively sent to the multicast transmitting apparatus, and the status change message is sent to the observer client, so that the signaling overhead can be reduced and the load of the observer server can be reduced.
  • FIG. 11 is a schematic structural diagram of a first embodiment of a multicast initiating apparatus according to the present invention.
  • the multicast initiating apparatus 10 of the present invention includes:
  • the first sending module 101 is configured to send a multicast message to the observer server, where the multicast message includes a network address of the multicast originating device and an operation instruction for a resource of the observer server, so that the observer server according to the operation instruction Updating a current state of the resource, and sending a state change message to the observer client, where the state change message includes a network address of the multicast originating device and a current state after the resource is updated;
  • the first receiving module 102 is configured to receive a response message sent by the observer client, where the response message includes an identifier of the observer server, where the response message is sent by the observer client after receiving the state change message sent by the observer server;
  • the confirmation module 104 is configured to obtain an identifier of the observer server from the response message to confirm that the observer server acquires the multicast message.
  • the network address of the multicast originating device in the multicast message is set in an option field in a standard COAP message.
  • the identifier of the observer server is the network address of the observer server.
  • the multicast message and the status change message include a latest acknowledgement time, and the latest acknowledgement time is used to indicate the latest time that the multicast originating device can accept when confirming that the observer server has obtained the multicast message.
  • the observer server After receiving the multicast message sent by the multicast transmitting device, the observer server only needs to send a status change message to the observer client, and the observer client sends a response message to the multicast transmitting device for confirmation, since the observer server does not need to The response message is respectively sent to the multicast transmitting apparatus, and the status change message is sent to the observer client, so that the signaling overhead can be reduced and the load of the observer server can be reduced.
  • the second receiving module 204 is configured to receive a multicast message sent by the multicast originating device, where the multicast message includes a network address of the multicast originating device and an operation instruction for a resource of the observer server;
  • the second sending module 203 is configured to send a status change message to the observer client, where the status change message includes a network address of the multicast originating device and a current status after the resource is updated.
  • the network address of the multicast originating device in the status change message is set in an option field in a standard COAP message.
  • FIG. 13 is a schematic structural diagram of a first embodiment of an observer server according to the present invention.
  • the viewer client 30 of the present invention includes:
  • the third receiving module 304 is configured to receive a state change message sent by the observer server, where the state change message includes a network address of the multicast originating device and a current state after the resource is updated;
  • the identifier of the observer server is the network address of the observer server.
  • the multicast message and the status change message further include a latest acknowledgement time, and the latest acknowledgement time is used to indicate the latest time that the multicast originating device can accept when confirming that the observer server acquires the multicast message.
  • the latest acknowledgement time in the multicast message and the status change message is set in the option field in the standard COAP message.
  • the third sending module sends a response message to the multicast originating device according to the network address of the multicast originating device before the latest acknowledgement time.
  • the third sending module 303 is further configured to send a standard COAP query message to the observer server before the third receiving module 304 receives the state change message sent by the observer server, where the standard COAP query message includes the resource to be queried.
  • the resource identifier is such that the observer server subscribes to the resource according to the resource identifier, queries the current state of the resource, and sends a standard COAP response message to the observer client 30, wherein the standard COAP response message includes the current state of the resource;
  • Module 304 is further for receiving a standard COAP response message.
  • the observer server After receiving the multicast message sent by the multicast transmitting device, the observer server only needs to send a status change message to the observer client, and the observer client sends a response message to the multicast transmitting device for confirmation, since the observer server does not need to The response message is respectively sent to the multicast transmitting apparatus, and the status change message is sent to the observer client, so that the signaling overhead can be reduced and the load of the observer server can be reduced.
  • FIG. 14 is a schematic structural diagram of a second embodiment of a message processing system according to the present invention.
  • the message processing system of the present invention includes a multicast originating device 10, a viewer server 20, and an observer client. ,among them:
  • the first sending module 101 is configured to send a multicast message to the observer server 20, where the multicast message includes a network address of the multicast originating device 10 and an operation instruction for the resource of the observer server 20;
  • the observer server 20 includes:
  • the second receiving module 204 is configured to receive the multicast message sent by the multicast originating device 10;
  • the resource processing module 202 is configured to operate on the resource according to the operation instruction to update the current state of the resource;
  • the second sending module 203 is configured to send a status change message to the observer client, where the status change message includes a network address of the multicast originating device 10 and a current status after the resource is updated;
  • the observer client 30 includes:
  • An identifier obtaining module 301 configured to acquire an identifier of the observer server 20;
  • the third receiving module 304 is configured to receive a state change message sent by the observer server 20;
  • the third sending module 303 is configured to send a response message to the multicast initiating device 10 according to the network address of the multicast initiating device 10, where the response message includes an identifier of the observer server 20;
  • the multicast transmitting apparatus further includes a first receiving module 102 and a confirming module 104.
  • the first receiving module 102 is configured to receive a response message
  • the confirming module 104 is configured to acquire the identifier of the observer server 20 from the response message to confirm that the observer server 20 obtains Multicast message.
  • the network address of the multicast originating device in the multicast message is set in an option field in the standard COAP message; the network address of the multicast originating device in the status change message is set in an option field in the standard COAP message; the response message The identity of the observer server in the setting is set in the option field in the standard COAP message.
  • the third sending module 303 is configured to send a standard COAP query message to the observer server 20, where the standard COAP query message includes the resource corresponding to the query.
  • the resource identifier module 202 is configured to perform subscription registration on the resource according to the resource identifier, and query the current state of the resource.
  • the second sending module 203 is configured to send a standard COAP response message to the observer client, where the standard COAP response message is sent. Includes the current state of the resource.
  • the multicast message and the status change message further include a latest acknowledgement time, and the latest acknowledgement time is used to indicate the latest time that the multicast originating device can accept when confirming that the observer server acquires the multicast message.
  • the latest acknowledgement time in the multicast message and the status change message is set in the option field in the standard COAP message.
  • the third sending module sends a response message to the multicast originating device according to the network address of the multicast originating device before the latest acknowledgement time.
  • the third sending module stops sending the response message to the multicast initiating device after the latest acknowledgement time, and stops sending the response message when the timeout occurs, thereby effectively saving network bandwidth and reducing unnecessary information transmission, thereby improving system transmission efficiency.
  • the number of observer servers and observer clients may be plural, and the number of observer clients
  • the present invention is not limited thereto, but it is worth noting that when the number of observer servers is plural, since each observer server only needs to send signaling to the observer client (ie, status response) The message) does not need to separately send signaling to the multicast originating device and the observer client, so that the signaling transmission bandwidth and the power consumption of the observer server itself can be greatly saved.
  • the observer server After receiving the multicast message sent by the multicast transmitting device, the observer server only needs to send a status change message to the observer client, and the observer client sends a response message to the multicast transmitting device for confirmation, since the observer server does not need to The response message is respectively sent to the multicast transmitting apparatus, and the status change message is sent to the observer client, so that the signaling overhead can be reduced and the load of the observer server can be reduced.
  • FIG. 15 is a schematic structural diagram of a second embodiment of a multicast initiating apparatus according to the present invention.
  • the multicast initiating apparatus 10 of the present invention includes a network interface 111, a memory 113, a processor 112, and a bus. 114.
  • the network interface 111, the memory 113, and the processor 112 are connected to the bus 114, wherein:
  • the network interface 111 is configured to send a multicast message to the observer server, where the multicast message includes a network address of the multicast originating device and an operation instruction for the resource of the observer server, so that the observer server updates the resource according to the operation instruction. a current state, and sending a state change message to the observer client, the state change message including a network address of the multicast originating device and a current state after the resource is updated;
  • the network interface 11 is further configured to receive a response message sent by the observer client, where the response message includes an identifier of the observer server, where the response message is sent by the observer client after receiving the state change message sent by the observer server;
  • the memory 113 is configured to store a program, and the program is configured to acquire an identifier of the observer server from the response message to confirm that the observer server acquires the multicast message;
  • the processor 112 is used to run a program.
  • the identifier of the observer server is the network address of the observer server.
  • the multicast message and the status change message further include a latest acknowledgement time, and the latest acknowledgement time is used to indicate the latest time that the multicast originating device can accept when confirming that the observer server acquires the multicast message.
  • the latest acknowledgement time in the multicast message is set in the option field in the standard COAP message.
  • the number of observer servers may be one or plural, and the number of observer clients may be one or plural.
  • the present invention does not limit this, but it is worth noting that when the number of observer servers is When the number is large, since each observer server only needs to send signaling (ie, status response message) to the observer client, it is not necessary to separately send signaling to the multicast initiator and the observer client, so The earth saves signaling transmission bandwidth and the power consumption of the observer server itself.
  • the network interface 211 is configured to receive the multicast message sent by the multicast originating device 10, where the multicast message includes a network address of the multicast originating device 10 and an operation instruction for the resource of the observer server 20;
  • the memory 213 stores a program for updating a current state of the resource according to the operation instruction
  • a processor 212 configured to run a program
  • the network address of the multicast originating device in the status change message is set in an option field in a standard COAP message.
  • the multicast message and the status change message further include a latest acknowledgement time, and the latest acknowledgement time is used to indicate the latest time that the multicast originating device can accept when confirming that the observer server acquires the multicast message.
  • the latest acknowledgement time in the multicast message and the status change message is set in the option field in the standard COAP message.
  • each observer server 20 since each observer server 20 only needs to send signaling (ie, status response message) to the observer client, it is not necessary to separately send signaling to the multicast originating device and the observer client, respectively.
  • the signaling transmission bandwidth and the power consumption of the observer server itself can be greatly saved.
  • the observer server After receiving the multicast message sent by the multicast transmitting device, the observer server only needs to send a status change message to the observer client, and the observer client sends a response message to the multicast transmitting device for confirmation, since the observer server does not need to The response message is respectively sent to the multicast transmitting apparatus, and the status change message is sent to the observer client, so that the signaling overhead can be reduced and the load of the observer server can be reduced.
  • a memory 313, configured to store a program, where the program is used to obtain an identifier of the observer server;
  • the processor 312 runs the program
  • the network interface 311 is configured to receive a state change message sent by the observer server, where the state change message includes a network address of the multicast originating device and a current state after the resource is updated;
  • the network interface 311 is further configured to send a response message to the multicast originating device according to the network address of the multicast originating device, where the response message includes an identifier of the observer server, so that the multicast initiating device acquires the identifier of the observer server from the response message to confirm The observer server gets the multicast message.
  • the identifier of the observer server is the network address of the observer server.
  • the multicast message and the status change message further include a latest acknowledgement time, and the latest acknowledgement time is used to indicate the latest time that the multicast originating device can accept when confirming that the observer server acquires the multicast message.
  • the latest acknowledgement time in the multicast message and the status change message is set in the option field in the standard COAP message.
  • the third sending module sends a response message to the multicast originating device according to the network address of the multicast originating device before the latest acknowledgement time.
  • the identifier of the observer server in the response message is set in an option field in the standard COAP message.
  • the network interface 311 is further configured to send a standard COAP query message to the observer server before receiving the state change message sent by the observer server, where the standard COAP query message includes the resource identifier corresponding to the resource to be queried, so that the observer The server subscribes to the resource according to the resource identifier, queries the current state of the resource, and sends a standard COAP response message to the observer client, where the standard COAP response message includes the current state of the resource; the network interface 311 is further configured to receive the standard COAP response message. .
  • Observer client 30 establishes an observer mode relationship with the observer server after receiving the standard COAP response message.
  • the number of the observer servers may be one or plural, and the number of the observer clients may be one or plural.
  • the present invention does not limit this, but it is worth noting that when the number of observer servers is compared In large cases, since each observer server only needs to send a signaling (ie, a status response message) to the observer client, it is not necessary to separately send signaling to the multicast originating device and the observer client, thereby greatly saving Signaling transmission bandwidth and power consumption of the observer server itself.
  • the observer server After receiving the multicast message sent by the multicast transmitting device, the observer server only needs to send a status change message to the observer client, and the observer client sends a response message to the multicast transmitting device for confirmation, since the observer server does not need to The response message is respectively sent to the multicast transmitting apparatus, and the status change message is sent to the observer client, so that the signaling overhead can be reduced and the load of the observer server can be reduced.
  • the disclosed apparatus and method may be implemented in other manners.
  • the foregoing embodiment of the device embodiment is merely illustrative.
  • the division of the module or unit is only a logical function division, and the actual implementation may have another division manner, such as multiple units or Components can be combined or integrated into another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the embodiments of the present embodiment.
  • the integrated unit if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium.
  • the instructions include a plurality of instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor to perform all or part of the steps of the methods described in the various embodiments of the present application.
  • the foregoing storage medium includes: a U disk, a mobile hard disk, a read only memory (ROM, Read-Only) Memory, random access memory (RAM), disk or optical disk, and other media that can store program code.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

Disclosed are a message processing method, and a related apparatus and system. The message processing method comprises: a multicast initiation apparatus sending a multicast message to an observer server; the multicast initiation apparatus receiving a response message sent by an observer client; and the multicast initiation apparatus obtaining an identification of the observer server from the response message to determine that the observer server obtains the multicast message. By means of the disclosed convent, the present invention reduces the signaling overhead, and decreases the load of an observer server.

Description

消息处理方法及其相关装置和系统  Message processing method and related device and system

【技术领域】[Technical Field]

本发明涉及网络技术领域,特别是涉及一种消息处理方法及其相关装置和系统。 The present invention relates to the field of network technologies, and in particular, to a message processing method and related apparatus and system.

【背景技术】【Background technique】

物联网是在互联网的基础上延伸和扩展的一种网络,其用户端延伸和扩展到了任何物品之间,彼此进行消息交换和通信,目的是实现所有物品与网络的连接,从而方便识别、管理和控制。The Internet of Things (IoT) is a network that extends and expands on the basis of the Internet. Its client extends and extends to any item, and exchanges and communicates with each other. The purpose is to realize the connection between all items and the network, so as to facilitate identification and management. And control.

在物联网中,观察者服务器上记录有各种资源的状态(在应用层中通过内容来实现),客户端需向服务器请求发送包括特定资源的状态的消息,才能获知特定资源的当前状态。作为观察者服务器的设备都是无线低功耗的,这些设备大部分时间是休眠状态,因此不能及时响应轮询请求,故在现有技术中,通过观察者模式实现对物联网物品的控制。In the Internet of Things, the status of various resources is recorded on the observer server (implemented by content in the application layer), and the client needs to send a message including the status of the specific resource to the server to know the current status of the specific resource. The devices that are the observer servers are all wireless low-power devices. These devices are in a dormant state most of the time, so they cannot respond to polling requests in time. Therefore, in the prior art, the control of the Internet of Things items is realized by the observer mode.

具体而言,观察者服务模式中具体包括观察者客户端和观察者服务器,在观察者模式中,推送模型需要一个订阅接口,用来请求响应关于观察者服务器中特定资源的改变。推送模型来源于设计模式中的观察者模式(observer pattern),举例而言,假设观察者服务器中的特定资源为当前的温度值,订阅机制如下:观察者客户端(observer client)向观察者服务器(observer server)发送对温度(temperature,即特定资源为传感器获得的温度)的订阅请求,观察者服务器收到该订阅请求后对该订阅进行注册,订阅注册成功后,观察者服务器立刻将现在的状态发送给观察者客户端,后续一旦观察者服务器被订阅的内容(即温度)发生改变,则立刻将当前已改变的状态发送给观察者客户端。观察者模式应用非常广泛,并且观察者服务器设备多数为无线传感器设备。Specifically, the observer service mode specifically includes an observer client and an observer server. In the observer mode, the push model requires a subscription interface for requesting a response to a change in a specific resource in the observer server. The push model is derived from the observer pattern in the design pattern (observer Pattern), for example, assuming that the specific resource in the observer server is the current temperature value, the subscription mechanism is as follows: Observer client (observer Client) to the observer server (observer The server sends a subscription request for the temperature (the temperature of the specific resource is the temperature obtained by the sensor), and the observer server registers the subscription after receiving the subscription request. After the subscription is successfully registered, the observer server immediately sends the current status. To the observer client, once the content (ie, temperature) to which the observer server is subscribed changes, the currently changed state is immediately sent to the observer client. The observer mode is very widely used, and the observer server device is mostly a wireless sensor device.

在现有技术中,当部署观察者模式的观察者服务器设备接收到多播消息时,观察者服务器不仅需要向观察者客户端发送状态改变的消息,还需要向发送多播消息的多播发送者发送多播确认消息。这样观察者服务器需要发送至少两次回复消息,其中一个是发送给观察者客户端的,另一个是发送给多播发送者的,会加大观察者服务器的负荷。In the prior art, when the observer server device deploying the observer mode receives the multicast message, the observer server not only needs to send a status change message to the observer client, but also needs to send a multicast message to the multicast message. The sender sends a multicast confirmation message. In this way, the observer server needs to send at least two reply messages, one of which is sent to the observer client, and the other is sent to the multicast sender, which increases the load on the observer server.

【发明内容】 [Summary of the Invention]

有鉴于此,本发明实施例提供了一种消息处理方法及其相关装置和系统,以减小信令开销,降低观察者服务器的负荷。In view of this, the embodiments of the present invention provide a message processing method and related apparatus and system thereof, so as to reduce signaling overhead and reduce the load of the observer server.

第一方面提供一种消息处理方法,包括:多播发起装置向观察者服务器发送多播消息,其中多播消息包括多播发起装置的网络地址和针对观察者服务器的资源的操作指令,以使得观察者服务器根据操作指令更新资源的当前状态,并向观察者客户端发送状态改变消息,状态改变消息包括多播发起装置的网络地址和资源更新后的当前状态;多播发起装置接收观察者客户端发送的响应消息,响应消息包括观察者服务器的标识,其中响应消息是观察者客户端在接收到观察者服务器发送的状态改变消息后发送的;多播发起装置从响应消息获取观察者服务器的标识以确认观察者服务器获取到多播消息。A first aspect provides a message processing method, comprising: a multicast initiating device transmitting a multicast message to a viewer server, wherein the multicast message includes a network address of the multicast originating device and an operation instruction for a resource of the observer server, such that The observer server updates the current state of the resource according to the operation instruction, and sends a state change message to the observer client, the state change message includes the network address of the multicast originating device and the current state after the resource update; the multicast originating device receives the observer client a response message sent by the terminal, the response message including an identifier of the observer server, wherein the response message is sent by the observer client after receiving the state change message sent by the observer server; the multicast initiating device acquires the observer server from the response message Identifies to confirm that the Observer server has obtained the multicast message.

在第一方面的第一种可能的实现方式中,多播消息中的多播发起装置的网络地址设置在标准COAP消息中的选项字段。In a first possible implementation of the first aspect, the network address of the multicast originating device in the multicast message is set in an option field in a standard COAP message.

在第一方面的第二种可能的实现方式中,观察者服务器的标识为观察者服务器的网络地址。In a second possible implementation of the first aspect, the identifier of the observer server is the network address of the observer server.

在第一方面的第三种可能的实现方式中,多播消息和状态改变消息还包括最迟确认时间,最迟确认时间用于表示多播发起装置在确认观察者服务器获取到多播消息时可以接受的最迟时间。In a third possible implementation manner of the first aspect, the multicast message and the state change message further include a latest acknowledgement time, and the latest acknowledgement time is used to indicate that the multicast originating device confirms that the observer server obtains the multicast message. The latest time that can be accepted.

结合第一方面的第三种可能的实现方式,在第四种可能的实现方式中,多播消息中的最迟确认时间设置在标准COAP消息中的选项字段。In conjunction with the third possible implementation of the first aspect, in a fourth possible implementation, the latest acknowledgement time in the multicast message is set in an option field in the standard COAP message.

第二方面提供一种消息处理方法,包括:观察者服务器接收多播发起装置发送的多播消息,其中多播消息包括多播发起装置的网络地址和针对观察者服务器的资源的操作指令;观察者服务器根据操作指令更新资源的当前状态;观察者服务器发送状态改变消息至观察者客户端,状态改变消息包括多播发起装置的网络地址和资源更新后的当前状态。A second aspect provides a message processing method, including: an observer server receiving a multicast message sent by a multicast originating device, where the multicast message includes a network address of the multicast originating device and an operation instruction for a resource of the observer server; The server updates the current state of the resource according to the operation instruction; the observer server sends a status change message to the observer client, and the status change message includes the network address of the multicast originating device and the current status after the resource is updated.

在第二方面的第一种可能的实现方式中,状态改变消息中的多播发起装置的网络地址设置在标准COAP消息中的选项字段。In a first possible implementation of the second aspect, the network address of the multicast originating device in the status change message is set in an option field in a standard COAP message.

在第二方面的第二种可能的实现方式中,多播消息和状态改变消息还包括最迟确认时间,最迟确认时间用于表示多播发起装置在确认观察者服务器获取到多播消息时可以接受的最迟时间。In a second possible implementation manner of the second aspect, the multicast message and the state change message further include a latest acknowledgement time, where the latest acknowledgement time is used to indicate that the multicast originating device confirms that the observer server obtains the multicast message The latest time that can be accepted.

结合第二方面的第二种可能的实现方式,在第三种可能的实现方式中,多播消息和状态改变消息中的最迟确认时间设置在标准COAP消息中的选项字段。 In conjunction with the second possible implementation of the second aspect, in a third possible implementation, the latest acknowledgement time in the multicast message and the state change message is set in an option field in the standard COAP message.

第三方面提供一种消息处理方法,包括:观察者客户端获取观察者服务器的标识;观察者客户端接收观察者服务器发送的状态改变消息,其中状态改变消息包括多播发起装置的网络地址和观察者服务器的资源更新后的当前状态;观察者客户端根据多播发起装置的网络地址发送响应消息至多播发起装置,其中响应消息包括观察者服务器的标识,以使得多播发起装置从响应消息获取观察者服务器的标识以确认观察者服务器获取到多播消息。A third aspect provides a message processing method, comprising: an observer client acquiring an identifier of an observer server; and an observer client receiving a state change message sent by the observer server, wherein the state change message includes a network address of the multicast initiator and The current state of the resource of the observer server after updating; the observer client sends a response message to the multicast originating device according to the network address of the multicast originating device, wherein the response message includes an identifier of the observer server such that the multicast originating device receives the response message Obtain the identity of the observer server to confirm that the observer server has obtained the multicast message.

在第三方面的第一种可能的实现方式中,观察者服务器的标识为观察者服务器的网络地址。In a first possible implementation of the third aspect, the identifier of the observer server is the network address of the observer server.

在第三方面的第二种可能的实现方式中,多播消息和状态改变消息还包括最迟确认时间,最迟确认时间用于表示多播发起装置在确认观察者服务器获取到多播消息时可以接受的最迟时间。In a second possible implementation of the third aspect, the multicast message and the state change message further include a latest acknowledgement time, and the latest acknowledgement time is used to indicate that the multicast originating device confirms that the observer server obtains the multicast message. The latest time that can be accepted.

结合第三方面的第二种可能的实现方式,在第三种可能的实现方式中,多播消息和状态改变消息中的最迟确认时间设置在标准COAP消息中的选项字段。In conjunction with the second possible implementation of the third aspect, in a third possible implementation, the latest acknowledgement time in the multicast message and the state change message is set in an option field in the standard COAP message.

结合第三方面的第二种可能的实现方式,在第四种可能的实现方式中,观察者客户端在最迟确认时间之前根据多播发起装置的网络地址发送响应消息至多播发起装置。In conjunction with the second possible implementation of the third aspect, in a fourth possible implementation, the observer client sends a response message to the multicast originating device according to the network address of the multicast originating device before the latest acknowledgement time.

在第三方面的第五种可能的实现方式中,响应消息中的观察者服务器的标识设置在标准COAP消息中的选项字段。In a fifth possible implementation of the third aspect, the identifier of the observer server in the response message is set in an option field in the standard COAP message.

在第三方面的第六种可能的实现方式中,在观察者客户端接收观察者服务器发送的状态改变消息之前,方法进一步包括:观察者客户端与观察者服务器建立观察者模式关系,其中观察者客户端与观察者服务器建立观察者模式关系包括:观察者客户端向观察者服务器发送标准COAP查询消息,标准COAP查询消息包括要查询的资源对应的资源标识,以使得观察者服务器根据资源标识对资源进行订阅注册,查询资源的当前状态,并发送标准COAP响应消息至观察者客户端,其中标准COAP响应消息包括资源的当前状态。In a sixth possible implementation manner of the third aspect, before the observer client receives the state change message sent by the observer server, the method further includes: the observer client establishes an observer mode relationship with the observer server, where the observation Establishing an observer mode relationship between the client and the observer server includes: the observer client sends a standard COAP query message to the observer server, and the standard COAP query message includes the resource identifier corresponding to the resource to be queried, so that the observer server identifies the resource according to the resource. Subscribe to the resource for registration, query the current state of the resource, and send a standard COAP response message to the observer client, where the standard COAP response message includes the current state of the resource.

第四方面提供一种多播发起装置,包括:第一发送模块,用于向观察者服务器发送多播消息,其中多播消息包括多播发起装置的网络地址和针对观察者服务器的资源的操作指令,以使得观察者服务器根据操作指令更新资源的当前状态,并向观察者客户端发送状态改变消息,状态改变消息包括多播发起装置的网络地址和资源更新后的当前状态;第一接收模块,用于接收观察者客户端发送的响应消息,响应消息包括观察者服务器的标识,其中响应消息是观察者客户端在接收到观察者服务器发送的状态改变消息后发送的;确认模块,用于从响应消息获取观察者服务器的标识以确认观察者服务器获取到多播消息。 A fourth aspect provides a multicast originating apparatus, including: a first sending module, configured to send a multicast message to a viewer server, where the multicast message includes a network address of the multicast originating device and an operation of a resource for the observer server An instruction to cause the observer server to update the current state of the resource according to the operation instruction, and send a state change message to the observer client, the state change message including a network address of the multicast originating device and a current state after the resource update; the first receiving module And a response message sent by the observer client, where the response message includes an identifier of the observer server, where the response message is sent by the observer client after receiving the state change message sent by the observer server; the confirmation module is configured to: The identity of the observer server is obtained from the response message to confirm that the observer server obtained the multicast message.

在第四方面的第一种可能的实现方式中,多播消息中的多播发起装置的网络地址设置在标准COAP消息中的选项字段。In a first possible implementation of the fourth aspect, the network address of the multicast originating device in the multicast message is set in an option field in the standard COAP message.

在第四方面的第二种可能的实现方式中,观察者服务器的标识为观察者服务器的网络地址。In a second possible implementation of the fourth aspect, the identifier of the observer server is the network address of the observer server.

在第四方面的第三种可能的实现方式中,多播消息还和状态改变消息包括最迟确认时间,最迟确认时间用于表示多播发起装置在确认观察者服务器获取到多播消息时可以接受的最迟时间。In a third possible implementation manner of the fourth aspect, the multicast message and the state change message include a latest acknowledgement time, and the latest acknowledgement time is used to indicate that the multicast originating device confirms that the observer server obtains the multicast message. The latest time that can be accepted.

结合第四方面的第三种可能的实现方式,在第四种可能的实现方式中,多播消息中的最迟确认时间设置在标准COAP消息中的选项字段。In conjunction with the third possible implementation of the fourth aspect, in a fourth possible implementation, the latest acknowledgement time in the multicast message is set in an option field in the standard COAP message.

第五方面提供一种观察者服务器,包括:第二接收模块,用于接收多播发起装置发送的多播消息,其中多播消息包括多播发起装置的网络地址和针对观察者服务器的资源的操作指令;资源处理模块,用于根据操作指令更新资源的当前状态;第二发送模块,用于发送状态改变消息至观察者客户端,状态改变消息包括多播发起装置的网络地址和资源更新后的当前状态。A fifth aspect provides an observer server, comprising: a second receiving module, configured to receive a multicast message sent by a multicast initiating device, where the multicast message includes a network address of the multicast initiating device and a resource for the observer server. An operation instruction; a resource processing module, configured to update a current state of the resource according to the operation instruction; and a second sending module, configured to send a state change message to the observer client, where the state change message includes a network address of the multicast initiator and a resource update The current state.

在第五方面的第一种可能的实现方式中,状态改变消息中的多播发起装置的网络地址设置在标准COAP消息中的选项字段。In a first possible implementation of the fifth aspect, the network address of the multicast originating device in the status change message is set in an option field in a standard COAP message.

在第五方面的第二种可能的实现方式中,多播消息和状态改变消息还包括最迟确认时间,最迟确认时间用于表示多播发起装置在确认观察者服务器获取到多播消息时可以接受的最迟时间。In a second possible implementation manner of the fifth aspect, the multicast message and the state change message further include a latest acknowledgement time, where the latest acknowledgement time is used to indicate that the multicast originating device confirms that the observer server obtains the multicast message The latest time that can be accepted.

结合第五方面的第二种可能的实现方式,在第三种可能的实现方式中,多播消息和状态改变消息中的最迟确认时间设置在标准COAP消息中的选项字段。 In conjunction with the second possible implementation of the fifth aspect, in a third possible implementation, the latest acknowledgement time in the multicast message and the state change message is set in an option field in the standard COAP message.

第六方面提供一种观察者客户端,包括:标识获取模块,用于获取观察者服务器的标识;第三接收模块,用于接收观察者服务器发送的状态改变消息,其中状态改变消息包括多播发起装置的网络地址和资源更新后的当前状态;第三发送模块,用于根据多播发起装置的网络地址发送响应消息至多播发起装置,其中响应消息包括观察者服务器的标识,以使得多播发起装置从响应消息获取观察者服务器的标识以确认观察者服务器获取到多播消息。 The sixth aspect provides an observer client, including: an identifier obtaining module, configured to acquire an identifier of the observer server; and a third receiving module, configured to receive a state change message sent by the observer server, where the state change message includes multicasting a network address of the initiating device and a current state after the resource is updated; the third sending module is configured to send a response message to the multicast initiating device according to the network address of the multicast initiating device, where the response message includes an identifier of the observer server, so that the multicasting The initiating device obtains the identity of the observer server from the response message to confirm that the observer server obtained the multicast message.

在第六方面的第一种可能的实现方式中,观察者服务器的标识为观察者服务器的网络地址。In a first possible implementation of the sixth aspect, the identifier of the observer server is a network address of the observer server.

在第六方面的第二种可能的实现方式中,多播消息和状态改变消息还包括最迟确认时间,最迟确认时间用于表示多播发起装置在确认观察者服务器获取到多播消息时可以接受的最迟时间。In a second possible implementation manner of the sixth aspect, the multicast message and the state change message further include a latest acknowledgement time, where the latest acknowledgement time is used to indicate that the multicast originating device confirms that the observer server obtains the multicast message The latest time that can be accepted.

结合第六方面的第二种可能的实现方式,在第三种可能的实现方式中,多播消息和状态改变消息中的最迟确认时间设置在标准COAP消息中的选项字段。In conjunction with the second possible implementation of the sixth aspect, in a third possible implementation, the latest acknowledgement time in the multicast message and the state change message is set in an option field in the standard COAP message.

结合第六方面的第二种可能的实现方式,在第四种可能的实现方式中,第三发送模块在最迟确认时间之前根据多播发起装置的网络地址发送响应消息至多播发起装置。In conjunction with the second possible implementation of the sixth aspect, in a fourth possible implementation, the third sending module sends a response message to the multicast originating device according to the network address of the multicast originating device before the latest acknowledgement time.

在第六方面的第五种可能的实现方式中,响应消息中的观察者服务器的标识设置在标准COAP消息中的选项字段。In a fifth possible implementation of the sixth aspect, the identifier of the observer server in the response message is set in an option field in the standard COAP message.

在第六方面的第六种可能的实现方式中,第三发送模块进一步用于在第三接收模块接收观察者服务器发送的状态改变消息之前,向观察者服务器发送标准COAP查询消息,标准COAP查询消息包括要查询的资源对应的资源标识,以使得观察者服务器根据资源标识对资源进行订阅注册,查询资源的当前状态,并发送标准COAP响应消息至观察者客户端,其中标准COAP响应消息包括资源的当前状态;第三接收模块进一步用于接收标准COAP响应消息。In a sixth possible implementation manner of the sixth aspect, the third sending module is further configured to send a standard COAP query message to the observer server before the third receiving module receives the state change message sent by the observer server, the standard COAP query The message includes a resource identifier corresponding to the resource to be queried, so that the observer server subscribes the resource according to the resource identifier, queries the current state of the resource, and sends a standard COAP response message to the observer client, where the standard COAP response message includes the resource. The current state; the third receiving module is further configured to receive a standard COAP response message.

第七方面提供一种消息处理系统,包括:多播发起装置,包括:第一发送模块,用于向观察者服务器发送多播消息,多播消息包括多播发起装置的网络地址和针对观察者服务器的资源的操作指令;观察者服务器,包括:第二接收模块,用于接收多播发起装置发送的多播消息;资源处理模块,用于根据操作指令更新资源的当前状态;第二发送模块,用于发送状态改变消息至观察者客户端,其中状态改变消息包括多播发起装置的网络地址和资源更新后的当前状态;观察者客户端,包括:标识获取模块,用于获取观察者服务器的标识;第三接收模块,用于接收观察者服务器发送的状态改变消息;第三发送模块,用于根据多播发起装置的网络地址发送响应消息至多播发起装置,其中响应消息包括观察者服务器的标识;多播发送装置进一步包括第一接收模块以及确认模块,第一接收模块用于接收响应消息,确认模块用于从响应消息获取观察者服务器的标识以确认观察者服务器获取到多播消息。A seventh aspect provides a message processing system, including: a multicast initiating device, comprising: a first sending module, configured to send a multicast message to a viewer server, where the multicast message includes a network address of the multicast initiating device and is directed to an observer An operation instruction of the resource of the server; the observer server, comprising: a second receiving module, configured to receive a multicast message sent by the multicast initiating device; a resource processing module, configured to update a current state of the resource according to the operation instruction; and a second sending module For transmitting a status change message to the observer client, where the status change message includes a network address of the multicast originating device and a current status after the resource is updated; the observer client includes: an identifier obtaining module, configured to acquire the observer server The third receiving module is configured to receive a status change message sent by the observer server, and the third sending module is configured to send a response message to the multicast originating device according to the network address of the multicast originating device, where the response message includes the observer server Identification; the multicast transmitting device further includes a first receiving module And confirmation module, receiving means for receiving a first response message, the response message confirmation means for acquiring from a server to confirm that the viewer identifies the viewer to the server to obtain the multicast message.

在第七方面的第一种可能的实现方式中,多播消息中的多播发起装置的网络地址设置在标准COAP消息中的选项字段;状态改变消息中的多播发起装置的网络地址设置在标准COAP消息中的选项字段;响应消息中的观察者服务器的标识设置在标准COAP消息中的选项字段。In a first possible implementation manner of the seventh aspect, the network address of the multicast initiating device in the multicast message is set in an option field in the standard COAP message; the network address of the multicast initiating device in the state change message is set in The option field in the standard COAP message; the identity of the observer server in the response message is set in the option field in the standard COAP message.

在第七方面的第二种可能的实现方式中,在第一发送模块向观察者服务器发送多播消息之前,第三发送模块,用于向观察者服务器发送标准COAP查询消息,标准COAP查询消息包括要查询的资源对应的资源标识;资源处理模块,用于根据资源标识对资源进行订阅注册,查询资源的当前状态;第二发送模块,用于发送标准COAP响应消息至观察者客户端,其中标准COAP响应消息包括资源的当前状态;第三接收模块,用于接收标准COAP响应消息。In a second possible implementation manner of the seventh aspect, before the first sending module sends the multicast message to the observer server, the third sending module is configured to send a standard COAP query message to the observer server, the standard COAP query message. The resource identifier module is configured to: perform a subscription registration on the resource according to the resource identifier, and query the current state of the resource; and a second sending module, configured to send a standard COAP response message to the observer client, where The standard COAP response message includes a current state of the resource, and a third receiving module is configured to receive the standard COAP response message.

在第七方面的第三种可能的实现方式中,多播消息和状态改变消息还包括最迟确认时间,最迟确认时间用于表示多播发起装置在确认观察者服务器获取到多播消息时可以接受的最迟时间。In a third possible implementation manner of the seventh aspect, the multicast message and the state change message further include a latest acknowledgement time, and the latest acknowledgement time is used to indicate that the multicast originating device confirms that the observer server obtains the multicast message. The latest time that can be accepted.

在第七方面的第四种可能的实现方式中,多播消息和状态改变消息中的最迟确认时间设置在标准COAP消息中的选项字段。 In a fourth possible implementation of the seventh aspect, the latest acknowledgement time in the multicast message and the status change message is set in an option field in the standard COAP message.

结合第七方面的第四种可能的实现方式,在第五种可能的实现方式中,第三发送模块在最迟确认时间之前根据多播发起装置的网络地址发送响应消息至多播发起装置。With reference to the fourth possible implementation manner of the seventh aspect, in a fifth possible implementation manner, the third sending module sends a response message to the multicast originating device according to the network address of the multicast originating device before the latest acknowledgement time.

第八方面提供一种多播发起装置,包括网络接口、存储器、处理器及总线,网络接口、存储器及处理器与总线连接,其中:网络接口,用于向观察者服务器发送多播消息,其中多播消息包括多播发起装置的网络地址和针对观察者服务器的资源的操作指令,以使得观察者服务器根据操作指令更新资源的当前状态,并向观察者客户端发送状态改变消息,状态改变消息包括多播发起装置的网络地址和资源更新后的当前状态;网络接口,进一步用于接收观察者客户端发送的响应消息,响应消息包括观察者服务器的标识,其中响应消息是观察者客户端在接收到观察者服务器发送的状态改变消息后发送的;存储器,用于存储程序,程序用于从响应消息获取观察者服务器的标识以确认观察者服务器获取到多播消息;处理器,用于运行程序。The eighth aspect provides a multicast initiation apparatus, including a network interface, a memory, a processor, and a bus, a network interface, a memory, and a processor and a bus connection, wherein: the network interface is configured to send a multicast message to the observer server, where The multicast message includes a network address of the multicast originating device and an operation instruction for the resource of the observer server to cause the observer server to update the current state of the resource according to the operation instruction and send a status change message to the observer client, the status change message The network address of the multicast originating device and the current state after the resource update; the network interface is further configured to receive a response message sent by the observer client, where the response message includes an identifier of the observer server, where the response message is the observer client The program is sent after receiving the status change message sent by the observer server; the program is configured to store the identifier of the observer server from the response message to confirm that the observer server acquires the multicast message; the processor is configured to run program.

在第八方面的第一种可能的实现方式中,多播消息中的多播发起装置的网络地址设置在标准COAP消息中的选项字段。In a first possible implementation of the eighth aspect, the network address of the multicast originating device in the multicast message is set in an option field in the standard COAP message.

在第八方面的第二种可能的实现方式中,观察者服务器的标识为观察者服务器的网络地址。In a second possible implementation of the eighth aspect, the identifier of the observer server is the network address of the observer server.

在第八方面的第三种可能的实现方式中,多播消息和状态改变消息还包括最迟确认时间,最迟确认时间用于表示多播发起装置在确认观察者服务器获取到多播消息时可以接受的最迟时间。In a third possible implementation manner of the eighth aspect, the multicast message and the state change message further include a latest acknowledgement time, where the latest acknowledgement time is used to indicate that the multicast originating device confirms that the observer server obtains the multicast message The latest time that can be accepted.

结合第八方面的第三种可能的实现方式,在第四种可能的实现方式中,多播消息中的最迟确认时间设置在标准COAP消息中的选项字段。In conjunction with the third possible implementation of the eighth aspect, in a fourth possible implementation, the latest acknowledgement time in the multicast message is set in an option field in the standard COAP message.

第九方面提供一种观察者服务器,包括网络接口、存储器、处理器以及总线,网络接口、存储器以及处理器与总线连接,其中:网络接口,用于接收多播发起装置发送的多播消息,其中多播消息包括多播发起装置的网络地址和针对观察者服务器的资源的操作指令;存储器,用于存储程序,程序用于根据操作指令更新资源的当前状态;处理器,用于运行程序;网络接口,用于发送状态改变消息至观察者客户端,状态改变消息包括多播发起装置的网络地址和资源更新后的当前状态。A ninth aspect provides a viewer server, including a network interface, a memory, a processor, and a bus, a network interface, a memory, and a processor and a bus connection, wherein: the network interface is configured to receive a multicast message sent by the multicast originating device, The multicast message includes a network address of the multicast originating device and an operation instruction for a resource of the observer server, a memory for storing the program, a program for updating a current state of the resource according to the operation instruction, and a processor for running the program; The network interface is configured to send a status change message to the observer client, where the status change message includes a network address of the multicast originating device and a current status after the resource is updated.

在第九方面的第一种可能的实现方式中,状态改变消息中的多播发起装置的网络地址设置在标准COAP消息中的选项字段。In a first possible implementation of the ninth aspect, the network address of the multicast originating device in the status change message is set in an option field in a standard COAP message.

在第九方面的第二种可能的实现方式中,多播消息和状态改变消息还包括最迟确认时间,最迟确认时间用于表示多播发起装置在确认观察者服务器获取到多播消息时可以接受的最迟时间。In a second possible implementation manner of the ninth aspect, the multicast message and the state change message further include a latest acknowledgement time, and the latest acknowledgement time is used to indicate that the multicast originating device confirms that the observer server obtains the multicast message. The latest time that can be accepted.

结合第九方面的第二种可能的实现方式,在第三种可能的实现方式中,多播消息和状态改变消息中的最迟确认时间设置在标准COAP消息中的选项字段。 In conjunction with the second possible implementation of the ninth aspect, in a third possible implementation, the latest acknowledgement time in the multicast message and the state change message is set in an option field in the standard COAP message.

第十方面提供一种观察者客户端,包括存储器、网络接口以及总线,存储器和网络接口分别与总线连接,其中:存储器,用于存储程序,程序用于获取观察者服务器的标识;处理器,用于运行程序;网络接口,用于接收观察者服务器发送的状态改变消息,其中状态改变消息包括多播发起装置的网络地址和资源更新后的当前状态;网络接口,进一步用于根据多播发起装置的网络地址发送响应消息至多播发起装置,其中响应消息包括观察者服务器的标识,以使得多播发起装置从响应消息获取观察者服务器的标识以确认观察者服务器获取到多播消息。A tenth aspect provides an observer client, comprising a memory, a network interface, and a bus, wherein the memory and the network interface are respectively connected to the bus, wherein: the memory is used to store a program, the program is used to obtain an identifier of the observer server; the processor, And a network interface, configured to receive a state change message sent by the observer server, where the state change message includes a network address of the multicast originating device and a current state after the resource is updated; the network interface is further configured to start according to the multicast The network address of the device sends a response message to the multicast originating device, wherein the response message includes an identity of the observer server such that the multicast originating device obtains the identity of the observer server from the response message to confirm that the observer server obtained the multicast message.

在第十方面的第一种可能的实现方式中,观察者服务器的标识为观察者服务器的网络地址。In a first possible implementation of the tenth aspect, the identifier of the observer server is a network address of the observer server.

在第十方面的第二种可能的实现方式中,多播消息和状态改变消息还包括最迟确认时间,最迟确认时间用于表示多播发起装置在确认观察者服务器获取到多播消息时可以接受的最迟时间。In a second possible implementation of the tenth aspect, the multicast message and the state change message further include a latest acknowledgement time, and the latest acknowledgement time is used to indicate that the multicast originating device confirms that the observer server obtains the multicast message. The latest time that can be accepted.

结合第十方面的第二种可能的实现方式,在第三种可能的实现方式中,多播消息和状态改变消息中的最迟确认时间设置在标准COAP消息中的选项字段。In conjunction with the second possible implementation of the tenth aspect, in a third possible implementation, the latest acknowledgement time in the multicast message and the state change message is set in an option field in the standard COAP message.

结合第十方面的第二种可能的实现方式,在第四种可能的实现方式中,第三发送模块在最迟确认时间之前根据多播发起装置的网络地址发送响应消息至多播发起装置。In conjunction with the second possible implementation of the tenth aspect, in a fourth possible implementation, the third sending module sends a response message to the multicast originating device according to the network address of the multicast originating device before the latest acknowledgement time.

在第十方面的第五种可能的实现方式中,响应消息中的观察者服务器的标识设置在标准COAP消息中的选项字段。In a fifth possible implementation of the tenth aspect, the identifier of the observer server in the response message is set in an option field in the standard COAP message.

在第十方面的第六种可能的实现方式中,网络接口进一步用于在接收观察者服务器发送的状态改变消息之前,向观察者服务器发送标准COAP查询消息,标准COAP查询消息包括要查询的资源对应的资源标识,以使得观察者服务器根据资源标识对资源进行订阅注册,查询资源的当前状态,并发送标准COAP响应消息至观察者客户端,其中标准COAP响应消息包括资源的当前状态;网络接口进一步用于接收标准COAP响应消息。In a sixth possible implementation manner of the tenth aspect, the network interface is further configured to send a standard COAP query message to the observer server before receiving the state change message sent by the observer server, where the standard COAP query message includes the resource to be queried. Corresponding resource identifier, so that the observer server subscribes the resource according to the resource identifier, queries the current state of the resource, and sends a standard COAP response message to the observer client, where the standard COAP response message includes the current state of the resource; the network interface Further used to receive standard COAP response messages.

第十一方面提供一种消息处理系统,包括第八方面、第八方面的第一至第四种可能的实现方式中任一项的多播发送装置、第九方面、第九方面的第一至第三种可能的实现方式中任一项的观察者服务器以及第十方面的第一至第六种可能的实现方式中任一项的观察者客户端。The eleventh aspect provides a message processing system, comprising the multicast transmitting apparatus according to any one of the first to fourth possible implementation manners of the eighth aspect, the ninth aspect, and the first aspect of the ninth aspect An observer client of any one of the third possible implementations and the observer client of any of the first to sixth possible implementations of the tenth aspect.

通过上述技术方案,本发明实施例提供了一种消息处理方法及其相关装置和系统,在接收到多播发送装置发送的多播消息之后,观察者服务器只需发送状态改变消息至观察者客户端,并由观察者客户端发送响应消息至多播发送装置进行确认,由于观察者服务器无需分别向多播发送装置发送响应消息,并向观察者客户端发送状态改变消息,因此可减小信令开销,降低观察者服务器的负荷。Through the foregoing technical solution, an embodiment of the present invention provides a message processing method and related apparatus and system. After receiving a multicast message sent by a multicast sending apparatus, the observer server only needs to send a status change message to the observer client. End, and the observer client sends a response message to the multicast transmitting device for confirmation. Since the observer server does not need to separately send a response message to the multicast transmitting device and sends a status change message to the observer client, the signaling can be reduced. Overhead, reducing the load on the observer server.

【附图说明】 [Description of the Drawings]

为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, a brief description of the drawings used in the embodiments or the prior art description will be briefly described below. Obviously, the drawings in the following description It is a certain embodiment of the present invention, and other drawings can be obtained from those skilled in the art without any inventive labor.

图1是本发明消息处理系统第一实施例的结构示意图;1 is a schematic structural diagram of a first embodiment of a message processing system according to the present invention;

图2是本发明消息处理方法第一实施例的流程图;2 is a flow chart of a first embodiment of a message processing method of the present invention;

图3是CoAP协议栈的数据结构示意图;3 is a schematic diagram of a data structure of a CoAP protocol stack;

图4为标准COAP消息的数据格式示意图;4 is a schematic diagram of a data format of a standard COAP message;

图5是标准COAP消息的选项字段的数据结构示意图;5 is a schematic diagram of a data structure of an option field of a standard COAP message;

图6是本发明消息处理方法第二实施例的数据交互图;6 is a data interaction diagram of a second embodiment of a message processing method according to the present invention;

图7是本发明消息处理方法第三实施例的数据交互图;7 is a data interaction diagram of a third embodiment of a message processing method according to the present invention;

图8是本发明消息处理方法第四实施例的流程图;FIG. 8 is a flowchart of a fourth embodiment of a message processing method according to the present invention; FIG.

图9是本发明消息处理方法第五实施例的流程图;9 is a flowchart of a fifth embodiment of a message processing method according to the present invention;

图10是本发明消息处理方法第六实施例的流程图;FIG. 10 is a flowchart of a sixth embodiment of a message processing method according to the present invention; FIG.

图11是本发明多播发起装置第一实施例的结构示意图;11 is a schematic structural diagram of a first embodiment of a multicast initiating apparatus according to the present invention;

图12是本发明观察者服务器第一实施例的结构示意图;12 is a schematic structural diagram of a first embodiment of an observer server according to the present invention;

图13是本发明观察者服务器第一实施例的结构示意图;Figure 13 is a schematic structural view of a first embodiment of an observer server of the present invention;

图14是本发明消息处理系统第二实施例的结构示意图;14 is a schematic structural diagram of a second embodiment of a message processing system according to the present invention;

图15是本发明多播发起装置第二实施例的结构示意图;15 is a schematic structural diagram of a second embodiment of a multicast initiating apparatus according to the present invention;

图16是本发明观察者服务器第二实施例的结构示意图;Figure 16 is a schematic structural view of a second embodiment of the observer server of the present invention;

图17是本发明观察者客户端第二实施例的结构示意图。Figure 17 is a block diagram showing the structure of a second embodiment of the viewer client of the present invention.

【具体实施方式】 【detailed description】

为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the drawings in the embodiments of the present invention. It is a partial embodiment of the invention, and not all of the embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.

首先请参见图1,图1是本发明消息处理系统第一实施例的结构示意图,如图1所示,本发明的消息处理系统包括多播发起装置10、观察者服务器20以及观察者客户端30,在本发明实施例中,优选地,多播发起装置10与观察者服务器20建立无线网络连接,观察者服务器与观察者客户端30建立无线网络连接,当然,在本发明的备选实施例中,多播发起装置10与观察者服务器20也可建立有线网络连接,观察者服务器与观察者客户端30也可建立有线网络连接,本发明对此不作限定。First, please refer to FIG. 1. FIG. 1 is a schematic structural diagram of a first embodiment of a message processing system according to the present invention. As shown in FIG. 1, the message processing system of the present invention includes a multicast originating device 10, an observer server 20, and an observer client. 30. In the embodiment of the present invention, preferably, the multicast originating device 10 establishes a wireless network connection with the observer server 20, and the observer server establishes a wireless network connection with the observer client 30, of course, in an alternative implementation of the present invention. For example, the multicast originating device 10 and the observer server 20 can also establish a wired network connection, and the observer server and the observer client 30 can also establish a wired network connection, which is not limited by the present invention.

并且,观察者服务器20设备优选为无线传感器设备,观察者客户端30优选为终端设备,多播发起装置10优选为终端设备或服务器。Also, the viewer server 20 device is preferably a wireless sensor device, the observer client 30 is preferably a terminal device, and the multicast originating device 10 is preferably a terminal device or server.

请参见图2,图2是本发明消息处理方法第一实施例的流程图,如图3所示,本发明的消息处理方法包括以下步骤:Referring to FIG. 2, FIG. 2 is a flowchart of a first embodiment of a message processing method according to the present invention. As shown in FIG. 3, the message processing method of the present invention includes the following steps:

步骤401:观察者客户端30获取观察者服务器20的标识。其中,观察者服务器20的标识用于识别观察者服务器20,举例而言,其可以是观察者服务器20的网络地址或其他可以作标识作用的识别码。在本步骤中,观察者客户端30具体可以预先获取并记录观察者服务器20的标识,获取标识的具体方式可包括:用户向观察者客户端30人工输入观察者服务器20的标识、观察者客户端30预先保存观察者服务器20的标识或由观察者服务器20发送其标识至观察者客户端30等。Step 401: The observer client 30 acquires the identity of the observer server 20. The identifier of the observer server 20 is used to identify the observer server 20, which may be, for example, the network address of the observer server 20 or other identification code that can be used for identification. In this step, the observer client 30 may specifically acquire and record the identifier of the observer server 20 in advance. The specific manner of obtaining the identifier may include: the user manually inputs the identifier of the observer server 20 to the observer client 30, and the observer client. The terminal 30 pre-stores the identity of the observer server 20 or transmits its identity to the viewer client 30 or the like by the observer server 20.

步骤402:多播发起装置10向观察者服务器20发送多播消息。在本步骤中,多播消息包括多播发起装置10的网络地址和针对观察者服务器20的资源的操作指令。其中这里所述的资源为观察者服务器20所提供,其包括温度、灯、亮度等,观察者服务器20根据需要设置有各类传感器或受控设备,如温度传感器、灯、亮度传感器等,操作指令用于对上述传感器或受控设备进行操作,如打开或关闭。Step 402: The multicast originating device 10 transmits a multicast message to the observer server 20. In this step, the multicast message includes the network address of the multicast originating device 10 and an operation instruction for the resources of the observer server 20. The resources described herein are provided by the observer server 20, which includes temperature, lights, brightness, etc., and the observer server 20 is provided with various types of sensors or controlled devices, such as temperature sensors, lights, brightness sensors, etc., as needed. Instructions are used to operate the above sensors or controlled devices, such as turning them on or off.

步骤403:观察者服务器20接收多播消息,根据操作指令更新资源的当前状态,并发送状态改变消息至观察者客户端30。其中状态改变消息包括多播发起装置10的网络地址和资源更新后的当前状态。Step 403: The observer server 20 receives the multicast message, updates the current state of the resource according to the operation instruction, and sends a status change message to the observer client 30. The status change message includes a network address of the multicast originating device 10 and a current status after the resource is updated.

步骤404:观察者客户端30接收状态改变消息,并根据多播发起装置10的网络地址发送响应消息至多播发起装置10。其中响应消息包括观察者服务器20的标识。Step 404: The observer client 30 receives the status change message and sends a response message to the multicast originating device 10 according to the network address of the multicast originating device 10. The response message includes the identity of the observer server 20.

步骤405:多播发起装置10接收响应消息,从响应消息获取观察者服务器20的标识以确认观察者服务器20获取到多播消息。Step 405: The multicast initiating device 10 receives the response message, and acquires the identifier of the observer server 20 from the response message to confirm that the observer server 20 acquires the multicast message.

可选地,在本发明中,多播消息、状态改变消息以及响应消息可通过对标准COAP消息进行修改来获得。Alternatively, in the present invention, the multicast message, the status change message, and the response message may be obtained by modifying the standard COAP message.

由于无线物联网中的设备(即本发明所述的观察者服务器)很多都是资源受限型的,这些设备只有少量的内存空间和有限的计算能力。在2010年3月,IETF(Intemet Engineering Task Force,互联网工程任务组)的CoRE(Constrained RESTful Environment,受限的RESTful环境)工作组开始制定CoAP(Constrained Application Protocol,受限应用协议)协议,为受限节点制定相关的REST(Representational State Transfer,表述性状态转移)形式的应用层协议。这就是CoRE工作组正在制订的CoAP协议。CoAP协议是为物联网中资源受限设备制定的应用层协议。它是一种面向网络的协议,采用了与HTTP(HTTP-Hypertext transfer protocol,超文本传输协议)类似的特征,核心内容为资源抽象、REST式交互以及可扩展的头选项等。应用程序通过URI(Uniform Resource Identifier,通用资源标识符)标识来获取服务器上的资源,即可以像HTTP协议对资源进行GET(查询)、PUT(修改)、POST(增加)和DELETE(删除)等操作。Since many devices in the wireless Internet of Things (ie, the observer servers described herein) are resource-constrained, these devices have only a small amount of memory space and limited computing power. In March 2010, IETF (Intemet Engineering Task Force, Internet Engineering Task Force) CoRE (Constrained RESTful) Environment, limited RESTful environment) The working group started to develop CoAP (Constrained Application) Protocol, Restricted Application Protocol), which establishes related REST for Restricted Nodes (Representational State) Application layer protocol in the form of Transfer, Representational State Transfer). This is the CoAP protocol being developed by the CoRE Working Group. The CoAP protocol is an application layer protocol for resource-constrained devices in the Internet of Things. It is a network-oriented protocol that uses HTTP (HTTP-Hypertext) Transfer protocol, Hypertext Transfer Protocol) Similar features, such as resource abstraction, RESTful interaction, and extensible header options. Application by URI (Uniform Resource Identifier, the universal resource identifier) identifies the resources on the server, that is, GET (query), PUT (modify), POST (add), and DELETE (delete) operations on the resource like the HTTP protocol.

请参见图3,图3是COAP协议栈的数据结构示意图,如图1所示,CoAP协议栈包括请求/响应层、业务层、UDP(User Datagram Protocol,用户数据包协议)层以及6LoWPAN(IPv6 over Low power WPAN,低功耗无线个人局域网上的IPv6协议)层,COAP协议栈的传输层使用UDP(User Datagram Protocol,用户数据包协议)协议。由于UDP传输的不可靠性,COAP协议采用了双层结构,定义了带有重传的事务处理机制,并且提供资源发现和资源描述等功能。Referring to FIG. 3, FIG. 3 is a schematic diagram of a data structure of a COAP protocol stack. As shown in FIG. 1, the CoAP protocol stack includes a request/response layer, a service layer, and a UDP (User Datagram). Protocol, User Packet Protocol) layer and 6LoWPAN (IPv6 over Low power WPAN, the IPv6 protocol layer on the low-power wireless personal area network, the transport layer of the COAP protocol stack uses UDP (User Datagram) Protocol, User Datagram Protocol) protocol. Due to the unreliability of UDP transmission, the COAP protocol adopts a two-layer structure, defines a transaction mechanism with retransmission, and provides functions such as resource discovery and resource description.

为了进一步清楚说明,并请参见图4,其中图4为标准COAP消息的数据格式示意图,如图4所示,标准COAP消息包括包头、负荷(payload)字段以及选项(option)字段,其中包头包括V(Version,版本)字段、T(Type,类型)字段、OC(Option Count,选项数量)字段、e消息类型(Cod)字段以及消息编号(Message ID)字段。 For further clarity, please refer to FIG. 4, where FIG. 4 is a schematic diagram of a data format of a standard COAP message. As shown in FIG. 4, the standard COAP message includes a header, a payload field, and an option field, where the header includes V (Version, version) field, T (Type, type) field, OC (Option Count, number of options) field, e message type (Cod) field, and message number (Message ID) field.

具体而言,在包头中,V字段表示COAP协议的版本号,OC字段表示包头后面的可选的选项数量,T字段表示消息的消息类型,消息类型字段表示消息的类型(包括请求消息、响应消息,或者是空消息),消息编号字段表示消息编号,用于重复消息检测、匹配消息类型等。Specifically, in the header, the V field indicates the version number of the COAP protocol, the OC field indicates the number of optional options following the packet header, the T field indicates the message type of the message, and the message type field indicates the type of the message (including the request message, response). Message, or empty message), the message number field indicates the message number, used for repeated message detection, matching message type, and so on.

并请参见图5,其中图5是标准COAP消息的选项字段的数据结构示意图,如图5所示,选项字段具体可分为多个子字段901、902……,每一子字段包括选项变量字段、长度字段以及选项值字段。Referring to FIG. 5, FIG. 5 is a schematic diagram of a data structure of an option field of a standard COAP message. As shown in FIG. 5, the option field may be specifically divided into multiple subfields 901, 902, ..., each subfield including an option variable field. , length field, and option value field.

在标准COAP消息中,通过对选项变量字段、长度字段以及选项值字段进行标准化设置,来定义基于标准的子字段。In standard COAP messages, standard-based subfields are defined by standardizing the option variable field, length field, and option value field.

在本发明实施例中,多播消息、状态改变消息以及响应消息可以通过对现有的标准COAP消息进行修改而获得,具体而言,多播发起装置10可将多播发起装置10的网络地址设置在标准COAP消息中的选项字段,以产生多播消息;观察者服务器20可将多播发起装置10的网络地址设置在标准COAP消息中的选项字段,以产生状态改变消息;观察者客户端30可将观察者服务器20的网络地址设置在标准COAP消息中的选项字段,以产生响应消息。 In the embodiment of the present invention, the multicast message, the state change message, and the response message may be obtained by modifying an existing standard COAP message. Specifically, the multicast originating device 10 may set the network address of the multicast originating device 10. An option field in the standard COAP message is set to generate a multicast message; the observer server 20 can set the network address of the multicast originating device 10 in an option field in the standard COAP message to generate a status change message; the observer client 30 The network address of the watcher server 20 can be set in an option field in a standard COAP message to generate a response message.

具体地,多播发起装置10可在标准COAP消息中的选项字段中定义选项变量为Mcast option的子字段,并在选项变量为Mcast option的子字段中记录多播发起装置10的网络地址,从而产生多播消息;观察者服务器20可在标准COAP消息中的选项字段中定义选项变量为Mcast option的子字段,并在选项变量为Mcast option的子字段中记录观察者服务器20的网络地址,从而产生状态改变消息;观察者客户端30可在标准COAP消息中的选项字段中定义选项变量为Mcast option的子字段,并在选项变量为Mcast option的子字段中记录观察者服务器20的网络地址,从而产生状态改变消息。Specifically, the multicast originating device 10 may define an option variable as Mcast in an option field in a standard COAP message. Subfield of option, and the option variable is Mcast The network address of the multicast originating device 10 is recorded in the subfield of the option, thereby generating a multicast message; the observer server 20 may define the option variable as Mcast in the option field in the standard COAP message. Subfield of option, and the option variable is Mcast The network address of the observer server 20 is recorded in the subfield of the option, thereby generating a state change message; the observer client 30 can define the option variable as Mcast in the option field in the standard COAP message. A subfield of option, and the network address of the observer server 20 is recorded in a subfield whose option variable is Mcast option, thereby generating a state change message.

可选地,多播消息和状态改变消息还包括最迟确认时间,最迟确认时间用于表示多播发起装置在确认观察者服务器获取到多播消息时可以接受的最迟时间。观察者客户端30根据接收到的状态改变消息中的最迟确认时间,在最迟确认时间之前发送响应消息,在当前时间晚于最迟最迟确认时间时,停止发送响应消息,由于在超时的情况下停止发送响应消息,因此可有效节省网络带宽。Optionally, the multicast message and the status change message further include a latest acknowledgement time, and the latest acknowledgement time is used to indicate the latest time that the multicast originating device can accept when confirming that the observer server acquires the multicast message. The observer client 30 sends a response message according to the latest confirmation time in the received status change message, before the latest confirmation time, and stops sending the response message when the current time is later than the latest latest confirmation time, due to the timeout In the case of the case, the response message is stopped, so the network bandwidth can be effectively saved.

可选地,观察者客户端30更可在响应消息的选项字段中,定义时间容忍子字段,用于记录完成多播确认的最迟时间。多播发送装置10接收到响应消息后,通过判断接收时间是否超过最迟时间,若是,则判定观察者服务器20没有收到多播消息,若否,则判定观察者服务器20收到多播消息,从而实现超时判断的功能。Optionally, the observer client 30 may further define a time tolerance subfield in the option field of the response message for recording the latest time to complete the multicast acknowledgement. After receiving the response message, the multicast transmitting apparatus 10 determines whether the reception time exceeds the latest time, and if so, determines that the observer server 20 does not receive the multicast message, and if not, determines that the observer server 20 receives the multicast message. To achieve the function of timeout judgment.

可选地,多播发送装置10更可在多播消息中,定义采用本发明的多播确认方法的标识,如图6中步骤5的“ION”。保证观察者服务器20收到多播消息后采用本发明的多播确认方法,而不采用现有技术中所支持的“NON”或“CON”。Optionally, the multicast transmitting apparatus 10 may further define, in the multicast message, an identifier using the multicast confirmation method of the present invention, such as "ION" of step 5 in FIG. It is ensured that the observer server 20 adopts the multicast confirmation method of the present invention after receiving the multicast message, instead of using "NON" or "CON" supported in the prior art.

在本发明的备选实施例中,在步骤402之前,上述方法可进一步包括:观察者客户端30与观察者服务器20建立观察者模式关系,其中观察者客户端30与观察者服务器20建立观察者模式关系具体可通过以下方式实现:In an alternative embodiment of the present invention, prior to step 402, the method may further include the observer client 30 establishing an observer mode relationship with the observer server 20, wherein the observer client 30 establishes an observation with the observer server 20. The pattern relationship can be achieved in the following ways:

观察者客户端30向观察者服务器20发送标准COAP查询消息,标准COAP查询消息包括要查询的资源对应的资源标识,以使得观察者服务器20根据资源标识对资源进行订阅注册,查询资源的当前状态,并发送标准COAP响应消息至观察者客户端30,其中标准COAP响应消息包括资源的当前状态。The observer client 30 sends a standard COAP query message to the observer server 20. The standard COAP query message includes the resource identifier corresponding to the resource to be queried, so that the observer server 20 subscribes to the resource according to the resource identifier, and queries the current state of the resource. And send a standard COAP response message to the observer client 30, where the standard COAP response message includes the current state of the resource.

其中,COAP查询消息及标准COAP响应消息为现有标准,于下文将会详细说明其具体格式。The COAP query message and the standard COAP response message are existing standards, and the specific format thereof will be described in detail below.

由于在接收到多播发送装置发送的多播消息之后,观察者服务器只需发送状态改变消息至观察者客户端,并由观察者客户端发送响应消息至多播发送装置进行确认,由于观察者服务器无需分别向多播发送装置发送响应消息,并向观察者客户端发送状态改变消息,因此可减小信令开销,降低观察者服务器的负荷。After receiving the multicast message sent by the multicast transmitting device, the observer server only needs to send a status change message to the observer client, and the observer client sends a response message to the multicast transmitting device for confirmation, due to the observer server. There is no need to separately send a response message to the multicast transmitting device and send a status change message to the observer client, thereby reducing signaling overhead and reducing the load on the observer server.

以下请参见图6,图6是本发明消息处理方法第二实施例的数据交互图,如图6所示,由于多播消息一般为群发,即以广播的方式发送,因此,在本实施例中,与本发明消息处理方法第一实施例相比,设置了两个观察者服务器20,以此来说明多播发送装置将多播消息发送到多个观察者服务器,并仅由一个观察者客户端发送响应消息至多播发送装置,以使得多播发送装置确认多个观察者服务器分别接收到多播消息的情况。Referring to FIG. 6, FIG. 6 is a data interaction diagram of a message processing method according to a second embodiment of the present invention. As shown in FIG. 6, the multicast message is generally sent in a broadcast manner, that is, in a broadcast manner. In contrast to the first embodiment of the message processing method of the present invention, two observer servers 20 are provided to illustrate that the multicast transmitting device transmits the multicast message to the plurality of observer servers, and only one observer The client sends a response message to the multicast transmitting device to cause the multicast transmitting device to confirm that the plurality of observer servers respectively receive the multicast message.

在本实施例中,观察者客户端30先分别与观察者服务器20和观察者服务器20’建立观察者模式关系,多播发起装置10发送多播消息,观察者服务器20和观察者服务器20’分别接收到多播消息,并分别发送状态改变消息至观察者客户端30,观察者客户端30接收到状态改变消息后,发送响应消息至多播发起装置10以使得多播发起装置10确认观察者服务器20获取到多播消息。In the present embodiment, the viewer client 30 first establishes an observer mode relationship with the observer server 20 and the observer server 20', respectively, and the multicast originating device 10 transmits a multicast message, the observer server 20 and the observer server 20' The multicast messages are respectively received, and the status change message is respectively sent to the observer client 30. After receiving the status change message, the observer client 30 sends a response message to the multicast originating device 10 to cause the multicast originating device 10 to confirm the observer. The server 20 acquires a multicast message.

以下将参见图6进行具体说明,如图6所示,本发明消息处理方法第二实施例具体包括以下步骤:The following is a detailed description with reference to FIG. 6. As shown in FIG. 6, the second embodiment of the message processing method of the present invention specifically includes the following steps:

步骤1:观察者客户端30向观察者服务器20’发送标准COAP查询消息,在本实施例中,标准COAP查询消息具体为:COAP CON (GET,uri-path:light, Token: 0x3c,Observe: empty)。其中,其中COAP表示符合COAP标准;CON表示可证实的消息;GET表示基于REST的查询操作方法;uri-path是标准COAP消息定义的选项,表示从观察者服务器20’中寻找目标资源light(灯)的内容;Token是建立一次观察模式关系的标记,之后发送状态改变消息也携带相同的Token;Observe也是标准COAP消息定义的选项,表示是观察模式关系消息,该option的选项值为empty表示申请建立观察模式关系。 Step 1: The observer client 30 sends a standard COAP query message to the observer server 20'. In this embodiment, the standard COAP query message is specifically: COAP CON (GET, uri-path: light, Token: 0x3c, Observe: Empty). Where COAP indicates compliance with the COAP standard; CON indicates a verifiable message; GET indicates a REST-based query operation method; uri-path is an option defined by the standard COAP message, indicating that the target resource light (light) is looked up from the observer server 20' The Token is a token that establishes an observation mode relationship, and then sends a status change message to carry the same Token; Observe is also an option defined by the standard COAP message, indicating that it is an observation mode relationship message, and the option value of the option is empty to indicate the application. Establish an observation mode relationship.

步骤2:观察者服务器20’根据资源标识对资源进行订阅注册,查询资源的当前状态,并发送标准COAP响应消息至观察者客户端30,在本实施例中, 标准COAP响应消息具体为:COAP NON(2.05 Content Token: 0x3c Observe: 12 Payload:OFF)。其中,这类消息是标准COAP响应消息,NON表示不需证实的消息;2.05 content是携带消息内容的响应消息,OFF表示资源Light的内容为关闭。Step 2: The observer server 20' subscribes to the resource according to the resource identifier, queries the current state of the resource, and sends a standard COAP response message to the observer client 30. In this embodiment, The standard COAP response message is specifically: COAP NON (2.05 Content Token: 0x3c Observe: 12 Payload: OFF). Among them, this type of message is a standard COAP response message, and NON means a message that does not need to be confirmed; 2.05 Content is a response message carrying the content of the message, and OFF indicates that the content of the resource Light is off.

步骤3:观察者客户端30向观察者服务器20发送标准COAP查询消息,在本实施例中,标准COAP查询消息具体为:COAP CON (GET,uri-path:light, Token: 0x4a,Observe: empty)。该标准COAP查询消息的数据格式与步骤1所述相同,于此不作赘述。Step 3: The observer client 30 sends a standard COAP query message to the observer server 20. In this embodiment, the standard COAP query message is specifically: COAP CON (GET, uri-path: light, Token: 0x4a, Observe: Empty). The data format of the standard COAP query message is the same as that described in step 1, and details are not described herein.

步骤4:观察者服务器20根据资源标识对资源进行订阅注册,查询资源的当前状态,并发送标准COAP响应消息至观察者客户端30,在本实施例中,标准COAP响应消息具体为:COAP NON(2.05 Content Token: 0x4a Observe: 12 Payload:OFF)。该标准COAP响应消息与步骤2所述相同,于此不作赘述。Step 4: The observer server 20 subscribes to the resource according to the resource identifier, queries the current state of the resource, and sends a standard COAP response message to the observer client 30. In this embodiment, the standard COAP response message is specifically: COAP. NON(2.05 Content Token: 0x4a Observe: 12 Payload: OFF). The standard COAP response message is the same as that described in step 2, and details are not described herein.

步骤5:多播发起装置10发送多播消息至观察者服务器20和观察者服务器20,在本实施例中,多播消息具体为:COAP ION Mcast(PUT, payload=lights ON) Mcast option: MI。在本实施例中,多播消息是在标准COAP消息的基础上进行改进而获得,其中Mcast表示多播消息,ION表示采用本发明的多播确认方式,PUT表示基于REST的修改操作方法;payload=lights ON表示将灯打开的指令。MI表示多播发送装置的网络地址,其设置在选项变量为Mcast option的自定义子选项字段中。Step 5: The multicast initiating device 10 sends a multicast message to the observer server 20 and the observer server 20. In this embodiment, the multicast message is specifically: COAP ION Mcast(PUT, payload=lights ON) Mcast option: MI. In this embodiment, the multicast message is obtained by improving on the basis of a standard COAP message, wherein Mcast represents a multicast message, ION represents a multicast confirmation mode using the present invention, and PUT represents a REST-based modification operation method; =lights ON indicates an instruction to turn the light on. MI indicates the network address of the multicast transmitting device, which is set in the custom sub-option field whose option variable is Mcast option.

步骤6:观察者服务器20接收到多播消息之后,发送状态改变消息至观察者客户端30,在本实施例中,状态改变消息具体为:COAP NON(2.05 Content Token: 0x4a Observe: 12 Payload: ON Mcast option: MI)。在本步骤中,观察者服务器20接收到多播消息之后,会进一步根据lights ON指令对资源Light进行操作,使得资源light的状态改变,状态改变消息在标准COAP消息的基础上进行改进而获得,MI表示多播发送装置的网络地址。其设置在选项变量定义为Mcast option的子选项字段中。Step 6: After receiving the multicast message, the observer server 20 sends a status change message to the observer client 30. In this embodiment, the status change message is specifically: COAP. NON(2.05 Content Token: 0x4a Observe: 12 Payload: ON Mcast option: MI). In this step, after the observer server 20 receives the multicast message, it will further according to the lights. The ON instruction operates on the resource Light such that the state of the resource light changes, the state change message is obtained based on the improvement of the standard COAP message, and the MI represents the network address of the multicast transmitting device. Its setting in the option variable is defined as Mcast In the suboption field of option.

步骤7:观察者服务器20’接收到多播消息之后,发送状态改变消息至观察者客户端30,在本实施例中,状态改变消息具体为:COAP NON(2.05 Content Token: 0x3c Observe: 12 Payload:ON Mcast option: MI)。在本步骤中,观察者服务器20’接收到多播消息之后,会进一步根据lights ON指令对资源Light进行操作,使得资源light的状态改变,状态改变消息在标准COAP消息的基础上进行改进而获得,MI表示多播发送装置的网络地址。其设置在选项变量定义为Mcast option的子选项字段中。Step 7: After receiving the multicast message, the observer server 20' sends a status change message to the observer client 30. In this embodiment, the status change message is specifically: COAP. NON(2.05 Content Token: 0x3c Observe: 12 Payload:ON Mcast option: MI). In this step, after the viewer server 20' receives the multicast message, it will further according to the lights. The ON instruction operates on the resource Light such that the state of the resource light changes, the state change message is obtained based on the improvement of the standard COAP message, and the MI represents the network address of the multicast transmitting device. Its setting in the option variable is defined as Mcast In the suboption field of option.

步骤8:观察者客户端30在分别接收到观察者服务器20发送的状态改变消息之后,发送响应消息至多播发起装置10。在本实施例中,响应消息具体为:COAP NON (2.04 Changed) Mcast option: MR1,MR2。2.04 changed是表示状态改变的响应消息。MR1表示观察者服务器20的网络地址,MR2表示观察者服务器20’的网络地址。MR1和MR2设置在选项变量为Mcast option的自定义子选项字段中。Step 8: The observer client 30 sends a response message to the multicast originating device 10 after receiving the status change message sent by the observer server 20, respectively. In this embodiment, the response message is specifically: COAP NON (2.04 Changed) Mcast option: MR1, MR2.2.04 Changed is a response message indicating a change in state. MR1 represents the network address of the observer server 20, and MR2 represents the network address of the observer server 20'. MR1 and MR2 are set in the option variable Mcast Option in the custom suboption field.

在本实施例中,多播发起装置10在广播发送多播消息之后,会从观察者客户端30获取到包括观察者服务器20的网络地址MR1以及观察者服务器20’的网络地址MR2的响应消息,从而确认收到观察者服务器20及观察者服务器20’分别收到多播消息。In this embodiment, the multicast initiating device 10 acquires a response message including the network address MR1 of the observer server 20 and the network address MR2 of the observer server 20' from the observer client 30 after the multicast transmission of the multicast message. , thereby confirming that the received observer server 20 and the observer server 20' respectively receive the multicast message.

在接收到多播发送装置发送的多播消息之后,观察者服务器只需发送状态改变消息至观察者客户端,并由观察者客户端发送响应消息至多播发送装置进行确认,由于观察者服务器无需分别向多播发送装置发送响应消息,并向观察者客户端发送状态改变消息,因此可减小信令开销,降低观察者服务器的负荷。After receiving the multicast message sent by the multicast transmitting device, the observer server only needs to send a status change message to the observer client, and the observer client sends a response message to the multicast transmitting device for confirmation, since the observer server does not need to The response message is respectively sent to the multicast transmitting apparatus, and the status change message is sent to the observer client, so that the signaling overhead can be reduced and the load of the observer server can be reduced.

可选地,多播消息和状态改变消息还包括最迟确认时间,最迟确认时间用于表示多播发起装置在确认观察者服务器获取到多播消息时可以接受的最迟时间。观察者客户端30根据接收到的状态改变消息中的最迟确认时间,在最迟确认时间之前发送响应消息,在当前时间晚于最迟最迟确认时间时,停止发送响应消息,由于在超时的情况下停止发送响应消息,因此可有效节省网络带宽。Optionally, the multicast message and the status change message further include a latest acknowledgement time, and the latest acknowledgement time is used to indicate the latest time that the multicast originating device can accept when confirming that the observer server acquires the multicast message. The observer client 30 sends a response message according to the latest confirmation time in the received status change message, before the latest confirmation time, and stops sending the response message when the current time is later than the latest latest confirmation time, due to the timeout In the case of the case, the response message is stopped, so the network bandwidth can be effectively saved.

在本实施例中,多播发送装置10更可在多播消息中,定义采用本发明的多播确认方法的标识,如图6中步骤5的“ION”。保证观察者服务器20收到多播消息后采用本发明的多播确认方法,而不采用现有技术中所支持的“NON”或“CON”。In this embodiment, the multicast transmitting apparatus 10 can further define the identifier of the multicast confirmation method of the present invention in the multicast message, such as "ION" of step 5 in FIG. It is ensured that the observer server 20 adopts the multicast confirmation method of the present invention after receiving the multicast message, instead of using "NON" or "CON" supported in the prior art.

以下请参见图7,图7是本发明消息处理方法第三实施例的数据交互图,本实施例与本发明消息处理方法第一实施例相比,设置了两个观察者服务器20,以及两个观察者客户端30,以此来说明多播发送装置多播消息发送到多个观察者服务器,并分别由多个观察者客户端发送响应消息至多播发送装置,以使得多播发送装置确认多个观察者服务器分别接收到多播消息的情况。Please refer to FIG. 7. FIG. 7 is a data interaction diagram of a third embodiment of the message processing method according to the present invention. Compared with the first embodiment of the message processing method of the present invention, two observer servers 20 are provided, and two An observer client 30, thereby indicating that the multicast transmitting device multicast message is sent to the plurality of observer servers, and the plurality of observer clients respectively send the response message to the multicast transmitting device to cause the multicast transmitting device to confirm The case where multiple observer servers receive multicast messages respectively.

在本实施例中,观察者客户端30先与观察者服务器20建立观察者模式关系,观察者客户端30’先与观察者服务器20’建立观察者模式关系,多播发起装置10发送多播消息,观察者服务器20和观察者服务器20’分别接收到多播消息,观察者服务器20发送状态改变消息至观察者客户端30,观察者服务器20’发送状态改变消息至观察者客户端30’,观察者客户端30接收到状态改变消息后,发送响应消息至多播发起装置10,观察者客户端30’接收到状态改变消息后,发送响应消息至多播发起装置10,以使得多播发起装置10确认观察者服务器20及观察者服务器20’获取到多播消息。以下将参见图7进行具体说明,如图7所示,本发明消息处理方法第二实施例具体包括以下步骤:In the present embodiment, the viewer client 30 first establishes an observer mode relationship with the observer server 20, the observer client 30' first establishes an observer mode relationship with the observer server 20', and the multicast originating device 10 transmits the multicast mode. The message, the observer server 20 and the observer server 20' respectively receive the multicast message, the observer server 20 sends a status change message to the observer client 30, and the observer server 20' sends a status change message to the observer client 30' After receiving the status change message, the observer client 30 sends a response message to the multicast initiating device 10. After receiving the status change message, the observer client 30' sends a response message to the multicast initiating device 10 to cause the multicast initiating device. 10 Confirm that the observer server 20 and the observer server 20' acquire the multicast message. The following is a detailed description with reference to FIG. 7. As shown in FIG. 7, the second embodiment of the message processing method of the present invention specifically includes the following steps:

步骤1:观察者客户端30’向观察者服务器20’发送标准COAP查询消息,在本实施例中,标准COAP查询消息具体为:COAP CON (GET,uri-path:light, Token: 0x3c,Observe: empty)。Step 1: The observer client 30' sends a standard COAP query message to the observer server 20'. In this embodiment, the standard COAP query message is specifically: COAP CON (GET, uri-path: light, Token: 0x3c, Observe: empty).

步骤2:观察者服务器20’根据资源标识对资源进行订阅注册,查询资源的当前状态,并发送标准COAP响应消息至观察者客户端30’,在本实施例中, 标准COAP响应消息具体为:COAP NON(2.05 Content Token: 0x3c Observe: 12 Payload:OFF)。Step 2: The observer server 20' subscribes to the resource according to the resource identifier, queries the current state of the resource, and sends a standard COAP response message to the observer client 30'. In this embodiment, The standard COAP response message is specifically: COAP NON (2.05 Content Token: 0x3c Observe: 12 Payload: OFF).

步骤3:观察者客户端30向观察者服务器20发送标准COAP查询消息,在本实施例中,标准COAP查询消息具体为:COAP CON (GET,uri-path:light, Token: 0x4a,Observe: empty)。Step 3: The observer client 30 sends a standard COAP query message to the observer server 20. In this embodiment, the standard COAP query message is specifically: COAP CON (GET, uri-path: light, Token: 0x4a, Observe: empty).

步骤4:观察者服务器20根据资源标识对资源进行订阅注册,查询资源的当前状态,并发送标准COAP响应消息至观察者客户端30,在本实施例中,标准COAP响应消息具体为:COAP NON(2.05 Content Token: 0x4a Observe: 12 Payload:OFF)。Step 4: The observer server 20 subscribes to the resource according to the resource identifier, queries the current state of the resource, and sends a standard COAP response message to the observer client 30. In this embodiment, the standard COAP response message is specifically: COAP. NON (2.05 Content Token: 0x4a Observe: 12 Payload: OFF).

步骤5:多播发起装置10发送多播消息至观察者服务器20和观察者服务器20’,在本实施例中,多播消息具体为:COAP ION Mcast(PUT, payload=lights ON) Mcast option: MI。Step 5: The multicast initiating device 10 sends a multicast message to the observer server 20 and the observer server 20'. In this embodiment, the multicast message is specifically: COAP ION Mcast(PUT, payload=lights ON) Mcast option: MI.

步骤6:观察者服务器20接收到多播消息之后,发送状态改变消息至观察者客户端30,在本实施例中,状态改变消息具体为:COAP NON(2.05 Content Token: 0x4a Observe: 12 Payload:ON Mcast option: MI)。Step 6: After receiving the multicast message, the observer server 20 sends a status change message to the observer client 30. In this embodiment, the status change message is specifically: COAP. NON(2.05 Content Token: 0x4a Observe: 12 Payload: ON Mcast option: MI).

步骤7:观察者服务器20’接收到多播消息之后,发送状态改变消息至观察者客户端30’,在本实施例中,状态改变消息具体为:COAP NON(2.05 Content Token: 0x3c Observe: 12 Payload:ON Mcast option: MI)。Step 7: After receiving the multicast message, the observer server 20' sends a status change message to the observer client 30'. In this embodiment, the status change message is specifically: COAP. NON(2.05 Content Token: 0x3c Observe: 12 Payload: ON Mcast option: MI).

步骤8:观察者客户端30在接收到观察者服务器20发送的状态改变消息之后,发送响应消息至多播发起装置10。在本实施例中,观察者客户端30发送的响应消息具体为:COAP NON (2.04 Changed) Mcast option: MR1。Step 8: After receiving the status change message sent by the observer server 20, the observer client 30 sends a response message to the multicast originating device 10. In this embodiment, the response message sent by the observer client 30 is specifically: COAP NON (2.04 Changed) Mcast option: MR1.

步骤9:观察者客户端30’在接收到观察者服务器20’发送的状态改变消息,发送响应消息至多播发起装置10。在本实施例中,观察者客户端30’发送的响应消息具体为:COAP NON (2.04 Changed) Mcast option: MR2。Step 9: The observer client 30' receives the status change message sent by the observer server 20' and sends a response message to the multicast originating device 10. In this embodiment, the response message sent by the observer client 30' is specifically: COAP NON (2.04 Changed) Mcast option: MR2.

因此,多播发起装置10会获取到观察者服务器20的网络地址MR1以及观察者服务器20’的网络地址MR2,从而确认收到观察者服务器20及观察者服务器20’分别收到多播消息。Therefore, the multicast originating apparatus 10 acquires the network address MR1 of the observer server 20 and the network address MR2 of the observer server 20', thereby confirming that the received observer server 20 and the observer server 20' respectively receive the multicast message.

其中上述消息的数据结构与图6所示实施例类似,于此不作赘述。The data structure of the above message is similar to the embodiment shown in FIG. 6, and details are not described herein.

在本实施例中,多播发起装置10在广播发送多播消息之后,会从观察者客户端30获取到包括观察者服务器20的网络地址MR1的响应消息,从观察者客户端30’获取观察者服务器20’的网络地址MR2的响应消息,从而确认收到观察者服务器20及观察者服务器20’分别收到多播消息。 In this embodiment, the multicast initiating device 10 acquires a response message including the network address MR1 of the observer server 20 from the observer client 30 after broadcasting the multicast message, and acquires an observation from the observer client 30'. The response message of the network address MR2 of the server 20' confirms that the received observer server 20 and the observer server 20' respectively receive the multicast message.

在接收到多播发送装置发送的多播消息之后,观察者服务器只需发送状态改变消息至观察者客户端,并由观察者客户端发送响应消息至多播发送装置进行确认,由于观察者服务器无需分别向多播发送装置发送响应消息,并向观察者客户端发送状态改变消息,因此可减小信令开销,降低观察者服务器的负荷。After receiving the multicast message sent by the multicast transmitting device, the observer server only needs to send a status change message to the observer client, and the observer client sends a response message to the multicast transmitting device for confirmation, since the observer server does not need to The response message is respectively sent to the multicast transmitting apparatus, and the status change message is sent to the observer client, so that the signaling overhead can be reduced and the load of the observer server can be reduced.

可选地,多播消息和状态改变消息还包括最迟确认时间,最迟确认时间用于表示多播发起装置在确认观察者服务器获取到多播消息时可以接受的最迟时间。观察者客户端30根据接收到的状态改变消息中的最迟确认时间,在最迟确认时间之前发送响应消息,在当前时间晚于最迟最迟确认时间时,停止发送响应消息,由于在超时的情况下停止发送响应消息,因此可有效节省网络带宽。Optionally, the multicast message and the status change message further include a latest acknowledgement time, and the latest acknowledgement time is used to indicate the latest time that the multicast originating device can accept when confirming that the observer server acquires the multicast message. The observer client 30 sends a response message according to the latest confirmation time in the received status change message, before the latest confirmation time, and stops sending the response message when the current time is later than the latest latest confirmation time, due to the timeout In the case of the case, the response message is stopped, so the network bandwidth can be effectively saved.

在本实施例中,多播发送装置10更可在多播消息中,定义采用本发明的多播确认方法的标识,如图6中步骤5的“ION”。保证观察者服务器20收到多播消息后采用本发明的多播确认方法,而不采用现有技术中所支持的“NON”或“CON”。In this embodiment, the multicast transmitting apparatus 10 can further define the identifier of the multicast confirmation method of the present invention in the multicast message, such as "ION" of step 5 in FIG. It is ensured that the observer server 20 adopts the multicast confirmation method of the present invention after receiving the multicast message, instead of using "NON" or "CON" supported in the prior art.

以下请参见图8,图8是本发明消息处理方法第四实施例的流程图。值得注意的是,本实施例以多播发起装置作为步骤执行主体进行说明,如图8所示,本发明的消息处理方法包括以下步骤:Referring to FIG. 8, FIG. 8 is a flowchart of a fourth embodiment of a message processing method according to the present invention. It should be noted that, in this embodiment, the multicast initiating device is used as the step execution subject. As shown in FIG. 8, the message processing method of the present invention includes the following steps:

步骤501:多播发起装置向观察者服务器发送多播消息。其中多播消息包括多播发起装置的网络地址和针对观察者服务器的资源的操作指令,以使得观察者服务器在接收到多播消息之后,根据操作指令更新资源的当前状态Step 501: The multicast originating device sends a multicast message to the observer server. The multicast message includes a network address of the multicast originating device and an operation instruction for the resource of the observer server, so that the observer server updates the current state of the resource according to the operation instruction after receiving the multicast message.

步骤502:多播发起装置接收观察者客户端发送的响应消息。响应消息包括观察者服务器的标识。Step 502: The multicast originating device receives the response message sent by the observer client. The response message includes the identity of the observer server.

步骤503:多播发起装置从响应消息获取观察者服务器的标识以确认观察者服务器获取到多播消息。其中响应消息是观察者客户端在接收到观察者服务器发送的状态改变消息后发送的,而观察者服务器在接收到多播消息后向观察者客户端发送状态改变消息,状态改变消息包括多播发起装置的网络地址和资源更新后的当前状态。Step 503: The multicast initiating device acquires the identifier of the observer server from the response message to confirm that the observer server acquires the multicast message. The response message is sent by the observer client after receiving the state change message sent by the observer server, and the observer server sends a state change message to the observer client after receiving the multicast message, and the state change message includes multicast. The network address of the originating device and the current state after the resource is updated.

可选地,多播消息中的多播发起装置的网络地址设置在标准COAP消息中的选项字段。Optionally, the network address of the multicast originating device in the multicast message is set in an option field in a standard COAP message.

可选地,观察者服务器的标识为观察者服务器的网络地址。Optionally, the identifier of the observer server is the network address of the observer server.

可选地,多播消息和状态改变消息还包括最迟确认时间,最迟确认时间用于表示多播发起装置在确认观察者服务器获取到多播消息时可以接受的最迟时间。Optionally, the multicast message and the status change message further include a latest acknowledgement time, and the latest acknowledgement time is used to indicate the latest time that the multicast originating device can accept when confirming that the observer server acquires the multicast message.

可选地,多播消息中的最迟确认时间设置在标准COAP消息中的选项字段。Optionally, the latest acknowledgement time in the multicast message is set in the option field in the standard COAP message.

在本实施例中,观察者服务器的数量可以是一个或复数个,观察者客户端的数量可以是一个或复数个,本发明对此不作限定,但值得注意的是,当观察者服务器的数量是复数个时,由于每个观察者服务器只需向观察者客户端发送一次信令(即状态响应消息),无需分别向多播发起装置及观察者客户端发送两次信令,因此可以极大地节约信令传输带宽以及观察者客户端本身的功耗。In this embodiment, the number of observer servers may be one or plural, and the number of observer clients may be one or plural. The present invention does not limit this, but it is worth noting that when the number of observer servers is In the plural, since each observer server only needs to send a signaling (ie, a status response message) to the observer client, it is not necessary to separately send the signaling to the multicast initiator and the observer client twice, so Save signaling bandwidth and power consumption of the observer client itself.

在接收到多播发送装置发送的多播消息之后,观察者服务器只需发送状态改变消息至观察者客户端,并由观察者客户端发送响应消息至多播发送装置进行确认,由于观察者服务器无需分别向多播发送装置发送响应消息,并向观察者客户端发送状态改变消息,因此可减小信令开销,降低观察者服务器的负荷。After receiving the multicast message sent by the multicast transmitting device, the observer server only needs to send a status change message to the observer client, and the observer client sends a response message to the multicast transmitting device for confirmation, since the observer server does not need to The response message is respectively sent to the multicast transmitting apparatus, and the status change message is sent to the observer client, so that the signaling overhead can be reduced and the load of the observer server can be reduced.

以下请参见图9,图9是本发明消息处理方法第五实施例的流程图。值得注意的是,本实施例以观察者服务器作为步骤执行主体进行说明,如图8所示,本发明的消息处理方法包括以下步骤:Referring to FIG. 9, FIG. 9 is a flowchart of a fifth embodiment of a message processing method according to the present invention. It should be noted that the embodiment is described by using the observer server as the step execution subject. As shown in FIG. 8, the message processing method of the present invention includes the following steps:

步骤601:观察者服务器接收多播发起装置发送的多播消息。其中多播消息包括多播发起装置的网络地址和针对观察者服务器的资源的操作指令。Step 601: The observer server receives the multicast message sent by the multicast originating device. The multicast message includes a network address of the multicast originating device and an operation instruction for a resource of the observer server.

步骤602:观察者服务器根据操作指令更新资源的当前状态。Step 602: The observer server updates the current state of the resource according to the operation instruction.

步骤603:观察者服务器发送状态改变消息至观察者客户端,状态改变消息包括多播发起装置的网络地址和资源更新后的当前状态。Step 603: The observer server sends a status change message to the observer client, where the status change message includes the network address of the multicast originating device and the current status after the resource is updated.

可选地,状态改变消息中的多播发起装置的网络地址设置在标准COAP消息中的选项字段。Optionally, the network address of the multicast originating device in the status change message is set in an option field in a standard COAP message.

可选地,多播消息和状态改变消息还包括最迟确认时间,最迟确认时间用于表示多播发起装置在确认观察者服务器获取到多播消息时可以接受的最迟时间。Optionally, the multicast message and the status change message further include a latest acknowledgement time, and the latest acknowledgement time is used to indicate the latest time that the multicast originating device can accept when confirming that the observer server acquires the multicast message.

可选地,多播消息和状态改变消息中的最迟确认时间设置在标准COAP消息中的选项字段。 Optionally, the latest acknowledgement time in the multicast message and the status change message is set in the option field in the standard COAP message.

在本实施例中,观察者服务器的数量可以是一个或复数个,观察者客户端的数量可以是一个或复数个,本发明对此不作限定,但值得注意的是,当观察者服务器的数量是复数个时,由于每个观察者服务器只需向观察者客户端发送一次信令(即状态响应消息),无需分别向多播发起装置及观察者客户端发送两次信令,因此可以极大地节约信令传输带宽以及观察者客户端本身的功耗。In this embodiment, the number of observer servers may be one or plural, and the number of observer clients may be one or plural. The present invention does not limit this, but it is worth noting that when the number of observer servers is In the plural, since each observer server only needs to send a signaling (ie, a status response message) to the observer client, it is not necessary to separately send the signaling to the multicast initiator and the observer client twice, so Save signaling bandwidth and power consumption of the observer client itself.

在接收到多播发送装置发送的多播消息之后,观察者服务器只需发送状态改变消息至观察者客户端,并由观察者客户端发送响应消息至多播发送装置进行确认,由于观察者服务器无需分别向多播发送装置发送响应消息,并向观察者客户端发送状态改变消息,因此可减小信令开销,降低观察者服务器的负荷。After receiving the multicast message sent by the multicast transmitting device, the observer server only needs to send a status change message to the observer client, and the observer client sends a response message to the multicast transmitting device for confirmation, since the observer server does not need to The response message is respectively sent to the multicast transmitting apparatus, and the status change message is sent to the observer client, so that the signaling overhead can be reduced and the load of the observer server can be reduced.

以下请参见图10,图10是本发明消息处理方法第六实施例的流程图。值得注意的是,本实施例以观察者客户端作为步骤执行主体进行说明,如图10所示,本发明的消息处理方法包括以下步骤:Referring to FIG. 10, FIG. 10 is a flowchart of a sixth embodiment of a message processing method according to the present invention. It should be noted that, in this embodiment, the observer client is used as the step execution subject. As shown in FIG. 10, the message processing method of the present invention includes the following steps:

步骤601:观察者客户端获取观察者服务器的标识。Step 601: The observer client acquires the identifier of the observer server.

步骤602:观察者客户端接收观察者服务器发送的状态改变消息。其中状态改变消息包括多播发起装置的网络地址和资源更新后的当前状态;Step 602: The observer client receives a state change message sent by the observer server. The status change message includes a network address of the multicast originating device and a current status after the resource is updated;

步骤603:观察者客户端根据多播发起装置的网络地址发送响应消息至多播发起装置,其中响应消息包括观察者服务器的标识,以使得多播发起装置从响应消息获取观察者服务器的标识以确认观察者服务器获取到多播消息。Step 603: The observer client sends a response message to the multicast originating device according to the network address of the multicast originating device, where the response message includes an identifier of the observer server, so that the multicast initiating device acquires the identifier of the observer server from the response message to confirm The observer server gets the multicast message.

可选地,观察者服务器的标识为观察者服务器的网络地址。Optionally, the identifier of the observer server is the network address of the observer server.

可选地,多播消息和状态改变消息还包括最迟确认时间,最迟确认时间用于表示多播发起装置在确认观察者服务器获取到多播消息时可以接受的最迟时间。Optionally, the multicast message and the status change message further include a latest acknowledgement time, and the latest acknowledgement time is used to indicate the latest time that the multicast originating device can accept when confirming that the observer server acquires the multicast message.

可选地,多播消息和状态改变消息中的最迟确认时间设置在标准COAP消息中的选项字段。Optionally, the latest acknowledgement time in the multicast message and the status change message is set in the option field in the standard COAP message.

可选地,观察者客户端在最迟确认时间之前根据多播发起装置的网络地址发送响应消息至多播发起装置。Optionally, the observer client sends a response message to the multicast originating device according to the network address of the multicast originating device before the latest acknowledgement time.

可选地,响应消息中的观察者服务器的标识设置在标准COAP消息中的选项字段。Optionally, the identifier of the observer server in the response message is set in an option field in the standard COAP message.

可选地,在步骤601之前,该方法进一步包括:观察者客户端与观察者服务器建立观察者模式关系,具体而言,观察者客户端向观察者服务器发送标准COAP查询消息,标准COAP查询消息包括要查询的资源对应的资源标识,以使得观察者服务器根据资源标识对资源进行订阅注册,查询资源的当前状态,并发送标准COAP响应消息至观察者客户端,其中标准COAP响应消息包括资源的当前状态。Optionally, before step 601, the method further comprises: the observer client establishing an observer mode relationship with the observer server, specifically, the observer client sends a standard COAP query message to the observer server, the standard COAP query message Include the resource identifier corresponding to the resource to be queried, so that the observer server subscribes the resource according to the resource identifier, queries the current state of the resource, and sends a standard COAP response message to the observer client, where the standard COAP response message includes the resource. Current status.

在本实施例中,观察者服务器的数量可以是一个或复数个,观察者客户端的数量可以是一个或复数个,本发明对此不作限定,但值得注意的是,当观察者服务器的数量是复数个时,由于每个观察者服务器只需向观察者客户端发送一次信令(即状态响应消息),无需分别向多播发起装置及观察者客户端发送两次信令,因此可以极大地节约信令传输带宽以及观察者客户端本身的功耗。In this embodiment, the number of observer servers may be one or plural, and the number of observer clients may be one or plural. The present invention does not limit this, but it is worth noting that when the number of observer servers is In the plural, since each observer server only needs to send a signaling (ie, a status response message) to the observer client, it is not necessary to separately send the signaling to the multicast initiator and the observer client twice, so Save signaling bandwidth and power consumption of the observer client itself.

在接收到多播发送装置发送的多播消息之后,观察者服务器只需发送状态改变消息至观察者客户端,并由观察者客户端发送响应消息至多播发送装置进行确认,由于观察者服务器无需分别向多播发送装置发送响应消息,并向观察者客户端发送状态改变消息,因此可减小信令开销,降低观察者服务器的负荷。After receiving the multicast message sent by the multicast transmitting device, the observer server only needs to send a status change message to the observer client, and the observer client sends a response message to the multicast transmitting device for confirmation, since the observer server does not need to The response message is respectively sent to the multicast transmitting apparatus, and the status change message is sent to the observer client, so that the signaling overhead can be reduced and the load of the observer server can be reduced.

以下请参见图11,图11是本发明多播发起装置第一实施例的结构示意图,如图10所示,本发明多播发起装置10包括:Referring to FIG. 11, FIG. 11 is a schematic structural diagram of a first embodiment of a multicast initiating apparatus according to the present invention. As shown in FIG. 10, the multicast initiating apparatus 10 of the present invention includes:

第一发送模块101,用于用于向观察者服务器发送多播消息,其中多播消息包括多播发起装置的网络地址和针对观察者服务器的资源的操作指令,以使得观察者服务器根据操作指令更新资源的当前状态,并向观察者客户端发送状态改变消息,状态改变消息包括多播发起装置的网络地址和资源更新后的当前状态;The first sending module 101 is configured to send a multicast message to the observer server, where the multicast message includes a network address of the multicast originating device and an operation instruction for a resource of the observer server, so that the observer server according to the operation instruction Updating a current state of the resource, and sending a state change message to the observer client, where the state change message includes a network address of the multicast originating device and a current state after the resource is updated;

第一接收模块102,用于接收观察者客户端发送的响应消息,响应消息包括观察者服务器的标识,其中响应消息是观察者客户端在接收到观察者服务器发送的状态改变消息后发送的;The first receiving module 102 is configured to receive a response message sent by the observer client, where the response message includes an identifier of the observer server, where the response message is sent by the observer client after receiving the state change message sent by the observer server;

确认模块104,用于用于从响应消息获取观察者服务器的标识以确认观察者服务器获取到多播消息。The confirmation module 104 is configured to obtain an identifier of the observer server from the response message to confirm that the observer server acquires the multicast message.

可选地,多播消息中的多播发起装置的网络地址设置在标准COAP消息中的选项字段。Optionally, the network address of the multicast originating device in the multicast message is set in an option field in a standard COAP message.

可选地,观察者服务器的标识为观察者服务器的网络地址。Optionally, the identifier of the observer server is the network address of the observer server.

可选地,多播消息还和状态改变消息包括最迟确认时间,最迟确认时间用于表示多播发起装置在确认观察者服务器获取到多播消息时可以接受的最迟时间。Optionally, the multicast message and the status change message include a latest acknowledgement time, and the latest acknowledgement time is used to indicate the latest time that the multicast originating device can accept when confirming that the observer server has obtained the multicast message.

可选地,多播消息中的最迟确认时间设置在标准COAP消息中的选项字段。在本实施例中,观察者服务器的数量可以是一个或复数个,观察者客户端的数量可以是一个或复数个,本发明对此不作限定,但值得注意的是,当观察者服务器的数量是为较大数量时(如上百个),由于每个观察者服务器只需向观察者客户端发送一次信令(即状态响应消息),无需分别向多播发起装置及观察者客户端发送两次信令,因此可以极大地节约信令传输带宽以及观察者服务器本身的功耗。Optionally, the latest acknowledgement time in the multicast message is set in the option field in the standard COAP message. In this embodiment, the number of observer servers may be one or plural, and the number of observer clients may be one or plural. The present invention does not limit this, but it is worth noting that when the number of observer servers is For a larger number (such as hundreds), since each observer server only needs to send a signaling (ie, a status response message) to the observer client, it does not need to send the multicast initiator and the observer client twice separately. Signaling, therefore, can greatly save the signaling transmission bandwidth and the power consumption of the observer server itself.

在接收到多播发送装置发送的多播消息之后,观察者服务器只需发送状态改变消息至观察者客户端,并由观察者客户端发送响应消息至多播发送装置进行确认,由于观察者服务器无需分别向多播发送装置发送响应消息,并向观察者客户端发送状态改变消息,因此可减小信令开销,降低观察者服务器的负荷。After receiving the multicast message sent by the multicast transmitting device, the observer server only needs to send a status change message to the observer client, and the observer client sends a response message to the multicast transmitting device for confirmation, since the observer server does not need to The response message is respectively sent to the multicast transmitting apparatus, and the status change message is sent to the observer client, so that the signaling overhead can be reduced and the load of the observer server can be reduced.

以下请参见图12,图12是本发明观察者服务器第一实施例的结构示意图,如图12所示,本发明的观察者服务器20包括:Referring to FIG. 12, FIG. 12 is a schematic structural diagram of a first embodiment of an observer server according to the present invention. As shown in FIG. 12, the observer server 20 of the present invention includes:

第二接收模块204,用于接收多播发起装置发送的多播消息,其中多播消息包括多播发起装置的网络地址和针对观察者服务器的资源的操作指令;The second receiving module 204 is configured to receive a multicast message sent by the multicast originating device, where the multicast message includes a network address of the multicast originating device and an operation instruction for a resource of the observer server;

资源处理模块202,用于根据操作指令更新资源的当前状态;The resource processing module 202 is configured to update a current state of the resource according to the operation instruction;

状态改变消息产生模块201,用于产生状态改变消息,其中状态改变消息包括多播发起装置的网络地址和资源更新后的当前状态;The state change message generating module 201 is configured to generate a state change message, where the state change message includes a network address of the multicast originating device and a current state after the resource is updated;

第二发送模块203,用于用于发送状态改变消息至观察者客户端,状态改变消息包括多播发起装置的网络地址和资源更新后的当前状态。The second sending module 203 is configured to send a status change message to the observer client, where the status change message includes a network address of the multicast originating device and a current status after the resource is updated.

可选地,状态改变消息中的多播发起装置的网络地址设置在标准COAP消息中的选项字段。Optionally, the network address of the multicast originating device in the status change message is set in an option field in a standard COAP message.

在第五方面的第二种可能的实现方式中,多播消息和状态改变消息还包括最迟确认时间,最迟确认时间用于表示多播发起装置在确认观察者服务器获取到多播消息时可以接受的最迟时间。In a second possible implementation manner of the fifth aspect, the multicast message and the state change message further include a latest acknowledgement time, where the latest acknowledgement time is used to indicate that the multicast originating device confirms that the observer server obtains the multicast message The latest time that can be accepted.

结合第五方面的第二种可能的实现方式,在第三种可能的实现方式中,多播消息和状态改变消息中的最迟确认时间设置在标准COAP消息中的选项字段。在本实施例中,观察者服务器的数量可以是一个或复数个,观察者客户端的数量可以是一个或复数个,本发明对此不作限定,但值得注意的是,当观察者服务器的数量是复数个时,由于每个观察者服务器只需向观察者客户端发送一次信令(即状态响应消息),无需分别向多播发起装置及观察者客户端发送两次信令,因此可以极大地节约信令传输带宽以及观察者服务器本身的功耗。In conjunction with the second possible implementation of the fifth aspect, in a third possible implementation, the latest acknowledgement time in the multicast message and the state change message is set in an option field in the standard COAP message. In this embodiment, the number of observer servers may be one or plural, and the number of observer clients may be one or plural. The present invention does not limit this, but it is worth noting that when the number of observer servers is In the plural, since each observer server only needs to send a signaling (ie, a status response message) to the observer client, it is not necessary to separately send the signaling to the multicast initiator and the observer client twice, so Save signaling bandwidth and power consumption of the observer server itself.

在接收到多播发送装置发送的多播消息之后,观察者服务器只需发送状态改变消息至观察者客户端,并由观察者客户端发送响应消息至多播发送装置进行确认,由于观察者服务器无需分别向多播发送装置发送响应消息,并向观察者客户端发送状态改变消息,因此可减小信令开销,降低观察者服务器的负荷。After receiving the multicast message sent by the multicast transmitting device, the observer server only needs to send a status change message to the observer client, and the observer client sends a response message to the multicast transmitting device for confirmation, since the observer server does not need to The response message is respectively sent to the multicast transmitting apparatus, and the status change message is sent to the observer client, so that the signaling overhead can be reduced and the load of the observer server can be reduced.

以下请参见图13,图13是本发明观察者服务器第一实施例的结构示意图,如图12所示,本发明的观察者客户端30包括:Referring to FIG. 13, FIG. 13 is a schematic structural diagram of a first embodiment of an observer server according to the present invention. As shown in FIG. 12, the viewer client 30 of the present invention includes:

标识获取模块301,用于获取观察者服务器的标识;An identifier obtaining module 301, configured to acquire an identifier of the observer server;

第三接收模块304,用于接收观察者服务器发送的状态改变消息,其中状态改变消息包括多播发起装置的网络地址和资源更新后的当前状态;The third receiving module 304 is configured to receive a state change message sent by the observer server, where the state change message includes a network address of the multicast originating device and a current state after the resource is updated;

第三发送模块303,用于根据多播发起装置的网络地址发送响应消息至多播发起装置,其中响应消息包括观察者服务器的标识,以使得多播发起装置从响应消息获取观察者服务器的标识以确认观察者服务器获取到多播消息。The third sending module 303 is configured to send a response message to the multicast originating device according to the network address of the multicast initiating device, where the response message includes an identifier of the observer server, so that the multicast initiating device acquires the identifier of the observer server from the response message. Confirm that the Observer server gets the multicast message.

可选地,观察者服务器的标识为观察者服务器的网络地址。Optionally, the identifier of the observer server is the network address of the observer server.

可选地,多播消息和状态改变消息还包括最迟确认时间,最迟确认时间用于表示多播发起装置在确认观察者服务器获取到多播消息时可以接受的最迟时间。Optionally, the multicast message and the status change message further include a latest acknowledgement time, and the latest acknowledgement time is used to indicate the latest time that the multicast originating device can accept when confirming that the observer server acquires the multicast message.

可选地,多播消息和状态改变消息中的最迟确认时间设置在标准COAP消息中的选项字段。Optionally, the latest acknowledgement time in the multicast message and the status change message is set in the option field in the standard COAP message.

可选地,第三发送模块在最迟确认时间之前根据多播发起装置的网络地址发送响应消息至多播发起装置。Optionally, the third sending module sends a response message to the multicast originating device according to the network address of the multicast originating device before the latest acknowledgement time.

可选地,响应消息中的观察者服务器的标识设置在标准COAP消息中的选项字段。Optionally, the identifier of the observer server in the response message is set in an option field in the standard COAP message.

可选地,第三发送模块303进一步用于在第三接收模块304接收观察者服务器发送的状态改变消息之前,向观察者服务器发送标准COAP查询消息,标准COAP查询消息包括要查询的资源对应的资源标识,以使得观察者服务器根据资源标识对资源进行订阅注册,查询资源的当前状态,并发送标准COAP响应消息至观察者客户端30,其中标准COAP响应消息包括资源的当前状态;第三接收模块304进一步用于接收标准COAP响应消息。 Optionally, the third sending module 303 is further configured to send a standard COAP query message to the observer server before the third receiving module 304 receives the state change message sent by the observer server, where the standard COAP query message includes the resource to be queried. The resource identifier is such that the observer server subscribes to the resource according to the resource identifier, queries the current state of the resource, and sends a standard COAP response message to the observer client 30, wherein the standard COAP response message includes the current state of the resource; Module 304 is further for receiving a standard COAP response message.

在本实施例中,观察者服务器的数量可以是一个或复数个,观察者客户端的数量可以是一个或复数个,本发明对此不作限定,但值得注意的是,当观察者服务器的数量是复数个时,由于每个观察者服务器只需向观察者客户端发送一次信令(即状态响应消息),无需分别向多播发起装置及观察者客户端发送两次信令,因此可以极大地节约信令传输带宽以及观察者服务器本身的功耗。In this embodiment, the number of observer servers may be one or plural, and the number of observer clients may be one or plural. The present invention does not limit this, but it is worth noting that when the number of observer servers is In the plural, since each observer server only needs to send a signaling (ie, a status response message) to the observer client, it is not necessary to separately send the signaling to the multicast initiator and the observer client twice, so Save signaling bandwidth and power consumption of the observer server itself.

在接收到多播发送装置发送的多播消息之后,观察者服务器只需发送状态改变消息至观察者客户端,并由观察者客户端发送响应消息至多播发送装置进行确认,由于观察者服务器无需分别向多播发送装置发送响应消息,并向观察者客户端发送状态改变消息,因此可减小信令开销,降低观察者服务器的负荷。After receiving the multicast message sent by the multicast transmitting device, the observer server only needs to send a status change message to the observer client, and the observer client sends a response message to the multicast transmitting device for confirmation, since the observer server does not need to The response message is respectively sent to the multicast transmitting apparatus, and the status change message is sent to the observer client, so that the signaling overhead can be reduced and the load of the observer server can be reduced.

以下请参见图14,图14是本发明消息处理系统第二实施例的结构示意图,如图14所示,本发明的消息处理系统包括多播发起装置10、观察者服务器20以及观察者客户端,其中:Referring to FIG. 14, FIG. 14 is a schematic structural diagram of a second embodiment of a message processing system according to the present invention. As shown in FIG. 14, the message processing system of the present invention includes a multicast originating device 10, a viewer server 20, and an observer client. ,among them:

多播发起装置10,包括:The multicast initiating device 10 includes:

第一发送模块101,用于向观察者服务器20发送多播消息,多播消息包括多播发起装置10的网络地址和针对观察者服务器20的资源的操作指令;The first sending module 101 is configured to send a multicast message to the observer server 20, where the multicast message includes a network address of the multicast originating device 10 and an operation instruction for the resource of the observer server 20;

观察者服务器20,包括: The observer server 20 includes:

第二接收模块204,用于接收多播发起装置10发送的多播消息;The second receiving module 204 is configured to receive the multicast message sent by the multicast originating device 10;

资源处理模块202,用于根据操作指令对资源进行操作,以更新资源的当前状态;The resource processing module 202 is configured to operate on the resource according to the operation instruction to update the current state of the resource;

第二发送模块203,用于发送状态改变消息至观察者客户端,其中状态改变消息包括多播发起装置10的网络地址和资源更新后的当前状态;The second sending module 203 is configured to send a status change message to the observer client, where the status change message includes a network address of the multicast originating device 10 and a current status after the resource is updated;

观察者客户端30,包括:The observer client 30 includes:

标识获取模块301,用于获取观察者服务器20的标识; An identifier obtaining module 301, configured to acquire an identifier of the observer server 20;

第三接收模块304,用于接收观察者服务器20发送的状态改变消息;The third receiving module 304 is configured to receive a state change message sent by the observer server 20;

第三发送模块303,用于根据多播发起装置10的网络地址发送响应消息至多播发起装置10,其中响应消息包括观察者服务器20的标识; The third sending module 303 is configured to send a response message to the multicast initiating device 10 according to the network address of the multicast initiating device 10, where the response message includes an identifier of the observer server 20;

多播发送装置进一步包括第一接收模块102以及确认模块104,第一接收模块102用于接收响应消息,确认模块104用于从响应消息获取观察者服务器20的标识以确认观察者服务器20获取到多播消息。The multicast transmitting apparatus further includes a first receiving module 102 and a confirming module 104. The first receiving module 102 is configured to receive a response message, and the confirming module 104 is configured to acquire the identifier of the observer server 20 from the response message to confirm that the observer server 20 obtains Multicast message.

可选地,多播消息中的多播发起装置的网络地址设置在标准COAP消息中的选项字段;状态改变消息中的多播发起装置的网络地址设置在标准COAP消息中的选项字段;响应消息中的观察者服务器的标识设置在标准COAP消息中的选项字段。Optionally, the network address of the multicast originating device in the multicast message is set in an option field in the standard COAP message; the network address of the multicast originating device in the status change message is set in an option field in the standard COAP message; the response message The identity of the observer server in the setting is set in the option field in the standard COAP message.

可选地,在第一发送模块101向观察者服务器20发送多播消息之前,第三发送模块303,用于向观察者服务器20发送标准COAP查询消息,标准COAP查询消息包括要查询的资源对应的资源标识;资源处理模块202,用于根据资源标识对资源进行订阅注册,查询资源的当前状态;第二发送模块203,用于发送标准COAP响应消息至观察者客户端,其中标准COAP响应消息包括资源的当前状态。Optionally, before the first sending module 101 sends the multicast message to the observer server 20, the third sending module 303 is configured to send a standard COAP query message to the observer server 20, where the standard COAP query message includes the resource corresponding to the query. The resource identifier module 202 is configured to perform subscription registration on the resource according to the resource identifier, and query the current state of the resource. The second sending module 203 is configured to send a standard COAP response message to the observer client, where the standard COAP response message is sent. Includes the current state of the resource.

可选地,多播消息和状态改变消息还包括最迟确认时间,最迟确认时间用于表示多播发起装置在确认观察者服务器获取到多播消息时可以接受的最迟时间。Optionally, the multicast message and the status change message further include a latest acknowledgement time, and the latest acknowledgement time is used to indicate the latest time that the multicast originating device can accept when confirming that the observer server acquires the multicast message.

可选地,多播消息和状态改变消息中的最迟确认时间设置在标准COAP消息中的选项字段。 Optionally, the latest acknowledgement time in the multicast message and the status change message is set in the option field in the standard COAP message.

可选地,在第五种可能的实现方式中,第三发送模块在最迟确认时间之前根据多播发起装置的网络地址发送响应消息至多播发起装置。第三发送模块在最迟确认时间之后停止发送响应消息至多播发起装置,在超时的情况下停止发送响应消息,因此可以有效节约网络带宽,减少不必要的信息传输,从而提高系统传输效率。Optionally, in a fifth possible implementation manner, the third sending module sends a response message to the multicast originating device according to the network address of the multicast originating device before the latest acknowledgement time. The third sending module stops sending the response message to the multicast initiating device after the latest acknowledgement time, and stops sending the response message when the timeout occurs, thereby effectively saving network bandwidth and reducing unnecessary information transmission, thereby improving system transmission efficiency.

在本实施例中,仅示出观察者服务器和观察者客户端的数量为一个的情况,但,在本发明的备选实施例中,观察者服务器的数量可以是复数个,观察者客户端的数量可以是复数个,本发明对此不作限定,但值得注意的是,当观察者服务器的数量是复数个时,由于每个观察者服务器只需向观察者客户端发送一次信令(即状态响应消息),无需分别向多播发起装置及观察者客户端发送两次信令,因此可以极大地节约信令传输带宽以及观察者服务器本身的功耗。In the present embodiment, only the case where the number of observer servers and observer clients is one is shown, but in an alternative embodiment of the present invention, the number of observer servers may be plural, and the number of observer clients The present invention is not limited thereto, but it is worth noting that when the number of observer servers is plural, since each observer server only needs to send signaling to the observer client (ie, status response) The message) does not need to separately send signaling to the multicast originating device and the observer client, so that the signaling transmission bandwidth and the power consumption of the observer server itself can be greatly saved.

在接收到多播发送装置发送的多播消息之后,观察者服务器只需发送状态改变消息至观察者客户端,并由观察者客户端发送响应消息至多播发送装置进行确认,由于观察者服务器无需分别向多播发送装置发送响应消息,并向观察者客户端发送状态改变消息,因此可减小信令开销,降低观察者服务器的负荷。After receiving the multicast message sent by the multicast transmitting device, the observer server only needs to send a status change message to the observer client, and the observer client sends a response message to the multicast transmitting device for confirmation, since the observer server does not need to The response message is respectively sent to the multicast transmitting apparatus, and the status change message is sent to the observer client, so that the signaling overhead can be reduced and the load of the observer server can be reduced.

以下请参见图15,图15是本发明多播发起装置第二实施例的结构示意图,如图15所示,本发明的多播发起装置10包括网络接口111、存储器113、处理器112及总线114,网络接口111、存储器113及处理器112与总线114连接,其中:Referring to FIG. 15, FIG. 15 is a schematic structural diagram of a second embodiment of a multicast initiating apparatus according to the present invention. As shown in FIG. 15, the multicast initiating apparatus 10 of the present invention includes a network interface 111, a memory 113, a processor 112, and a bus. 114. The network interface 111, the memory 113, and the processor 112 are connected to the bus 114, wherein:

网络接口111,用于用于向观察者服务器发送多播消息,其中多播消息包括多播发起装置的网络地址和针对观察者服务器的资源的操作指令,以使得观察者服务器根据操作指令更新资源的当前状态,并向观察者客户端发送状态改变消息,状态改变消息包括多播发起装置的网络地址和资源更新后的当前状态;The network interface 111 is configured to send a multicast message to the observer server, where the multicast message includes a network address of the multicast originating device and an operation instruction for the resource of the observer server, so that the observer server updates the resource according to the operation instruction. a current state, and sending a state change message to the observer client, the state change message including a network address of the multicast originating device and a current state after the resource is updated;

网络接口11,进一步用于接收观察者客户端发送的响应消息,响应消息包括观察者服务器的标识,其中响应消息是观察者客户端在接收到观察者服务器发送的状态改变消息后发送的;The network interface 11 is further configured to receive a response message sent by the observer client, where the response message includes an identifier of the observer server, where the response message is sent by the observer client after receiving the state change message sent by the observer server;

存储器113用于存储程序,程序用于从响应消息获取观察者服务器的标识以确认观察者服务器获取到多播消息;The memory 113 is configured to store a program, and the program is configured to acquire an identifier of the observer server from the response message to confirm that the observer server acquires the multicast message;

处理器112用于运行程序。The processor 112 is used to run a program.

可选地,多播消息中的多播发起装置的网络地址设置在标准COAP消息中的选项字段。Optionally, the network address of the multicast originating device in the multicast message is set in an option field in a standard COAP message.

可选地,观察者服务器的标识为观察者服务器的网络地址。Optionally, the identifier of the observer server is the network address of the observer server.

可选地,多播消息和状态改变消息还包括最迟确认时间,最迟确认时间用于表示多播发起装置在确认观察者服务器获取到多播消息时可以接受的最迟时间。Optionally, the multicast message and the status change message further include a latest acknowledgement time, and the latest acknowledgement time is used to indicate the latest time that the multicast originating device can accept when confirming that the observer server acquires the multicast message.

可选地,多播消息中的最迟确认时间设置在标准COAP消息中的选项字段。在本实施例中,观察者服务器的数量可以是一个或复数个,观察者客户端的数量可以是一个或复数个,本发明对此不作限定,但值得注意的是,当观察者服务器的数量是数目较大时,由于每个观察者服务器只需向观察者客户端发送一次信令(即状态响应消息),无需分别向多播发起装置及观察者客户端发送两次信令,因此可以极大地节约信令传输带宽以及观察者服务器本身的功耗。Optionally, the latest acknowledgement time in the multicast message is set in the option field in the standard COAP message. In this embodiment, the number of observer servers may be one or plural, and the number of observer clients may be one or plural. The present invention does not limit this, but it is worth noting that when the number of observer servers is When the number is large, since each observer server only needs to send signaling (ie, status response message) to the observer client, it is not necessary to separately send signaling to the multicast initiator and the observer client, so The earth saves signaling transmission bandwidth and the power consumption of the observer server itself.

在接收到多播发送装置发送的多播消息之后,观察者服务器只需发送状态改变消息至观察者客户端,并由观察者客户端发送响应消息至多播发送装置进行确认,由于观察者服务器无需分别向多播发送装置发送响应消息,并向观察者客户端发送状态改变消息,因此可减小信令开销,降低观察者服务器的负荷。After receiving the multicast message sent by the multicast transmitting device, the observer server only needs to send a status change message to the observer client, and the observer client sends a response message to the multicast transmitting device for confirmation, since the observer server does not need to The response message is respectively sent to the multicast transmitting apparatus, and the status change message is sent to the observer client, so that the signaling overhead can be reduced and the load of the observer server can be reduced.

以下请参见图16,图16是本发明观察者服务器第二实施例的结构示意图,如图16所示,本发明的观察者服务器20包括网络接口211、存储器213、处理器212以及总线214,网络接口211、存储器213以及处理器212与总线214连接,其中:Referring to FIG. 16, FIG. 16 is a schematic structural diagram of a second embodiment of an observer server according to the present invention. As shown in FIG. 16, the viewer server 20 of the present invention includes a network interface 211, a memory 213, a processor 212, and a bus 214. Network interface 211, memory 213, and processor 212 are coupled to bus 214, where:

网络接口211,用于接收多播发起装置10发送的多播消息,其中多播消息包括多播发起装置10的网络地址和针对观察者服务器20的资源的操作指令;The network interface 211 is configured to receive the multicast message sent by the multicast originating device 10, where the multicast message includes a network address of the multicast originating device 10 and an operation instruction for the resource of the observer server 20;

存储器213,存储有程序,程序用于根据操作指令更新资源的当前状态;The memory 213 stores a program for updating a current state of the resource according to the operation instruction;

处理器212,用于运行程序;a processor 212, configured to run a program;

网络接口211,用于发送状态改变消息至观察者客户端,状态改变消息包括多播发起装置的网络地址和资源更新后的当前状态。The network interface 211 is configured to send a status change message to the observer client, where the status change message includes a network address of the multicast originating device and a current status after the resource is updated.

可选地,状态改变消息中的多播发起装置的网络地址设置在标准COAP消息中的选项字段。Optionally, the network address of the multicast originating device in the status change message is set in an option field in a standard COAP message.

可选地,多播消息和状态改变消息还包括最迟确认时间,最迟确认时间用于表示多播发起装置在确认观察者服务器获取到多播消息时可以接受的最迟时间。Optionally, the multicast message and the status change message further include a latest acknowledgement time, and the latest acknowledgement time is used to indicate the latest time that the multicast originating device can accept when confirming that the observer server acquires the multicast message.

可选地,多播消息和状态改变消息中的最迟确认时间设置在标准COAP消息中的选项字段。在本实施例中,由于每个观察者服务器20只需向观察者客户端发送一次信令(即状态响应消息),无需分别向多播发起装置及观察者客户端发送两次信令,因此可以极大地节约信令传输带宽以及观察者服务器本身的功耗。Optionally, the latest acknowledgement time in the multicast message and the status change message is set in the option field in the standard COAP message. In this embodiment, since each observer server 20 only needs to send signaling (ie, status response message) to the observer client, it is not necessary to separately send signaling to the multicast originating device and the observer client, respectively. The signaling transmission bandwidth and the power consumption of the observer server itself can be greatly saved.

在接收到多播发送装置发送的多播消息之后,观察者服务器只需发送状态改变消息至观察者客户端,并由观察者客户端发送响应消息至多播发送装置进行确认,由于观察者服务器无需分别向多播发送装置发送响应消息,并向观察者客户端发送状态改变消息,因此可减小信令开销,降低观察者服务器的负荷。After receiving the multicast message sent by the multicast transmitting device, the observer server only needs to send a status change message to the observer client, and the observer client sends a response message to the multicast transmitting device for confirmation, since the observer server does not need to The response message is respectively sent to the multicast transmitting apparatus, and the status change message is sent to the observer client, so that the signaling overhead can be reduced and the load of the observer server can be reduced.

以下请参见图17,图17是本发明观察者客户端第二实施例的结构示意图,如图17所示,本发明的观察者客户端30包括处理器312、存储器313、网络接口311以及总线314,存储器313和网络接口311分别与总线314连接,其中:Referring to FIG. 17, FIG. 17 is a schematic structural diagram of a second embodiment of an observer client according to the present invention. As shown in FIG. 17, the viewer client 30 of the present invention includes a processor 312, a memory 313, a network interface 311, and a bus. 314, the memory 313 and the network interface 311 are respectively connected to the bus 314, wherein:

存储器313,用于存储程序,程序用于获取观察者服务器的标识;a memory 313, configured to store a program, where the program is used to obtain an identifier of the observer server;

处理器312运行程序;The processor 312 runs the program;

网络接口311,用于接收观察者服务器发送的状态改变消息,其中状态改变消息包括多播发起装置的网络地址和资源更新后的当前状态;The network interface 311 is configured to receive a state change message sent by the observer server, where the state change message includes a network address of the multicast originating device and a current state after the resource is updated;

网络接口311,进一步用于根据多播发起装置的网络地址发送响应消息至多播发起装置,其中响应消息包括观察者服务器的标识,以使得多播发起装置从响应消息获取观察者服务器的标识以确认观察者服务器获取到多播消息。The network interface 311 is further configured to send a response message to the multicast originating device according to the network address of the multicast originating device, where the response message includes an identifier of the observer server, so that the multicast initiating device acquires the identifier of the observer server from the response message to confirm The observer server gets the multicast message.

可选地,观察者服务器的标识为观察者服务器的网络地址。Optionally, the identifier of the observer server is the network address of the observer server.

可选地,多播消息和状态改变消息还包括最迟确认时间,最迟确认时间用于表示多播发起装置在确认观察者服务器获取到多播消息时可以接受的最迟时间。Optionally, the multicast message and the status change message further include a latest acknowledgement time, and the latest acknowledgement time is used to indicate the latest time that the multicast originating device can accept when confirming that the observer server acquires the multicast message.

可选地,多播消息和状态改变消息中的最迟确认时间设置在标准COAP消息中的选项字段。Optionally, the latest acknowledgement time in the multicast message and the status change message is set in the option field in the standard COAP message.

可选地,第三发送模块在最迟确认时间之前根据多播发起装置的网络地址发送响应消息至多播发起装置。Optionally, the third sending module sends a response message to the multicast originating device according to the network address of the multicast originating device before the latest acknowledgement time.

可选地,响应消息中的观察者服务器的标识设置在标准COAP消息中的选项字段。Optionally, the identifier of the observer server in the response message is set in an option field in the standard COAP message.

可选地,网络接口311进一步用于在接收观察者服务器发送的状态改变消息之前,向观察者服务器发送标准COAP查询消息,标准COAP查询消息包括要查询的资源对应的资源标识,以使得观察者服务器根据资源标识对资源进行订阅注册,查询资源的当前状态,并发送标准COAP响应消息至观察者客户端,其中标准COAP响应消息包括资源的当前状态;网络接口311进一步用于接收标准COAP响应消息。观察者客户端30在接收到标准COAP响应消息之后,与观察者服务器建立观察者模式关系。Optionally, the network interface 311 is further configured to send a standard COAP query message to the observer server before receiving the state change message sent by the observer server, where the standard COAP query message includes the resource identifier corresponding to the resource to be queried, so that the observer The server subscribes to the resource according to the resource identifier, queries the current state of the resource, and sends a standard COAP response message to the observer client, where the standard COAP response message includes the current state of the resource; the network interface 311 is further configured to receive the standard COAP response message. . Observer client 30 establishes an observer mode relationship with the observer server after receiving the standard COAP response message.

在本实施例中,观察者服务器的数量可以是一个或复数个,观察者客户端的数量可以是一个或复数个,本发明对此不作限定,但值得注意的是,当观察者服务器的数量较大时,由于每个观察者服务器只需向观察者客户端发送一次信令(即状态响应消息),无需分别向多播发起装置及观察者客户端发送两次信令,因此可以极大地节约信令传输带宽以及观察者服务器本身的功耗。In this embodiment, the number of the observer servers may be one or plural, and the number of the observer clients may be one or plural. The present invention does not limit this, but it is worth noting that when the number of observer servers is compared In large cases, since each observer server only needs to send a signaling (ie, a status response message) to the observer client, it is not necessary to separately send signaling to the multicast originating device and the observer client, thereby greatly saving Signaling transmission bandwidth and power consumption of the observer server itself.

在接收到多播发送装置发送的多播消息之后,观察者服务器只需发送状态改变消息至观察者客户端,并由观察者客户端发送响应消息至多播发送装置进行确认,由于观察者服务器无需分别向多播发送装置发送响应消息,并向观察者客户端发送状态改变消息,因此可减小信令开销,降低观察者服务器的负荷。After receiving the multicast message sent by the multicast transmitting device, the observer server only needs to send a status change message to the observer client, and the observer client sends a response message to the multicast transmitting device for confirmation, since the observer server does not need to The response message is respectively sent to the multicast transmitting apparatus, and the status change message is sent to the observer client, so that the signaling overhead can be reduced and the load of the observer server can be reduced.

本发明进一步提供一种消息处理系统,其包括图15至图17所述的多播发起装置、观察者客户端以及观察者服务器。The present invention further provides a message processing system including the multicast originating device, the viewer client, and the observer server described in FIGS. 15-17.

在本申请所提供的几个实施方式中,应该理解到,所揭露的装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例实施方式仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided by the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners. For example, the foregoing embodiment of the device embodiment is merely illustrative. For example, the division of the module or unit is only a logical function division, and the actual implementation may have another division manner, such as multiple units or Components can be combined or integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.

所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例实施方式方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the objectives of the embodiments of the present embodiment.

另外,在本申请各个实施例实施方式中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in the embodiments of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.

所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器(processor)执行本申请各个实施例实施方式所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。The integrated unit, if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application, in essence or the contribution to the prior art, or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium. The instructions include a plurality of instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor to perform all or part of the steps of the methods described in the various embodiments of the present application. The foregoing storage medium includes: a U disk, a mobile hard disk, a read only memory (ROM, Read-Only) Memory, random access memory (RAM), disk or optical disk, and other media that can store program code.

以上所述仅为本发明的实施例,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。The above is only the embodiment of the present invention, and is not intended to limit the scope of the invention, and the equivalent structure or equivalent process transformation of the present invention and the contents of the drawings may be directly or indirectly applied to other related technologies. The fields are all included in the scope of patent protection of the present invention.

Claims (55)

一种消息处理方法,其特征在于,包括:A message processing method, comprising: 多播发起装置向观察者服务器发送多播消息,其中所述多播消息包括所述多播发起装置的网络地址和针对观察者服务器的资源的操作指令,以使得所述观察者服务器根据所述操作指令更新所述资源的当前状态,并向观察者客户端发送状态改变消息,所述状态改变消息包括所述多播发起装置的网络地址和所述资源更新后的当前状态;The multicast originating device transmits a multicast message to the observer server, wherein the multicast message includes a network address of the multicast originating device and an operation instruction for a resource of the observer server, such that the observer server is configured according to the The operation instruction updates a current state of the resource, and sends a state change message to the observer client, where the state change message includes a network address of the multicast originating device and a current state after the resource is updated; 所述多播发起装置接收所述观察者客户端发送的响应消息,所述响应消息包括所述观察者服务器的标识,其中所述响应消息是所述观察者客户端在接收到所述观察者服务器发送的所述状态改变消息后发送的;The multicast originating device receives a response message sent by the observer client, the response message including an identifier of the observer server, wherein the response message is that the observer client is receiving the observer Transmitted after the status change message sent by the server; 所述多播发起装置从所述响应消息获取所述观察者服务器的标识以确认所述观察者服务器获取到所述多播消息。The multicast originating device acquires an identifier of the observer server from the response message to confirm that the observer server acquires the multicast message. 根据权利要求1所述的方法,其特征在于,所述多播消息中的所述多播发起装置的网络地址设置在标准COAP消息中的选项字段。The method according to claim 1, wherein the network address of the multicast originating device in the multicast message is set in an option field in a standard COAP message. 根据权利要求1所述的方法,其特征在于,所述观察者服务器的标识为所述观察者服务器的网络地址。 The method of claim 1 wherein the identity of the observer server is a network address of the observer server. 根据权利要求1所述的方法,其特征在于,所述多播消息和所述状态改变消息还包括最迟确认时间,所述最迟确认时间用于表示所述多播发起装置在确认所述观察者服务器获取到所述多播消息时可以接受的最迟时间。The method of claim 1, wherein the multicast message and the status change message further comprise a latest acknowledgement time, the latest acknowledgement time being used to indicate that the multicast originating device is acknowledging the The latest time that the observer server can accept when the multicast message is obtained. 根据权利要求4所述的方法,其特征在于,所述多播消息中的最迟确认时间设置在标准COAP消息中的选项字段。The method of claim 4 wherein the latest acknowledgement time in the multicast message is set in an option field in a standard COAP message. 一种消息处理方法,其特征在于,包括:A message processing method, comprising: 观察者服务器接收多播发起装置发送的多播消息,其中所述多播消息包括所述多播发起装置的网络地址和针对所述观察者服务器的资源的操作指令;The observer server receives the multicast message sent by the multicast originating device, wherein the multicast message includes a network address of the multicast originating device and an operation instruction for a resource of the observer server; 所述观察者服务器根据所述操作指令更新所述资源的当前状态;The observer server updates a current state of the resource according to the operation instruction; 所述观察者服务器发送状态改变消息至所述观察者客户端,所述状态改变消息包括所述多播发起装置的网络地址和所述资源更新后的当前状态。The observer server sends a status change message to the observer client, the status change message including a network address of the multicast originating device and a current status after the resource is updated. 根据权利要求6所述的方法,其特征在于,所述状态改变消息中的所述多播发起装置的网络地址设置在标准COAP消息中的选项字段。The method of claim 6, wherein the network address of the multicast originating device in the status change message is set in an option field in a standard COAP message. 根据权利要求6所述的方法,其特征在于,所述多播消息和所述状态改变消息还包括最迟确认时间,所述最迟确认时间用于表示所述多播发起装置在确认所述观察者服务器获取到所述多播消息时可以接受的最迟时间。The method of claim 6, wherein the multicast message and the status change message further comprise a latest acknowledgement time, the latest acknowledgement time being used to indicate that the multicast originating device is acknowledging the The latest time that the observer server can accept when the multicast message is obtained. 根据权利要求8所述的方法,其特征在于,所述多播消息和所述状态改变消息中的所述最迟确认时间设置在标准COAP消息中的选项字段。 The method of claim 8, wherein the latest acknowledgement time in the multicast message and the status change message is set in an option field in a standard COAP message. 一种消息处理方法,其特征在于,包括:A message processing method, comprising: 观察者客户端获取观察者服务器的标识;The observer client obtains the identity of the observer server; 所述观察者客户端接收所述观察者服务器发送的状态改变消息,其中所述状态改变消息包括所述多播发起装置的网络地址和所述观察者服务器的资源更新后的当前状态;Receiving, by the observer client, a status change message sent by the observer server, where the status change message includes a network address of the multicast originating device and a current status of the resource of the observer server after updating; 所述观察者客户端根据所述多播发起装置的网络地址发送响应消息至多播发起装置,其中所述响应消息包括所述观察者服务器的标识,以使得所述多播发起装置从所述响应消息获取所述观察者服务器的标识以确认所述观察者服务器获取到多播消息。The observer client sends a response message to the multicast originating device according to the network address of the multicast originating device, wherein the response message includes an identifier of the observer server such that the multicast originating device receives the response The message acquires the identity of the observer server to confirm that the observer server obtained the multicast message. 根据权利要求10所述的方法,其特征在于,所述观察者服务器的标识为所述观察者服务器的网络地址。The method of claim 10 wherein the identity of the observer server is a network address of the observer server. 根据权利要求10所述的方法,其特征在于,所述多播消息和所述状态改变消息还包括最迟确认时间,所述最迟确认时间用于表示所述多播发起装置在确认所述观察者服务器获取到所述多播消息时可以接受的最迟时间。The method of claim 10, wherein the multicast message and the status change message further comprise a latest acknowledgement time, the latest acknowledgement time being used to indicate that the multicast originating device is acknowledging the The latest time that the observer server can accept when the multicast message is obtained. 根据权利要求12所述的方法,其特征在于,所述多播消息和所述状态改变消息中的所述最迟确认时间设置在标准COAP消息中的选项字段。The method of claim 12, wherein the latest acknowledgement time in the multicast message and the state change message is set in an option field in a standard COAP message. 根据权利要求12所述的方法,其特征在于,所述观察者客户端在所述最迟确认时间之前根据所述多播发起装置的网络地址发送所述响应消息至所述多播发起装置。The method of claim 12 wherein said observer client transmits said response message to said multicast originating device in accordance with a network address of said multicast originating device prior to said latest acknowledgement time. 根据权利要求10所述的消息处理方法,其特征在于,所述响应消息中的所述观察者服务器的标识设置在标准COAP消息中的选项字段。The message processing method according to claim 10, wherein the identifier of the observer server in the response message is set in an option field in a standard COAP message. 根据权利要求10所述的方法,其特征在于,在所述观察者客户端接收观察者服务器发送的状态改变消息之前,所述方法进一步包括:The method of claim 10, wherein before the observer client receives the status change message sent by the observer server, the method further comprises: 所述观察者客户端与观察者服务器建立观察者模式关系,其中所述观察者客户端与观察者服务器建立观察者模式关系包括:The observer client establishes an observer mode relationship with the observer server, wherein the observer client establishes an observer mode relationship with the observer server, including: 所述观察者客户端向所述观察者服务器发送标准COAP查询消息,所述标准COAP查询消息包括要查询的资源对应的资源标识,以使得所述观察者服务器根据所述资源标识对所述资源进行订阅注册,查询所述资源的当前状态,并发送标准COAP响应消息至所述观察者客户端,其中所述标准COAP响应消息包括所述资源的当前状态。The observer client sends a standard COAP query message to the observer server, where the standard COAP query message includes a resource identifier corresponding to the resource to be queried, so that the observer server pairs the resource according to the resource identifier. A subscription registration is made, the current state of the resource is queried, and a standard COAP response message is sent to the observer client, wherein the standard COAP response message includes the current state of the resource. 一种多播发起装置,其特征在于,包括:A multicast initiating device, comprising: 第一发送模块,用于向观察者服务器发送多播消息,其中所述多播消息包括所述多播发起装置的网络地址和针对所述观察者服务器的资源的操作指令,以使得所述观察者服务器根据所述操作指令更新所述资源的当前状态,并向观察者客户端发送状态改变消息,所述状态改变消息包括所述多播发起装置的网络地址和所述资源更新后的当前状态;a first sending module, configured to send a multicast message to an observer server, where the multicast message includes a network address of the multicast originating device and an operation instruction for a resource of the observer server, so that the observation The server updates the current state of the resource according to the operation instruction, and sends a state change message to the observer client, where the state change message includes a network address of the multicast originating device and a current state after the resource is updated. ; 第一接收模块,用于接收所述观察者客户端发送的响应消息,所述响应消息包括所述观察者服务器的标识,其中所述响应消息是所述观察者客户端在接收到所述观察者服务器发送的所述状态改变消息后发送的;a first receiving module, configured to receive a response message sent by the observer client, where the response message includes an identifier of the observer server, where the response message is that the observer client receives the observation Sent by the server after the status change message is sent; 确认模块,用于从所述响应消息获取所述观察者服务器的标识以确认所述观察者服务器获取到所述多播消息。 And an acknowledgment module, configured to obtain an identifier of the observer server from the response message to confirm that the observer server acquires the multicast message. 根据权利要求17所述的多播发起装置,其特征在于,所述多播消息中的多播发起装置的网络地址设置在标准COAP消息中的选项字段。The multicast originating apparatus according to claim 17, wherein a network address of the multicast originating apparatus in the multicast message is set in an option field in a standard COAP message. 根据权利要求17所述的多播发起装置,其特征在于,所述观察者服务器的标识为所述观察者服务器的网络地址。The multicast originating apparatus according to claim 17, wherein the identifier of the observer server is a network address of the observer server. 根据权利要求17所述的多播发起装置,其特征在于,所述多播消息还和所述状态改变消息包括最迟确认时间,所述最迟确认时间用于表示所述多播发起装置在确认所述观察者服务器获取到所述多播消息时可以接受的最迟时间。The multicast originating apparatus according to claim 17, wherein said multicast message and said status change message comprise a latest acknowledgement time, said latest acknowledgement time being used to indicate that said multicast originating device is The latest time that the observer server can accept when the multicast message is obtained is confirmed. 根据权利要求20所述的多播发起装置,其特征在于,所述多播消息中的最迟确认时间设置在标准COAP消息中的选项字段。The multicast originating apparatus according to claim 20, wherein a latest acknowledgement time in said multicast message is set in an option field in a standard COAP message. 一种观察者服务器,其特征在于,包括:An observer server, comprising: 第二接收模块,用于接收多播发起装置发送的多播消息,其中所述多播消息包括所述多播发起装置的网络地址和针对观察者服务器的资源的操作指令;a second receiving module, configured to receive a multicast message sent by the multicast originating device, where the multicast message includes a network address of the multicast originating device and an operation instruction for a resource of the observer server; 资源处理模块,用于根据所述操作指令更新所述资源的当前状态;a resource processing module, configured to update a current state of the resource according to the operation instruction; 第二发送模块,用于发送状态改变消息至所述观察者客户端,所述状态改变消息包括所述多播发起装置的网络地址和所述资源更新后的当前状态。And a second sending module, configured to send a status change message to the observer client, where the status change message includes a network address of the multicast originating device and a current status after the resource is updated. 根据权利要求22所述的观察者服务器,其特征在于,所述状态改变消息中的所述多播发起装置的网络地址设置在标准COAP消息中的选项字段。The observer server of claim 22, wherein the network address of the multicast originating device in the status change message is set in an option field in a standard COAP message. 根据权利要求22所述的观察者服务器,其特征在于,所述多播消息和所述状态改变消息还包括最迟确认时间,所述最迟确认时间用于表示所述多播发起装置在确认所述观察者服务器获取到所述多播消息时可以接受的最迟时间。The observer server according to claim 22, wherein said multicast message and said status change message further comprise a latest acknowledgement time, said latest acknowledgement time being used to indicate that said multicast originating device is confirming The latest time that the observer server can accept when the multicast message is obtained. 根据权利要求24所述的观察者服务器,其特征在于,所述多播消息和所述状态改变消息中的所述最迟确认时间设置在标准COAP消息中的选项字段。The observer server according to claim 24, wherein said latest acknowledgement time in said multicast message and said state change message is set in an option field in a standard COAP message. 一种观察者客户端,其特征在于,包括:An observer client, comprising: 标识获取模块,用于获取所述观察者服务器的标识;An identifier obtaining module, configured to acquire an identifier of the observer server; 第三接收模块,用于接收所述观察者服务器发送的状态改变消息,其中所述状态改变消息包括所述多播发起装置的网络地址和所述资源更新后的当前状态;a third receiving module, configured to receive a state change message sent by the observer server, where the state change message includes a network address of the multicast originating device and a current state after the resource is updated; 第三发送模块,用于根据所述多播发起装置的网络地址发送响应消息至多播发起装置,其中所述响应消息包括所述观察者服务器的标识,以使得所述多播发起装置从所述响应消息获取所述观察者服务器的标识以确认所述观察者服务器获取到多播消息。a third sending module, configured to send a response message to the multicast originating device according to the network address of the multicast initiating device, where the response message includes an identifier of the observer server, so that the multicast initiating device is from the The response message acquires the identity of the observer server to confirm that the observer server acquires the multicast message. 根据权利要求26所述的观察者客户端,其特征在于,所述观察者服务器的标识为所述观察者服务器的网络地址。The viewer client of claim 26 wherein the identity of the viewer server is a network address of the observer server. 根据权利要求26所述的观察者客户端,其特征在于,所述多播消息和所述状态改变消息还包括最迟确认时间,所述最迟确认时间用于表示所述多播发起装置在确认所述观察者服务器获取到所述多播消息时可以接受的最迟时间。The viewer client of claim 26, wherein said multicast message and said status change message further comprise a latest acknowledgement time, said latest acknowledgement time being used to indicate that said multicast originating device is The latest time that the observer server can accept when the multicast message is obtained is confirmed. 根据权利要求28所述的观察者客户端,其特征在于,所述多播消息和所述状态改变消息中的所述最迟确认时间设置在标准COAP消息中的选项字段。The viewer client of claim 28, wherein said latest acknowledgement time in said multicast message and said state change message is set in an option field in a standard COAP message. 根据权利要求28所述的观察者客户端,其特征在于,所述第三发送模块在所述最迟确认时间之前根据所述多播发起装置的网络地址发送所述响应消息至所述多播发起装置。The observer client according to claim 28, wherein said third transmitting module transmits said response message to said multicast according to a network address of said multicast originating device before said latest acknowledgement time Initiate the device. 根据权利要求26所述的观察者客户端,其特征在于,所述响应消息中的所述观察者服务器的标识设置在标准COAP消息中的选项字段。The viewer client of claim 26, wherein the identity of the observer server in the response message is set in an option field in a standard COAP message. 根据权利要求26所述的观察者客户端,其特征在于,所述第三发送模块进一步用于在所述第三接收模块接收观察者服务器发送的状态改变消息之前,向所述观察者服务器发送标准COAP查询消息,所述标准COAP查询消息包括要查询的资源对应的资源标识,以使得所述观察者服务器根据所述资源标识对所述资源进行订阅注册,查询所述资源的当前状态,并发送标准COAP响应消息至所述观察者客户端,其中所述标准COAP响应消息包括所述资源的当前状态;The viewer client according to claim 26, wherein said third transmitting module is further configured to send to said observer server before said third receiving module receives a state change message sent by the observer server a standard COAP query message, where the standard COAP query message includes a resource identifier corresponding to the resource to be queried, so that the observer server performs subscription registration on the resource according to the resource identifier, and queries the current state of the resource, and Transmitting a standard COAP response message to the observer client, wherein the standard COAP response message includes a current state of the resource; 所述第三接收模块进一步用于接收所述标准COAP响应消息。The third receiving module is further configured to receive the standard COAP response message. 一种消息处理系统,其特征在于,包括:A message processing system, comprising: 多播发起装置,包括:Multicast originating device, including: 第一发送模块,用于向观察者服务器发送多播消息,所述多播消息包括所述多播发起装置的网络地址和针对所述观察者服务器的资源的操作指令;a first sending module, configured to send a multicast message to the observer server, where the multicast message includes a network address of the multicast originating device and an operation instruction for a resource of the observer server; 观察者服务器,包括: Observer server, including: 第二接收模块,用于接收所述多播发起装置发送的多播消息;a second receiving module, configured to receive a multicast message sent by the multicast originating device; 资源处理模块,用于根据所述操作指令更新所述资源的当前状态;a resource processing module, configured to update a current state of the resource according to the operation instruction; 第二发送模块,用于发送状态改变消息至所述观察者客户端,其中所述状态改变消息包括所述多播发起装置的网络地址和所述资源更新后的当前状态;a second sending module, configured to send a status change message to the observer client, where the status change message includes a network address of the multicast originating device and a current status after the resource is updated; 观察者客户端,包括:Observer client, including: 标识获取模块,用于获取所述观察者服务器的标识; An identifier obtaining module, configured to acquire an identifier of the observer server; 第三接收模块,用于接收所述观察者服务器发送的状态改变消息;a third receiving module, configured to receive a status change message sent by the observer server; 第三发送模块,用于根据所述多播发起装置的网络地址发送响应消息至多播发起装置,其中所述响应消息包括所述观察者服务器的标识;a third sending module, configured to send a response message to the multicast originating device according to the network address of the multicast initiating device, where the response message includes an identifier of the observer server; 所述多播发送装置进一步包括第一接收模块以及确认模块,所述第一接收模块用于接收所述响应消息,所述确认模块用于从所述响应消息获取所述观察者服务器的标识以确认所述观察者服务器获取到所述多播消息。The multicast sending apparatus further includes a first receiving module, configured to receive the response message, and a confirming module, where the confirming module is configured to acquire an identifier of the observer server from the response message. Confirming that the observer server acquires the multicast message. 根据权利要求33所述的系统,其特征在于,The system of claim 33, wherein 所述多播消息中的所述多播发起装置的网络地址设置在标准COAP消息中的选项字段;The network address of the multicast originating device in the multicast message is set in an option field in a standard COAP message; 所述状态改变消息中的所述多播发起装置的网络地址设置在标准COAP消息中的选项字段;The network address of the multicast originating device in the status change message is set in an option field in a standard COAP message; 所述响应消息中的所述观察者服务器的标识设置在标准COAP消息中的选项字段。The identity of the observer server in the response message is set in an option field in a standard COAP message. 根据权利要求33所述的系统,其特征在于,在所述第一发送模块向观察者服务器发送多播消息之前,The system of claim 33, prior to said first transmitting module transmitting a multicast message to an observer server, 所述第三发送模块,用于向所述观察者服务器发送标准COAP查询消息,所述标准COAP查询消息包括要查询的资源对应的资源标识;The third sending module is configured to send a standard COAP query message to the observer server, where the standard COAP query message includes a resource identifier corresponding to the resource to be queried; 所述资源处理模块,用于根据所述资源标识对所述资源进行订阅注册,查询所述资源的当前状态;The resource processing module is configured to perform subscription registration on the resource according to the resource identifier, and query a current state of the resource; 所述第二发送模块,用于发送标准COAP响应消息至所述观察者客户端,其中所述标准COAP响应消息包括所述资源的当前状态;The second sending module is configured to send a standard COAP response message to the observer client, where the standard COAP response message includes a current state of the resource; 所述第三接收模块,用于接收所述标准COAP响应消息。The third receiving module is configured to receive the standard COAP response message. 根据权利要求33所述的系统,其特征在于,所述多播消息和所述状态改变消息还包括最迟确认时间,所述最迟确认时间用于表示所述多播发起装置在确认所述观察者服务器获取到所述多播消息时可以接受的最迟时间。The system according to claim 33, wherein said multicast message and said status change message further comprise a latest acknowledgement time, said latest acknowledgement time being used to indicate said multicast originating device is acknowledging said The latest time that the observer server can accept when the multicast message is obtained. 根据权利要求33所述的系统,其特征在于,所述多播消息和所述状态改变消息中的所述最迟确认时间设置在标准COAP消息中的选项字段。The system of claim 33, wherein the latest acknowledgement time in the multicast message and the status change message is set in an option field in a standard COAP message. 根据权利要求36所述的系统,其特征在于,所述第三发送模块在所述最迟确认时间之前根据所述多播发起装置的网络地址发送所述响应消息至所述多播发起装置。The system according to claim 36, wherein said third transmitting module transmits said response message to said multicast originating device according to a network address of said multicast originating device prior to said latest acknowledgement time. 一种多播发起装置,其特征在于,包括网络接口、存储器、处理器及总线,所述网络接口、所述存储器及所述处理器与所述总线连接,其中:A multicast initiating device, comprising: a network interface, a memory, a processor, and a bus, wherein the network interface, the memory, and the processor are connected to the bus, wherein: 所述网络接口,用于向观察者服务器发送多播消息,其中所述多播消息包括所述多播发起装置的网络地址和针对所述观察者服务器的资源的操作指令,以使得所述观察者服务器根据所述操作指令更新所述资源的当前状态,并向观察者客户端发送状态改变消息,所述状态改变消息包括所述多播发起装置的网络地址和所述资源更新后的当前状态;The network interface, configured to send a multicast message to an observer server, where the multicast message includes a network address of the multicast originating device and an operation instruction for a resource of the observer server, such that the observation The server updates the current state of the resource according to the operation instruction, and sends a state change message to the observer client, where the state change message includes a network address of the multicast originating device and a current state after the resource is updated. ; 所述网络接口,进一步用于接收观察者客户端发送的响应消息,所述响应消息包括所述观察者服务器的标识,其中所述响应消息是所述观察者客户端在接收到所述观察者服务器发送的所述状态改变消息后发送的;The network interface is further configured to receive a response message sent by the observer client, where the response message includes an identifier of the observer server, where the response message is that the observer client is receiving the observer Transmitted after the status change message sent by the server; 所述存储器,用于存储程序,所述程序用于从所述响应消息获取所述观察者服务器的标识以确认所述观察者服务器获取到所述多播消息;The memory is configured to store a program, where the program is configured to acquire an identifier of the observer server from the response message to confirm that the observer server acquires the multicast message; 所述处理器,用于运行所述程序。The processor is configured to run the program. 根据权利要求39所述的多播发起装置,其特征在于,所述多播消息中的多播发起装置的网络地址设置在标准COAP消息中的选项字段。The multicast originating apparatus according to claim 39, wherein a network address of the multicast originating apparatus in the multicast message is set in an option field in a standard COAP message. 根据权利要求39所述的多播发起装置,其特征在于,所述观察者服务器的标识为所述观察者服务器的网络地址。The multicast originating apparatus according to claim 39, wherein the identifier of the observer server is a network address of the observer server. 根据权利要求39所述的多播发起装置,其特征在于,所述多播消息和所述状态改变消息还包括最迟确认时间,所述最迟确认时间用于表示所述多播发起装置在确认所述观察者服务器获取到所述多播消息时可以接受的最迟时间。The multicast originating apparatus according to claim 39, wherein said multicast message and said status change message further comprise a latest acknowledgement time, said latest acknowledgement time being used to indicate that said multicast originating device is The latest time that the observer server can accept when the multicast message is obtained is confirmed. 根据权利要求42所述的多播发起装置,其特征在于,所述多播消息中的最迟确认时间设置在标准COAP消息中的选项字段。The multicast originating apparatus according to claim 42, wherein the latest acknowledgement time in said multicast message is set in an option field in a standard COAP message. 一种观察者服务器,其特征在于,包括网络接口、存储器、处理器以及总线,所述网络接口、所述存储器以及所述处理器与所述总线连接,其中:An observer server, comprising: a network interface, a memory, a processor, and a bus, wherein the network interface, the memory, and the processor are connected to the bus, wherein: 所述网络接口,用于接收多播发起装置发送的多播消息,其中所述多播消息包括所述多播发起装置的网络地址和针对观察者服务器的资源的操作指令;The network interface is configured to receive a multicast message sent by a multicast originating device, where the multicast message includes an operation instruction of a network address of the multicast originating device and a resource for an observer server; 所述存储器,用于存储程序,所述程序用于根据所述操作指令更新所述资源的当前状态;The memory is configured to store a program, where the program is configured to update a current state of the resource according to the operation instruction; 所述处理器,用于运行所述程序;The processor is configured to run the program; 所述网络接口,用于发送状态改变消息至所述观察者客户端,所述状态改变消息包括所述多播发起装置的网络地址和所述资源更新后的当前状态。The network interface is configured to send a status change message to the observer client, where the status change message includes a network address of the multicast originating device and a current status after the resource is updated. 根据权利要求44所述的观察者服务器,其特征在于,所述状态改变消息中的所述多播发起装置的网络地址设置在标准COAP消息中的选项字段。The viewer server of claim 44, wherein the network address of the multicast originating device in the status change message is set in an option field in a standard COAP message. 根据权利要求44所述的观察者服务器,其特征在于,所述多播消息和所述状态改变消息还包括最迟确认时间,所述最迟确认时间用于表示所述多播发起装置在确认所述观察者服务器获取到所述多播消息时可以接受的最迟时间。The observer server according to claim 44, wherein said multicast message and said status change message further comprise a latest acknowledgement time, said latest acknowledgement time being used to indicate that said multicast originating device is confirming The latest time that the observer server can accept when the multicast message is obtained. 根据权利要求44所述的观察者服务器,其特征在于,所述多播消息和所述状态改变消息中的所述最迟确认时间设置在标准COAP消息中的选项字段。The observer server according to claim 44, wherein said latest acknowledgement time in said multicast message and said state change message is set in an option field in a standard COAP message. 一种观察者客户端,其特征在于,包括存储器、网络接口以及总线,所述存储器和所述网络接口分别与所述总线连接,其中:An observer client, comprising: a memory, a network interface, and a bus, wherein the memory and the network interface are respectively connected to the bus, wherein: 所述存储器,用于存储程序,所述程序用于获取所述观察者服务器的标识;The memory is configured to store a program, where the program is used to obtain an identifier of the observer server; 所述处理器,用于运行所述程序;The processor is configured to run the program; 所述网络接口,用于接收观察者服务器发送的状态改变消息,其中所述状态改变消息包括所述多播发起装置的网络地址和所述资源更新后的当前状态;The network interface is configured to receive a state change message sent by the observer server, where the state change message includes a network address of the multicast originating device and a current state after the resource is updated; 所述网络接口,进一步用于根据所述多播发起装置的网络地址发送响应消息至多播发起装置,其中所述响应消息包括所述观察者服务器的标识,以使得所述多播发起装置从所述响应消息获取所述观察者服务器的标识以确认所述观察者服务器获取到多播消息。The network interface is further configured to send a response message to the multicast initiation device according to the network address of the multicast initiation device, where the response message includes an identifier of the observer server, so that the multicast initiation device The response message acquires an identifier of the observer server to confirm that the observer server acquires a multicast message. 根据权利要求48所述的观察者客户端,其特征在于,所述观察者服务器的标识为所述观察者服务器的网络地址。The viewer client of claim 48, wherein the identifier of the observer server is a network address of the observer server. 根据权利要求48所述的观察者客户端,其特征在于,所述多播消息和所述状态改变消息还包括最迟确认时间,所述最迟确认时间用于表示所述多播发起装置在确认所述观察者服务器获取到所述多播消息时可以接受的最迟时间。The viewer client of claim 48, wherein said multicast message and said status change message further comprise a latest acknowledgement time, said latest acknowledgement time being used to indicate that said multicast originating device is The latest time that the observer server can accept when the multicast message is obtained is confirmed. 根据权利要求50所述的观察者客户端,其特征在于,所述多播消息和所述状态改变消息中的所述最迟确认时间设置在标准COAP消息中的选项字段。The viewer client of claim 50 wherein said latest acknowledgement time in said multicast message and said state change message is set in an option field in a standard COAP message. 根据权利要求50所述的观察者客户端,其特征在于,所述第三发送模块在所述最迟确认时间之前根据所述多播发起装置的网络地址发送所述响应消息至所述多播发起装置。The observer client according to claim 50, wherein said third transmitting module transmits said response message to said multicast according to a network address of said multicast originating device before said latest acknowledgement time Initiate the device. 根据权利要求48所述的观察者客户端,其特征在于,所述响应消息中的所述观察者服务器的标识设置在标准COAP消息中的选项字段。The viewer client of claim 48, wherein the identity of the observer server in the response message is set in an option field in a standard COAP message. 根据权利要求48所述的观察者客户端,其特征在于,所述网络接口进一步用于在接收观察者服务器发送的状态改变消息之前,向所述观察者服务器发送标准COAP查询消息,所述标准COAP查询消息包括要查询的资源对应的资源标识,以使得所述观察者服务器根据所述资源标识对所述资源进行订阅注册,查询所述资源的当前状态,并发送标准COAP响应消息至所述观察者客户端,其中所述标准COAP响应消息包括所述资源的当前状态;The viewer client of claim 48, wherein said network interface is further for transmitting a standard COAP query message to said observer server prior to receiving a status change message sent by the observer server, said standard The COAP query message includes a resource identifier corresponding to the resource to be queried, so that the observer server subscribes to the resource according to the resource identifier, queries the current state of the resource, and sends a standard COAP response message to the An observer client, wherein the standard COAP response message includes a current state of the resource; 所述网络接口进一步用于接收所述标准COAP响应消息。The network interface is further for receiving the standard COAP response message. 一种消息处理系统,其特征在于,包括权利要求39-43中任一项所述的多播发送装置、权利要求44-47中任一项所述的观察者服务器以及权利要求48-54任一项所述的观察者客户端。A message processing system comprising the multicast transmitting apparatus according to any one of claims 39-43, the observer server according to any one of claims 44-47, and any of claims 48-54 One of the described client clients.
PCT/CN2013/084774 2013-09-30 2013-09-30 Message processing method, and related apparatus and system Ceased WO2015042979A1 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2013/084774 WO2015042979A1 (en) 2013-09-30 2013-09-30 Message processing method, and related apparatus and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2013/084774 WO2015042979A1 (en) 2013-09-30 2013-09-30 Message processing method, and related apparatus and system

Publications (1)

Publication Number Publication Date
WO2015042979A1 true WO2015042979A1 (en) 2015-04-02

Family

ID=52741898

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2013/084774 Ceased WO2015042979A1 (en) 2013-09-30 2013-09-30 Message processing method, and related apparatus and system

Country Status (1)

Country Link
WO (1) WO2015042979A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021217631A1 (en) * 2020-04-30 2021-11-04 Oppo广东移动通信有限公司 Service sharing method, communication device, and cloud platform

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060255986A1 (en) * 2005-05-11 2006-11-16 Canon Kabushiki Kaisha Network camera system and control method therefore
CN101814227A (en) * 2010-03-18 2010-08-25 北京创毅视讯科技有限公司 System and method for remote control of equipment based on Internet of things
CN103227803A (en) * 2012-01-30 2013-07-31 华为技术有限公司 Internet of thing resource obtaining method, client and internet of thing resource devices

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060255986A1 (en) * 2005-05-11 2006-11-16 Canon Kabushiki Kaisha Network camera system and control method therefore
CN101814227A (en) * 2010-03-18 2010-08-25 北京创毅视讯科技有限公司 System and method for remote control of equipment based on Internet of things
CN103227803A (en) * 2012-01-30 2013-07-31 华为技术有限公司 Internet of thing resource obtaining method, client and internet of thing resource devices

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2021217631A1 (en) * 2020-04-30 2021-11-04 Oppo广东移动通信有限公司 Service sharing method, communication device, and cloud platform

Similar Documents

Publication Publication Date Title
WO2014186986A1 (en) Stream forwarding method, device and system
WO2016023148A1 (en) Packet control method, switch and controller
WO2016089009A1 (en) Method and cloud server for managing device
WO2015133865A1 (en) Method and system for establishing a service session between seeker device and advertiser device
WO2018048230A1 (en) Method for managing short data service (sds) in mission critical data (mc data) communication system
WO2015002519A1 (en) Apparatus and method for transmitting/receiving streaming service data in mobile communication network
WO2020032649A1 (en) Electronic device and communication relaying method thereof
WO2013187719A1 (en) A method and system to notify users activity during an ongoing communication session
WO2018076875A1 (en) Backup data synchronisation method, apparatus, storage medium, electronic device, and server
EP4186182A1 (en) Apparatus and method for providing synchronization information of first communication network to second communication network in communication system
WO2021201620A1 (en) Electronic device for performing edge computing service and method for the same
WO2015037909A1 (en) Method and apparatus for providing push service in communication system
WO2022075737A1 (en) Method and device for providing mec service
WO2011090287A2 (en) Electronic device and operating method of the same
WO2019143081A1 (en) Method and electronic device for controlling data communication
WO2019210574A1 (en) Message processing method, apparatus, device, and readable storage medium
WO2017049432A1 (en) Data transmission method and apparatus
WO2018076871A1 (en) Method for synchronizing contact information, apparatus, medium, electronic device and system
WO2015042979A1 (en) Message processing method, and related apparatus and system
WO2015103748A1 (en) Authentication association method and system
WO2017107381A1 (en) Method for controlling wireless hotspot to sleep, and smart television
WO2015106461A1 (en) Address obtaining method and network virtualization edge device
WO2015106459A1 (en) Transmission method of transparently transferred data and common service entity
WO2019172653A1 (en) Method carried out by electronic device comprising secure element, and electronic device
WO2015050302A1 (en) Method and apparatus for content verification

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 13894744

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 13894744

Country of ref document: EP

Kind code of ref document: A1