Message interaction method, device, electronic device, message server and storage medium

By using the POST method of the CoAP protocol in the Internet of Things scenario to build a message interaction method, carrying parameters such as service identity and terminal address, the problem of low instant message interaction in the Internet of Things scenario is solved, and lightweight and efficient message interaction is achieved.

CN114884913BActive Publication Date: 2025-04-01CHINA MOBILE COMM LTD RES INST +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202210022148.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-01-10
Publication Date
2025-04-01
Estimated Expiration
2042-01-10

AI Technical Summary

Technical Problem

The existing technology cannot effectively realize instant message interaction in the Internet of Things scenario, affecting the efficiency of message interaction.

Method used

The message interaction method is constructed using the POST method based on the CoAP protocol, and the message is sent and received by carrying parameters such as service identifier, terminal address, and server address in the message body.

Benefits of technology

It realizes a lightweight message interaction method, which is suitable for IoT scenarios with resource-constrained, without installing APPs on each terminal, improving message interaction efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114884913B_ABST
    Figure CN114884913B_ABST
Patent Text Reader

Abstract

The present application discloses a message interaction method, device, electronic device, message server and storage medium, wherein the method comprises: a first terminal constructs and sends a first POST request; the POST request is constructed based on the POST method of CoAP; wherein the Playload of the first POST request carries a first message body; the message body carries at least one parameter for describing the first message.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of Internet of Things, and in particular to a message interaction method, device, electronic device, message server and storage medium. Background Art

[0002] In the IoT scenario, there is a demand for instant messaging interaction, for example, devices transmit commands through point-to-point, multiple sensors share data through group messaging, multiple smart home devices share commands through group messaging, etc. However, in the related art, the implementation method of instant messaging interaction cannot be well applied to the IoT scenario, which affects the efficiency of message interaction. Summary of the invention

[0003] To solve related technical problems, the embodiments of the present application provide a message interaction method, device, electronic device, message server and storage medium.

[0004] The technical solution of the embodiment of the present application is implemented as follows:

[0005] The present application provides a message sending method, which is applied to a first terminal, and the method includes:

[0006] Construct and send a first POST request; the POST request is constructed based on the POST method of the Constrained Application Protocol (CoAP); wherein,

[0007] The bearer (Playload) of the first POST request carries a first message body; the message body carries at least one parameter for describing the first message.

[0008] In the above solution, the parameters carried in the message body include at least one of the following:

[0009] A service identifier, indicating that the first message is a message of an Internet of Things message service;

[0010] A first terminal address, indicating that the sender of the first message is the terminal pointed to by the first terminal address;

[0011] A first server address, indicating that the sender of the first message is the application server pointed to by the first server address;

[0012] A second terminal address, indicating that the recipient of the first message is the terminal pointed to by the second terminal address;

[0013] A second server address, indicating that the recipient of the first message is the application server pointed to by the second server address;

[0014] A group identifier, indicating that a recipient of the first message is a terminal in a group corresponding to the group identifier;

[0015] An area identifier, indicating that a recipient of the first message is a terminal and / or an application server in an area corresponding to the area identifier;

[0016] The topic identifier indicates that the recipients of the first message are all terminals that are interested in the message topic corresponding to the topic identifier.

[0017] In the above solution, the destination address of the first POST request points to the message server or the second terminal; wherein,

[0018] The second terminal is directly connected to the message server.

[0019] In the above scheme, before constructing and sending the first POST request, the method further includes:

[0020] Construct and send a second POST request; wherein,

[0021] The destination address of the second POST request points to the message server; the Playload of the second POST request carries the second message body; the second message body carries parameters representing the request to register the first terminal.

[0022] In the above scheme, when constructing a POST request, the method includes:

[0023] Set the T parameter of the POST request to 0.

[0024] The embodiment of the present application further provides a message receiving method, which is applied to an electronic device, wherein the electronic device includes a terminal or an application server, and the method includes:

[0025] A third POST request is received; the Playload of the third POST request carries a third message body; the third message body is generated based on the first message;

[0026] Parsing the third POST request to obtain a first parsing result; the first parsing result at least includes at least one parameter carried by the third message body for describing the first message;

[0027] Process the third POST request based on the first parsing result; wherein,

[0028] The message body carries at least one parameter for describing the first message; the POST request is constructed based on the POST method of CoAP.

[0029] In the above solution, the parameters carried in the message body include at least one of the following:

[0030] A service identifier, indicating that the first message is a message of an Internet of Things message service;

[0031] A first terminal address, indicating that the sender of the first message is the terminal pointed to by the first terminal address;

[0032] A first server address, indicating that the sender of the first message is the application server pointed to by the first server address;

[0033] A second terminal address, indicating that the recipient of the first message is the terminal pointed to by the second terminal address;

[0034] A second server address, indicating that the recipient of the first message is the application server pointed to by the second server address;

[0035] A group identifier, indicating that a recipient of the first message is a terminal in a group corresponding to the group identifier;

[0036] An area identifier, indicating that a recipient of the first message is a terminal and / or an application server in an area corresponding to the area identifier;

[0037] The topic identifier indicates that the recipients of the first message are all terminals that are interested in the message topic corresponding to the topic identifier.

[0038] In the above solution, the processing of the third POST request based on the first parsing result includes:

[0039] When the first parsing result indicates that the second terminal address or the second server address carried in the third message body is the same as the address registered by the electronic device, the first message is processed by setting an application; the setting application indicates a message application corresponding to the first message;

[0040] When the first parsing result indicates that the second terminal address carried in the third message body is the same as the address registered by the third terminal, a fourth POST request is constructed and sent; wherein,

[0041] The Playload of the fourth POST request carries the third message body; the destination address of the fourth POST request points to the third terminal.

[0042] In the above scheme, the method further includes:

[0043] When the first parsing result indicates that the T parameter of the third POST request is 0, a response is sent back to the message server.

[0044] In the above solution, before receiving the third POST request, the method further includes:

[0045] Construct and send the fifth POST request; wherein,

[0046] The destination address of the fifth POST request points to the message server; the Playload of the fifth POST request carries a fourth message body; the fourth message body carries parameters representing the request to register the electronic device.

[0047] In the above scheme, when constructing a POST request, the method includes:

[0048] Set the POST method parameter T to 0.

[0049] The present application also provides a message interaction method, which is applied to a message server, and the method includes:

[0050] receiving a sixth POST request; wherein the Playload of the sixth POST request carries the first message body; parsing the sixth POST request to obtain a second parsing result; wherein the second parsing result at least represents at least one parameter carried by the first message body and used to describe the first message;

[0051] Construct and send a third POST request based on the second parsing result; wherein,

[0052] The message body carries at least one parameter for describing the first message; the POST request is constructed based on the POST method of CoAP; the Playload of the third POST request carries a third message body; and the third message body is generated based on the first message.

[0053] In the above solution, the parameters carried in the message body include at least one of the following:

[0054] A service identifier, indicating that the first message is a message of an Internet of Things message service;

[0055] A first terminal address, indicating that the sender of the first message is the terminal pointed to by the first terminal address;

[0056] A first server address, indicating that the sender of the first message is the application server pointed to by the first server address;

[0057] A second terminal address, indicating that the recipient of the first message is the terminal pointed to by the second terminal address;

[0058] A second server address, indicating that the recipient of the first message is the application server pointed to by the second server address;

[0059] A group identifier, indicating that a recipient of the first message is a terminal in a group corresponding to the group identifier;

[0060] An area identifier, indicating that a recipient of the first message is a terminal and / or an application server in an area corresponding to the area identifier;

[0061] The topic identifier indicates that the recipients of the first message are all terminals that are interested in the message topic corresponding to the topic identifier.

[0062] In the above solution, constructing a third POST request based on the second parsing result includes:

[0063] When the second parsing result indicates that the recipient of the third message is a terminal or an application server, construct the third POST request; wherein,

[0064] The destination address of the third POST request is the address registered by the recipient of the first message; the third message body is the same as the first message body.

[0065] In the above solution, constructing a third POST request based on the second parsing result includes:

[0066] When the second parsing result indicates that the first message body carries the group identifier, querying a corresponding group member list by using the group identifier to obtain addresses registered by M fourth terminals;

[0067] Construct M third POST requests; among them,

[0068] The M fourth terminals represent the terminals of all group members in the group corresponding to the group identifier; the destination address of each of the M third POST requests is an address registered by a fourth terminal among the M fourth terminals, and the second terminal address carried in the third message body carried in the Playload of each third POST request points to the corresponding fourth terminal; M is an integer greater than or equal to 1.

[0069] In the above solution, constructing a third POST request based on the second parsing result includes:

[0070] When the second parsing result indicates that the fifth message body carries the area identifier, the broadcast capability is called based on the area identifier to construct the third POST request.

[0071] In the above solution, constructing a third POST request based on the second parsing result includes:

[0072] In the case where the second parsing result indicates that the fifth message body carries the subject identifier, the addresses registered by N electronic devices that subscribe to the corresponding message subject through the subject identifier; the electronic devices include terminals and / or application servers;

[0073] Construct N third POST requests; among them,

[0074] The destination address of each of the N third POST requests is the registered address of one of the N electronic devices, and the second terminal address carried in the third message body carried in the Playload of each third POST request points to the corresponding terminal or the second server address carried points to the corresponding application server; N is an integer greater than or equal to 1.

[0075] In the above solution, before receiving the sixth POST request, the method further includes:

[0076] receiving a second POST request and / or a fifth POST request; a message body carried in the Playload of the second POST request and / or the fifth POST request carries a parameter representing the electronic device corresponding to the request for registration;

[0077] The corresponding electronic device is registered based on the second POST request and / or the fifth POST request.

[0078] In the above solution, before receiving the sixth POST request, the method further includes:

[0079] Pulling a group message of at least one group from a group management server; and / or,

[0080] Notifying at least one electronic device of a group message of a corresponding group; wherein,

[0081] The group message includes a group identifier of the corresponding group and a list of group members.

[0082] The embodiment of the present application also provides a message sending device, including:

[0083] The first sending unit is used to construct and send a first POST request; wherein,

[0084] The POST request is constructed based on the POST method of CoAP; the Playload of the first POST request carries a first message body; the message body carries at least one parameter for describing the first message.

[0085] The embodiment of the present application also provides a message receiving device, including:

[0086] A first receiving unit is configured to receive a third POST request; the Playload of the third POST request carries a third message body; and the third message body is generated based on the first message;

[0087] A first parsing unit, configured to parse the third POST request to obtain a first parsing result; the first parsing result at least includes at least one parameter carried by the third message body and used to describe the first message;

[0088] A first processing unit is configured to process the third POST request based on the first parsing result; wherein:

[0089] The message body carries at least one parameter for describing the first message; the POST request is constructed based on the POST method of CoAP.

[0090] The embodiment of the present application also provides a message interaction device, including:

[0091] A second receiving unit is configured to receive a sixth POST request; the Playload of the sixth POST request carries the first message body;

[0092] A second parsing unit, configured to parse the sixth POST request to obtain a second parsing result; the second parsing result at least represents at least one parameter carried by the first message body and used to describe the first message;

[0093] The second sending unit is used to construct and send a third POST request based on the second parsing result; wherein,

[0094] The message body carries at least one parameter for describing the first message; the POST request is constructed based on the POST method of CoAP; the Playload of the third POST request carries the third message body; the third message body is generated based on the first message.

[0095] The embodiment of the present application further provides a first terminal, comprising: a first processor and a first communication interface; wherein,

[0096] The first processor is used to construct a first POST request; the POST request is constructed based on the POST method of CoAP;

[0097] The first communication interface is used to send the first POST request; wherein,

[0098] The bearer Playload of the first POST request carries a first message body; the message body carries at least one parameter for describing the first message.

[0099] The embodiment of the present application further provides an electronic device, the electronic device includes a terminal or an application server, the electronic device includes: a second processor and a second communication interface; wherein,

[0100] The second communication interface is used to receive a third POST request; the Playload of the third POST request carries a third message body; the third message body is generated based on the first message;

[0101] The first processor is used to parse the third POST request to obtain a first parsing result; and process the third POST request based on the first parsing result; wherein,

[0102] The message body carries at least one parameter for describing the first message; the POST request is constructed based on the POST method of CoAP; the first parsing result includes at least one parameter carried by the third message body for describing the first message.

[0103] The embodiment of the present application further provides a message server, comprising: a third processor and a third communication interface; wherein,

[0104] The third communication interface is used to receive a sixth POST request; the Playload of the sixth POST request carries the first message body;

[0105] The third processor is used to parse the sixth POST request to obtain a second parsing result; and construct a third POST request based on the second parsing result; the second parsing result at least represents at least one parameter carried by the first message body for describing the first message;

[0106] The third communication interface is also used to send the third POST request; wherein,

[0107] The message body carries at least one parameter for describing the first message; the POST request is constructed based on the POST method of CoAP; the Playload of the third POST request carries a third message body; and the third message body is generated based on the first message.

[0108] The embodiment of the present application further provides a first terminal, comprising: a first processor and a first memory for storing a computer program that can be run on the processor,

[0109] Wherein, the first processor is used to execute the steps of any one of the above-mentioned methods on the first terminal side when running the computer program.

[0110] The embodiment of the present application further provides an electronic device, comprising: a second processor and a second memory for storing a computer program that can be run on the processor,

[0111] Wherein, the second processor is used to execute the steps of the above-mentioned electronic device side method when running the computer program.

[0112] The embodiment of the present application further provides a message server, comprising: a third processor and a third memory for storing a computer program that can be run on the processor,

[0113] Wherein, the third processor is used to execute the steps of any one of the above-mentioned message server side methods when running the computer program.

[0114] An embodiment of the present application further provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above methods are implemented.

[0115] In the message interaction method, device, electronic device, message server and storage medium provided by the embodiments of the present application, the message body carries at least one parameter for describing the first message; the POST request is constructed based on the POST method of CoAP; first, the first terminal constructs and sends a first POST request, and the Playload of the first POST request carries the first message body; the message server receives a sixth POST request carrying the first message body in the Playload, parses the sixth POST request, and obtains a second parsing result, the second parsing result at least represents at least one parameter carried by the first message body for describing the first message, and the message server constructs and sends a third POST request based on the second parsing result, and the Playload of the third POST request carries a third message body; the third message body is generated based on the first message; the electronic device, including a terminal or an application server, receives the third POST request; parses the third POST request to obtain a first parsing result; the first parsing result at least includes at least one parameter carried by the third message body for describing the first message; the electronic device processes the third POST request based on the first parsing result. The above scheme implements message interaction based on the CoAP protocol message body extension method. The message interaction implementation method is lightweight and is no longer limited to resource-constrained application scenarios. There is no need to install the corresponding APP on each interactive terminal, which improves the message interaction efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0116] Figure 1 This is a schematic diagram of the creation process of the related technology 5G message / RCS group message;

[0117] Figure 2A schematic diagram of the process of message interaction between users after the creation of the related technology 5G message / RCS group message;

[0118] Figure 3 A schematic diagram of the process of initiating a group message based on an instant messaging APP in the related technology;

[0119] Figure 4 This is an example diagram of a system architecture supporting message interaction in an Internet of Things scenario applicable to the embodiments of the related technology application;

[0120] Figure 5 This is a flow chart of a message sending method according to an embodiment of the present application;

[0121] Figure 6 A schematic diagram of a message interaction method flow in an embodiment of the present application;

[0122] Figure 7 This is a flow chart of a message receiving method according to an embodiment of the present application;

[0123] Figure 8 This is a schematic diagram of the structure of a message sending device according to an embodiment of the present application;

[0124] Fig. 9 This is a schematic diagram of the structure of a message receiving device according to an embodiment of the present application;

[0125] Fig.10 This is a schematic diagram of the structure of a message interaction device according to an embodiment of the present application;

[0126] Fig.11 This is a schematic diagram of the first terminal structure of an embodiment of the present application;

[0127] Fig.12 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present application;

[0128] Fig.13 This is a schematic diagram of the message server structure of an embodiment of the present application. DETAILED DESCRIPTION

[0129] The terminal supports instant messaging interactions such as point-to-point and group messaging, mainly including the following implementation methods: the terminal natively supports instant messaging, creates and conducts instant messaging interactions through phone numbers, such as fifth-generation mobile communication technology (5G) messages, or the terminal is based on installed application software (APP, Application), and conducts instant messaging interactions between users who have installed the same APP.

[0130] Among them, the 5G message / Rich Communication Suite (RCS) service implements instant messaging based on the Open Mobile Alliance (OMA) Converged IP Message (CPM) protocol. The OMA CPM protocol is an extension of the Session Initialization Protocol (SIP). Figure 1 The creation process of 5G message / RCS group message shown is as follows: the terminal of user A, the initiator of the group message, creates a group message session through an extended SIP request (INVITE) method carrying a list of group members, and establishes a message session relay protocol (MSRP, Message Session Relay Protocol) channel for the group message with the 5G Message Center (5GMC); 5GMC invites other users to join the group message by initiating an extended SIP INVITE method to all users in the group list, and establishes an MSRP channel with the users joining the group message; subsequently, group messages of all users are transmitted in the established MSRP channel. Figure 2 It shows the process of message interaction between users after the 5G message / RCS group message is created.

[0131] Figure 3 The process of initiating a group message based on an instant messaging APP is shown: the user first logs in to the instant messaging APP, and uses the method supported by the instant messaging APP to initiate a group message to users who have installed the same instant messaging APP through the service platform of the instant messaging APP. Specifically, there are two ways to initiate a group message: the first is that the instant messaging APP first creates a group, invites several users to join, and then initiates a group message through the group; the second is that the instant messaging APP user selects several contacts in the friend list, directly creates and initiates a group message.

[0132] At this stage, relevant protocol standards require that 5G IoT messages should support point-to-point, application-to-point, group messaging, broadcast messaging and other functions. In other words, there is also a need for instant messaging interaction in the IoT scenario, for example, point-to-point transmission of instructions between devices, multiple sensors sharing data through group messaging, and multiple smart home devices sharing instructions through group messaging. In the above-mentioned related technologies, the 5G messages that can be natively supported by the terminal are implemented based on the SIP protocol, which has large resource requirements and is not suitable for the situation where the IoT terminal resources are limited in the IoT scenario. The implementation method based on the instant messaging APP requires the same instant messaging APP to be pre-made or downloaded on each terminal, and there is a situation where devices from different manufacturers cannot interact with each other. In general, in the related technologies, the implementation method of instant messaging interaction cannot be well applied to the IoT scenario, affecting the efficiency of message interaction.

[0133] Based on this, in each embodiment of the present application, the message body carries at least one parameter for describing the first message; the POST request is constructed based on the POST method of CoAP; first, the first terminal constructs and sends a first POST request, and the Playload of the first POST request carries the first message body; the message server receives a sixth POST request carrying the first message body in the Playload, parses the sixth POST request, and obtains a second parsing result, the second parsing result at least represents at least one parameter carried by the first message body for describing the first message, and the message server constructs and sends a third POST request based on the second parsing result, and the Playload of the third POST request carries a third message body; the third message body is generated based on the first message; the electronic device, including a terminal or an application server, receives the third POST request; parses the third POST request, and obtains a first parsing result; the first parsing result at least includes at least one parameter carried by the third message body for describing the first message; the electronic device processes the third POST request based on the first parsing result. The above scheme implements message interaction based on the extension of the CoAP protocol message body, and the implementation method of message interaction is lightweight, no longer limited to resource-constrained application scenarios, and there is no need to install corresponding APPs on each interactive terminal, thereby improving the efficiency of message interaction.

[0134] The present application is further described in detail below in conjunction with the accompanying drawings and embodiments.

[0135] First, in order to better illustrate the message interaction method provided in the embodiment of the present application, Figure 4 This application embodiment is applicable to the system architecture example that supports message interaction in the Internet of Things scenario. Figure 4In the system architecture shown: the message server and the message client support CoAP; terminal 1 is directly connected to the message server, and at the same time, assuming that terminal 2 is limited by factors such as wireless connection capability and distance, the message client in terminal 2 cannot be directly connected to the message server; the application server performs application logic processing based on the message obtained from the message server, and the application client performs application logic processing based on the message obtained from the message client, and the application logic processing performed in the application server and the application client is irrelevant to the message interaction process provided in the embodiment of the present application; the group management client and the group management server are used to create and manage groups corresponding to group messages, and in actual applications, considering that most IoT terminals are terminals with relatively weak capabilities, it is assumed in the embodiment of the present application that terminals with relatively weak capabilities do not support the ability to create and manage groups, and only support group message interaction, while another type of terminals with relatively strong capabilities support the ability to create and manage groups, and, as an implementation method, the application server can also create and manage groups. In addition, if Figure 4 As shown in the figure, the SMS client can communicate with the message server through the conversion gateway, and the conversion gateway completes the conversion between SMS and CoAP protocol. In actual application, other non-CoAP protocol message clients can communicate with the corresponding non-CoAP protocol message server through Figure 4 Message server communication in.

[0136] Here, the CoAP protocol is an IoT protocol based on the User Datagram Protocol (UDP) transmission, using a RESTFul style similar to the Hypertext Transfer Protocol (HTTP). In addition to supporting the four RESTFul methods of POST, PUT, GET, and DELETE, it also supports the Oberve method for resources.

[0137] In the embodiment of the present application, before the message interaction, the message client initiates registration with the message server to obtain the application layer address (UE Service ID) used by the terminal during the message interaction. Similarly, the application server initiates registration with the message server to obtain the application layer address (ASService ID) used by the application server during the message interaction. In actual application, the message client and the application server can make configuration requests through their own private identifiers to obtain the corresponding application layer address.

[0138] Before group messaging, you need to create the group required for group messaging. Figure 4The terminal 1) interacts with the group management server, and the group management server creates a group. After the group is created, the group management server notifies the message server of group information such as the group identifier and the group user list, or the message server pulls the group information from the group management server when it is needed. Here, the group management server interacts with the terminal with the group management client at the same time, notifies the group management client of the group information, and then the group management client notifies the message client of the group information.

[0139] Here, extended CoAP is used for message exchange. During the message exchange process, if the sender hopes to receive a response to the sent message, the parameter T in the CoAP message is set to 0.

[0140] Combination Figure 4 The system architecture shown in the figure, the embodiment of the present application realizes message interaction by extending the message body of CoAP and adding extended parameters to the message body. First, before message interaction, the message client and application server need to register with the message server at the application layer. The registration process is as follows:

[0141] Step 1: A message body carrying parameters representing the electronic device corresponding to the registration request.

[0142] Specifically, the message body carries parameters indicating that this is a registration request message.

[0143] Step 2: Build and send a POST request.

[0144] Among them, a POST request is constructed based on the CoAP protocol, and the destination address of the POST request is the address of the message server. In actual application, according to the requirements of the CoAP protocol, the T parameter of the POST request is set to 0, that is, the message server is required to return a response. At the same time, Content-Format is set to "50", that is, application / json, indicating that the payload of the POST request carries a message body in JSON format.

[0145] Step 3: When the first terminal is successfully registered in the message server, obtain the registered address of the first terminal returned by the message server.

[0146] In actual application, after completing the registration, the message server maintains the actual address corresponding to the application layer address of the registered terminal and / or application server.

[0147] The present application provides a message sending method, which is applied to Figure 4 Terminal 1 or Terminal 2 in the system architecture, refer to Figure 5 , the method comprising:

[0148] Step 501: Construct and send the first POST request.

[0149] Among them, the POST request is constructed based on the POST method of the restricted application protocol CoAP; the Playload of the first POST request carries a first message body; and the message body carries at least one parameter for describing the first message.

[0150] In one embodiment, before constructing and sending the first POST request, the method further includes:

[0151] Construct and send a second POST request; wherein,

[0152] The destination address of the second POST request points to the message server; the Playload of the second POST request carries a second message body; and the second message body carries parameters representing the request to register the first terminal.

[0153] Here, the first message is the actual message content that needs to be interacted during the message interaction process, including but not limited to text, voice, picture, video, etc. The message service type of the first message includes but is not limited to point-to-point messages, point-to-application messages, group messages, broadcast messages or specific message subject messages, etc. As the sender of the instant message, the first terminal generates a first message body according to the message service type of the first message, or the first message body is generated by an application that calls the message service capability on the first terminal. In an embodiment of the present application, considering that the method defined by CoAP cannot realize the group messaging function, the CoAP Payload is used to carry the message body. In an embodiment of the present application, the message body of CoAP is extended to carry the first message to be sent and at least one related parameter for describing the first message in the first message body.

[0154] In this embodiment of the present application, the parameters carried in the message body include at least one of the following:

[0155] A service identifier, indicating that the first message is a message of an Internet of Things message service;

[0156] A first terminal address, indicating that the sender of the first message is the terminal pointed to by the first terminal address;

[0157] A first server address, indicating that the sender of the first message is the application server pointed to by the first server address;

[0158] A second terminal address, indicating that the recipient of the first message is the terminal pointed to by the second terminal address;

[0159] A second server address, indicating that the recipient of the first message is the application server pointed to by the second server address;

[0160] A group identifier, indicating that a recipient of the first message is a terminal in a group corresponding to the group identifier;

[0161] An area identifier, indicating that a recipient of the first message is a terminal and / or an application server in an area corresponding to the area identifier;

[0162] The topic identifier indicates that the recipients of the first message are all terminals that are interested in the message topic corresponding to the topic identifier.

[0163] Exemplarily, each of the above parameters is configured with a corresponding parameter name. For example, corresponding to each of the above parameters in turn, the parameter names are configured as follows:

[0164] MSGin5GserviceIdentifier: indicates that the first message is a message of the IoT message service. Thus, after receiving the first message, the message server processes it according to the IoT message logic.

[0165] OriginatingUEServiceID: indicates that the sender of the first message is the terminal pointed to by OriginatingUEServiceID. Here, the corresponding parameter value indicates the application layer address registered by the corresponding terminal to the message server;

[0166] OriginatingASServiceID: indicates that the sender of the first message is the application server pointed to by OriginatingASServiceID. Here, the corresponding parameter value indicates the address registered by the corresponding application server with the message server;

[0167] RecipientUEServiceID: indicates that the recipient of the first message is the terminal pointed to by RecipientUEServiceID. Here, the corresponding parameter value indicates the application layer address registered by the corresponding terminal to the message server. When the parameter has a parameter value, it indicates that the first message is a point-to-point message or an application-to-point message;

[0168] RecipientASServiceID: indicates that the sender of the first message is the application server pointed to by RecipientASServiceID. Here, the corresponding parameter value indicates the address registered by the corresponding application server to the message server. When the parameter value exists, it indicates that the first message is a point-to-application message.

[0169] GroupServiceID: indicates that the recipient of the first message is a terminal in the group corresponding to GroupServiceID. Here, the corresponding parameter value indicates the group ID of the corresponding group. When this parameter has a parameter value, it indicates that the first message is a group message. In actual application, the message server should have obtained the group information such as the group ID and group member list of the group from the group management server;

[0170] BroadcastAreaID: indicates that the recipient of the first message is a terminal and / or application server in the area corresponding to BroadcastAreaID. When this parameter has a parameter value, it indicates that the first message is a broadcast message, and the parameter value indicates the corresponding broadcast area. In actual application, the message server should call the broadcast capability to send the first message to the corresponding recipient. Here, the broadcast capability includes calling the 5BMS capability of CBCF or 5GC through the Network Exposure Function (NEF).

[0171] MessagingTopic: indicates that the recipients of the first message are all terminals that follow the message topic corresponding to MessagingTopic. When this parameter has a parameter value, it indicates that the first message is a topic message, and the parameter value indicates the corresponding message topic. The message will be sent to all recipients that follow the message topic, including terminals or application servers.

[0172] Here, the message body carries different parameters to distinguish the sender, receiver and message type of the first message, but it should be noted that the sender and receiver in the above parameters are not the sender and receiver of the CoAP message, that is, not the sender and receiver of the POST request, but the application layer message service, that is, the sender and receiver of the instant message. For example, terminal A sends an instant message to terminal B. The sender identified by the parameters in the first message body is terminal A, and the receiver is terminal B. The sender of the CoAP POST request sent by terminal A is terminal A, and the receiver is the message server. In the CoAP POST request sent by the message server to terminal B, the sender is the message server, and the receiver is terminal B.

[0173] In addition, in practical applications, Figure 4 Terminal 1 in the system architecture can be directly connected to the message server, so the destination address of the first POST request is the address of the message server. Figure 4Terminal 2 in the system architecture cannot be directly connected to the message server, so it needs to send the first POST request to the message server through terminal 1. Therefore, the destination address of the first POST request is the address of terminal 1. For example, if terminal 2 sends an instant message to terminal B through terminal 1, the Payload of the CoAP POST request generated by the message client 2 of terminal 2 should carry the RecipientUEServiceID, which is the address registered by terminal B on the message server. At the same time, the CoAP operation resource address in the CoAP POST request, that is, the destination address of the POST request points to the message client 1 on terminal 1.

[0174] After generating the first message body, the message client on the first terminal constructs a first POST request based on the POST method of CoAP. In one embodiment, when constructing the POST request, the method includes:

[0175] Set the POST method parameter T to 0.

[0176] Here, all POST requests involved in the embodiments of the present application set the parameter T of the POST method to 0 when constructed, that is, the recipient of the POST request is required to return a confirmation response.

[0177] In actual application, the POST request is constructed by the message client. If the message content is required to be in JSON format, set Content-Format to "50", that is, application / json, when constructing the POST request.

[0178] Table 1 gives an example of a message body carried by Playload in the first POST request sent by the first terminal.

[0179] Table 1

[0180]

[0181]

[0182] Based on the above scheme, the first POST request is sent. Figure 4 Terminal 2 in the system architecture example sends a POST request, then terminal 1 receives and processes the first POST request, and then sends the corresponding POST request to the message server; if the first POST request is sent by Figure 4 The terminal 1 in the system architecture example sends a POST request, and the first POST request is directly received by the message server. Therefore, the embodiment of the present application also provides a message interaction method, which is applied to Figure 4 Refer to the message server in the system architecture example. Figure 6, the method comprising:

[0183] Step 601: Receive the sixth POST request.

[0184] The Playload of the sixth POST request carries the first message body.

[0185] In one embodiment, before receiving the sixth POST request, the method further includes:

[0186] receiving a second POST request and / or a fifth POST request; the message body carried in the Playload of the second POST request and / or the fifth POST request carries a parameter representing the electronic device corresponding to the request for registration;

[0187] The corresponding electronic device is registered based on the second POST request and / or the fifth POST request.

[0188] Here, the sixth POST request is sent by a terminal directly connected to the message server. As the sender of the instant message, the terminal can be Figure 4 In the terminal 1 of the system architecture example, at this time, the sixth POST request can be understood as the first POST request in the above embodiment, or the terminal can be Figure 4 For terminal 2 in the system architecture example, at this time, the sixth POST request can be understood as the fourth POST request that is initiated again after the first POST request in the above embodiment is sent to terminal 1 and processed by terminal 1.

[0189] Step 602: Parse the sixth POST request to obtain a second parsing result.

[0190] The second parsing result at least represents at least one parameter carried by the first message body and used to describe the first message.

[0191] In actual application, the message server parses the sixth POST request, which also includes: after the message server receives the sixth POST request whose destination address points to the message server itself, it checks whether the T parameter of the sixth POST request is 0. If the T parameter of the sixth POST request is 0, it means that the sixth POST request requires a reply response, and the message server replies CoAP ACK to the sender of the sixth POST request. In addition, the message server checks whether the Content-Format of the sixth POST request is "50", that is, application / json. If the Content-Format of the sixth POST request is "50", the message server detects whether the Payload of the sixth POST request contains MSGin5GserviceIdentifier. If the Payload of the sixth POST request contains MSGin5GserviceIdentifier, it means that this is a message of the Internet of Things message service, and the message server further parses the Payload of the sixth POST request; if the Payload of the sixth POST request does not contain MSGin5GserviceIdentifier, it means that the received sixth POST request is not a message of the Internet of Things message service, and the message server processes the sixth POST request according to the corresponding message service logic.

[0192] Step 603: Construct and send a third POST request based on the second parsing result.

[0193] The Playload of the third POST request carries a third message body; the third message body is generated based on the first message.

[0194] Likewise, the sixth POST request and the third POST request are both constructed based on the POST method of CoAP.

[0195] Here, after receiving the sixth POST request whose destination address points to the message server itself, the message server parses the first message body in the Payload of the sixth POST request, and constructs a corresponding third POST request according to the parameters carried in the first message body.

[0196] In one embodiment, constructing a third POST request based on the second parsing result includes:

[0197] When the second parsing result indicates that the recipient of the third message is a terminal or an application server, the third POST request is constructed.

[0198] The destination address of the third POST request is the address registered by the recipient of the first message; and the third message body is the same as the first message body.

[0199] For example, the first message body contains RecipientUEServiceID, indicating that the recipient is another IoT terminal, and this message is a point-to-point message or an application-to-point message. The message server should use the address registered by the terminal on the message server as the destination address of the third POST request, and carry the Payload of the first POST request to send the third POST request.

[0200] For another example, the first message body contains RecipientASServiceID, indicating that the recipient is an application server. This message is a point-to-application message. The message server should use the address registered by the application server on the message server as the destination address of the third PSOT request, and carry the Payload of the first POST request, and also carry the first message body, and then send the third POST request.

[0201] In one embodiment, constructing a third POST request based on the second parsing result includes:

[0202] When the second parsing result indicates that the first message body carries the group identifier, querying a corresponding group member list by using the group identifier to obtain addresses registered by M fourth terminals;

[0203] Construct M third POST requests.

[0204] Among them, the M fourth terminals represent the terminals of all group members in the group corresponding to the group identifier; the destination address of each of the M third POST requests is the address registered by a fourth terminal among the M fourth terminals, and the second terminal address carried in the third message body carried in the Playload of each third POST request points to the corresponding fourth terminal; M is an integer greater than or equal to 1.

[0205] In one embodiment, before receiving the sixth POST request, the method further includes:

[0206] Pulling a group message of at least one group from a group management server; and / or,

[0207] At least one electronic device is notified of a group message of the corresponding group.

[0208] The group message includes a group identifier of the corresponding group and a list of group members.

[0209] That is, the message server pulls the group message of each group from the group management server by querying in advance, and notifies the corresponding electronic device of the pulled group message.

[0210] For example, the first message body contains GroupServiceID, indicating that the recipient is a group and this message is a group message. The message server uses GroupServiceID to query the group information corresponding to the GroupServiceID previously obtained from the group management server, including the group member list of the group, etc. Thereafter, the message server constructs a third POST request for all group members in the group list, or for other group members in the group list except the sender of the sixth POST request, and each third POST request is sent to a group member. Here, the destination address of each third POST request points to the address registered by the corresponding group member on the message server, and the third message body is modified on the basis of the first message body and carried in the third POST request. Specifically, the GroupServiceID in the payload of the first POST request is deleted, and the RecipientUEServiceID of the corresponding group member is written, and the other information maintains the content of the payload of the first POST request, and then the third POST request is sent.

[0211] In one embodiment, constructing a third POST request based on the second parsing result includes:

[0212] When the second parsing result indicates that the fifth message body carries the area identifier, the broadcast capability is called based on the area identifier to construct the third POST request.

[0213] For example, the first message body contains BroadcastAreaID, indicating that the receiving mode is broadcast and this message is a broadcast message. The message server shall call the broadcast capability (such as calling the CBCF or 5BMS capability of 5GC through NEF) to construct the third POST request, and then send the third POST request.

[0214] In one embodiment, constructing a third POST request based on the second parsing result includes:

[0215] In the case where the second parsing result indicates that the fifth message body carries the subject identifier, the addresses registered by N electronic devices that subscribe to the corresponding message subject through the subject identifier; the electronic devices include terminals and / or application servers;

[0216] Construct N third POST requests; among them,

[0217] The destination address of each of the N third POST requests is the registered address of one of the N electronic devices, and the second terminal address carried in the third message body carried in the Playload of each third POST request points to the corresponding terminal or the second server address carried points to the corresponding application server; N is an integer greater than or equal to 1.

[0218] For example, the first message body contains MessagingTopic, indicating that this is a message transmitted based on the message topic MessagingTopic, and the message server queries the terminals and / or application servers that have subscribed to the message topic. Thereafter, the message server constructs a third POST request for each terminal and / or application server that subscribes to the message topic. Here, the destination address of each third POST request points to the address registered by the corresponding terminal and / or application server on the message server, and the third message body is modified on the basis of the first message body and carried in the third POST request. Specifically, the MessagingTopic in the payload of the first POST request is deleted, and the RecipientUEServiceID of the corresponding terminal and / or the RecipientASServiceID of the application server are written, and other information maintains the content of the payload of the first POST request, and then the third POST request is issued.

[0219] In one embodiment, before receiving the sixth POST request, the method further includes:

[0220] receiving a second POST request and / or a fifth POST request; a message body carried in the Playload of the second POST request and / or the fifth POST request carries a parameter representing the electronic device corresponding to the request for registration;

[0221] The corresponding electronic device is registered based on the second POST request and / or the fifth POST request, and the registered address is returned to the corresponding electronic device if the registration is successful.

[0222] Table 2 and Table 3 respectively give examples of different message bodies carried by Playload in the third POST request sent by the message server.

[0223] Table 2

[0224]

[0225] Table 3

[0226]

[0227] Based on the above solution, the message server receives the first POST request, and on this basis constructs and sends a third POST request. Therefore, the embodiment of the present application also provides a message receiving method, which is applied to an electronic device, including Figure 4 For the terminal or application server in the system architecture example, refer to Figure 7 , the method comprising:

[0228] Step 701: Receive a third POST request.

[0229] The Playload of the third POST request carries a third message body; the third message body is generated based on the first message.

[0230] Step 702: Parse the third POST request to obtain a first parsing result.

[0231] The first parsing result includes at least one parameter carried by the third message body and used to describe the first message.

[0232] Step 703: Process the third POST request based on the first parsing result.

[0233] Similarly, the third message body carries at least one parameter for describing the first message; and the third POST request is constructed based on the POST method of CoAP.

[0234] In one embodiment, processing the third POST request based on the first parsing result includes:

[0235] When the first parsing result indicates that the second terminal address or the second server address carried in the third message body is the same as the address registered by the electronic device, the first message is processed by setting an application; the setting application indicates a message application corresponding to the first message;

[0236] When the first parsing result indicates that the second terminal address carried in the third message body is the same as the address registered by the third terminal, a fourth POST request is constructed and sent; wherein,

[0237] The Playload of the fourth POST request carries the third message body; the destination address of the fourth POST request points to the third terminal.

[0238] In one embodiment, the method further comprises:

[0239] When the first parsing result indicates that the T parameter of the third POST request is 0, a response is sent back to the message server.

[0240] In practical application, Figure 4In the system architecture example, a message client 1 on a terminal 1 directly connected to a message server, or for Figure 4 In the system architecture example, the application server connected to the message server receives the message:

[0241] After the electronic device receives the third POST request whose destination address is the electronic device itself, it checks whether the T parameter of the third POST request is 0. If the T parameter of the third POST request is 0, it means that the third POST request requires a reply response, then the electronic device replies CoAP ACK to the sender of the third POST request. In addition, the electronic device checks whether the Content-Format of the third POST request is "50", that is, application / json. If the Content-Format of the third POST request is "50", the electronic device detects whether the Payload of the third POST request contains MSGin5GserviceIdentifier. If the Payload of the third POST request contains MSGin5GserviceIdentifier, it means that this is a message of the Internet of Things message service, and the electronic device further parses the Payload of the third POST request.

[0242] The electronic device checks whether the Payload in the third POST request carries the electronic device's own UEServiceID or ASServiceID. If they are the same, the third POST request is a POST request sent to the electronic device. In the case where the electronic device is a terminal, if the Payload in the third POST request carries ApplicationID, the message client of the electronic device sends the first message carried in the third POST request to the corresponding application processing using its own message capability based on ApplicationID; in the case where the electronic device is an application server, if the Payload in the third POST request carries ApplicationID, the first message is processed by the application corresponding to the ApplicationID.

[0243] In electronic equipment Figure 4In the case of terminal 1 in the system architecture example, the message client 1 on terminal 1 detects that the Payload in the third POST request does not carry the address registered by terminal 1, but carries the same address registered by terminal 2, and then determines that the first message in the third POST request is a message that needs to be forwarded to the message client 2 on terminal 2, and the message client 1 sends the message to the message client 2 on terminal 2 through the fourth POST request. Among them, the fourth POST request uses the address registered by the message client 2 on the message client 1 on the terminal 2 as the destination address of the fourth POST request, and keeps the content of the Payload in the third POST request unchanged, and sends the fourth POST request to the message client 2 on the terminal 2.

[0244] for Figure 4 In the system architecture example, the situation where the message client 2 on the terminal 2 which is not directly connected to the message server receives the message:

[0245] After receiving the third POST request whose destination address is Terminal 2, Terminal 2 checks whether the T parameter of the third POST request is 0. If the T parameter of the third POST request is 0, it means that the third POST request requires a reply response, then Terminal 2 replies CoAP ACK to the sender of the third POST request. In addition, Terminal 2 checks whether the Content-Format of the third POST request is "50", that is, application / json. If the Content-Format of the third POST request is "50", Terminal 2 detects whether the Payload of the third POST request contains MSGin5GserviceIdentifier. If the Payload of the third POST request contains MSGin5GserviceIdentifier, it means that this is a message of the Internet of Things message service, and Terminal 2 further parses the Payload of the third POST request.

[0246] The message client 2 checks whether the Payload of the third POST request carries the UEServiceID of the terminal 2. If the Payload in the third POST request carries the ApplicationID, the message client of the terminal 2 sends the first message carried in the third POST request to the corresponding application processing using its own message capability based on the ApplicationID.

[0247] In one embodiment, before receiving the third POST request, the method further includes:

[0248] Construct and send the fifth POST request.

[0249] The destination address of the fifth POST request points to the message server; the Playload of the fifth POST request carries a fourth message body; and the fourth message body carries parameters representing the request to register the electronic device.

[0250] In one embodiment, when constructing a POST request, the method includes:

[0251] Set the POST method parameter T to 0.

[0252] In the message interaction method, device, electronic device, message server and storage medium provided by the embodiments of the present application, the message body carries at least one parameter for describing the first message; the POST request is constructed based on the POST method of CoAP; first, the first terminal constructs and sends a first POST request, and the Playload of the first POST request carries the first message body; the message server receives a sixth POST request carrying the first message body in the Playload, parses the sixth POST request, and obtains a second parsing result, the second parsing result at least represents at least one parameter carried by the first message body for describing the first message, and the message server constructs and sends a third POST request based on the second parsing result, and the Playload of the third POST request carries a third message body; the third message body is generated based on the first message; the electronic device, including a terminal or an application server, receives the third POST request; parses the third POST request to obtain a first parsing result; the first parsing result at least includes at least one parameter carried by the third message body for describing the first message; the electronic device processes the third POST request based on the first parsing result. The above scheme implements message interaction based on the extension of the CoAP protocol message body. Compared with 5G messages, the implementation method of message interaction is lightweight and no longer limited to resource-constrained application scenarios. Compared with the CoAP protocol in related technologies, it adds message application processes such as point-to-point, application-to-point, group messages, broadcast messages, and messages based on message topics, which are more suitable for various specific IoT applications. In addition, it supports terminals that cannot communicate directly with the message server to transfer through other terminals that can communicate with the message server, and realize IoT message interaction with the message server. There is no need to install the corresponding APP on each interactive terminal, which improves the efficiency of message interaction.

[0253] In order to implement the message sending method of the embodiment of the present application, the embodiment of the present application also provides a message sending device, which is set on the first terminal, such as Figure 8 As shown, the device comprises:

[0254] The first sending unit 81 is used to construct and send a first POST request; wherein,

[0255] The POST request is constructed based on the POST method of CoAP; the Playload of the first POST request carries a first message body; the message body carries at least one parameter for describing the first message.

[0256] In one embodiment, the parameters carried in the message body include at least one of the following:

[0257] A service identifier, indicating that the first message is a message of an Internet of Things message service;

[0258] A first terminal address, indicating that the sender of the first message is the terminal pointed to by the first terminal address;

[0259] A first server address, indicating that the sender of the first message is the application server pointed to by the first server address;

[0260] A second terminal address, indicating that the recipient of the first message is the terminal pointed to by the second terminal address;

[0261] A second server address, indicating that the recipient of the first message is the application server pointed to by the second server address;

[0262] A group identifier, indicating that a recipient of the first message is a terminal in a group corresponding to the group identifier;

[0263] An area identifier, indicating that a recipient of the first message is a terminal and / or an application server in an area corresponding to the area identifier;

[0264] The topic identifier indicates that the recipients of the first message are all terminals that are interested in the message topic corresponding to the topic identifier.

[0265] In one embodiment, the destination address of the first POST request points to the message server or the second terminal; wherein,

[0266] The second terminal is directly connected to the message server.

[0267] In one embodiment, the device further comprises:

[0268] The third sending unit is used to construct and send a second POST request before constructing and sending the first POST request; wherein,

[0269] The destination address of the second POST request points to the message server; the Playload of the second POST request carries the second message body; the second message body carries parameters representing the request to register the first terminal.

[0270] In one embodiment, when constructing a POST request, the T parameter of the POST request is set to 0.

[0271] In actual application, the first sending unit 81 and the third sending unit can be implemented by a processor in the message sending device in combination with a communication interface.

[0272] It should be noted that: the message sending device provided in the above embodiment only uses the division of the above program modules as an example when sending a message. In actual applications, the above processing can be assigned to different program modules as needed, that is, the internal structure of the device is divided into different program modules to complete all or part of the processing described above. In addition, the message sending device provided in the above embodiment and the message sending method embodiment belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.

[0273] In order to implement the message receiving method of the embodiment of the present application, the embodiment of the present application also provides a message receiving device, which is arranged on an electronic device, and the electronic device includes a terminal or an application server, such as Fig. 9 As shown, the device comprises:

[0274] The first receiving unit 91 is configured to receive a third POST request; the Playload of the third POST request carries a third message body; the third message body is generated based on the first message;

[0275] A first parsing unit 92 is used to parse the third POST request to obtain a first parsing result; the first parsing result at least includes at least one parameter carried by the third message body for describing the first message;

[0276] The first processing unit 93 is used to process the third POST request based on the first parsing result; wherein:

[0277] The message body carries at least one parameter for describing the first message; the POST request is constructed based on the POST method of CoAP.

[0278] In one embodiment, the parameters carried in the message body include at least one of the following:

[0279] A service identifier, indicating that the first message is a message of an Internet of Things message service;

[0280] A first terminal address, indicating that the sender of the first message is the terminal pointed to by the first terminal address;

[0281] A first server address, indicating that the sender of the first message is the application server pointed to by the first server address;

[0282] A second terminal address, indicating that the recipient of the first message is the terminal pointed to by the second terminal address;

[0283] A second server address, indicating that the recipient of the first message is the application server pointed to by the second server address;

[0284] A group identifier, indicating that a recipient of the first message is a terminal in a group corresponding to the group identifier;

[0285] An area identifier, indicating that a recipient of the first message is a terminal and / or an application server in an area corresponding to the area identifier;

[0286] The topic identifier indicates that the recipients of the first message are all terminals that are interested in the message topic corresponding to the topic identifier.

[0287] In one embodiment, the first processing unit 93 is configured to:

[0288] When the first parsing result indicates that the second terminal address or the second server address carried in the third message body is the same as the address registered by the electronic device, the first message is processed by setting an application; the setting application indicates a message application corresponding to the first message;

[0289] When the first parsing result indicates that the second terminal address carried in the third message body is the same as the address registered by the third terminal, a fourth POST request is constructed and sent; wherein,

[0290] The Playload of the fourth POST request carries the third message body; the destination address of the fourth POST request points to the third terminal.

[0291] In one embodiment, the device further comprises:

[0292] The first response unit is used to reply a response to the message server when the first parsing result indicates that the T parameter of the third POST request is 0.

[0293] In one embodiment, the device further comprises:

[0294] The fourth sending unit is used to construct and send a fifth POST request; wherein,

[0295] The destination address of the fifth POST request points to the message server; the Playload of the fifth POST request carries the fourth message body; the fourth message body carries parameters representing the request to register the electronic device.

[0296] In one embodiment, when constructing a POST request, the parameter T of the POST method is set to 0.

[0297] In actual application, the first receiving unit 91 and the first responding unit can be implemented by a communication interface in the message receiving device, the first parsing unit 92 can be implemented by a processor in the message receiving device, and the first processing unit 93 and the fourth sending unit can be implemented by a processor in the message receiving device combined with a communication interface.

[0298] It should be noted that: the message receiving device provided in the above embodiment only uses the division of the above program modules as an example to illustrate when receiving messages. In actual applications, the above processing can be assigned to different program modules as needed, that is, the internal structure of the device is divided into different program modules to complete all or part of the processing described above. In addition, the message receiving device provided in the above embodiment and the message receiving method embodiment belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.

[0299] In order to implement the message interaction method of the embodiment of the present application, the embodiment of the present application also provides a message interaction device, which is set on the message server, such as Fig.10 As shown, the device comprises:

[0300] The second receiving unit 1001 is configured to receive a sixth POST request; the Playload of the sixth POST request carries the first message body;

[0301] The second parsing unit 1002 is used to parse the sixth POST request to obtain a second parsing result; the second parsing result at least represents at least one parameter carried by the first message body for describing the first message;

[0302] The second sending unit 1003 is used to construct and send a third POST request based on the second parsing result; wherein,

[0303] The message body carries at least one parameter for describing the first message; the POST request is constructed based on the POST method of CoAP; the Playload of the third POST request carries a third message body; and the third message body is generated based on the first message.

[0304] In one embodiment, the parameters carried in the message body include at least one of the following:

[0305] A service identifier, indicating that the first message is a message of an Internet of Things message service;

[0306] A first terminal address, indicating that the sender of the first message is the terminal pointed to by the first terminal address;

[0307] A first server address, indicating that the sender of the first message is the application server pointed to by the first server address;

[0308] A second terminal address, indicating that the recipient of the first message is the terminal pointed to by the second terminal address;

[0309] A second server address, indicating that the recipient of the first message is the application server pointed to by the second server address;

[0310] A group identifier, indicating that a recipient of the first message is a terminal in a group corresponding to the group identifier;

[0311] An area identifier, indicating that a recipient of the first message is a terminal and / or an application server in an area corresponding to the area identifier;

[0312] The topic identifier indicates that the recipients of the first message are all terminals that are interested in the message topic corresponding to the topic identifier.

[0313] In one embodiment, the second sending unit 1003 is used to:

[0314] When the second parsing result indicates that the recipient of the third message is a terminal or an application server, construct the third POST request; wherein,

[0315] The destination address of the third POST request is the address registered by the recipient of the first message; the third message body is the same as the first message body.

[0316] In one embodiment, the second sending unit 1003 is used to:

[0317] When the second parsing result indicates that the first message body carries the group identifier, querying a corresponding group member list by using the group identifier to obtain addresses registered by M fourth terminals;

[0318] Construct M third POST requests; among them,

[0319] The M fourth terminals represent the terminals of all group members in the group corresponding to the group identifier; the destination address of each of the M third POST requests is an address registered by a fourth terminal among the M fourth terminals, and the second terminal address carried in the third message body carried in the Playload of each third POST request points to the corresponding fourth terminal; M is an integer greater than or equal to 1.

[0320] In one embodiment, the second sending unit 1003 is used to:

[0321] When the second parsing result indicates that the fifth message body carries the area identifier, the broadcast capability is called based on the area identifier to construct the third POST request.

[0322] In one embodiment, the second sending unit 1003 is used to:

[0323] In the case where the second parsing result indicates that the fifth message body carries the subject identifier, the addresses registered by N electronic devices that subscribe to the corresponding message subject through the subject identifier; the electronic devices include terminals and / or application servers;

[0324] Construct N third POST requests; among them,

[0325] The destination address of each of the N third POST requests is the registered address of one of the N electronic devices, and the second terminal address carried in the third message body carried in the Playload of each third POST request points to the corresponding terminal or the second server address carried points to the corresponding application server; N is an integer greater than or equal to 1.

[0326] In one embodiment, the device further comprises:

[0327] A third receiving unit is used to receive a second POST request and / or a fifth POST request before receiving the sixth POST request; the message body carried in the Playload of the second POST request and / or the fifth POST request carries a parameter representing the electronic device corresponding to the request for registration;

[0328] A registration unit is used to register the corresponding electronic device based on the second POST request and / or the fifth POST request.

[0329] In one embodiment, the device further comprises:

[0330] a pulling unit, configured to pull a group message of at least one group from the group management server before receiving the sixth POST request; and / or,

[0331] A notification unit, used for notifying at least one electronic device of a group message of a corresponding group before receiving the sixth POST request; wherein,

[0332] The group message includes a group identifier of the corresponding group and a list of group members.

[0333] In actual application, the second receiving unit 1001 and the pulling unit, the notification unit, and the third receiving unit can be implemented by the communication interface in the message interaction device, the second parsing unit 1002 and the registration unit can be implemented by the processor in the message interaction device, and the second sending unit 1003 can be implemented by the processor in the message interaction device combined with the communication interface.

[0334] It should be noted that: the message interaction device provided in the above embodiment only uses the division of the above program modules as an example when receiving messages. In actual applications, the above processing can be assigned to different program modules as needed, that is, the internal structure of the device is divided into different program modules to complete all or part of the processing described above. In addition, the message interaction device provided in the above embodiment and the message interaction method embodiment belong to the same concept. The specific implementation process is detailed in the method embodiment and will not be repeated here.

[0335] Based on the hardware implementation of the above program module, and in order to implement the method on the first terminal side of the embodiment of the present application, the embodiment of the present application also provides a first terminal, such as Fig.11 As shown, the first terminal 1100 includes:

[0336] The first communication interface 1101 is capable of exchanging information with other network nodes;

[0337] The first processor 1102 is connected to the first communication interface 1101 to implement information exchange with other network nodes, and is used to execute the method provided by one or more technical solutions of the first terminal side when running a computer program. The computer program is stored in the first memory 1103.

[0338] Specifically, the first processor 1102 is used to construct a first POST request;

[0339] The first communication interface 1101 is used to send the first POST request; wherein,

[0340] The message body carries at least one parameter for describing the first message; the POST request is constructed based on the POST method of CoAP; and the Playload of the first POST request carries the first message body.

[0341] In one embodiment, the parameters carried in the message body include at least one of the following:

[0342] A service identifier, indicating that the first message is a message of an Internet of Things message service;

[0343] A first terminal address, indicating that the sender of the first message is the terminal pointed to by the first terminal address;

[0344] A first server address, indicating that the sender of the first message is the application server pointed to by the first server address;

[0345] A second terminal address, indicating that the recipient of the first message is the terminal pointed to by the second terminal address;

[0346] A second server address, indicating that the recipient of the first message is the application server pointed to by the second server address;

[0347] A group identifier, indicating that a recipient of the first message is a terminal in a group corresponding to the group identifier;

[0348] An area identifier, indicating that a recipient of the first message is a terminal and / or an application server in an area corresponding to the area identifier;

[0349] The topic identifier indicates that the recipients of the first message are all terminals that are interested in the message topic corresponding to the topic identifier.

[0350] In one embodiment, the destination address of the first POST request points to the message server or the second terminal; wherein,

[0351] The second terminal is directly connected to the message server.

[0352] In one embodiment, the first processor 1102 is further configured to construct a second POST request before constructing and sending the first POST request; the second message body carries a parameter representing the request to register the first terminal;

[0353] The first communication interface 1101 is used to send a second POST request; wherein,

[0354] The destination address of the second POST request points to the message server; the Playload of the second POST request carries the second message body.

[0355] In one embodiment, when constructing a POST request, the T parameter of the POST request is set to 0.

[0356] It should be noted that the specific processing process of the first processor 1102 and the first communication interface 1101 can be understood by referring to the above method.

[0357] Of course, in actual application, the various components in the first terminal 1100 are coupled together through the bus system 1104. It can be understood that the bus system 1104 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 1104 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, Fig.11Various buses are labeled as bus system 1104 .

[0358] The first memory 1103 in the embodiment of the present application is used to store various types of data to support the operation of the first terminal 1100. Examples of such data include: any computer program used to operate on the first terminal 1100.

[0359] The method disclosed in the above embodiment of the present application can be applied to the first processor 1102, or implemented by the first processor 1102. The first processor 1102 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of the hardware in the first processor 1102 or an instruction in the form of software. The above-mentioned first processor 1102 may be a general-purpose processor, a digital signal processor (DSP, Digital Signal Processor), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The first processor 1102 can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor may be a microprocessor or any conventional processor, etc. In combination with the steps of the method disclosed in the embodiment of the present application, it can be directly embodied as a hardware decoding processor to execute, or it can be executed by a combination of hardware and software modules in the decoding processor. The software module may be located in a storage medium, which is located in the first memory 1103, and the first processor 1102 reads the information in the first memory 1103, and completes the steps of the above method in combination with its hardware.

[0360] In an exemplary embodiment, the first terminal 1100 can be implemented by one or more application-specific integrated circuits (ASIC), DSP, programmable logic device (PLD), complex programmable logic device (CPLD), field-programmable gate array (FPGA), general-purpose processor, controller, microcontroller (MCU), microprocessor, or other electronic components to execute the aforementioned method.

[0361] Based on the hardware implementation of the above program modules, and in order to implement the method of the electronic device side of the embodiment of the present application, the embodiment of the present application also provides an electronic device, the electronic device includes a terminal or an application server, such as Fig.12 As shown, the electronic device 1200 includes:

[0362] The second communication interface 1201 is capable of exchanging information with other network nodes;

[0363] The second processor 1202 is connected to the second communication interface 1201 to implement information exchange with other network nodes, and is used to execute the method provided by one or more technical solutions of the electronic device side when running the computer program. The computer program is stored in the second memory 1203.

[0364] Specifically, the second communication interface 1201 is used to receive a third POST request; the Playload of the third POST request carries a third message body; the third message body is generated based on the first message;

[0365] The second processor 1202 is used to parse the third POST request to obtain a first parsing result; and is also used to process the third POST request based on the first parsing result;

[0366] Among them, the first parsing result at least includes at least one parameter carried by the third message body for describing the first message; the message body carries at least one parameter for describing the first message; and the POST request is constructed based on the POST method of CoAP.

[0367] In one embodiment, the parameters carried in the message body include at least one of the following:

[0368] A service identifier, indicating that the first message is a message of an Internet of Things message service;

[0369] A first terminal address, indicating that the sender of the first message is the terminal pointed to by the first terminal address;

[0370] A first server address, indicating that the sender of the first message is the application server pointed to by the first server address;

[0371] A second terminal address, indicating that the recipient of the first message is the terminal pointed to by the second terminal address;

[0372] A second server address, indicating that the recipient of the first message is the application server pointed to by the second server address;

[0373] A group identifier, indicating that a recipient of the first message is a terminal in a group corresponding to the group identifier;

[0374] An area identifier, indicating that a recipient of the first message is a terminal and / or an application server in an area corresponding to the area identifier;

[0375] The topic identifier indicates that the recipients of the first message are all terminals that are interested in the message topic corresponding to the topic identifier.

[0376] In one embodiment, the second processor 1202 is configured to:

[0377] When the first parsing result indicates that the second terminal address or the second server address carried in the third message body is the same as the address registered by the electronic device, the first message is processed by setting an application; the setting application indicates a message application corresponding to the first message;

[0378] If the first parsing result indicates that the second terminal address carried in the third message body is the same as the address registered by the third terminal, constructing a fourth POST request;

[0379] The second communication interface 1201 is also used to send the fourth POST request; wherein,

[0380] The Playload of the fourth POST request carries the third message body; the destination address of the fourth POST request points to the third terminal.

[0381] In one embodiment, the second communication interface 1201 is further used for:

[0382] When the first parsing result indicates that the T parameter of the third POST request is 0, a response is sent back to the message server.

[0383] In one embodiment, the second processor 1202 is further configured to construct a fifth request before receiving the third POST request; the fourth message body carries a parameter representing the request to register the electronic device;

[0384] The second communication interface is used to send a fifth POST request; wherein,

[0385] The destination address of the fifth POST request points to the message server; the Playload of the fifth POST request carries the fourth message body.

[0386] In one embodiment, when constructing a POST request, the parameter T of the POST method is set to 0.

[0387] It should be noted that the specific processing process of the second processor 1202 and the second communication interface 1201 can be understood by referring to the above method.

[0388] Of course, in actual application, the various components in the electronic device 1200 are coupled together through the bus system 1204. It can be understood that the bus system 1204 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 1204 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, Fig.12 Various buses are labeled as bus system 1204.

[0389] The second memory 1203 in the embodiment of the present application is used to store various types of data to support the operation of the electronic device 1200. Examples of such data include: any computer program used to operate on the electronic device 1200.

[0390] The method disclosed in the above embodiment of the present application can be applied to the second processor 1202, or implemented by the second processor 1202. The second processor 1202 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the second processor 1202. The above-mentioned second processor 1202 may be a general-purpose processor, DSP, or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The second processor 1202 can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor may be a microprocessor or any conventional processor, etc. In combination with the steps of the method disclosed in the embodiment of the present application, it can be directly embodied as a hardware decoding processor to execute, or it can be executed by a combination of hardware and software modules in the decoding processor. The software module may be located in a storage medium, which is located in the second memory 1203, and the second processor 1202 reads the information in the second memory 1203 and completes the steps of the above method in combination with its hardware.

[0391] In an exemplary embodiment, the electronic device 1200 may be implemented by one or more ASICs, DSPs, PLDs, CPLDs, FPGAs, general purpose processors, controllers, MCUs, Microprocessors, or other electronic components to perform the aforementioned methods.

[0392] Based on the hardware implementation of the above program modules, and in order to implement the method of the message server side of the embodiment of the present application, the embodiment of the present application also provides a message server, such as Fig.13 As shown, the message server 1300 includes:

[0393] The third communication interface 1301 is capable of exchanging information with other network nodes;

[0394] The third processor 1302 is connected to the third communication interface 1301 to implement information interaction with other network nodes, and is used to execute the method provided by one or more technical solutions of the message server side when running the computer program. The computer program is stored in the third memory 1303.

[0395] Specifically, the third communication interface 1301 is used to receive a sixth POST request; the Playload of the sixth POST request carries the first message body;

[0396] The third processor 1302 is configured to parse the sixth POST request to obtain a second parsing result; and construct a third POST request based on the second parsing result; the second parsing result at least represents at least one parameter carried by the first message body for describing the first message;

[0397] The third communication interface 1301 is also used to send the third POST request; wherein,

[0398] The message body carries at least one parameter for describing the corresponding message; the POST request is constructed based on the POST method of CoAP; the Playload of the third POST request carries a third message body; the third message body is generated based on the first message.

[0399] In one embodiment, the parameters carried in the message body include at least one of the following:

[0400] A service identifier, indicating that the first message is a message of an Internet of Things message service;

[0401] A first terminal address, indicating that the sender of the first message is the terminal pointed to by the first terminal address;

[0402] A first server address, indicating that the sender of the first message is the application server pointed to by the first server address;

[0403] A second terminal address, indicating that the recipient of the first message is the terminal pointed to by the second terminal address;

[0404] A second server address, indicating that the recipient of the first message is the application server pointed to by the second server address;

[0405] A group identifier, indicating that a recipient of the first message is a terminal in a group corresponding to the group identifier;

[0406] An area identifier, indicating that a recipient of the first message is a terminal and / or an application server in an area corresponding to the area identifier;

[0407] The topic identifier indicates that the recipients of the first message are all terminals that are interested in the message topic corresponding to the topic identifier.

[0408] In one embodiment, the third processor 1302 is configured to:

[0409] When the second parsing result indicates that the recipient of the third message is a terminal or an application server, construct the third POST request; wherein,

[0410] The destination address of the third POST request is the address registered by the recipient of the first message; the third message body is the same as the first message body.

[0411] In one embodiment, the third processor 1302 is configured to:

[0412] When the second parsing result indicates that the first message body carries the group identifier, querying a corresponding group member list by using the group identifier to obtain addresses registered by M fourth terminals;

[0413] Construct M third POST requests; among them,

[0414] The M fourth terminals represent the terminals of all group members in the group corresponding to the group identifier; the destination address of each of the M third POST requests is an address registered by a fourth terminal among the M fourth terminals, and the second terminal address carried in the third message body carried in the Playload of each third POST request points to the corresponding fourth terminal; M is an integer greater than or equal to 1.

[0415] In one embodiment, the third processor 1302 is configured to:

[0416] When the second parsing result indicates that the fifth message body carries the area identifier, the broadcast capability is called based on the area identifier to construct the third POST request.

[0417] In one embodiment, the third processor 1302 is configured to:

[0418] In the case where the second parsing result indicates that the fifth message body carries the subject identifier, the addresses registered by N electronic devices that subscribe to the corresponding message subject through the subject identifier; the electronic devices include terminals and / or application servers;

[0419] Construct N third POST requests; among them,

[0420] The destination address of each of the N third POST requests is the registered address of one of the N electronic devices, and the second terminal address carried in the third message body carried in the Playload of each third POST request points to the corresponding terminal or the second server address carried points to the corresponding application server; N is an integer greater than or equal to 1.

[0421] In one embodiment, the third communication interface 1301 is further used for:

[0422] Before receiving the sixth POST request, receiving a second POST request and / or a fifth POST request; the message body carried in the Playload of the second POST request and / or the fifth POST request carries a parameter representing the electronic device corresponding to the request for registration;

[0423] The third processor 1302 is configured to register the corresponding electronic device based on the second POST request and / or the fifth POST request.

[0424] In one embodiment, the third communication interface 1301 is further used for:

[0425] Before receiving the sixth POST request, pulling a group message of at least one group from the group management server; and / or,

[0426] Before receiving the sixth POST request, at least one electronic device is notified of a group message of the corresponding group; wherein,

[0427] The group message includes a group identifier of the corresponding group and a list of group members.

[0428] Of course, in actual application, the various components in the message server 1300 are coupled together through the bus system 1304. It can be understood that the bus system 1304 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 1304 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, Fig.13 Various buses are labeled as bus system 1304 .

[0429] The third memory 1303 in the embodiment of the present application is used to store various types of data to support the operation of the message server 1300. Examples of such data include: any computer program used to operate on the message server 1300.

[0430] The method disclosed in the above embodiment of the present application can be applied to the third processor 1302, or implemented by the third processor 1302. The third processor 1302 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by an integrated logic circuit of hardware or software instructions in the third processor 1302. The third processor 1302 mentioned above can be a general-purpose processor, a DSP, or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The third processor 1302 can implement or execute the various methods, steps and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor can be a microprocessor or any conventional processor, etc. In combination with the steps of the method disclosed in the embodiment of the present application, it can be directly embodied as a hardware decoding processor to execute, or it can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium, which is located in the third memory 1303. The third processor 1302 reads the information in the third memory 1303 and completes the steps of the above method in combination with its hardware.

[0431] In an exemplary embodiment, the message server 1300 may be implemented by one or more ASICs, DSPs, PLDs, CPLDs, FPGAs, general purpose processors, controllers, MCUs, Microprocessors, or other electronic components to perform the aforementioned methods.

[0432] It can be understood that the memory (first memory 1203, second memory 1303, third memory 1303) of the embodiment of the present application can be a volatile memory or a non-volatile memory, and can also include both volatile and non-volatile memories. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a ferromagnetic random access memory, a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM); the magnetic surface memory can be a disk memory or a tape memory. The volatile memory can be a random access memory (RAM), which is used as an external cache.By way of example but not limitation, many forms of RAM are available, such as static random access memory (SRAM), synchronous static random access memory (SSRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM), direct memory bus random access memory (DRRAM). The memory described in the embodiments of the present application is intended to include but is not limited to these and any other suitable types of memory.

[0433] In an exemplary embodiment, the embodiment of the present application further provides a storage medium, namely a computer storage medium, specifically a computer-readable storage medium, for example, including a first memory 1103 storing a computer program, and the computer program can be executed by the first processor 1102 of the first terminal 1100 to complete the steps of the first terminal side method. For another example, a second memory 1203 storing a computer program is included, and the computer program can be executed by the second processor 1202 of the electronic device 1200 to complete the steps of the electronic device side method. For another example, a third memory 1303 storing a computer program is included, and the computer program can be executed by the third processor 1302 of the message server 1300 to complete the steps of the message server side method. The computer-readable storage medium can be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, FlashMemory, magnetic surface memory, optical disk, or CD-ROM.

[0434] It should be noted that: "first", "second", etc. are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0435] The term "and / or" herein is only a description of the association relationship of the associated objects, indicating that there may be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the term "at least one" herein represents any combination of at least two of any one or more of a plurality of. For example, including at least one of A, B, and C can represent including any one or more elements selected from the set consisting of A, B, and C.

[0436] In addition, the technical solutions described in the embodiments of the present application can be combined arbitrarily without conflict.

[0437] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application.

Claims

1. A message sending method, characterized in that: Applied to a first terminal, the method includes: Construct and send a first POST request; the POST request is constructed based on the POST method of the restricted application protocol CoAP; wherein, The bearer Playload of the first POST request carries a first message body; the first message body carries a first message and at least one parameter used to describe the first message; when the first terminal does not support direct connection with the message server, the destination address of the first POST request points to the address of the second terminal, and the second terminal is directly connected to the message server.

2. The method according to claim 1, characterized in that The parameters carried in the message body include at least one of the following: A service identifier, indicating that the first message is a message of an Internet of Things message service; A first terminal address, indicating that the sender of the first message is the terminal pointed to by the first terminal address; A first server address, indicating that the sender of the first message is the application server pointed to by the first server address; A second terminal address, indicating that the recipient of the first message is the terminal pointed to by the second terminal address; A second server address, indicating that the recipient of the first message is the application server pointed to by the second server address; A group identifier, indicating that a recipient of the first message is a terminal in a group corresponding to the group identifier; An area identifier, indicating that a recipient of the first message is a terminal and / or an application server in an area corresponding to the area identifier; The topic identifier indicates that the recipients of the first message are all terminals that are interested in the message topic corresponding to the topic identifier.

3. The method according to claim 1, characterized in that The destination address of the first POST request points to the message server or the second terminal; wherein, The second terminal is directly connected to the message server.

4. The method according to claim 1, characterized in that: Before constructing and sending the first POST request, the method further includes: Construct and send a second POST request; wherein, The destination address of the second POST request points to the message server; the Playload of the second POST request carries a second message body; and the second message body carries parameters representing the request to register the first terminal.

5. The method according to any one of claims 1 to 4, characterized in that: When constructing a POST request, the method includes: Set the T parameter of the POST request to 0.

6. A message receiving method, characterized in that: Applied to an electronic device, the electronic device includes a terminal or an application server, and the method includes: A third POST request is received; the Playload of the third POST request carries a third message body; the third message body is generated based on the first message; Parsing the third POST request to obtain a first parsing result; the first parsing result at least includes at least one parameter carried by the third message body for describing the first message; Processing the third POST request based on the first parsing result; wherein the third message body carries the first message and at least one parameter used to describe the first message; the POST request is constructed based on the POST method of CoAP; The processing of the third POST request based on the first parsing result includes: When the first parsing result indicates that the second terminal address or the second server address carried in the third message body is the same as the address registered by the electronic device, the first message is processed by setting an application; the setting application indicates a message application corresponding to the first message; When the first parsing result indicates that the second terminal address carried in the third message body is the same as the address registered by the third terminal, a fourth POST request is constructed and sent; wherein the Playload of the fourth POST request carries the third message body; and the destination address of the fourth POST request points to the third terminal.

7. The method according to claim 6, characterized in that The parameters carried in the message body include at least one of the following: A service identifier, indicating that the first message is a message of an Internet of Things message service; A first terminal address, indicating that the sender of the first message is the terminal pointed to by the first terminal address; A first server address, indicating that the sender of the first message is the application server pointed to by the first server address; A second terminal address, indicating that the recipient of the first message is the terminal pointed to by the second terminal address; A second server address, indicating that the recipient of the first message is the application server pointed to by the second server address; A group identifier, indicating that a recipient of the first message is a terminal in a group corresponding to the group identifier; An area identifier, indicating that a recipient of the first message is a terminal and / or an application server in an area corresponding to the area identifier; The topic identifier indicates that the recipients of the first message are all terminals that are interested in the message topic corresponding to the topic identifier.

8. The method according to claim 6, characterized in that The method further comprises: When the first parsing result indicates that the T parameter of the third POST request is 0, a response is sent back to the message server.

9. The method according to claim 6, characterized in that Before receiving the third POST request, the method further includes: Construct and send the fifth POST request; wherein, The destination address of the fifth POST request points to the message server; the Playload of the fifth POST request carries a fourth message body; the fourth message body carries parameters representing the request to register the electronic device.

10. The method according to claim 6, characterized in that When constructing a POST request, the method includes: Set the POST method parameter T to 0.

11. A message interaction method, characterized in that: Applied to a message server, the method comprises: A sixth POST request is received; the Playload of the sixth POST request carries the first message body; Parsing the sixth POST request to obtain a second parsing result; the second parsing result at least represents at least one parameter carried by the first message body for describing the first message; Construct and send a third POST request based on the second parsing result; wherein, The first message body carries the first message and at least one parameter used to describe the first message; the POST request is constructed based on the POST method of CoAP; the Playload of the third POST request carries the third message body; and the third message body is generated based on the first message.

12. The method according to claim 11, characterized in that The parameters carried in the message body include at least one of the following: A service identifier, indicating that the first message is a message of an Internet of Things message service; A first terminal address, indicating that the sender of the first message is the terminal pointed to by the first terminal address; A first server address, indicating that the sender of the first message is the application server pointed to by the first server address; A second terminal address, indicating that the recipient of the first message is the terminal pointed to by the second terminal address; A second server address, indicating that the recipient of the first message is the application server pointed to by the second server address; A group identifier, indicating that a recipient of the first message is a terminal in a group corresponding to the group identifier; An area identifier, indicating that a recipient of the first message is a terminal and / or an application server in an area corresponding to the area identifier; The topic identifier indicates that the recipients of the first message are all terminals that are interested in the message topic corresponding to the topic identifier.

13. The method according to claim 11, characterized in that Constructing a third POST request based on the second parsing result includes: When the second parsing result indicates that the recipient of the first message is a terminal or an application server, construct the third POST request; wherein, The destination address of the third POST request is the address registered by the recipient of the first message; the third message body is the same as the first message body.

14. The method according to claim 12, characterized in that Constructing a third POST request based on the second parsing result includes: When the second parsing result indicates that the first message body carries the group identifier, querying a corresponding group member list by using the group identifier to obtain addresses registered by M fourth terminals; Construct M third POST requests; among them, The M fourth terminals represent the terminals of all group members in the group corresponding to the group identifier; the destination address of each of the M third POST requests is an address registered by a fourth terminal among the M fourth terminals, and the second terminal address carried in the third message body carried in the Playload of each third POST request points to the corresponding fourth terminal; M is an integer greater than or equal to 1.

15. The method according to claim 12, characterized in that Constructing a third POST request based on the second parsing result includes: When the second parsing result indicates that the first message body carries the area identifier, the broadcast capability is called based on the area identifier to construct the third POST request.

16. The method according to claim 12, characterized in that Constructing a third POST request based on the second parsing result includes: In the case where the second parsing result indicates that the first message body carries the subject identifier, the addresses registered by N electronic devices that subscribe to the corresponding message subject through the subject identifier; the electronic devices include a terminal and / or an application server; Construct N third POST requests; among them, The destination address of each of the N third POST requests is the registered address of one of the N electronic devices, and the second terminal address carried in the third message body carried in the Playload of each third POST request points to the corresponding terminal or the second server address carried points to the corresponding application server; N is an integer greater than or equal to 1.

17. The method according to claim 11, characterized in that Before receiving the sixth POST request, the method further includes: receiving a second POST request and / or a fifth POST request; the message body carried in the Playload of the second POST request and / or the fifth POST request carries a parameter representing the electronic device corresponding to the request for registration; The corresponding electronic device is registered based on the second POST request and / or the fifth POST request.

18. The method according to claim 11, characterized in that Before receiving the sixth POST request, the method further includes: Pulling a group message of at least one group from a group management server; and / or, Notifying at least one electronic device of a group message of a corresponding group; wherein, The group message includes a group identifier of the corresponding group and a list of group members.

19. A message sending device, characterized in that: The method is set on the first terminal and includes: The first sending unit is used to construct and send a first POST request; wherein, The POST request is constructed based on the POST method of CoAP; the Playload of the first POST request carries a first message body; the first message body carries a first message and at least one parameter used to describe the first message; when the first terminal does not support direct connection with the message server, the destination address of the first POST request points to the address of the second terminal, and the second terminal is directly connected to the message server.

20. A message receiving device, characterized in that: Set on an electronic device, the electronic device includes a terminal or an application server, including: A first receiving unit is configured to receive a third POST request; the Playload of the third POST request carries a third message body; and the third message body is generated based on the first message; A first parsing unit, configured to parse the third POST request to obtain a first parsing result; the first parsing result at least includes at least one parameter carried by the third message body and used to describe the first message; A first processing unit, used to process the third POST request based on the first parsing result; specifically, when the first parsing result indicates that the second terminal address or the second server address carried in the third message body is the same as the address registered by the electronic device, to process the first message by setting an application; when the first parsing result indicates that the second terminal address carried in the third message body is the same as the address registered by the third terminal, to construct and send a fourth POST request; wherein the third message body carries the first message and at least one parameter for describing the first message; the POST request is constructed based on the POST method of CoAP; the setting application indicates the message application corresponding to the first message; the Playload of the fourth POST request carries the third message body; and the destination address of the fourth POST request points to the third terminal.

21. A message interaction device, characterized in that: include: A second receiving unit, configured to receive a sixth POST request; The Playload of the sixth POST request carries the first message body; A second parsing unit, configured to parse the sixth POST request to obtain a second parsing result; the second parsing result at least represents at least one parameter carried by the first message body and used to describe the first message; The second sending unit is used to construct and send a third POST request based on the second parsing result; wherein, The first message body carries the first message and at least one parameter used to describe the first message; the POST request is constructed based on the POST method of CoAP; the Playload of the third POST request carries the third message body; and the third message body is generated based on the first message.

22. A first terminal, characterized in that: include: A first processor and a first communication interface; wherein, The first processor is used to construct a first POST request; the POST request is constructed using the POST method of CoAP; The first communication interface is used to send the first POST request; wherein, The bearer Playload of the first POST request carries a first message body; the first message body carries a first message and at least one parameter used to describe the first message; when the first terminal does not support direct connection with the message server, the destination address of the first POST request points to the address of the second terminal, and the second terminal is directly connected to the message server.

23. An electronic device, characterized in that: The electronic device includes a terminal or an application server, and the electronic device includes: a second processor and a second communication interface; wherein, The second communication interface is used to receive a third POST request; the Playload of the third POST request carries a third message body; the third message body is generated based on the first message; The second processor is used to parse the third POST request to obtain a first parsing result; and to process the third POST request based on the first parsing result; specifically, when the first parsing result indicates that the second terminal address or the second server address carried in the third message body is the same as the address registered by the electronic device, process the first message by setting an application; when the first parsing result indicates that the second terminal address carried in the third message body is the same as the address registered by the third terminal, construct and send a fourth POST request; wherein the third message body carries the first message and at least one parameter for describing the first message; the POST request is constructed based on the POST method of CoAP; the first parsing result includes at least one parameter carried in the third message body for describing the first message; the setting application indicates the message application corresponding to the first message; the Playload of the fourth POST request carries the third message body; the destination address of the fourth POST request points to the third terminal.

24. A message server, characterized in that: include: A third processor and a third communication interface; wherein, The third communication interface is used to receive a sixth POST request; the Playload of the sixth POST request carries the first message body; The third processor is used to parse the sixth POST request to obtain a second parsing result; and construct a third POST request based on the second parsing result; the second parsing result at least represents at least one parameter carried by the first message body for describing the first message; The third communication interface is also used to send the third POST request; wherein, The first message body carries the first message and at least one parameter used to describe the first message; the POST request is constructed based on the POST method of CoAP; the Playload of the third POST request carries the third message body; and the third message body is generated based on the first message.

25. A first terminal, characterized in that: include: a first processor and a first memory for storing a computer program executable on the processor, Wherein, when the first processor is used to run the computer program, the steps of the method described in any one of claims 1 to 5 are executed.

26. An electronic device, characterized in that: include: a second processor and a second memory for storing a computer program executable on the processor, Wherein, when the second processor is used to run the computer program, the steps of the method described in any one of claims 6 to 10 are executed.

27. A message server, characterized in that: include: a third processor and a third memory for storing a computer program executable on the processor, Wherein, the third processor is used to execute the steps of the method described in any one of claims 11 to 18 when running the computer program.

28. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, it implements the steps of the method described in any one of claims 1 to 5, or implements the steps of the method described in any one of claims 6 to 10, or implements the steps of the method described in any one of claims 11 to 18.

Citation Information

Patent Citations

  • Internet of thing resource obtaining method, client and internet of thing resource devices

    CN103227803A