[go: up one dir, main page]

CN105722040B - Method, device and system for transmitting business messages - Google Patents

Method, device and system for transmitting business messages Download PDF

Info

Publication number
CN105722040B
CN105722040B CN201410727947.2A CN201410727947A CN105722040B CN 105722040 B CN105722040 B CN 105722040B CN 201410727947 A CN201410727947 A CN 201410727947A CN 105722040 B CN105722040 B CN 105722040B
Authority
CN
China
Prior art keywords
resource
server
message
terminal
mqtt
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201410727947.2A
Other languages
Chinese (zh)
Other versions
CN105722040A (en
Inventor
吴加明
张永靖
高莹
殷佳欣
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Cloud Computing Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN201410727947.2A priority Critical patent/CN105722040B/en
Priority to PCT/CN2015/083224 priority patent/WO2016086659A1/en
Publication of CN105722040A publication Critical patent/CN105722040A/en
Application granted granted Critical
Publication of CN105722040B publication Critical patent/CN105722040B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • H04W4/12Messaging; Mailboxes; Announcements

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Telephonic Communication Services (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

本发明公开了一种业务消息的传输方法、装置及系统,涉及通信技术领域,能够减小M2M服务器与MQTT服务器之间的通信开销。该方法包括:当M2M服务器需向与M2M服务器中存储的第一资源对应的至少两个M2M终端发送相同内容的第一业务消息时,M2M服务器确定为该第一资源生成的第一公共主题,并向MQTT服务器发送一次第一MQTT消息,该第一MQTT消息中包含该第一业务消息和该第一公共主题,该第一业务消息中包含发送给该至少两个M2M终端的相同内容。该方法应用于M2M系统。

The invention discloses a service message transmission method, device and system, relates to the technical field of communication, and can reduce communication overhead between an M2M server and an MQTT server. The method includes: when the M2M server needs to send a first service message with the same content to at least two M2M terminals corresponding to the first resource stored in the M2M server, the M2M server determines the first common topic generated for the first resource, And send a first MQTT message to the MQTT server once, the first MQTT message includes the first service message and the first common topic, and the first service message includes the same content sent to the at least two M2M terminals. The method is applied to an M2M system.

Description

一种业务消息的传输方法、装置及系统Method, device and system for transmitting business messages

技术领域technical field

本发明涉及通信技术领域,尤其涉及一种业务消息的传输方法、装置及系统。The present invention relates to the technical field of communication, in particular to a method, device and system for transmitting business messages.

背景技术Background technique

随着机器对机器(英文:Machine-to-Machine,缩写:M2M)通信在通信技术中的广泛应用,物联网领域国际标准化组织定义了一种消息序列遥测传输(英文:message queuetelemetry transport,缩写:MQTT)协议,以用于传输M2M系统中的业务消息。MQTT协议支持一种主题订阅(subscribe)/发布(英文:publish)机制,即发送端可将待传输的业务消息承载在一条MQTT消息上发布,该MQTT消息中包含一个主题。当接收端订阅了该主题时,接收端可以接收到包含该主题的MQTT消息,从而发送端和接收端可以利用这种主题订阅/发布机制完成该业务消息的传输。With the widespread application of machine-to-machine (English: Machine-to-Machine, abbreviation: M2M) communication in communication technology, the International Organization for Standardization in the Internet of Things has defined a message sequence telemetry transport (English: message queuetelemetry transport, abbreviation: MQTT) protocol for transmitting service messages in the M2M system. The MQTT protocol supports a topic subscription (subscribe)/publish (English: publish) mechanism, that is, the sender can publish the service message to be transmitted on an MQTT message, and the MQTT message contains a topic. When the receiving end subscribes to the topic, the receiving end can receive the MQTT message containing the topic, so that the sending end and the receiving end can use this topic subscription/publishing mechanism to complete the transmission of the business message.

目前,在MQTT协议中,接收端可根据该接收端的资源标识配置需订阅的主题的名称,并向MQTT服务器(英文:MQTT server)订阅该主题。当发送端需向接收端发送业务消息时,发送端可将接收端的资源标识(即该业务消息的目的地址)配置在待发布主题的名称中作为承载该业务消息的MQTT消息中包含的主题,并将该MQTT消息发送至MQTT服务器,从而由MQTT服务器根据MQTT消息中的主题将该MQTT消息转发给订阅过该主题的接收端。接收端接收到MQTT消息后,可根据该MQTT消息中承载的业务消息,对MQTT消息中包含的主题所指示的资源执行相应的操作。由于在MQTT协议中,MQTT消息中包含的主题的名称中配置了业务消息的目的地址,因此若发送端待发送的业务消息的目的地址不同,则发送端待发布的MQTT消息中的主题就不同。其中,发送端可以为M2M终端,接收端可以为M2M服务器;或者发送端可以为M2M服务器,接收端可以为M2M终端。Currently, in the MQTT protocol, the receiving end can configure the name of the topic to be subscribed according to the resource identifier of the receiving end, and subscribe to the topic with the MQTT server (English: MQTT server). When the sending end needs to send a business message to the receiving end, the sending end can configure the resource identifier of the receiving end (that is, the destination address of the business message) in the name of the topic to be published as the topic contained in the MQTT message carrying the business message, And send the MQTT message to the MQTT server, so that the MQTT server forwards the MQTT message to the receiving end that has subscribed to the topic according to the topic in the MQTT message. After receiving the MQTT message, the receiving end can perform corresponding operations on the resources indicated by the topic contained in the MQTT message according to the service message carried in the MQTT message. In the MQTT protocol, the destination address of the business message is configured in the name of the topic contained in the MQTT message, so if the destination address of the business message to be sent by the sender is different, the topic in the MQTT message to be published by the sender will be different . Wherein, the sending end may be an M2M terminal, and the receiving end may be an M2M server; or the sending end may be an M2M server, and the receiving end may be an M2M terminal.

在M2M系统中,M2M服务器可能会向多个M2M终端发送内容相同的业务消息,例如群组管理中的群组成员访问消息或者订阅通知管理中的订阅通知消息等。此时,若根据上述主题订阅/发布机制,则由于多个M2M终端的资源标识均不相同,即该业务消息的目的地址均不相同,因此,M2M服务器需向MQTT服务器发布多个包含不同的主题的MQTT消息,从而增加了M2M服务器与MQTT服务器之间的通信开销。In an M2M system, an M2M server may send a service message with the same content to multiple M2M terminals, such as a group member access message in group management or a subscription notification message in subscription notification management. At this time, according to the above topic subscription/publishing mechanism, since the resource identifiers of multiple M2M terminals are different, that is, the destination addresses of the service messages are all different, therefore, the M2M server needs to publish multiple The MQTT message of the topic, thus increasing the communication overhead between the M2M server and the MQTT server.

发明内容Contents of the invention

本发明提供一种业务消息的传输方法、装置及系统,能够减小M2M服务器与MQTT服务器之间的通信开销。The present invention provides a service message transmission method, device and system, which can reduce communication overhead between an M2M server and an MQTT server.

为达到上述目的,本发明采用如下技术方案:To achieve the above object, the present invention adopts the following technical solutions:

第一方面,本发明提供一种业务消息的传输方法,包括:In a first aspect, the present invention provides a method for transmitting service messages, including:

机器对机器M2M终端接收消息序列遥测传输MQTT服务器发送的第一MQTT消息,所述第一MQTT消息中包含第一业务消息和第一公共主题;The machine-to-machine M2M terminal receives the first MQTT message sent by the message sequence telemetry transmission MQTT server, and the first MQTT message includes the first service message and the first common topic;

所述M2M终端根据保存的所述第一公共主题与在所述M2M终端中存储的资源的标识之间的映射关系,查找与所述第一公共主题对应的所述在所述M2M终端中存储的资源的标识;The M2M terminal searches for the resource identifier stored in the M2M terminal corresponding to the first public topic according to the saved mapping relationship between the first public topic and the identifier of the resource stored in the M2M terminal. The identity of the resource;

所述M2M终端对所述在所述M2M终端中存储的资源的标识指示的所述在所述M2M终端中存储的资源执行与所述第一业务消息相关的操作。The M2M terminal performs an operation related to the first service message on the resource stored in the M2M terminal indicated by the identifier of the resource stored in the M2M terminal.

在第一方面的第一种可能的实现方式中,所述M2M终端接收MQTT服务器发送的第一MQTT消息之前,所述方法还包括:In a first possible implementation manner of the first aspect, before the M2M terminal receives the first MQTT message sent by the MQTT server, the method further includes:

所述M2M终端接收所述MQTT服务器发送的第二MQTT消息,所述第二MQTT消息中包含第二业务消息和第一主题,所述第二业务消息中包含所述第一公共主题,所述第一主题中包含所述在所述M2M终端中存储的资源的标识;The M2M terminal receives a second MQTT message sent by the MQTT server, the second MQTT message includes a second service message and a first topic, the second service message includes the first common topic, and the The first topic includes the identifier of the resource stored in the M2M terminal;

所述M2M终端保存所述第一公共主题与所述在所述M2M终端中存储的资源的标识之间的映射关系;The M2M terminal saves the mapping relationship between the first common theme and the identifier of the resource stored in the M2M terminal;

所述M2M终端向所述MQTT服务器发送第一订阅主题的消息,所述第一订阅主题的消息中包含所述第一公共主题以及所述M2M终端的标识。The M2M terminal sends a first subscription topic message to the MQTT server, and the first subscription topic message includes the first public topic and the identifier of the M2M terminal.

结合第一方面的第一种可能的实现方式,在第二种可能的实现方式中,所述M2M终端接收所述MQTT服务器发送的第二MQTT消息之前,所述方法还包括:With reference to the first possible implementation of the first aspect, in a second possible implementation, before the M2M terminal receives the second MQTT message sent by the MQTT server, the method further includes:

所述M2M终端向所述MQTT服务器发送第二订阅主题的消息,所述第二订阅主题的消息包含所述M2M终端需要订阅的所述第一主题。The M2M terminal sends a second subscription topic message to the MQTT server, where the second subscription topic message includes the first topic that the M2M terminal needs to subscribe to.

第二方面,本发明提供一种业务消息的传输方法,包括:In a second aspect, the present invention provides a method for transmitting service messages, including:

当机器对机器M2M服务器需向与所述M2M服务器中存储的第一资源对应的至少两个M2M终端发送相同内容的第一业务消息时,When the machine-to-machine M2M server needs to send a first service message with the same content to at least two M2M terminals corresponding to the first resources stored in the M2M server,

所述M2M服务器确定为所述第一资源生成的第一公共主题;The M2M server determines a first common theme generated for the first resource;

所述M2M服务器向消息序列遥测传输MQTT服务器发送一次第一MQTT消息,所述第一MQTT消息中包含所述第一业务消息和所述第一公共主题,所述第一业务消息中包含发送给所述至少两个M2M终端的相同内容。The M2M server sends a first MQTT message to the message sequence telemetry transmission MQTT server once, the first MQTT message includes the first service message and the first public topic, and the first service message includes the message sent to Same content of the at least two M2M terminals.

在第二方面的第一种可能的实现方式中,所述M2M服务器确定为所述第一资源生成的第一公共主题之前,所述方法还包括:In a first possible implementation manner of the second aspect, before the M2M server determines the first common topic generated for the first resource, the method further includes:

所述M2M服务器为所述第一资源生成所述第一公共主题;generating, by the M2M server, the first common theme for the first resource;

所述M2M服务器将所述至少两个M2M终端中的每一个M2M终端中存储的第二资源的标识作为该M2M终端已经订阅的第一主题包含的内容;The M2M server uses the identifier of the second resource stored in each of the at least two M2M terminals as the content contained in the first topic that the M2M terminal has subscribed to;

所述M2M服务器通过所述MQTT服务器向所述至少两个M2M终端中的每一个M2M终端发送一条第二MQTT消息,所述第二MQTT消息中包含第二业务消息和所述第一主题,所述第二业务消息中包含所述第一公共主题。The M2M server sends a second MQTT message to each of the at least two M2M terminals through the MQTT server, and the second MQTT message includes a second service message and the first topic, so The second service message includes the first public topic.

结合第二方面的第一种可能的实现方式,在第二种可能的实现方式中,In combination with the first possible implementation of the second aspect, in the second possible implementation,

当所述第一资源为群组资源时,所述第二资源的标识为所述群组资源中的成员资源的标识,所述M2M服务器为所述第一资源生成所述第一公共主题具体为:When the first resource is a group resource, the identifier of the second resource is an identifier of a member resource in the group resource, and the M2M server generates the first public theme specific information for the first resource for:

所述M2M服务器在接收到所述群组资源的创建请求消息后,根据为所述群组资源分配的所述群组资源的标识,为所述群组资源生成所述群组资源的第一公共主题,所述群组资源的第一公共主题中包含所述群组资源的标识;After receiving the creation request message of the group resource, the M2M server generates the first group resource ID for the group resource according to the identifier of the group resource allocated to the group resource. A public topic, the first public topic of the group resource includes the identification of the group resource;

所述M2M服务器将所述至少两个M2M终端中的每一个M2M终端中存储的第二资源的标识作为该M2M终端已经订阅的第一主题包含的内容具体为:The M2M server uses the identifier of the second resource stored in each of the at least two M2M terminals as the first topic that the M2M terminal has subscribed to. The content contained is specifically:

所述M2M服务器将所述成员资源的标识,作为与所述成员资源的标识对应的M2M终端已经订阅的第一主题包含的内容;The M2M server uses the identifier of the member resource as the content included in the first topic that the M2M terminal corresponding to the identifier of the member resource has subscribed to;

其中,所述第二业务消息为所述M2M服务器对与所述成员资源的标识对应的M2M终端的通知消息。Wherein, the second service message is a notification message sent by the M2M server to the M2M terminal corresponding to the identifier of the member resource.

结合第二方面的第一种可能的实现方式,在第三种可能的实现方式中,当所述第一资源为群组资源时,所述第二资源的标识为所述群组资源中的成员资源的标识,所述M2M服务器为所述第一资源生成所述第一公共主题具体为:With reference to the first possible implementation manner of the second aspect, in a third possible implementation manner, when the first resource is a group resource, the identifier of the second resource is the The identifier of the member resource, the M2M server generating the first common topic for the first resource is specifically:

所述M2M服务器在接收到对所述群组资源的成员资源的访问请求消息后,所述M2M服务器根据所述对所述群组资源的成员资源的访问请求消息中包含的所述群组资源的标识确定没有与所述群组资源对应的第一公共主题;After the M2M server receives the access request message for the member resource of the group resource, the M2M server, according to the group resource included in the access request message for the member resource of the group resource, The identification of determines that there is no first public topic corresponding to the group resource;

所述M2M服务器根据所述群组资源的标识,为所述群组资源生成所述群组资源的第一公共主题,所述群组资源的第一公共主题中包含所述群组资源的标识;The M2M server generates a first common topic of the group resource for the group resource according to the identifier of the group resource, and the first common topic of the group resource includes the identifier of the group resource ;

所述M2M服务器将所述至少两个M2M终端中的每一个M2M终端中存储的第二资源的标识作为该M2M终端已经订阅的第一主题包含的内容具体为:The M2M server uses the identifier of the second resource stored in each of the at least two M2M terminals as the first topic that the M2M terminal has subscribed to. The content contained is specifically:

所述M2M服务器将所述成员资源的标识,作为与所述成员资源的标识对应的M2M终端已经订阅的第一主题包含的内容;The M2M server uses the identifier of the member resource as the content included in the first topic that the M2M terminal corresponding to the identifier of the member resource has subscribed to;

其中,所述第二业务消息为所述M2M服务器根据所述对所述群组资源的成员资源的访问请求消息生成的第一访问请求消息,所述第一访问请求消息为所述M2M服务器发送给与所述成员资源的标识对应的M2M终端的访问请求消息。Wherein, the second service message is a first access request message generated by the M2M server according to the access request message to the member resource of the group resource, and the first access request message is sent by the M2M server An access request message to the M2M terminal corresponding to the identifier of the member resource.

结合第二方面的第一种可能的实现方式,在第四种可能的实现方式中,当所述第一资源为订阅资源时,所述M2M服务器为所述第一资源生成所述第一公共主题具体为:With reference to the first possible implementation manner of the second aspect, in a fourth possible implementation manner, when the first resource is a subscription resource, the M2M server generates the first common Specifically the topics are:

当所述M2M服务器确定所述订阅资源发生变化时,所述M2M服务器根据所述订阅资源的标识确定没有与所述订阅资源对应的第一公共主题;When the M2M server determines that the subscription resource changes, the M2M server determines according to the identifier of the subscription resource that there is no first public topic corresponding to the subscription resource;

所述M2M服务器根据所述订阅资源的标识,为所述订阅资源生成所述订阅资源的第一公共主题,所述订阅资源的第一公共主题中包含所述订阅资源的标识;The M2M server generates a first public topic of the subscription resource for the subscription resource according to the identifier of the subscription resource, and the first public topic of the subscription resource includes the identifier of the subscription resource;

所述M2M服务器将所述至少两个M2M终端中的每一个M2M终端中存储的第二资源的标识作为该M2M终端已经订阅的第一主题包含的内容具体为:The M2M server uses the identifier of the second resource stored in each of the at least two M2M terminals as the first topic that the M2M terminal has subscribed to. The content contained is specifically:

所述M2M服务器将每一个订阅所述订阅资源的M2M终端中存储的第二资源的标识,作为该M2M终端已经订阅的第一主题包含的内容;The M2M server uses the identifier of the second resource stored in each M2M terminal subscribing to the subscription resource as the content contained in the first topic that the M2M terminal has subscribed to;

其中,所述第二业务消息为所述M2M服务器对每一个订阅所述订阅资源的M2M终端的订阅通知消息。Wherein, the second service message is a subscription notification message sent by the M2M server to each M2M terminal subscribing to the subscription resource.

结合第二方面的第一种可能的实现方式,在第五种可能的实现方式中,In combination with the first possible implementation of the second aspect, in a fifth possible implementation,

当所述第一资源为订阅资源时,所述M2M服务器为所述第一资源生成所述第一公共主题具体为:When the first resource is a subscription resource, the M2M server generating the first common topic for the first resource is specifically:

当所述M2M服务器接收到对所述订阅资源的订阅创建请求消息时,所述对所述订阅资源的订阅创建请求消息中包含所述订阅资源的标识以及订阅所述订阅资源的M2M终端中存储的第二资源的标识,所述M2M服务器根据所述订阅资源的标识,为所述订阅资源生成所述订阅资源的第一公共主题,所述订阅资源的第一公共主题中包含所述订阅资源的标识;When the M2M server receives the subscription creation request message for the subscription resource, the subscription creation request message for the subscription resource includes the identifier of the subscription resource and the The identifier of the second resource of the subscription resource, the M2M server generates the first public topic of the subscription resource for the subscription resource according to the identifier of the subscription resource, and the first public topic of the subscription resource includes the subscription resource logo;

所述M2M服务器将所述至少两个M2M终端中的每一个M2M终端中存储的第二资源的标识作为该M2M终端已经订阅的第一主题包含的内容具体为:The M2M server uses the identifier of the second resource stored in each of the at least two M2M terminals as the first topic that the M2M terminal has subscribed to. The content contained is specifically:

所述M2M服务器将每一个订阅所述订阅资源的M2M终端中存储的第二资源的标识,作为该M2M终端已经订阅的第一主题包含的内容;The M2M server uses the identifier of the second resource stored in each M2M terminal subscribing to the subscription resource as the content contained in the first topic that the M2M terminal has subscribed to;

其中,所述第二业务消息为所述M2M服务器根据所述对所述订阅资源的订阅创建请求消息生成的订阅创建响应消息,所述订阅创建响应消息为所述M2M服务器需发送给每一个订阅所述订阅资源的M2M终端的响应消息。Wherein, the second service message is a subscription creation response message generated by the M2M server according to the subscription creation request message for the subscription resource, and the subscription creation response message is that the M2M server needs to send to each subscription A response message of the M2M terminal subscribing to the resource.

第三方面,本发明提供一种机器对机器M2M终端,包括:In a third aspect, the present invention provides a machine-to-machine M2M terminal, including:

接收单元,用于接收消息序列遥测传输MQTT服务器发送的第一MQTT消息,所述第一MQTT消息中包含第一业务消息和第一公共主题;A receiving unit, configured to receive a first MQTT message sent by a message sequence telemetry transmission MQTT server, where the first MQTT message includes a first business message and a first common topic;

查找单元,用于根据存储单元保存的所述第一公共主题与在所述存储单元中存储的资源的标识之间的映射关系,查找与所述接收单元接收的所述第一公共主题对应的所述在所述存储单元中存储的资源的标识;A search unit, configured to search for the information corresponding to the first public topic received by the receiving unit according to the mapping relationship between the first public topic stored in the storage unit and the identifiers of resources stored in the storage unit an identification of the resource stored in the storage unit;

执行单元,用于对所述查找单元查找的所述在所述存储单元中存储的资源的标识指示的所述在所述存储单元中存储的资源执行与所述接收单元接收的所述第一业务消息相关的操作。an executing unit, configured to execute the first resource stored in the storage unit indicated by the identifier of the resource stored in the storage unit searched by the search unit and the first resource received by the receiving unit Operations related to business messages.

在第三方面的第一种可能的实现方式中,所述M2M终端还包括发送单元,In a first possible implementation manner of the third aspect, the M2M terminal further includes a sending unit,

所述接收单元,还用于在接收所述MQTT服务器发送的第一MQTT消息之前,接收所述MQTT服务器发送的第二MQTT消息,所述第二MQTT消息中包含第二业务消息和第一主题,所述第二业务消息中包含所述第一公共主题,所述第一主题中包含所述在所述存储单元中存储的资源的标识;The receiving unit is further configured to receive a second MQTT message sent by the MQTT server before receiving the first MQTT message sent by the MQTT server, and the second MQTT message includes a second business message and a first topic , the second service message includes the first public topic, and the first topic includes the identifier of the resource stored in the storage unit;

所述存储单元,用于保存所述接收单元接收的所述第一公共主题与所述在所述存储单元中存储的资源的标识之间的映射关系;The storage unit is configured to save the mapping relationship between the first public theme received by the receiving unit and the identifier of the resource stored in the storage unit;

所述发送单元,用于向所述MQTT服务器发送第一订阅主题的消息,所述第一订阅主题的消息中包含所述接收单元接收的所述第一公共主题以及所述M2M终端的标识。The sending unit is configured to send a message of a first subscribed topic to the MQTT server, where the message of the first subscribed topic includes the first public topic received by the receiving unit and the identifier of the M2M terminal.

结合第三方面的第一种可能的实现方式,在第二中可能的实现方式中,In combination with the first possible implementation of the third aspect, in the second possible implementation,

所述发送单元,还用于在所述接收单元接收所述MQTT服务器发送的第二MQTT消息之前,向所述MQTT服务器发送第二订阅主题的消息,所述第二订阅主题的消息包含需要订阅的所述第一主题。The sending unit is further configured to send a message of a second subscription topic to the MQTT server before the receiving unit receives the second MQTT message sent by the MQTT server, and the message of the second subscription topic includes a subscription required The first topic of .

第四方面,本发明提供一种M2M服务器,包括:In a fourth aspect, the present invention provides an M2M server, including:

确定单元,用于当需向与存储单元中存储的第一资源对应的至少两个M2M终端发送相同内容的第一业务消息时,确定为所述第一资源生成的第一公共主题;A determining unit, configured to determine a first common topic generated for the first resource when a first service message with the same content needs to be sent to at least two M2M terminals corresponding to the first resource stored in the storage unit;

发送单元,用于向消息序列遥测传输MQTT服务器发送一次第一MQTT消息,所述第一MQTT消息中包含所述第一业务消息和所述确定单元确定的所述第一公共主题,所述第一业务消息中包含发送给所述至少两个M2M终端的相同内容。a sending unit, configured to send a first MQTT message to a message sequence telemetry transmission MQTT server once, where the first MQTT message includes the first business message and the first common topic determined by the determining unit, and the first A service message includes the same content sent to the at least two M2M terminals.

在第四方面的第一种可能的实现方式中,所述M2M服务器还包括:In a first possible implementation manner of the fourth aspect, the M2M server further includes:

生成单元,用于所述确定单元确定为所述第一资源生成的第一公共主题之前,为所述第一资源生成所述第一公共主题,并将所述至少两个M2M终端中的每一个M2M终端中存储的第二资源的标识作为该M2M终端已经订阅的第一主题包含的内容;a generating unit, configured to generate the first common theme for the first resource before the determining unit determines the first common theme generated for the first resource, and generate the first common theme for each of the at least two M2M terminals The identifier of the second resource stored in an M2M terminal is used as the content contained in the first topic that the M2M terminal has subscribed to;

所述发送单元,还用于通过所述MQTT服务器向所述至少两个M2M终端中的每一个M2M终端发送一条第二MQTT消息,所述第二MQTT消息中包含第二业务消息和所述生成单元生成的所述第一主题,所述第二业务消息中包含所述生成单元生成的所述第一公共主题。The sending unit is further configured to send a second MQTT message to each of the at least two M2M terminals through the MQTT server, and the second MQTT message includes a second service message and the generated The first topic generated by the generating unit, and the second service message includes the first public topic generated by the generating unit.

结合第四方面的第一种可能的实现方式,在第二种可能的实现方式中,In combination with the first possible implementation of the fourth aspect, in the second possible implementation,

当所述第一资源为群组资源时,所述第二资源的标识为所述群组资源中的成员资源的标识,When the first resource is a group resource, the identifier of the second resource is an identifier of a member resource in the group resource,

所述生成单元,具体用于在接收到所述群组资源的创建请求消息后,根据为所述群组资源分配的所述群组资源的标识,为所述群组资源生成所述群组资源的第一公共主题,并将所述成员资源的标识,作为与所述成员资源的标识对应的M2M终端已经订阅的第一主题包含的内容,所述群组资源的第一公共主题中包含所述群组资源的标识;The generating unit is specifically configured to, after receiving the creation request message of the group resource, generate the group resource for the group resource according to the identifier of the group resource allocated for the group resource The first common theme of the resource, and the identifier of the member resource is used as the content contained in the first topic that the M2M terminal corresponding to the identifier of the member resource has subscribed to, and the first common theme of the group resource contains an identification of the group resource;

其中,所述第二业务消息为对与所述成员资源的标识对应的M2M终端的通知消息。Wherein, the second service message is a notification message to the M2M terminal corresponding to the identifier of the member resource.

结合第四方面的第一种可能的实现方式,在第三种可能的实现方式中,当所述第一资源为群组资源时,所述第二资源的标识为所述群组资源中的成员资源的标识,所述生成单元具体包括确定模块和生成模块,With reference to the first possible implementation manner of the fourth aspect, in a third possible implementation manner, when the first resource is a group resource, the identifier of the second resource is the an identifier of a member resource, the generation unit specifically includes a determination module and a generation module,

所述确定模块,用于在接收到对所述群组资源的成员资源的访问请求消息后,根据所述对所述群组资源的成员资源的访问请求消息中包含的所述群组资源的标识确定没有与所述群组资源对应的第一公共主题;The determining module is configured to, after receiving an access request message for a member resource of the group resource, according to the information of the group resource included in the access request message for a member resource of the group resource identifying a first common topic that is determined not to correspond to the group resource;

所述生成模块,用于当所述确定模块确定没有与所述群组资源对应的第一公共主题时,根据所述群组资源的标识,为所述群组资源生成所述群组资源的第一公共主题,并将所述成员资源的标识,作为与所述成员资源的标识对应的M2M终端已经订阅的第一主题包含的内容,所述群组资源的第一公共主题中包含所述群组资源的标识;The generating module is configured to, when the determining module determines that there is no first common topic corresponding to the group resource, generate the group resource for the group resource according to the identifier of the group resource The first common topic, and the identifier of the member resource is used as the content contained in the first topic that the M2M terminal corresponding to the identifier of the member resource has subscribed to, and the first common topic of the group resource contains the The identification of the group resource;

其中,所述第二业务消息为根据所述对所述群组资源的成员资源的访问请求消息生成的第一访问请求消息,所述第一访问请求消息为发送给与所述成员资源的标识对应的M2M终端的访问请求消息。Wherein, the second service message is a first access request message generated according to the access request message to the member resource of the group resource, and the first access request message is an identifier sent to the member resource The corresponding access request message of the M2M terminal.

结合第四方面的第一种可能的实现方式,在第四种可能的实现方式中,当所述第一资源为订阅资源时,所述生成单元具体包括确定模块和生成模块,With reference to the first possible implementation of the fourth aspect, in a fourth possible implementation, when the first resource is a subscription resource, the generation unit specifically includes a determination module and a generation module,

所述确定模块,用于当确定所述订阅资源发生变化时,根据所述订阅资源的标识确定没有与所述订阅资源对应的第一公共主题;The determination module is configured to determine, according to the identifier of the subscription resource, that there is no first public topic corresponding to the subscription resource when it is determined that the subscription resource has changed;

所述生成模块,用于在所述确定模块确定没有与所述订阅资源对应的第一公共主题时,根据所述订阅资源的标识,为所述订阅资源生成所述订阅资源的第一公共主题,并将每一个订阅所述订阅资源的M2M终端中存储的第二资源的标识,作为该M2M终端已经订阅的第一主题包含的内容,所述订阅资源的第一公共主题中包含所述订阅资源的标识;The generation module is configured to generate the first public topic of the subscription resource for the subscription resource according to the identifier of the subscription resource when the determination module determines that there is no first public topic corresponding to the subscription resource , and use the identifier of the second resource stored in each M2M terminal subscribing to the subscription resource as the content contained in the first topic that the M2M terminal has subscribed to, and the first public topic of the subscription resource includes the subscription the identification of the resource;

其中,所述第二业务消息为对每一个订阅所述订阅资源的M2M终端的订阅通知消息。Wherein, the second service message is a subscription notification message for each M2M terminal subscribing to the subscription resource.

结合第四方面的第一种可能的实现方式,在第五种可能的实现方式中,In combination with the first possible implementation of the fourth aspect, in the fifth possible implementation,

当所述第一资源为订阅资源时,When the first resource is a subscription resource,

所述生成单元,具体用于当接收到对所述订阅资源的订阅创建请求消息时,根据所述订阅资源的标识,为所述订阅资源生成所述订阅资源的第一公共主题,并将每一个订阅所述订阅资源的M2M终端中存储的第二资源的标识,作为该M2M终端已经订阅的第一主题包含的内容,所述对所述订阅资源的订阅创建请求消息中包含所述订阅资源的标识以及订阅所述订阅资源的M2M终端中存储的第二资源的标识,所述订阅资源的第一公共主题中包含所述订阅资源的标识;The generating unit is specifically configured to, when receiving the subscription creation request message for the subscription resource, generate the first public topic of the subscription resource for the subscription resource according to the identifier of the subscription resource, and An identifier of a second resource stored in an M2M terminal that subscribes to the subscription resource, as the content contained in the first topic that the M2M terminal has subscribed to, and the subscription creation request message for the subscription resource includes the subscription resource and the identifier of the second resource stored in the M2M terminal subscribing to the subscription resource, where the first public subject of the subscription resource includes the identifier of the subscription resource;

其中,所述第二业务消息为根据所述对所述订阅资源的订阅创建请求消息生成的订阅创建响应消息,所述订阅创建响应消息为需发送给每一个订阅所述订阅资源的M2M终端的响应消息。Wherein, the second service message is a subscription creation response message generated according to the subscription creation request message for the subscription resource, and the subscription creation response message is a message that needs to be sent to each M2M terminal that subscribes to the subscription resource Respond to the message.

第五方面,本发明提供一种业务消息的传输系统,包括:In the fifth aspect, the present invention provides a service message transmission system, including:

至少两个如上述第三方面或第三方面的任一种可能的实现方式所述的机器对机器M2M终端,如上述第四方面或第四方面的任一种可能的实现方式所述的M2M服务器,以及消息序列遥测传输MQTT服务器。At least two machine-to-machine M2M terminals as described in the third aspect or any possible implementation of the third aspect, and M2M terminals as described in the fourth aspect or any possible implementation of the fourth aspect server, and the message sequence telemetry transport MQTT server.

本发明提供一种业务消息的传输方法、装置及系统,当M2M服务器需向与该M2M服务器中存储的第一资源对应的至少两个M2M终端发送内容相同的第一业务消息时,M2M服务器确定为该第一资源生成的第一公共主题,并向MQTT服务器发送一次第一MQTT消息,该第一MQTT消息中包含该第一业务消息和该第一公共主题,该第一业务消息中包含发送给该至少两个M2M终端的相同内容,该至少两个M2M终端中的每个M2M终端能够接收该MQTT服务器发送的该第一MQTT消息,并根据保存的该第一公共主题与在该M2M终端中存储的第二资源的标识之间的映射关系,查找与该第一公共主题对应的第二资源的标识,以及对该第二资源的标识指示的第二资源执行与该第一业务消息相关的操作。通过该方法,当M2M服务器需向该至少两个M2M终端发送内容相同的第一业务消息时,M2M服务器只需向MQTT服务器发送一次第一MQTT消息,与现有技术中M2M服务器需向MQTT服务器发送包含不同主题的MQTT消息相比,本发明提供的业务消息的传输方法,能够减小M2M服务器与MQTT服务器之间的通信开销。The present invention provides a service message transmission method, device and system. When an M2M server needs to send a first service message with the same content to at least two M2M terminals corresponding to a first resource stored in the M2M server, the M2M server determines Generate a first common topic for the first resource, and send a first MQTT message to the MQTT server, the first MQTT message includes the first business message and the first public topic, and the first business message includes sending Given the same content of the at least two M2M terminals, each M2M terminal in the at least two M2M terminals can receive the first MQTT message sent by the MQTT server, and according to the stored first common theme and the M2M terminal The mapping relationship between the identifiers of the second resources stored in , look up the identifiers of the second resources corresponding to the first public subject, and the execution of the second resource indicated by the identifiers of the second resources is related to the first business message operation. Through this method, when the M2M server needs to send the first service message with the same content to the at least two M2M terminals, the M2M server only needs to send the first MQTT message to the MQTT server once, unlike the M2M server in the prior art that needs to send the first MQTT message to the MQTT server. Compared with sending MQTT messages containing different topics, the service message transmission method provided by the present invention can reduce the communication overhead between the M2M server and the MQTT server.

附图说明Description of drawings

图1为本发明实施例提供的一种业务消息的传输方法流程图一;FIG. 1 is a flow chart 1 of a method for transmitting a service message provided by an embodiment of the present invention;

图2为本发明实施例提供的一种业务消息的传输方法流程图二;FIG. 2 is a second flow chart of a method for transmitting service messages provided by an embodiment of the present invention;

图3为本发明实施例提供的一种业务消息的传输方法交互图一;FIG. 3 is an interaction diagram 1 of a service message transmission method provided by an embodiment of the present invention;

图4为本发明实施例提供的一种将群组资源的第一公共主题作为该群组资源的子资源的示意图;FIG. 4 is a schematic diagram of using the first common subject of a group resource as a sub-resource of the group resource provided by an embodiment of the present invention;

图5为本发明实施例提供的一种业务消息的传输方法交互图二;Fig. 5 is an interaction diagram 2 of a method for transmitting service messages provided by an embodiment of the present invention;

图6为本发明实施例提供的一种业务消息的传输方法交互图三;FIG. 6 is an interaction diagram 3 of a method for transmitting service messages provided by an embodiment of the present invention;

图7为本发明实施例提供的一种业务消息的传输方法交互图四;FIG. 7 is an interaction diagram 4 of a method for transmitting service messages provided by an embodiment of the present invention;

图8为本发明实施例提供的一种业务消息的传输方法交互图五;FIG. 8 is an interaction diagram five of a method for transmitting service messages provided by an embodiment of the present invention;

图9为本发明实施例提供的一种M2M终端的结构示意图一;FIG. 9 is a first structural schematic diagram of an M2M terminal provided by an embodiment of the present invention;

图10为本发明实施例提供的一种M2M终端的结构示意图二;FIG. 10 is a second structural schematic diagram of an M2M terminal provided by an embodiment of the present invention;

图11为本发明实施例提供的一种M2M服务器的结构示意图一;FIG. 11 is a first structural diagram of an M2M server provided by an embodiment of the present invention;

图12为本发明实施例提供的一种M2M服务器的结构示意图二;FIG. 12 is a second structural diagram of an M2M server provided by an embodiment of the present invention;

图13为本发明实施例提供的一种M2M服务器的结构示意图三;FIG. 13 is a schematic structural diagram III of an M2M server provided by an embodiment of the present invention;

图14为本发明实施例提供的一种M2M终端的硬件结构示意图;FIG. 14 is a schematic diagram of a hardware structure of an M2M terminal provided by an embodiment of the present invention;

图15为本发明实施例提供的一种M2M服务器的硬件结构示意图;FIG. 15 is a schematic diagram of a hardware structure of an M2M server provided by an embodiment of the present invention;

图16为本发明实施例提供的一种业务消息的传输系统框图。Fig. 16 is a block diagram of a service message transmission system provided by an embodiment of the present invention.

具体实施方式Detailed ways

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some of the embodiments of the present invention, not all of them.

在本发明实施例中,M2M服务器可以为应用于各种管理系统中的服务器,M2M终端可以为应用与各种应用场景中的终端。例如,在车辆监控管理系统中,M2M服务器为车辆监控管理服务器,M2M终端为车载终端;在电力抄表系统中,M2M服务器为电力抄表服务器,M2M终端为各个智能电表;在智能交通系统中,M2M服务器为智能交通服务器,M2M终端为各个交通路口的微控制器。在本发明中均不做限制。In the embodiment of the present invention, the M2M server may be a server applied in various management systems, and the M2M terminal may be an application and a terminal in various application scenarios. For example, in the vehicle monitoring and management system, the M2M server is the vehicle monitoring and management server, and the M2M terminal is the vehicle terminal; in the power meter reading system, the M2M server is the power meter reading server, and the M2M terminal is each smart meter; , the M2M server is an intelligent traffic server, and the M2M terminal is a microcontroller at each traffic intersection. None are limited in the present invention.

为了更好的说明本发明实施例提供的业务消息的传输方法,下面以一种可能的应用场景为例,对本发明以下实施例中涉及的业务消息,资源,主题和资源的标识,及其之间的关系进行示例性的说明。假设,本发明实施例提供的应用场景为智能交通系统,在智能交通系统中,M2M服务器为智能交通服务器,M2M终端为每个交通路口的微控制器,智能交通服务器为每个交通路口的微控制器提供服务。In order to better illustrate the transmission method of the business message provided by the embodiment of the present invention, a possible application scenario is taken as an example below to identify the business message, resource, topic and resource involved in the following embodiments of the present invention, and their The relationship between them is illustrated as an example. It is assumed that the application scenario provided by the embodiment of the present invention is an intelligent transportation system. In the intelligent transportation system, the M2M server is the intelligent transportation server, the M2M terminal is the microcontroller of each traffic intersection, and the intelligent transportation server is the microcontroller of each traffic intersection. The controller provides the service.

每个交通路口的微控制器中保存了其所在交通路口的相关数据,例如,可以包括该微控制器所在交通路口的位置信息、交通录像和违规记录等。则该位置信息、该交通录像和该违规记录构成该微控制器的资源,该位置信息、该交通录像和该违规记录分别为该微控制器的子资源。The microcontroller of each traffic intersection stores relevant data of the traffic intersection where it is located, for example, may include location information of the traffic intersection where the microcontroller is located, traffic video and violation records, and the like. Then the location information, the traffic video and the violation record constitute resources of the microcontroller, and the location information, the traffic video and the violation record are respectively sub-resources of the microcontroller.

智能交通服务器保存了其提供服务的每个交通路口的微控制器的属性和该智能交通服务器的属性,每个交通路口的微控制器的属性和该智能交通服务器的属性构成了该智能交通服务器的资源(该智能交通服务器的资源即可以理解为一个群组资源),每个交通路口的微控制器的属性和该智能交通服务器的属性分别为该智能交通服务器的子资源。The intelligent traffic server saves the attribute of the microcontroller of each traffic intersection and the attribute of the intelligent traffic server that it provides services, and the attribute of the microcontroller of each traffic intersection and the attribute of the intelligent traffic server constitute the intelligent traffic server resources (the resources of the intelligent traffic server can be understood as a group resource), the attributes of the micro-controller of each traffic intersection and the attributes of the intelligent traffic server are respectively sub-resources of the intelligent traffic server.

若某个微控制器的资源标识(例如为该微控制器的域名)可以表示为“m.example.com”,则该微控制器的各个子资源的标识分别可以表示为:该地理位置信息的标识可以表示为“m.example.com/address”,该交通录像的标识可以表示为“m.example.com/video”,该违规记录的标识可以表示为“m.example.com/record”。If the resource identifier of a microcontroller (for example, the domain name of the microcontroller) can be expressed as "m.example.com", then the identifiers of each sub-resource of the microcontroller can be expressed as: the geographic location information The identifier of the traffic video can be expressed as "m.example.com/address", the identifier of the traffic video can be expressed as "m.example.com/video", and the identifier of the violation record can be expressed as "m.example.com/record" .

当智能交通服务器需访问该某个微控制器的某一子资源(该某个微控制器的某一子资源即可以理解为该群组资源的某个成员资源),例如,智能交通服务器请求某个微控制器清除该微控制器保存的违规记录时,根M2M系统中的主题订阅/发布机制,智能交通服务器会根据该微控制器的违规记录的标识(即成员资源的标识)“m.example.com/record”,生成包含该违规记录的标识的主题“/oneM2M/m.example.com/record/req”,并将业务消息(该业务消息用于指示该微控制器清除该微控制器保存的违规记录)和该主题承载在MQTT消息上,发送至MQTT服务器。MQTT服务器将该MQTT消息转发给订阅过该主题的微控制器,该微控制器接收到该MQTT消息后,根据该MQTT消息中包含的业务消息清除该微控制器保存的违规记录。When the intelligent transportation server needs to access a certain sub-resource of the certain microcontroller (a certain sub-resource of the certain microcontroller can be understood as a certain member resource of the group resource), for example, the intelligent transportation server requests When a certain microcontroller clears the violation record saved by the microcontroller, the topic subscription/publishing mechanism in the root M2M system, the intelligent traffic server will use the identifier of the violation record of the microcontroller (ie, the identifier of the member resource) "m .example.com/record", generate the topic "/oneM2M/m.example.com/record/req" containing the identification of the violation record, and send a business message (the business message is used to instruct the microcontroller to clear the microcontroller The violation record saved by the controller) and the topic are carried on the MQTT message and sent to the MQTT server. The MQTT server forwards the MQTT message to the microcontroller that has subscribed to the topic, and after receiving the MQTT message, the microcontroller clears the violation record saved by the microcontroller according to the business message contained in the MQTT message.

需要说明的是,上述对本发明以下实施例中涉及的业务消息,资源,主题和资源的标识,及其之间的关系进行的说明仅为示例性的。在其他可能的应用场景中,例如在车辆监控管理系统,电力抄表系统等应用场景中,M2M终端中存储的资源和M2M服务器中存储的资源均不相同。且在智能交通系统中,每个交通路口的微控制器的资源和智能交通服务器的资源可以包括但不限于上述列举的资源,在本发明实施例中不做限定。It should be noted that, the above descriptions of service messages, resources, topics and resource identifiers involved in the following embodiments of the present invention, and the relationships among them are only exemplary. In other possible application scenarios, for example, in application scenarios such as a vehicle monitoring management system and a power meter reading system, the resources stored in the M2M terminal are different from the resources stored in the M2M server. And in the intelligent transportation system, the resources of the micro-controller and the intelligent transportation server at each traffic intersection may include but not limited to the resources listed above, which are not limited in the embodiment of the present invention.

本发明实施例提供一种业务消息的传输方法,如图1所示,该方法可以包括:An embodiment of the present invention provides a method for transmitting a service message. As shown in FIG. 1, the method may include:

S101、M2M终端接收MQTT服务器发送的第一MQTT消息,该第一MQTT消息中包含第一业务消息和第一公共主题。S101. The M2M terminal receives a first MQTT message sent by an MQTT server, where the first MQTT message includes a first service message and a first common topic.

需要说明的是,在M2M终端接收包含第一公共主题的第一MQTT消息之前,M2M终端已经向MQTT服务器订阅了该第一公共主题的内容,因此,M2M终端能够接收包含该第一公共主题的第一MQTT消息。It should be noted that, before the M2M terminal receives the first MQTT message containing the first common topic, the M2M terminal has already subscribed to the content of the first public topic to the MQTT server, therefore, the M2M terminal can receive the message containing the first public topic The first MQTT message.

S102、M2M终端根据保存的该第一公共主题与在该M2M终端中存储的资源的标识之间的映射关系,查找与该第一公共主题对应的在该M2M终端中存储的资源的标识。S102. The M2M terminal searches for an identifier of a resource stored in the M2M terminal corresponding to the first common theme according to the stored mapping relationship between the first common theme and the identifier of the resource stored in the M2M terminal.

其中,M2M终端中可能存储一个资源,也可能存储多个资源。在M2M终端中存储的资源的标识可以为能够唯一表征在M2M终端中存储的资源的标识,具体可以为在M2M终端中存储的资源的通用资源标识符(英文:uniform resource identifier,缩写:URI)。Wherein, one resource may be stored in the M2M terminal, and multiple resources may also be stored. The identifier of the resource stored in the M2M terminal may be an identifier that can uniquely characterize the resource stored in the M2M terminal, specifically, it may be a universal resource identifier (English: uniform resource identifier, abbreviation: URI) of the resource stored in the M2M terminal .

需要说明的是,该第一公共主题与在该M2M终端中存储的资源的标识之间的映射关系是该M2M终端在向MQTT服务器订阅该第一公共主题时保存在该M2M终端中的。示例性的,该第一公共主题与在该M2M终端中存储的资源的标识之间的映射关系可以如表1所示。其中,该第一公共主题可以为“/oneM2M/g/g.example.com/req”,在该M2M终端中存储的资源的标识(即该第一业务消息的目的地址)可以为“m1.example.com/container1”。It should be noted that the mapping relationship between the first common topic and the identifier of the resource stored in the M2M terminal is saved in the M2M terminal when the M2M terminal subscribes to the first common topic with the MQTT server. Exemplarily, the mapping relationship between the first common subject and the identifier of the resource stored in the M2M terminal may be as shown in Table 1. Wherein, the first public topic may be "/oneM2M/g/g.example.com/req", and the identifier of the resource stored in the M2M terminal (that is, the destination address of the first service message) may be "m1. example.com/container1".

表1Table 1

公共主题public topic 在M2M终端中存储的资源的标识Identification of resources stored in the M2M terminal /oneM2M/g/g.example.com/req/oneM2M/g/g.example.com/req m1.example.com/container1m1.example.com/container1

S103、M2M终端对该在该M2M终端中存储的资源的标识指示的在该M2M终端中存储的资源执行与该第一业务消息相关的操作。S103. The M2M terminal performs an operation related to the first service message on the resource stored in the M2M terminal indicated by the identifier of the resource stored in the M2M terminal.

在本发明实施例中,M2M终端对该在该M2M终端中存储的资源的标识指示的在该M2M终端中存储的资源执行与该第一业务消息相关的操作的具体方式,在不同的应用场景中采用的具体方式也不同。In the embodiment of the present invention, the specific manner in which the M2M terminal performs operations related to the first service message on the resources stored in the M2M terminal indicated by the identifier of the resource stored in the M2M terminal, in different application scenarios The specific methods used are also different.

示例性的,当本发明实施例提供的方法应用于群组管理中时,M2M终端对该在该M2M终端中存储的资源的标识指示的在该M2M终端中存储的资源执行与该第一业务消息相关的操作的具体方式可以为,M2M终端对该在该M2M终端中存储的资源的标识指示的在该M2M终端中存储的资源执行该第一业务消息的内容指示的操作。例如,假设该M2M终端为智能交通系统中某个交通路口的微控制器,该微控制器接收的第一MQTT消息中包含的第一业务消息的内容为“删除指示”,则该微控制器根据该第一业务消息的内容,删除在该微控制器中存储的资源的标识指示的在该微控制器中存储的资源。Exemplarily, when the method provided by the embodiment of the present invention is applied to group management, the M2M terminal executes the resource stored in the M2M terminal indicated by the identifier of the resource stored in the M2M terminal with the first service A specific manner of message-related operations may be that the M2M terminal executes the operation indicated by the content of the first service message on the resource stored in the M2M terminal indicated by the identifier of the resource stored in the M2M terminal. For example, assuming that the M2M terminal is a microcontroller at a traffic intersection in an intelligent transportation system, and the content of the first service message contained in the first MQTT message received by the microcontroller is "delete instruction", the microcontroller According to the content of the first service message, the resource stored in the microcontroller indicated by the identifier of the resource stored in the microcontroller is deleted.

当本发明实施例提供的方法应用于订阅通知管理中时,M2M终端对该在该M2M终端中存储的资源的标识指示的在该M2M终端中存储的资源执行与该第一业务消息相关的操作的具体方式可以为,M2M终端根据第一业务消息的内容与该M2M终端中预置的指示信息的对应关系,获取与该第一业务消息的内容对应的指示信息,并对该在该M2M终端中存储的资源的标识指示的在该M2M终端中存储的资源执行该指示信息指示的操作。例如,假设该M2M终端为控制空调的微控制器,该第一业务消息的内容为“当前温度小于5度”,该微控制器中预置的与该第一业务消息的内容对应的指示信息为“启动空调”,则该微控制器接收到该第一业务消息后,根据第一业务消息的内容与该M2M终端中预置的指示信息的对应关系,获取与“当前温度小于5度”对应的指示信息“启动空调”,并根据该指示信息启动空调。When the method provided by the embodiment of the present invention is applied to subscription notification management, the M2M terminal performs an operation related to the first service message on the resource stored in the M2M terminal indicated by the identifier of the resource stored in the M2M terminal The specific manner may be that the M2M terminal obtains the indication information corresponding to the content of the first service message according to the corresponding relationship between the content of the first service message and the indication information preset in the M2M terminal, and The resource stored in the M2M terminal indicated by the identifier of the resource stored in , executes the operation indicated by the indication information. For example, assuming that the M2M terminal is a microcontroller controlling an air conditioner, and the content of the first service message is "the current temperature is less than 5 degrees", the instruction information corresponding to the content of the first service message preset in the microcontroller is "start the air conditioner", after the microcontroller receives the first service message, according to the corresponding relationship between the content of the first service message and the indication information preset in the M2M terminal, obtain the "current temperature is less than 5 degrees" Corresponding instruction information "Start the air conditioner", and start the air conditioner according to the instruction information.

本发明实施例提供一种业务消息的传输方法,通过M2M终端接收MQTT服务器发送的第一MQTT消息,并根据保存的该第一公共主题与在该M2M终端中存储的资源的标识之间的映射关系,查找与该第一公共主题对应的在该M2M终端中存储的资源的标识,以及对在该M2M终端中存储的资源的标识指示的在该M2M终端中存储的资源执行与该第一业务消息相关的操作,该第一MQTT消息中包含第一业务消息和第一公共主题。通过该方法,当M2M服务器需向与该M2M服务器中存储的资源对应的至少两个M2M终端发送相同内容的第一业务消息时,MQTT服务器只需发送一次第一MQTT消息到MQTT服务器,由于该至少两个M2M终端都订阅了该第一公共主题,因此MQTT服务器会将该第一MQTT消息转发给该至少两个M2M终端,且该至少两个M2M终端中的每个M2M终端能够根据该第一公共主题与该每个M2M终端中存储的资源的标识之间的映射关系,执行与该第一业务消息相关的操作。与现有技术中M2M服务器需向MQTT服务器发送多个包含不同主题的MQTT消息相比,本发明实施例提供的业务消息的传输方法,能够减小M2M服务器与MQTT服务器之间的通信开销。An embodiment of the present invention provides a method for transmitting service messages. The M2M terminal receives the first MQTT message sent by the MQTT server, and according to the saved mapping between the first public theme and the identifier of the resource stored in the M2M terminal relationship, look up the identifier of the resource stored in the M2M terminal corresponding to the first common theme, and execute the resource stored in the M2M terminal indicated by the identifier of the resource stored in the M2M terminal with the first service For message-related operations, the first MQTT message includes the first service message and the first public topic. Through this method, when the M2M server needs to send the first service message with the same content to at least two M2M terminals corresponding to the resources stored in the M2M server, the MQTT server only needs to send the first MQTT message to the MQTT server once, because the At least two M2M terminals have subscribed to the first common topic, so the MQTT server will forward the first MQTT message to the at least two M2M terminals, and each M2M terminal in the at least two M2M terminals can A mapping relationship between a common topic and the identifier of the resource stored in each M2M terminal executes an operation related to the first service message. Compared with the prior art where the M2M server needs to send multiple MQTT messages containing different topics to the MQTT server, the service message transmission method provided by the embodiment of the present invention can reduce the communication overhead between the M2M server and the MQTT server.

本发明实施例提供一种业务消息的传输方法,如图2所示,该方法可以包括:An embodiment of the present invention provides a method for transmitting a service message. As shown in FIG. 2, the method may include:

S201、当M2M服务器需向与该M2M服务器中存储的第一资源对应的至少两个M2M终端发送相同内容的第一业务消息时,该M2M服务器确定为该第一资源生成的第一公共主题。S201. When the M2M server needs to send a first service message with the same content to at least two M2M terminals corresponding to a first resource stored in the M2M server, the M2M server determines a first common topic generated for the first resource.

其中,第一资源为在M2M服务器中存储的资源。Wherein, the first resource is a resource stored in the M2M server.

需要说明的是,M2M服务器可以根据该M2M服务器中存储的第一资源的变化情况,确定需向与该第一资源对应的至少两个M2M终端发送相同内容的第一业务消息。例如,当本发明实施例提供的方法应用于订阅通知管理中时,该第一资源为在M2M服务器中存储的订阅资源,该订阅资源的一项子资源用于描述订阅该订阅资源的M2M终端的第二资源的标识,则订阅该订阅资源的M2M终端的第二资源的标识对应的M2M终端,即为该订阅资源对应的M2M终端。其中,第二资源是指存储在M2M终端中的资源。It should be noted that, the M2M server may determine that the first service message with the same content needs to be sent to at least two M2M terminals corresponding to the first resource according to a change situation of the first resource stored in the M2M server. For example, when the method provided by the embodiment of the present invention is applied to subscription notification management, the first resource is a subscription resource stored in the M2M server, and a sub-resource of the subscription resource is used to describe the M2M terminal subscribing to the subscription resource If the identifier of the second resource is the identifier of the second resource, the M2M terminal corresponding to the identifier of the second resource of the M2M terminal subscribing to the subscription resource is the M2M terminal corresponding to the subscription resource. Wherein, the second resource refers to a resource stored in the M2M terminal.

当该订阅资源发生变化,M2M服务器将该订阅资源的变化情况分别与每一个订阅该订阅资源的M2M终端的通知过滤条件(英文:notice filter criteria)相比,若该订阅资源的变化情况满足订阅该订阅资源的所有M2M终端中的至少两个M2M终端的通知过滤条件,则M2M服务器确定需向该至少两个M2M终端中的每一个M2M终端发送包含该订阅资源的变化情况的通知消息。此时,该通知消息为第一业务消息,且M2M服务器向该至少两个M2M终端中的每一个M2M终端发送的通知消息的内容均为该订阅资源的变化情况,即M2M服务器确定需向该至少两个M2M终端发送相同内容的第一业务消息。其中,订阅该订阅资源的每个M2M终端的通知过滤条件为该M2M终端在向M2M服务器请求创建订阅通知时发送至M2M服务器的。When the subscription resource changes, the M2M server compares the change of the subscription resource with the notification filter criteria (English: notice filter criteria) of each M2M terminal subscribing to the subscription resource. The notification filter condition of at least two M2M terminals among all M2M terminals subscribing to the resource, the M2M server determines that a notification message including the change of the subscription resource needs to be sent to each of the at least two M2M terminals. At this time, the notification message is the first service message, and the content of the notification message sent by the M2M server to each of the at least two M2M terminals is the change of the subscription resource, that is, the M2M server determines that the At least two M2M terminals send the first service message with the same content. Wherein, the notification filter condition of each M2M terminal subscribing to the subscription resource is sent to the M2M server when the M2M terminal requests the M2M server to create a subscription notification.

M2M服务器也可以根据接收到的公共业务实体(英文:common service entity,缩写:CSE)发送的消息,确定需向与该M2M服务器中存储的第一资源对应的至少两个M2M终端发送相同内容的第一业务消息。其中,该业务公共实体可以为M2M服务器,也可以为M2M终端,本发明不作限制。The M2M server may also determine that at least two M2M terminals corresponding to the first resource stored in the M2M server need to send the same content according to the received message sent by the common service entity (English: common service entity, abbreviation: CSE). First business news. Wherein, the service public entity may be an M2M server or an M2M terminal, which is not limited in the present invention.

例如,当本发明实施例提供的方法应用于群组管理中时,该第一资源为某个群组资源,该群组资源的一项子资源是用于描述形成该群组资源的成员资源的标识,则与形成该群组资源的成员资源的标识对应的M2M终端,即为该群组资源对应的M2M终端。For example, when the method provided by the embodiment of the present invention is applied to group management, the first resource is a certain group resource, and a sub-resource of the group resource is used to describe the member resources that form the group resource , the M2M terminal corresponding to the identifiers of the member resources forming the group resource is the M2M terminal corresponding to the group resource.

当某个CSE访问该群组资源的成员资源时,该CSE会向M2M服务器发送对该群组资源的成员资源的访问请求消息,M2M服务器接收到对该群组资源的成员资源的访问请求消息后,M2M服务器确定向与该群组资源的成员资源的标识对应的所有M2M终端发送第一访问请求消息。此时,第一业务消息为该第一访问请求消息。其中,M2M服务器向每一个与该群组资源的成员资源的标识对应的M2M终端发送的第一访问请求消息的内容,均为对该群组资源的成员资源的访问请求消息中的内容,即M2M服务器向与该群组资源的成员资源的标识对应的所有M2M终端发送相同内容的第一业务消息。示例性的,对该群组资源的成员资源的访问请求消息中的内容可以为“读取指示”,用于指示M2M终端上报与该M2M终端对应的成员资源;或者对该群组资源的成员资源的访问请求消息中的内容可以为“删除指示”,用于指示M2M终端删除与该M2M终端对应的成员资源等。When a CSE accesses a member resource of the group resource, the CSE will send an access request message to the M2M server for the member resource of the group resource, and the M2M server receives the access request message for the member resource of the group resource Afterwards, the M2M server determines to send the first access request message to all M2M terminals corresponding to the identifiers of the member resources of the group resource. At this time, the first service message is the first access request message. Wherein, the content of the first access request message sent by the M2M server to each M2M terminal corresponding to the identifier of the member resource of the group resource is the content of the access request message of the member resource of the group resource, namely The M2M server sends the first service message with the same content to all M2M terminals corresponding to the identifiers of the member resources of the group resource. Exemplarily, the content in the access request message of the member resource of the group resource may be "read indication", which is used to instruct the M2M terminal to report the member resource corresponding to the M2M terminal; or the member resource of the group resource The content in the resource access request message may be a "deletion instruction", which is used to instruct the M2M terminal to delete the member resource corresponding to the M2M terminal.

当M2M服务器确定需向与该M2M服务器中存储的第一资源对应的至少两个M2M终端发送相同内容的第一业务消息时,该M2M服务器确定为该第一资源生成的第一公共主题。When the M2M server determines that the first service message with the same content needs to be sent to at least two M2M terminals corresponding to the first resource stored in the M2M server, the M2M server determines the first common topic generated for the first resource.

进一步的,M2M服务器确定为该第一资源生成的第一公共主题的方式有多种。示例性的,M2M服务器确定为该第一资源生成的第一公共主题的方式可以包括,若M2M服务器判断该第一资源的某一子资源为包含该第一资源的标识的主题,则M2M服务器可以确定该主题为MQTT服务器为该第一资源生成的第一公共主题。或者,若M2M服务器判断该第一资源的某一属性为包含该第一资源的标识的主题,则M2M服务器可以确定该主题为MQTT服务器为该第一资源生成的第一公共主题。Further, there are multiple ways for the M2M server to determine the first common theme generated for the first resource. Exemplarily, the manner in which the M2M server determines the first common theme generated for the first resource may include, if the M2M server judges that a certain sub-resource of the first resource is a theme containing the identifier of the first resource, then the M2M server It may be determined that the topic is the first public topic generated by the MQTT server for the first resource. Alternatively, if the M2M server judges that a certain attribute of the first resource is a topic including the identifier of the first resource, the M2M server may determine that the topic is the first public topic generated by the MQTT server for the first resource.

具体的,M2M服务器为该第一资源生成公共主题的方式,将在下述实施例中进行详细地描述。Specifically, the manner in which the M2M server generates a common theme for the first resource will be described in detail in the following embodiments.

S202、该M2M服务器向MQTT服务器发送一次第一MQTT消息,该第一MQTT消息中包含该第一业务消息和该第一公共主题,该第一业务消息中包含发送给该至少两个M2M终端的相同内容。S202. The M2M server sends a first MQTT message to the MQTT server once, the first MQTT message includes the first service message and the first common topic, and the first service message includes information sent to the at least two M2M terminals same content.

需要说明的是,在M2M服务器向MQTT服务器发送第一MQTT消息之前,该至少两个M2M终端已经向MQTT服务器订阅过该第一公共主题。因此,M2M服务器将包含该第一业务消息和该第一公共主题的第一MQTT消息发送至MQTT服务器后,MQTT服务器会将该第一MQTT消息分别转发给该至少两个M2M终端。与现有技术M2M服务器将该第一业务消息承载在至少两个包含不同主题的MQTT消息上发送至MQTT服务器相比,在本发明实施例提供的业务消息的传输方法中,M2M服务器只需向MQTT服务器发送一次第一MQTT消息即可。It should be noted that, before the M2M server sends the first MQTT message to the MQTT server, the at least two M2M terminals have already subscribed to the first common topic from the MQTT server. Therefore, after the M2M server sends the first MQTT message including the first service message and the first common topic to the MQTT server, the MQTT server will respectively forward the first MQTT message to the at least two M2M terminals. Compared with the M2M server in the prior art sending the first service message to the MQTT server on at least two MQTT messages containing different topics, in the service message transmission method provided by the embodiment of the present invention, the M2M server only needs to send the first service message to the MQTT server. The MQTT server only needs to send the first MQTT message once.

本发明实施例提供一种业务消息的传输方法,当M2M服务器需向与M2M服务器中存储的第一资源对应的至少两个M2M终端发送相同内容的第一业务消息时,M2M服务器通过确定为该第一资源生成的所述第一公共主题,以及向MQTT服务器发送一次第一MQTT消息,第一MQTT消息中包含第一业务消息和第一公共主题,第一业务消息包含发送给至少两个终端的相同内容。与现有技术中M2M服务器需向MQTT服务器发布多个包含不同的主题的MQTT消息相比,本发明实施例提供的业务消息的传输方法,能够减小M2M服务器与MQTT服务器之间的通信开销。An embodiment of the present invention provides a service message transmission method. When an M2M server needs to send a first service message with the same content to at least two M2M terminals corresponding to the first resources stored in the M2M server, the M2M server determines the The first public topic generated by the first resource, and the first MQTT message is sent to the MQTT server once, the first MQTT message includes the first business message and the first public topic, and the first business message includes sending to at least two terminals of the same content. Compared with the prior art where the M2M server needs to issue multiple MQTT messages containing different topics to the MQTT server, the service message transmission method provided by the embodiment of the present invention can reduce the communication overhead between the M2M server and the MQTT server.

需要说明的是,本发明实施例提供的一种业务消息的传输方法中,在M2M服务器为M2M服务器中存储的第一资源生成了第一公共主题,以及M2M终端已经订阅了该第一公共主题的情况下,M2M服务器才能够执行上述如图2所示的方法,M2M终端才能够执行上述如图1所示的方法。It should be noted that, in a service message transmission method provided by an embodiment of the present invention, the M2M server generates a first public topic for the first resource stored in the M2M server, and the M2M terminal has subscribed to the first public topic In the case of , the M2M server can execute the method shown in FIG. 2 above, and the M2M terminal can execute the method shown in FIG. 1 above.

因此,进一步的,在M2M服务器执行上述如图2所示的方法之前,以及M2M终端在执行上述如图1所示的方法之前,本发明实施例提供的一种业务消息的传输方法还可以包括M2M服务器为M2M服务器中存储的第一资源生成第一公共主题,以及M2M终端订阅该第一公共主题的过程。具体的,如图3所示,M2M服务器为M2M服务器中存储的第一资源生成第一公共主题,以及M2M终端订阅该第一公共主题的方法可以包括:Therefore, further, before the M2M server executes the method shown in FIG. 2 above, and before the M2M terminal executes the method shown in FIG. 1 above, a service message transmission method provided by an embodiment of the present invention may further include A process in which the M2M server generates a first common theme for the first resource stored in the M2M server, and the M2M terminal subscribes to the first common theme. Specifically, as shown in FIG. 3, the M2M server generates a first common theme for the first resource stored in the M2M server, and the method for the M2M terminal to subscribe to the first common theme may include:

S301、M2M服务器和至少两个M2M终端分别与MQTT服务器建立连接。S301, the M2M server and at least two M2M terminals respectively establish connections with the MQTT server.

具体的,M2M服务器和该至少两个M2M终端分别与MQTT服务器建立连接的方式可以为,M2M服务器和至少两个M2M终端分别向MQTT服务器发送MQTT连接消息(英文:MQTTconnect),以与MQTT服务器建立连接。M2M服务器和至少两个M2M终端分别与MQTT服务器建立连接后,M2M服务器和至少两个M2M终端都能够与MQTT服务器进行通信。Specifically, the manner in which the M2M server and the at least two M2M terminals respectively establish connections with the MQTT server may be that the M2M server and the at least two M2M terminals respectively send an MQTT connection message (English: MQTTconnect) to the MQTT server to establish a connection with the MQTT server. connect. After the M2M server and the at least two M2M terminals respectively establish connections with the MQTT server, both the M2M server and the at least two M2M terminals can communicate with the MQTT server.

S302、M2M服务器和该至少两个M2M终端分别向MQTT服务器订阅相关主题。S302. The M2M server and the at least two M2M terminals respectively subscribe to related topics from the MQTT server.

其中,M2M服务器的相关主题为M2M服务器需要订阅的,包含M2M服务器中存储的所有第一资源的标识的所有主题,该至少两个M2M终端中的每一个M2M终端的相关主题为该M2M终端需要订阅的,包含该M2M终端中存储的所有第二资源的标识的所有主题。Wherein, the related topics of the M2M server are all topics that the M2M server needs to subscribe to, including all the identifiers of all first resources stored in the M2M server, and the related topics of each M2M terminal in the at least two M2M terminals are the topics that the M2M terminal needs to subscribe to. Subscribed, including all topics of identifiers of all second resources stored in the M2M terminal.

具体的,M2M服务器和该至少两个M2M终端中的每个M2M终端,都可以通过向MQTT服务器发送第二订阅主题的消息订阅相关主题。Specifically, the M2M server and each of the at least two M2M terminals may subscribe to related topics by sending a message of the second subscription topic to the MQTT server.

示例性的,以一个M2M终端向MQTT服务器订阅相关主题为例。当该M2M终端向MQTT服务器订阅与在该M2M终端中存储的第二资源对应的第一主题时,该M2M终端将该第二资源的标识作为与该第二资源对应的第一主题包含的内容,并将该第一主题,和该M2M终端的标识包含在一条第二订阅主题的消息中发送至MQTT服务器,从而订阅与该第二资源对应的第一主题,即M2M终端向MQTT服务器发送包含该M2M终端需要订阅的第一主题的第二订阅主题的消息,订阅第一主题。Exemplarily, take an M2M terminal subscribing to a related topic from an MQTT server as an example. When the M2M terminal subscribes to the MQTT server for the first topic corresponding to the second resource stored in the M2M terminal, the M2M terminal uses the identifier of the second resource as the content contained in the first topic corresponding to the second resource , and send the first topic and the identifier of the M2M terminal to the MQTT server in a second subscription topic message, thereby subscribing to the first topic corresponding to the second resource, that is, the M2M terminal sends a message containing The M2M terminal needs to subscribe to the message of the second subscription topic of the first topic, and subscribes to the first topic.

S303、MQTT服务器分别保存M2M服务器的相关主题,和该至少两个M2M终端的相关主题。S303. The MQTT server saves the related topics of the M2M server and the related topics of the at least two M2M terminals respectively.

具体的,MQTT服务器分别保存在M2M服务器中存储的每一个第一资源的标识和包含该第一资源的标识的主题的对应关系,以及MQTT服务器分别保存该至少两个M2M终端中的每一个M2M终端的标识和包含该M2M终端中存储的第二资源的标识的第一主题的对应关系。Specifically, the MQTT server respectively saves the corresponding relationship between the identifier of each first resource stored in the M2M server and the topic containing the identifier of the first resource, and the MQTT server respectively saves the corresponding relationship between each M2M terminal in the at least two M2M terminals. The corresponding relationship between the identifier of the terminal and the first topic including the identifier of the second resource stored in the M2M terminal.

S304、M2M服务器为M2M服务器中存储的第一资源生成第一公共主题。S304. The M2M server generates a first common theme for the first resource stored in the M2M server.

具体的,由于本发明实施例提供的业务消息的传输方法应用在不同的应用场景中时,M2M服务器为M2M服务器中的第一资源生成第一公共主题的过程也是不同的,因此,M2M服务器为M2M服务器中的第一资源生成第一公共主题的具体过程将在下述示例性的应用场景中进行详细说明,此处不再赘述。Specifically, when the service message transmission method provided by the embodiment of the present invention is applied in different application scenarios, the process for the M2M server to generate the first common theme for the first resource in the M2M server is also different. Therefore, the M2M server is The specific process for the first resource in the M2M server to generate the first common theme will be described in detail in the following exemplary application scenarios, and will not be repeated here.

需要说明的是,M2M服务器为M2M服务器中的第一资源生成的第一公共主题需具有唯一性,即M2M服务器为M2M服务器中的第一资源生成的第一公共主题与M2M服务器在为M2M服务器中的第一资源生成第一公共主题之前生成的其他所有主题都不相同。It should be noted that the first common theme generated by the M2M server for the first resource in the M2M server must be unique, that is, the first common theme generated by the M2M server for the first resource in the M2M server is the same as that generated by the M2M server for the first resource in the M2M server. All other topics generated before the first resource in generate the first common topic are different.

进一步的,保证第一公共主题的唯一性的方式可以为,M2M服务器根据各个资源的标识(包括各个群组资源的标识、各个在M2M终端中存储的第二资源的标识和各个订阅资源的标识等)生成第一公共主题,由于各个资源的标识都不相同,因此根据资源的标识生成第一公共主题的方法也能够保证第一公共主题的唯一性。Further, the way to ensure the uniqueness of the first public topic may be that the M2M server may use the identifiers of each resource (including the identifier of each group resource, the identifier of each second resource stored in the M2M terminal, and the identifier of each subscribed resource etc.) to generate the first common theme, since the identification of each resource is different, so the method of generating the first common theme according to the identification of the resource can also guarantee the uniqueness of the first common theme.

进一步的,M2M服务器为该第一资源生成第一公共主题后,M2M服务器需将该第一公共主题作为该第一资源的子资源,或者M2M服务器将该第一公共主题作为该第一资源的属性。Further, after the M2M server generates the first common theme for the first resource, the M2M server needs to use the first common theme as a sub-resource of the first resource, or the M2M server needs to use the first common theme as a sub-resource of the first resource. Attributes.

示例性的,如图4所示,当该第一资源为群组资源时,M2M服务器将为该群组资源生成的第一公共主题作为该群组资源的子资源的示意图。其中,群组资源中包括多个子资源。例如,子资源1用于描述群组资源中各个成员资源的标识;子资源2用于指示所有群组资源的成员资源的分发请求(英文:fan out point)资源的标识等。M2M服务器为该群组资源生成第一公共主题后,M2M服务器将该第一公共主题作为该群组资源的子资源(如图4中所示的子资源n),添加到该群组资源中,从而将为该群组资源生成的第一公共主题作为该群组资源的子资源。Exemplarily, as shown in FIG. 4 , when the first resource is a group resource, the M2M server will generate a first common theme for the group resource as a schematic diagram of a sub-resource of the group resource. Wherein, the group resource includes multiple sub-resources. For example, sub-resource 1 is used to describe the identification of each member resource in the group resource; sub-resource 2 is used to indicate the distribution request (English: fan out point) resource identification of member resources of all group resources, etc. After the M2M server generates the first common theme for the group resource, the M2M server adds the first common theme as a sub-resource of the group resource (sub-resource n shown in FIG. 4 ) to the group resource , so that the first public theme generated for the group resource is used as a sub-resource of the group resource.

S305、M2M服务器将该至少两个M2M终端中的每一个M2M终端中存储的第二资源的标识作为该M2M终端已经订阅的第一主题包含的内容。S305. The M2M server takes the identifier of the second resource stored in each of the at least two M2M terminals as content included in the first topic that the M2M terminal has subscribed to.

其中,该至少两个M2M终端中的每一个M2M终端在上述S302中向MQTT服务器订阅相关主题时,已经订阅第一主题。M2M服务器将该至少两个M2M终端中的每一个M2M终端中存储的第二资源的标识作为该M2M终端已经订阅的第一主题包含的内容,即为M2M服务器根据该至少两个M2M终端中的每一个M2M终端中存储的第二资源的标识(即M2M服务器发送的第二业务消息的多个目的地址),为该M2M终端生成包含该M2M终端中存储的第二资源的标识的第一主题。Wherein, each of the at least two M2M terminals has subscribed to the first topic when subscribing to the relevant topic from the MQTT server in S302 above. The M2M server takes the identifier of the second resource stored in each of the at least two M2M terminals as the content contained in the first topic that the M2M terminal has subscribed to, that is, the M2M server The identifier of the second resource stored in each M2M terminal (that is, the multiple destination addresses of the second service message sent by the M2M server), generating a first topic containing the identifier of the second resource stored in the M2M terminal for the M2M terminal .

进一步的,M2M服务器将该至少两个M2M终端中的每一个M2M终端中存储的第二资源的标识作为该M2M终端已经订阅的第一主题包含的内容的具体方式,与现有技术中M2M服务器将该至少两个M2M终端中的每一个M2M终端中存储的第二资源的标识作为该M2M终端已经订阅的第一主题包含的内容的方式相同,此处不再赘述。Further, the specific manner in which the M2M server uses the identifier of the second resource stored in each of the at least two M2M terminals as the content contained in the first topic that the M2M terminal has subscribed to is different from that of the M2M server in the prior art. The manner in which the identifier of the second resource stored in each of the at least two M2M terminals is used as the content included in the first topic that the M2M terminal has subscribed to is the same, and will not be repeated here.

S306、M2M服务器通过MQTT服务器向该至少两个M2M终端中的每一个M2M终端发送一条第二MQTT消息,第二MQTT消息中包含第二业务消息和第一主题,第二业务消息中携带第一公共主题。S306. The M2M server sends a second MQTT message to each of the at least two M2M terminals through the MQTT server. The second MQTT message includes the second service message and the first topic, and the second service message carries the first public subject.

具体的,M2M服务器通过MQTT服务器向至少两个M2M终端中的每一个M2M终端发送一条包含第二业务消息和一个主题的第二MQTT消息,该一个主题为M2M服务器为M2M终端生成的包含该M2M终端中存储的第二资源的标识的第一主题。Specifically, the M2M server sends a second MQTT message including a second service message and a topic to each of the at least two M2M terminals through the MQTT server, and the topic is generated by the M2M server for the M2M terminal and includes the M2M The first subject of the identifier of the second resource stored in the terminal.

其中,该第二业务消息中携带第一公共主题的方式可以为,M2M服务器将该第一公共主题作为该第二业务消息的属性,添加到该第二业务消息中,从而使得该第二业务消息携带该第一公共主题。M2M服务器将该第一公共主题携带在第二业务消息中发送至该至少两个M2M终端中的每个M2M终端,以使得该至少两个M2M终端中的每个终端接收到该第二业务消息后,根据该第二业务消息中携带的该第一公共主题,向MQTT服务器订阅该第一公共主题。Wherein, the manner of carrying the first common subject in the second service message may be that the M2M server adds the first common subject as an attribute of the second service message to the second service message, so that the second service Messages carry this first common topic. The M2M server carries the first common topic in a second service message and sends it to each of the at least two M2M terminals, so that each of the at least two M2M terminals receives the second service message Then, according to the first public topic carried in the second service message, subscribe to the first public topic with the MQTT server.

进一步的,由于该至少两个M2M终端中的每一个M2M终端已经向MQTT服务器订阅了该第一主题,因此,MQTT服务器能够将包含该第一主题的第二MQTT消息转发给该M2M终端。Further, since each of the at least two M2M terminals has subscribed to the first topic from the MQTT server, the MQTT server can forward the second MQTT message containing the first topic to the M2M terminal.

S307、该至少两个M2M终端中的每一个M2M终端接收MQTT服务器发送的第二MQTT消息,第二MQTT消息中包含第二业务消息和第一主题,第二业务消息中包含第一公共主题,该第一主题中包含在该M2M终端中存储的第二资源的标识。S307. Each M2M terminal of the at least two M2M terminals receives a second MQTT message sent by the MQTT server, the second MQTT message includes a second service message and a first topic, and the second service message includes a first public topic, The first theme includes the identifier of the second resource stored in the M2M terminal.

进一步的,该至少两个M2M终端中的每一个M2M终端接收MQTT服务器发送的第二MQTT消息后,该M2M终端判断其订阅过的公共主题中是否有包含该第二业务消息包含的第一公共主题。具体的,该M2M终端可以通过将该第二业务消息中包含的主题与其保存的公共主题进行对比,从而判断该M2M终端向MQTT服务器订阅的公共主题中是否有该第二业务消息中包含的主题。该第二业务消息中包含的主题即为第一公共主题。Further, after each M2M terminal of the at least two M2M terminals receives the second MQTT message sent by the MQTT server, the M2M terminal judges whether the public topic it has subscribed to contains the first public message contained in the second service message. theme. Specifically, the M2M terminal may compare the topic contained in the second service message with the public topic saved by the M2M terminal to determine whether the topic contained in the second service message is included in the public topic subscribed by the M2M terminal to the MQTT server. . The topic included in the second service message is the first public topic.

若该M2M终端向MQTT服务器订阅的公共主题中没有该第二业务消息包含的第一公共主题,则该M2M终端执行S308、S309或者S310。If the M2M terminal does not have the first common topic contained in the second service message in the public topics subscribed to by the MQTT server, the M2M terminal executes S308, S309 or S310.

S308、该至少两个M2M终端中的每一个M2M终端均保存该第一公共主题与第一主题中包含的在该M2M终端中存储的第二资源的标识之间的映射关系。S308. Each M2M terminal of the at least two M2M terminals saves the mapping relationship between the first common theme and the identifier of the second resource contained in the first theme and stored in the M2M terminal.

其中,该至少两个M2M终端中的每一个M2M终端均保存该第一公共主题与第一主题中包含的在该M2M终端中存储的第二资源的标识之间的映射关系的方式,具体可参见如图1所示实施例中的相关描述,此处不再赘述。The manner in which each of the at least two M2M terminals saves the mapping relationship between the first common theme and the identifier of the second resource stored in the M2M terminal included in the first theme may specifically be Refer to related descriptions in the embodiment shown in FIG. 1 , and details are not repeated here.

S309、该至少两个M2M终端中的每一个M2M终端向MQTT服务器发送第一订阅主题的消息,该第一订阅主题的消息中包含该第一公共主题以及该M2M终端的标识。S309. Each M2M terminal of the at least two M2M terminals sends a first subscription topic message to the MQTT server, where the first subscription topic message includes the first public topic and the identifier of the M2M terminal.

具体的,该至少两个M2M终端中的每一个M2M终端生成用于向MQTT服务器订阅该第一公共主题的第一订阅主题的消息,第一订阅主题的消息中包含该第一公共主题以及该M2M终端的标识。该至少两个M2M终端中的每一个M2M终端向MQTT服务器发送该第一订阅主题的消息,MQTT服务器接收到该至少两个M2M终端中的每一个M2M终端发送的第一订阅主题的消息后,保存该第一公共主题与该M2M终端的标识的对应关系,即该至少两个M2M终端中的每一个M2M终端向MQTT服务器订阅了该第一公共主题。从而,当MQTT服务器接收到M2M服务器发送的包含该第一公共主题的第一MQTT消息时,MQTT服务器就能根据保存的该第一公共主题与M2M终端的标识之间的对应关系,将该第一MQTT消息转发给订阅过该第一公共主题的M2M终端的标识对应的M2M终端。即MQTT服务器能够将该包含第一公共主题的第一MQTT消息转发给订阅过该第一公共主题的M2M终端。Specifically, each M2M terminal of the at least two M2M terminals generates a message for subscribing to the MQTT server for the first subscription topic of the first public topic, and the message of the first subscription topic includes the first public topic and the The identifier of the M2M terminal. Each M2M terminal of the at least two M2M terminals sends a message of the first subscription topic to the MQTT server, and after the MQTT server receives the message of the first subscription topic sent by each M2M terminal of the at least two M2M terminals, The corresponding relationship between the first common topic and the identifier of the M2M terminal is stored, that is, each of the at least two M2M terminals has subscribed to the first common topic with the MQTT server. Therefore, when the MQTT server receives the first MQTT message containing the first common topic sent by the M2M server, the MQTT server can, according to the stored correspondence between the first common topic and the identity of the M2M terminal, send the first public topic to the M2M terminal. An MQTT message is forwarded to the M2M terminal corresponding to the identifier of the M2M terminal that has subscribed to the first common topic. That is, the MQTT server can forward the first MQTT message including the first common topic to the M2M terminals that have subscribed to the first common topic.

S310、该至少两个M2M终端中的每一个M2M终端对第一主题中包含的在该M2M终端中存储的第二资源的标识指示的第二资源执行与该第二业务消息相关的操作。S310. Each M2M terminal of the at least two M2M terminals performs an operation related to the second service message on the second resource indicated by the identifier of the second resource contained in the first theme and stored in the M2M terminal.

需要说明的是,上述S308、S309和S310可以同时执行,也可以依次执行。若上述S308、S309和S310依次执行,则执行顺序可以随机排序,在本发明实施例中不作限定。It should be noted that the above S308, S309, and S310 may be executed simultaneously or sequentially. If the above S308, S309, and S310 are executed sequentially, the execution sequence can be randomly sorted, which is not limited in this embodiment of the present invention.

通过上述S301-S310中的方法,M2M服务器为M2M服务器中存储的第一资源生成第一公共主题,并通过MQTT服务器向M2M终端(即该至少两个M2M终端中的每个M2M终端)发送第二MQTT消息,该第二MQTT消息中包含该M2M终端的第一主题和第二业务消息,该第二业务消息中包含该第一公共主题。M2M终端接收到该第二MQTT消息后,保存该第二业务消息中包含的该第一公共主题与该第一主题中包含的在该M2M终端中存储的第二资源的标识之间的映射关系,并向MQTT服务器订阅该第一公共主题。Through the above method in S301-S310, the M2M server generates the first common theme for the first resource stored in the M2M server, and sends the second topic to the M2M terminal (ie each of the at least two M2M terminals) through the MQTT server. Two MQTT messages, the second MQTT message includes the first topic of the M2M terminal and a second service message, and the second service message includes the first common topic. After receiving the second MQTT message, the M2M terminal saves the mapping relationship between the first common topic contained in the second service message and the identifier of the second resource stored in the M2M terminal contained in the first topic. , and subscribe the first public topic to the MQTT server.

因此,当M2M服务器需向与M2M服务器中存储的第一资源对应的至少两个M2M终端发送相同内容的第一业务消息时,M2M服务器能够根据如图2所示的实施例中的方法,向MQTT服务器发送一次第一MQTT消息,该第一MQTT消息中包含第一业务消息和第一公共主题。另一方面,由于M2M终端已经订阅了该第一公共主题的内容,因此MQTT服务器能够将该第一MQTT消息转发给M2M终端,M2M终端能够根据如图1所示的实施例中的方法,接收该第一MQTT消息,并执行与该第一MQTT消息中包含的第一业务消息相关的操作。Therefore, when the M2M server needs to send the first service message with the same content to at least two M2M terminals corresponding to the first resources stored in the M2M server, the M2M server can send The MQTT server sends a first MQTT message once, and the first MQTT message includes the first service message and the first public topic. On the other hand, since the M2M terminal has subscribed to the content of the first public topic, the MQTT server can forward the first MQTT message to the M2M terminal, and the M2M terminal can receive the the first MQTT message, and perform operations related to the first service message included in the first MQTT message.

为了更好的说明本发明实施例提供的一种业务消息的传输方法,下面将列举两种可能的应用场景,进行示例性的说明。In order to better illustrate a method for transmitting a service message provided by an embodiment of the present invention, two possible application scenarios will be listed below for exemplary description.

一种可能的应用场景为,当本发明实施例提供的业务消息的传输方法应用于群组管理中时,第一资源为群组资源,第二资源的标识为群组资源中的成员资源的标识,M2M服务器可能会通过两种可能的实现方式(方式一和方式二)执行如图3所示方法。A possible application scenario is that when the service message transmission method provided by the embodiment of the present invention is applied to group management, the first resource is a group resource, and the identifier of the second resource is the ID of a member resource in the group resource. mark, the M2M server may execute the method shown in Figure 3 through two possible implementation modes (mode 1 and mode 2).

方式一:当M2M服务器创建群组资源时,M2M服务器为该群组资源生成第一公共主题。Way 1: When the M2M server creates a group resource, the M2M server generates a first common topic for the group resource.

如图5所示,上述S304具体可以为:As shown in Figure 5, the above S304 may specifically be:

S304a、M2M服务器在接收到群组资源的创建请求消息后,根据为该群组资源分配的群组资源的标识,为该群组资源生成该群组资源的第一公共主题,该群组资源的第一公共主题包含该群组资源的标识。S304a. After receiving the creation request message of the group resource, the M2M server generates the first public theme of the group resource for the group resource according to the identifier of the group resource allocated for the group resource, and the group resource The first public topic contains the identity of the group resource.

当发起端(英文:originator)需要向M2M服务器请求创建群组资源时,发起端可以通过MQTT服务器向M2M服务器发送群组创建请求消息。其中,发起端可以为向M2M服务器发送群组创建请求消息的CSE。When the originator (English: originator) needs to request the M2M server to create a group resource, the originator may send a group creation request message to the M2M server through the MQTT server. Wherein, the initiator may be a CSE that sends a group creation request message to the M2M server.

当M2M服务器接收到群组创建请求消息后,M2M服务器根据群组创建请求消息,创建群组资源,并为该群组资源分配该群组资源的标识,以及为该群组资源生成该群组资源的第一公共主题。其中,该群组资源的第一公共主题包含该群组资源的标识。After the M2M server receives the group creation request message, the M2M server creates a group resource according to the group creation request message, assigns the group resource identifier to the group resource, and generates the group resource for the group resource. The resource's first public theme. Wherein, the first common topic of the group resource includes the identification of the group resource.

举例来说,假设M2M服务器为该群组资源分配的标识为“g.example.com/group”,则M2M服务器根据该群组资源的标识,可以将该第一公共主题的主题名配置为“/oneM2M/group/g.example.com/req”,即M2M服务器为该群组资源生成包含该群组资源的标识的第一公共主题“/oneM2M/group/g.example.com/req”。由于该群组资源的标识是唯一的,因此M2M服务器根据该群组资源的标识,为该群组资源生成的该第一公共主题也是唯一的,即第一公共主题具有唯一性。For example, assuming that the identifier assigned by the M2M server to the group resource is "g.example.com/group", the M2M server can configure the topic name of the first public topic as "g.example.com/group" according to the identifier of the group resource. /oneM2M/group/g.example.com/req", that is, the M2M server generates for the group resource the first public topic "/oneM2M/group/g.example.com/req" including the identifier of the group resource. Since the identifier of the group resource is unique, the first public topic generated by the M2M server for the group resource is also unique according to the identifier of the group resource, that is, the first public topic is unique.

进一步的,在方式一中,如图5所示,上述S306中的第二业务消息为M2M服务器对与该成员资源的标识对应的M2M终端的通知消息。其中,上述S305-S306具体可以为:Further, in the first manner, as shown in FIG. 5 , the second service message in S306 is a notification message sent by the M2M server to the M2M terminal corresponding to the identifier of the member resource. Wherein, the above-mentioned S305-S306 may specifically be:

S305a、M2M服务器将该成员资源的标识,作为与该成员资源的标识对应的M2M终端已经订阅的第一主题包含的内容。S305a. The M2M server uses the identifier of the member resource as the content included in the first topic that the M2M terminal corresponding to the identifier of the member resource has subscribed to.

S306a、M2M服务器通过MQTT服务器向至少两个M2M终端中的每一个M2M终端发送一条第二MQTT消息,第二MQTT消息中包含通知消息和第一主题,该通知消息携带该群组资源的第一公共主题。S306a. The M2M server sends a second MQTT message to each of the at least two M2M terminals through the MQTT server. The second MQTT message includes a notification message and a first topic, and the notification message carries the first message of the group resource. public subject.

其中,该群组资源中的多个成员资源的标识可能对应一个M2M终端,也可能分别对应多个M2M终端。Wherein, identifiers of multiple member resources in the group resource may correspond to one M2M terminal, or may respectively correspond to multiple M2M terminals.

示例性的,假设该群组资源的成员资源分别为成员资源1、成员资源2和成员资源3,其中成员资源1的标识对应的M2M终端为M2M终端1,成员资源2和成员资源3对应的M2M终端都为M2M终端2。则当M2M服务器在创建由成员资源1,成员资源2和成员资源3形成的群组资源时,M2M服务器将成员资源1的标识作为M2M终端1已订阅的第一主题(以下称为第一主题1),M2M服务器将成员资源2的标识作为M2M终端2已订阅的第一主题(以下称为第一主题2),M2M服务器将成员资源3的标识作为M2M终端3已订阅的第一主题(以下称为第一主题3),即M2M服务器为M2M终端1生成包含成员资源1的标识的第一主题1,M2M服务器为M2M终端2生成包含成员资源2的标识的第一主题2和包含成员资源3的标识的第一主题3。M2M服务器通过MQTT服务器向成员资源1的标识对应的M2M终端1发送一条包含第一主题1的第二MQTT消息,M2M服务器通过MQTT服务器向成员资源2的标识对应的M2M终端2发送一条包含第一主题2的第二MQTT消息,以及M2M服务器通过MQTT服务器向成员资源3的标识对应的M2M终端2发送一条包含第一主题3的第二MQTT消息。For example, assume that the member resources of the group resource are member resource 1, member resource 2 and member resource 3 respectively, wherein the M2M terminal corresponding to the identifier of member resource 1 is M2M terminal 1, and the identifier of member resource 2 and member resource 3 corresponds to The M2M terminals are all M2M terminals 2 . Then when the M2M server is creating a group resource formed by member resource 1, member resource 2 and member resource 3, the M2M server will use the identifier of member resource 1 as the first topic subscribed by M2M terminal 1 (hereinafter referred to as the first topic 1), the M2M server uses the identifier of the member resource 2 as the first topic that the M2M terminal 2 has subscribed to (hereinafter referred to as the first topic 2), and the M2M server uses the identifier of the member resource 3 as the first topic that the M2M terminal 3 has subscribed to ( Hereinafter referred to as the first topic 3), that is, the M2M server generates the first topic 1 containing the identification of the member resource 1 for the M2M terminal 1, and the M2M server generates the first topic 2 containing the identification of the member resource 2 and the first topic 2 containing the identification of the member resource 2 for the M2M terminal 2. The first topic 3 identified by the resource 3. The M2M server sends a second MQTT message including the first topic 1 to the M2M terminal 1 corresponding to the identifier of the member resource 1 through the MQTT server, and the M2M server sends a second MQTT message including the first topic 1 to the M2M terminal 2 corresponding to the identifier of the member resource 2 through the MQTT server. The second MQTT message of the topic 2, and the M2M server sends a second MQTT message including the first topic 3 to the M2M terminal 2 corresponding to the identifier of the member resource 3 through the MQTT server.

方式二:当M2M服务器在接收到对群组资源的成员资源的访问请求消息时,M2M服务器为该群组资源生成第一公共主题。Way 2: When the M2M server receives an access request message for a member resource of the group resource, the M2M server generates a first common topic for the group resource.

如图6所示,上述S304具体可以包括:As shown in Figure 6, the above S304 may specifically include:

S304b、M2M服务器在接收到对群组资源的成员资源的访问请求消息后,M2M服务器根据对该群组资源的成员资源的访问请求消息中包含的群组资源的标识确定没有与该群组资源对应的第一公共主题。S304b. After the M2M server receives the access request message for the member resource of the group resource, the M2M server determines that there is no connection with the group resource according to the identifier of the group resource included in the access request message for the member resource of the group resource. The corresponding first public topic.

其中,对该群组资源的成员资源的访问请求消息可以为与该群组资源对应的某个M2M终端向M2M服务器发送的,也可以为该群组资源以外的CSE发送的。Wherein, the access request message of a member resource of the group resource may be sent by an M2M terminal corresponding to the group resource to the M2M server, or may be sent by a CSE other than the group resource.

具体的,若M2M服务器根据该群组资源的标识确定该群组资源没有一项子资源为包含该群组资源的标识的主题,则M2M服务器确定没有与该群组资源对应的第一公共主题。或者,若M2M服务器根据该群组资源的标识确定该群组资源没有一项属性为包含该群组资源的标识的主题,则M2M服务器确定没有与该群组资源对应的第一公共主题。Specifically, if the M2M server determines according to the identifier of the group resource that none of the subresources of the group resource is a topic containing the identifier of the group resource, then the M2M server determines that there is no first public topic corresponding to the group resource . Or, if the M2M server determines according to the identifier of the group resource that none of the attributes of the group resource is a topic including the identifier of the group resource, the M2M server determines that there is no first public topic corresponding to the group resource.

S304c、M2M服务器根据该群组资源的标识,为该群组资源生成该群组资源的第一公共主题,该群组资源的第一公共主题包含该群组资源的标识。S304c. The M2M server generates a first common theme of the group resource for the group resource according to the identifier of the group resource, where the first common theme of the group resource includes the identifier of the group resource.

具体的,M2M服务器根据该群组资源的标识,为该群组资源生成该群组资源的第一公共主题的方式,可以参见上述S304a中的相关描述,此处不再赘述。Specifically, the manner in which the M2M server generates the first common theme of the group resource for the group resource according to the identifier of the group resource may refer to the relevant description in S304a above, and details will not be repeated here.

进一步的,如图6所示,在方式二中,上述S306中的第二业务消息为M2M服务器根据对该群组资源的成员资源的访问请求消息生成的第一访问请求消息,该第一访问请求消息为M2M服务器发送给与该成员资源的标识对应的M2M终端的访问请求消息。其中,上述S305-S306具体可以为:Further, as shown in FIG. 6, in mode 2, the second service message in S306 above is the first access request message generated by the M2M server according to the access request message of the member resource of the group resource, and the first access The request message is an access request message sent by the M2M server to the M2M terminal corresponding to the identifier of the member resource. Wherein, the above-mentioned S305-S306 may specifically be:

S305a、M2M服务器将该成员资源的标识,作为与该成员资源的标识对应的M2M终端已经订阅的第一主题包含的内容。S305a. The M2M server uses the identifier of the member resource as the content included in the first topic that the M2M terminal corresponding to the identifier of the member resource has subscribed to.

S306b、M2M服务器通过MQTT服务器向至少两个M2M终端中的每一个M2M终端发送一条第二MQTT消息,第二MQTT消息中包含第一访问请求消息和第一主题,第一访问请求消息中携带该群组资源的第一公共主题。S306b. The M2M server sends a second MQTT message to each of the at least two M2M terminals through the MQTT server. The second MQTT message includes the first access request message and the first topic, and the first access request message carries the The first public topic of the group resource.

具体的,上述S306b的具体实现方式与上述S306a的具体实现方式类似,此处不再赘述。Specifically, the specific implementation manner of the above-mentioned S306b is similar to the specific implementation manner of the above-mentioned S306a, and will not be repeated here.

另一种可能的应用场景为,当本发明实施例提供的业务消息的传输方法应用于订阅通知管理中时,第一资源为订阅资源,M2M服务器可能会通过两种可能的实现方式(方式三和方式四)执行如图3所示方法。Another possible application scenario is that when the service message transmission method provided by the embodiment of the present invention is applied to subscription notification management, the first resource is a subscription resource, and the M2M server may use two possible implementation methods (mode 3 and way 4) execute the method as shown in FIG. 3 .

方式三:当M2M服务器发送订阅通知消息时,M2M服务器为订阅资源生成该订阅资源的第一公共主题。Mode 3: When the M2M server sends a subscription notification message, the M2M server generates the first common topic of the subscribed resource for the subscribed resource.

如图7所示,上述S304具体包括:As shown in Figure 7, the above S304 specifically includes:

S304d、当M2M服务器确定订阅资源发生变化时,M2M服务器根据该订阅资源的标识确定没有与该订阅资源对应的第一公共主题。S304d. When the M2M server determines that the subscription resource changes, the M2M server determines that there is no first public topic corresponding to the subscription resource according to the identifier of the subscription resource.

具体的,M2M服务器根据该订阅资源的标识确定该订阅资源没有一项子资源为包含该订阅资源的标识的主题,则M2M服务器确定没有与该订阅资源对应的第一公共主题。或者,M2M服务器根据该订阅资源的标识确定该订阅资源没有一项属性为包含该订阅资源的标识的主题,则M2M服务器确定没有与该订阅资源对应的第一公共主题。Specifically, the M2M server determines according to the identifier of the subscription resource that no sub-resource of the subscription resource is a topic including the identifier of the subscription resource, and then the M2M server determines that there is no first common topic corresponding to the subscription resource. Alternatively, the M2M server determines according to the identifier of the subscription resource that none of the attributes of the subscription resource is a topic including the identifier of the subscription resource, and then the M2M server determines that there is no first public topic corresponding to the subscription resource.

S304e、M2M服务器根据该订阅资源的标识,为该订阅资源生成该订阅资源的第一公共主题,该订阅资源的第一公共主题中包含该订阅资源的标识。S304e. The M2M server generates a first public topic of the subscription resource for the subscription resource according to the identifier of the subscription resource, and the first public topic of the subscription resource includes the identifier of the subscription resource.

进一步的,在方式三中,当至少两个M2M终端向M2M服务器订阅的订阅资源发生变化时,若该订阅资源的变化情况满足该至少两个M2M终端的通知过滤条件,则M2M服务器会生成订阅通知消息,并判断公共主题中是否有与该订阅资源关联的第一公共主题。若公共主题中无该第一公共主题,M2M服务器则会根据该订阅资源的标识符(具体可以为该订阅资源的标识和编号),生成包含该订阅资源标识和编号的第一公共主题。其中,M2M终端的通知过滤条件是M2M终端向M2M服务器请求创建订阅通知时,M2M终端发送给M2M服务器的。Further, in mode 3, when at least two M2M terminals subscribe to the subscription resource of the M2M server, if the change of the subscription resource satisfies the notification filter condition of the at least two M2M terminals, the M2M server will generate a subscription Notify the message, and determine whether there is a first public topic associated with the subscription resource in the public topics. If the first public topic does not exist in the public topics, the M2M server will generate the first public topic including the subscription resource identifier and number according to the identifier of the subscription resource (specifically, the identifier and number of the subscription resource). Wherein, the notification filtering condition of the M2M terminal is that the M2M terminal sends to the M2M server when the M2M terminal requests the M2M server to create a subscription notification.

特别的,M2M终端的通知过滤条件可以理解为,M2M服务器向该M2M终端发送订阅通知消息的条件。In particular, the notification filter condition of the M2M terminal can be understood as a condition for the M2M server to send a subscription notification message to the M2M terminal.

示例性的,假设M2M终端向M2M服务器订阅的订阅资源为在M2M服务器中存储的温度资源,且M2M终端的通知过滤条件为:当温度高于5°且低于15°时,M2M服务器向该M2M终端发送订阅通知消息。当M2M服务器检测到在该M2M服务器中存储的温度资源发生变化时,M2M服务器判断该温度资源的变化情况是否满足该通知过滤条件,即M2M服务器判断当前温度是否高于5度且低于15度。若M2M服务器判断该温度资源的变化情况满足M2M终端的通知过滤条件,M2M服务器则生成订阅通知消息,并将该订阅通知消息发送给该M2M终端。Exemplarily, it is assumed that the subscription resource subscribed by the M2M terminal to the M2M server is a temperature resource stored in the M2M server, and the notification filter condition of the M2M terminal is: when the temperature is higher than 5° and lower than 15°, the M2M server sends the The M2M terminal sends a subscription notification message. When the M2M server detects that the temperature resource stored in the M2M server changes, the M2M server judges whether the change of the temperature resource satisfies the notification filter condition, that is, the M2M server judges whether the current temperature is higher than 5 degrees and lower than 15 degrees . If the M2M server judges that the change of the temperature resource satisfies the notification filtering condition of the M2M terminal, the M2M server generates a subscription notification message and sends the subscription notification message to the M2M terminal.

进一步的,在方式三中,如图7所示,上述S306中的第二业务消息为M2M服务器对每一个订阅该订阅资源的M2M终端的订阅通知消息。其中,上述S305-S306具体可以为:Further, in mode 3, as shown in FIG. 7 , the second service message in S306 is a subscription notification message sent by the M2M server to each M2M terminal subscribing to the subscription resource. Wherein, the above-mentioned S305-S306 may specifically be:

S305b、M2M服务器将每一个订阅该订阅资源的M2M终端中存储的第二资源的标识,作为该M2M终端已经订阅的第一主题包含的内容。S305b. The M2M server uses the identifier of the second resource stored in each M2M terminal subscribing to the subscription resource as the content included in the first topic that the M2M terminal has subscribed to.

S306c、M2M服务器通过MQTT服务器向至少两个M2M终端中的每一个M2M终端发送一条第二MQTT消息,第二MQTT消息中包含订阅通知消息和第一主题,订阅通知消息中携带该订阅资源的第一公共主题。S306c. The M2M server sends a second MQTT message to each of the at least two M2M terminals through the MQTT server. The second MQTT message includes a subscription notification message and a first topic, and the subscription notification message carries the subscription resource number. a public theme.

方式四:当M2M服务器创建订阅通知时,M2M服务器为M2M服务器中的订阅资源生成第一公共主题。Way 4: When the M2M server creates a subscription notification, the M2M server generates a first common topic for the subscription resource in the M2M server.

如图8所示,上述S304具体为:As shown in Figure 8, the above S304 is specifically:

S304f、当M2M服务器接收到对订阅资源的订阅创建请求消息时,该对该订阅资源的订阅创建请求消息中包含该订阅资源的标识,以及订阅该订阅资源的M2M终端中存储的第二资源的标识,M2M服务器根据该订阅资源的标识,为该订阅资源生成该订阅资源的第一公共主题,该订阅资源的第一公共主题中包含该订阅资源的标识。S304f. When the M2M server receives the subscription creation request message for the subscription resource, the subscription creation request message for the subscription resource includes the identifier of the subscription resource and the ID of the second resource stored in the M2M terminal subscribing to the subscription resource. An identifier, the M2M server generates a first public topic of the subscription resource for the subscription resource according to the identifier of the subscription resource, and the first public topic of the subscription resource includes the identifier of the subscription resource.

在本发明实施例中,当至少两个M2M终端中的每一个M2M终端向M2M服务器请求对订阅资源创建订阅通知时,该至少两个M2M终端中的每一个M2M终端向M2M服务器发送订阅创建请求消息。其中,该至少两个M2M终端中的每一个M2M终端发送的订阅创建请求消息中还可以包括该M2M终端的通知过滤条件,该M2M终端请求订阅的订阅资源的标识,以及该M2M终端中存储的第二资源的标识。该M2M终端中存储的第二资源的标识用于M2M服务器生成订阅通知消息后,确定该订阅通知消息的目的地址。In this embodiment of the present invention, when each of the at least two M2M terminals requests the M2M server to create a subscription notification for the subscription resource, each of the at least two M2M terminals sends a subscription creation request to the M2M server information. Wherein, the subscription creation request message sent by each of the at least two M2M terminals may also include the notification filter condition of the M2M terminal, the identifier of the subscription resource requested by the M2M terminal, and the information stored in the M2M terminal. The identifier of the second resource. The identifier of the second resource stored in the M2M terminal is used for determining the destination address of the subscription notification message after the M2M server generates the subscription notification message.

需要说明的是,在方式四中,由于该至少两个M2M终端的通知过滤条件可能相同,也可能不同,因此M2M服务器根据该订阅资源的标识生成的第一公共主题可能只有一个,也可能有多个。具体的,当该至少两个M2M终端的通知过滤条件相同时,M2M服务器根据该订阅资源的标识生成的第一公共主题只有一个;当该至少两个M2M终端的通知过滤条件不同时,M2M服务器根据该订阅资源的标识生成的第一公共主题有多个。It should be noted that in mode 4, since the notification filtering conditions of the at least two M2M terminals may be the same or different, the first common topic generated by the M2M server according to the identifier of the subscription resource may be only one, or there may be Multiple. Specifically, when the notification filtering conditions of the at least two M2M terminals are the same, the M2M server generates only one first common topic according to the identifier of the subscription resource; when the notification filtering conditions of the at least two M2M terminals are different, the M2M server There are multiple first public topics generated according to the identifier of the subscription resource.

进一步地,当M2M服务器接收到该至少两个M2M终端中的第一个M2M终端发送的订阅创建请求消息时,M2M服务器为该第一个M2M终端的订阅资源的标识分配编号,例如编号为1,则M2M服务器根据该订阅资源的标识和该编号1,生成与该第一个M2M终端对应的该订阅资源的第一公共主题。Further, when the M2M server receives the subscription creation request message sent by the first M2M terminal among the at least two M2M terminals, the M2M server assigns a number to the identifier of the subscription resource of the first M2M terminal, for example, the number is 1 , the M2M server generates the first public topic of the subscription resource corresponding to the first M2M terminal according to the identifier of the subscription resource and the number 1.

当M2M服务器接收到该至少两个M2M终端中的第二个M2M终端发送的订阅创建请求消息时,若M2M服务器确定该第二个M2M终端的通知过滤条件与该第一个M2M终端的通知过滤条件相同,则M2M服务器可将为该第一个M2M终端生成的第一公共主题分配给该第二个M2M终端。若M2M服务器确定该第二个M2M终端的通知过滤条件与该第一个M2M终端的通知过滤条件不同,则M2M服务器为该第二个M2M终端的订阅资源的标识分配编号,例如编号为2,并根据该订阅资源的标识和该编号2,生成与该第二个M2M终端对应的该订阅资源的第一公共主题。When the M2M server receives the subscription creation request message sent by the second M2M terminal among the at least two M2M terminals, if the M2M server determines that the notification filter condition of the second M2M terminal is different from the notification filter condition of the first M2M terminal If the conditions are the same, the M2M server may assign the first public theme generated by the first M2M terminal to the second M2M terminal. If the M2M server determines that the notification filter condition of the second M2M terminal is different from the notification filter condition of the first M2M terminal, the M2M server assigns a number, for example, 2, to the identifier of the subscription resource of the second M2M terminal, And according to the identifier of the subscription resource and the number 2, a first common topic of the subscription resource corresponding to the second M2M terminal is generated.

进一步地,在方式四中,如图8所示,上述S306中的第二业务消息为M2M服务器根据该对该订阅资源的订阅创建请求消息生成的订阅创建响应消息,该订阅创建响应消息为M2M服务器需发送给每一个订阅该订阅资源的M2M终端的响应消息。其中,上述S305-S306具体可以为:Further, in mode 4, as shown in FIG. 8 , the second service message in S306 above is a subscription creation response message generated by the M2M server according to the subscription creation request message for the subscription resource, and the subscription creation response message is an M2M The server needs to send a response message to each M2M terminal subscribing to the subscription resource. Wherein, the above-mentioned S305-S306 may specifically be:

S305c、M2M服务器将每一个订阅该订阅资源的M2M终端中存储的第二资源的标识,作为该M2M终端已经订阅的第一主题包含的内容。S305c. The M2M server uses the identifier of the second resource stored in each M2M terminal subscribing to the subscription resource as the content included in the first topic that the M2M terminal has subscribed to.

S306d、M2M服务器通过MQTT服务器向至少两个M2M终端中的每一个M2M终端发送一条第二MQTT消息,第二MQTT消息中包含订阅创建响应消息和第一主题,订阅创建响应消息中携带该订阅资源的第一公共主题。S306d, the M2M server sends a second MQTT message to each of the at least two M2M terminals through the MQTT server, the second MQTT message includes a subscription creation response message and the first topic, and the subscription creation response message carries the subscription resource The first public topic of .

本发明实施例提供一种业务消息的传输方法,M2M服务器确定向与M2M服务器中存储的第一资源对应的至少两个M2M终端发送相同内容的第一业务消息,并确定为该第一资源生成的所述第一公共主题,以及向MQTT服务器发送一次第一MQTT消息,第一MQTT消息中包含第一业务消息和第一公共主题,第一业务消息包含发送给至少两个终端的相同内容。与现有技术中M2M服务器需向MQTT服务器发布多个包含不同的主题的MQTT消息相比,本发明实施例提供的业务消息的传输方法,能够减小M2M服务器与MQTT服务器之间的通信开销。An embodiment of the present invention provides a service message transmission method. An M2M server determines to send a first service message with the same content to at least two M2M terminals corresponding to a first resource stored in the M2M server, and determines to generate a service message for the first resource. The first public topic of the first MQTT message is sent to the MQTT server once, the first MQTT message includes the first business message and the first public topic, and the first business message includes the same content sent to at least two terminals. Compared with the prior art where the M2M server needs to issue multiple MQTT messages containing different topics to the MQTT server, the service message transmission method provided by the embodiment of the present invention can reduce the communication overhead between the M2M server and the MQTT server.

如图9所示,本发明实施例提供一种M2M终端,该M2M终端可以包括:As shown in FIG. 9, an embodiment of the present invention provides an M2M terminal, and the M2M terminal may include:

接收单元10,用于接收MQTT服务器发送的第一MQTT消息,所述第一MQTT消息中包含第一业务消息和第一公共主题。The receiving unit 10 is configured to receive a first MQTT message sent by an MQTT server, where the first MQTT message includes a first service message and a first public topic.

查找单元11,用于根据存储单元12保存的所述第一公共主题与在所述存储单元12中存储的资源的标识之间的映射关系,查找与所述接收单元10接收的所述第一公共主题对应的所述在所述存储单元12中存储的资源的标识。The search unit 11 is configured to search for the first public topic received by the receiving unit 10 according to the mapping relationship between the first public theme stored in the storage unit 12 and the identifier of the resource stored in the storage unit 12. The identifier of the resource stored in the storage unit 12 corresponding to the public topic.

执行单元13,用于对所述查找单元10查找的所述在所述存储单元12中存储的资源的标识指示的所述在所述存储单元12中存储的资源执行与所述接收单元10接收的所述第一业务消息相关的操作。The executing unit 13 is configured to execute the resource stored in the storage unit 12 indicated by the identifier of the resource stored in the storage unit 12 searched by the search unit 10 and received by the receiving unit 10 Operations related to the first service message.

可选的,结合图9,如图10所示,所述M2M终端还包括发送单元14。Optionally, referring to FIG. 9 , as shown in FIG. 10 , the M2M terminal further includes a sending unit 14 .

所述接收单元10,还用于在接收MQTT服务器发送的第一MQTT消息之前,接收所述MQTT服务器发送的第二MQTT消息,所述第二MQTT消息中包含第二业务消息和第一主题,所述第二业务消息中包含所述第一公共主题,所述第一主题中包含所述在所述存储单元12中存储的资源的标识。The receiving unit 10 is further configured to receive a second MQTT message sent by the MQTT server before receiving the first MQTT message sent by the MQTT server, the second MQTT message includes a second business message and a first topic, The second service message includes the first public topic, and the first topic includes the identifier of the resource stored in the storage unit 12 .

所述存储单元12,用于保存所述接收单元10接收的所述第一公共主题与所述在所述存储单元12中存储的资源的标识之间的映射关系。The storage unit 12 is configured to store a mapping relationship between the first public topic received by the receiving unit 10 and the identifiers of the resources stored in the storage unit 12 .

所述发送单元14,用于向所述MQTT服务器发送第一订阅主题的消息,所述第一订阅主题的消息中包含所述接收单元10接收的所述第一公共主题以及所述M2M终端的标识。The sending unit 14 is configured to send a message of a first subscribed topic to the MQTT server, where the message of the first subscribed topic includes the first public topic received by the receiving unit 10 and the M2M terminal's logo.

可选的,所述发送单元14,还用于在所述接收单元接收所述MQTT服务器发送的第二MQTT消息之前,向所述MQTT服务器发送第二订阅主题的消息,所述第二订阅主题的消息包含所述M2M终端需要订阅的所述第一主题。Optionally, the sending unit 14 is further configured to send a message of a second subscription topic to the MQTT server before the receiving unit receives the second MQTT message sent by the MQTT server, and the second subscription topic The message includes the first topic that the M2M terminal needs to subscribe to.

在本发明实施例中,该M2M终端可以为传感器或者微控制器等。In the embodiment of the present invention, the M2M terminal may be a sensor or a microcontroller.

本发明实施例提供一种M2M终端,由于该M2M能够接收MQTT服务器发送的第一MQTT消息,并根据保存的该第一公共主题与在该M2M终端中存储的资源的标识之间的映射关系,查找与该第一公共主题对应的在该M2M终端中存储的资源的标识,以及对在该M2M终端中存储的资源的标识指示的在该M2M终端中存储的资源执行与该第一业务消息相关的操作,该第一MQTT消息中包含第一业务消息和第一公共主题。因此,当M2M服务器需向与该M2M服务器中存储的资源对应的至少两个该M2M终端发送相同内容的第一业务消息时,MQTT服务器只需发送一次第一MQTT消息到MQTT服务器,由于该至少两个M2M终端都订阅了该第一公共主题,因此MQTT服务器会将该第一MQTT消息转发给该至少两个M2M终端,且该至少两个M2M终端中的每个M2M终端能够根据该第一公共主题与在该每个M2M终端中存储的资源的标识之间的映射关系,执行与该第一业务消息相关的操作,从而能够减小M2M服务器与MQTT服务器之间的通信开销。An embodiment of the present invention provides an M2M terminal, because the M2M can receive the first MQTT message sent by the MQTT server, and according to the saved mapping relationship between the first common theme and the identifier of the resource stored in the M2M terminal, Finding the identifier of the resource stored in the M2M terminal corresponding to the first common theme, and executing the resource stored in the M2M terminal indicated by the identifier of the resource stored in the M2M terminal is related to the first service message In the operation, the first MQTT message includes the first service message and the first public topic. Therefore, when the M2M server needs to send the first service message with the same content to at least two M2M terminals corresponding to the resources stored in the M2M server, the MQTT server only needs to send the first MQTT message to the MQTT server once, because the at least Both M2M terminals have subscribed to the first common topic, so the MQTT server will forward the first MQTT message to the at least two M2M terminals, and each M2M terminal in the at least two M2M terminals can be based on the first The mapping relationship between the public topic and the identifier of the resource stored in each M2M terminal executes an operation related to the first service message, thereby reducing the communication overhead between the M2M server and the MQTT server.

如图11所示,本发明实施例提供一种M2M服务器,该M2M服务器可以包括:As shown in FIG. 11, an embodiment of the present invention provides an M2M server, and the M2M server may include:

确定单元20,用于当需向与存储单元22中存储的第一资源对应的至少两个M2M终端发送相同内容的第一业务消息时,确定为所述第一资源生成的第一公共主题。The determining unit 20 is configured to determine a first common topic generated for the first resource when the first service message with the same content needs to be sent to at least two M2M terminals corresponding to the first resource stored in the storage unit 22 .

发送单元21,用于向MQTT服务器发送一次第一MQTT消息,所述第一MQTT消息中包含所述第一业务消息和所述确定单元20确定的所述第一公共主题,所述第一业务消息中包含发送给所述至少两个M2M终端的相同内容。The sending unit 21 is configured to send a first MQTT message to the MQTT server once, the first MQTT message includes the first business message and the first public topic determined by the determining unit 20, the first business The message includes the same content sent to the at least two M2M terminals.

可选的,结合如11,如图12所示,所述M2M服务器还包括:Optionally, combined with Step 11, as shown in Figure 12, the M2M server further includes:

生成单元23,用于所述确定单元20确定为所述第一资源生成的第一公共主题之前,为所述第一资源生成所述第一公共主题,并将所述至少两个M2M终端中的每一个M2M终端中存储的第二资源的标识作为该M2M终端已经订阅的第一主题包含的内容。The generating unit 23 is configured to generate the first common topic for the first resource before the determining unit 20 determines the first common topic generated for the first resource, and generate the first common topic in the at least two M2M terminals The identifier of the second resource stored in each M2M terminal of , is used as the content included in the first topic that the M2M terminal has subscribed to.

其中,所述生成单元23为所述第一资源生成所述第一公共主题之后,将所述第一公共主题与所述第一资源关联,并存储到存储单元22中。Wherein, after the generating unit 23 generates the first public topic for the first resource, associate the first public topic with the first resource and store it in the storage unit 22 .

所述发送单元21,还用于通过所述MQTT服务器向所述至少两个M2M终端中的每一个M2M终端发送一条第二MQTT消息,所述第二MQTT消息中包含第二业务消息和所述生成单元23生成的所述第一主题,所述第二业务消息中包含所述生成单元23生成的所述第一公共主题。The sending unit 21 is further configured to send a second MQTT message to each of the at least two M2M terminals through the MQTT server, and the second MQTT message includes a second service message and the The first topic generated by the generating unit 23, and the second service message includes the first common topic generated by the generating unit 23.

可选的,如图12所示,当所述第一资源为群组资源时,所述第二资源的标识为所述群组资源中的成员资源的标识,所述生成单元23,具体用于在接收到所述群组资源的创建请求消息后,根据为所述群组资源分配的所述群组资源的标识,为所述群组资源生成所述群组资源的第一公共主题,并将所述成员资源的标识,作为与所述成员资源的标识对应的M2M终端已经订阅的第一主题包含的内容,所述群组资源的第一公共主题中包含所述群组资源的标识。其中,所述发送单元21发送的所述第二业务消息为所述M2M服务器对与所述成员资源的标识对应的M2M终端的通知消息。Optionally, as shown in FIG. 12, when the first resource is a group resource, the identifier of the second resource is an identifier of a member resource in the group resource, and the generation unit 23 specifically uses After receiving the creation request message of the group resource, generating a first public theme of the group resource for the group resource according to the identifier of the group resource allocated to the group resource, and the identifier of the member resource is used as the content contained in the first topic that the M2M terminal corresponding to the identifier of the member resource has subscribed to, and the first common topic of the group resource includes the identifier of the group resource . Wherein, the second service message sent by the sending unit 21 is a notification message sent by the M2M server to the M2M terminal corresponding to the identifier of the member resource.

可选的,结合图12,如图13所示,当所述第一资源为群组资源时,所述第二资源的标识为所述群组资源中的成员资源的标识,所述生成单元23具体包括确定模块200和生成模块201。Optionally, referring to FIG. 12, as shown in FIG. 13, when the first resource is a group resource, the identifier of the second resource is an identifier of a member resource in the group resource, and the generation unit 23 specifically includes a determination module 200 and a generation module 201.

所述确定模块200,用于在接收到对所述群组资源的成员资源的访问请求消息后,根据所述对所述群组资源的成员资源的访问请求消息中包含的所述群组资源的标识确定没有与所述群组资源对应的第一公共主题。The determining module 200 is configured to, after receiving an access request message to a member resource of the group resource, according to the group resource included in the access request message to a member resource of the group resource The identifier of determines that there is no first common topic corresponding to the group resource.

所述生成模块201,用于当所述确定模块200确定没有与所述群组资源对应的第一公共主题时,根据所述群组资源的标识,为所述群组资源生成所述群组资源的第一公共主题,并将所述成员资源的标识,作为与所述成员资源的标识对应的M2M终端已经订阅的第一主题包含的内容,所述群组资源的第一公共主题中包含所述群组资源的标识。The generating module 201 is configured to generate the group for the group resource according to the identifier of the group resource when the determining module 200 determines that there is no first common theme corresponding to the group resource The first common theme of the resource, and the identifier of the member resource is used as the content contained in the first topic that the M2M terminal corresponding to the identifier of the member resource has subscribed to, and the first common theme of the group resource contains The identifier of the group resource.

其中,所述发送单元21发送的所述第二业务消息为所述M2M服务器根据所述对所述群组资源的成员资源的访问请求消息生成的第一访问请求消息,所述第一访问请求消息为所述M2M服务器发送给与所述成员资源的标识对应的M2M终端的访问请求消息。Wherein, the second service message sent by the sending unit 21 is a first access request message generated by the M2M server according to the access request message for member resources of the group resource, and the first access request message The message is an access request message sent by the M2M server to the M2M terminal corresponding to the identifier of the member resource.

可选的,如图13所示,当所述第一资源为订阅资源时,所述生成单元23具体包括确定模块200和生成模块201。Optionally, as shown in FIG. 13 , when the first resource is a subscription resource, the generating unit 23 specifically includes a determining module 200 and a generating module 201 .

所述确定模块200,用于当确定所述订阅资源发生变化时,根据所述订阅资源的标识确定没有与所述订阅资源对应的第一公共主题。The determining module 200 is configured to determine, according to the identifier of the subscribed resource, that there is no first public topic corresponding to the subscribed resource when it is determined that the subscribed resource has changed.

所述生成模块201,用于在所述确定模块200确定没有与所述订阅资源对应的第一公共主题时,根据所述订阅资源的标识,为所述订阅资源生成所述订阅资源的第一公共主题,并将每一个订阅所述订阅资源的M2M终端中存储的第二资源的标识,作为该M2M终端已经订阅的第一主题包含的内容,所述订阅资源的第一公共主题中包含所述订阅资源的标识。The generation module 201 is configured to, when the determination module 200 determines that there is no first public topic corresponding to the subscription resource, generate the first topic of the subscription resource for the subscription resource according to the identifier of the subscription resource. public topic, and use the identifier of the second resource stored in each M2M terminal that subscribes to the subscription resource as the content contained in the first topic that the M2M terminal has subscribed to, and the first public topic of the subscription resource contains all The ID of the subscription resource described above.

其中,所述发送单元21发送的所述第二业务消息为对每一个订阅所述订阅资源的M2M终端的订阅通知消息。Wherein, the second service message sent by the sending unit 21 is a subscription notification message for each M2M terminal subscribing to the subscription resource.

可选的,如图12所示,当所述第一资源为订阅资源时,所述生成单元23,具体用于当接收到对所述订阅资源的订阅创建请求消息时,根据所述订阅资源的标识,为所述订阅资源生成所述订阅资源的第一公共主题,并将每一个订阅所述订阅资源的M2M终端中存储的第二资源的标识,作为该M2M终端已经订阅的第一主题包含的内容,所述对所述订阅资源的订阅创建请求消息中包含所述订阅资源的标识以及订阅所述订阅资源的M2M终端中存储的第二资源的标识,所述订阅资源的第一公共主题中包含所述订阅资源的标识。Optionally, as shown in FIG. 12, when the first resource is a subscription resource, the generation unit 23 is specifically configured to, when receiving a subscription creation request message for the subscription resource, generate the first public topic of the subscription resource for the subscription resource, and use the identifier of the second resource stored in each M2M terminal subscribing to the subscription resource as the first topic that the M2M terminal has subscribed to Included content, the subscription creation request message for the subscription resource includes the identifier of the subscription resource and the identifier of the second resource stored in the M2M terminal subscribing to the subscription resource, the first public resource of the subscription resource The subject contains the identifier of the subscription resource.

其中,所述发送单元21发送的所述第二业务消息为所述M2M服务器根据所述对所述订阅资源的订阅创建请求消息生成的订阅创建响应消息,所述订阅创建响应消息为所述M2M服务器需发送给每一个订阅所述订阅资源的M2M终端的响应消息。Wherein, the second service message sent by the sending unit 21 is a subscription creation response message generated by the M2M server according to the subscription creation request message for the subscription resource, and the subscription creation response message is the M2M The server needs to send a response message to each M2M terminal subscribing to the subscription resource.

在本发明实施例中,该M2M服务器可以为M2M应用,具体可以包括电力抄表服务器、智能交通服务器以及车队管理服务器等。In the embodiment of the present invention, the M2M server may be an M2M application, and specifically may include a power meter reading server, an intelligent transportation server, a fleet management server, and the like.

本发明实施例提供一种M2M服务器,当该M2M服务器需向与该M2M服务器中存储的第一资源对应的至少两个M2M终端发送相同内容的第一业务消息时,该M2M服务器能够确定为该第一资源生成的所述第一公共主题,以及向MQTT服务器发送一次第一MQTT消息,第一MQTT消息中包含第一业务消息和第一公共主题,第一业务消息包含发送给至少两个终端的相同内容。与现有技术中M2M服务器需向MQTT服务器发布多个包含不同的主题的MQTT消息相比,使用本发明实施例提供的M2M服务器,能够减小M2M服务器与MQTT服务器之间的通信开销。An embodiment of the present invention provides an M2M server. When the M2M server needs to send a first service message with the same content to at least two M2M terminals corresponding to the first resource stored in the M2M server, the M2M server can determine that the The first public topic generated by the first resource, and the first MQTT message is sent to the MQTT server once, the first MQTT message includes the first business message and the first public topic, and the first business message includes sending to at least two terminals of the same content. Compared with the prior art where the M2M server needs to issue multiple MQTT messages containing different topics to the MQTT server, using the M2M server provided by the embodiment of the present invention can reduce the communication overhead between the M2M server and the MQTT server.

如图14所示,本发明实施例提供一种M2M终端,该M2M终端包括:处理器30、存储器31、收发器32,以及系统总线33。所述:处理器30、存储器31以及收发器32之间通过所述系统总线33连接并完成相互间的通信。As shown in FIG. 14 , an embodiment of the present invention provides an M2M terminal, and the M2M terminal includes: a processor 30 , a memory 31 , a transceiver 32 , and a system bus 33 . Said: the processor 30 , the memory 31 and the transceiver 32 are connected through the system bus 33 to complete mutual communication.

所述处理器30可以是一个中央处理器(Central Processing Unit,CPU),或者是特定集成电路(Application Specific Integrated Circuit,ASIC),或者是被配置成实施本发明实施例的一个或多个集成电路。The processor 30 may be a central processing unit (Central Processing Unit, CPU), or a specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits configured to implement embodiments of the present invention .

所述收发器32,可以为由独立的接收器和独立的发送器组成的模块,也可以为由接收器和发送器集成的模块。The transceiver 32 may be a module composed of an independent receiver and an independent transmitter, or may be an integrated module of the receiver and the transmitter.

所述存储器31可以包括易失性存储器(英文:volatilememory),例如随机存取存储器(英文:random-access memory,缩写:RAM);所述存储器31也可以包括非易失性存储器(英文:non-volatile memory),例如只读存储器(英文:read-only memory,缩写:ROM),快闪存储器(英文:flash memory),硬盘(英文:hard disk drive,缩写:HDD)或固态硬盘(英文:solid-state drive,缩写:SSD);所述存储器31还可以包括上述种类的存储器的组合。The memory 31 may include a volatile memory (English: volatile memory), such as a random-access memory (English: random-access memory, abbreviated as RAM); the memory 31 may also include a non-volatile memory (English: non-volatile memory). -volatile memory), such as read-only memory (English: read-only memory, abbreviation: ROM), flash memory (English: flash memory), hard disk (English: hard disk drive, abbreviation: HDD) or solid state drive (English: solid-state drive, abbreviation: SSD); the storage 31 may also include a combination of the above-mentioned types of storage.

当所述M2M终端运行时,处理器30、存储器31以及收发器32,可以执行图1、图3或图5至图8任意之一所述的方法流程,具体包括:When the M2M terminal is running, the processor 30, the memory 31 and the transceiver 32 may execute the method flow described in any one of FIG. 1, FIG. 3 or FIG. 5 to FIG. 8, specifically including:

所述收发器32,用于接收MQTT服务器发送的第一MQTT消息,所述第一MQTT消息中包含第一业务消息和第一公共主题;所述处理器30,用于根据保存的所述第一公共主题与在所述M2M终端中存储的资源的标识之间的映射关系,查找与所述收发器32接收的所述第一公共主题对应的所述在所述M2M终端中存储的资源的标识,以及对所述在所述M2M终端中存储的资源的标识指示的所述在所述M2M终端中存储的资源执行与所述第一业务消息相关的操作;所述存储器31,用于存储所述第一MQTT消息的代码、所述第一业务消息的代码、所述M2M终端中存储的资源的代码、所述M2M终端中存储的资源的标识的代码、所述第一公共主题的代码,以及控制所述处理器30完成上述过程的软件程序,从而所述处理器30通过执行所述软件程序,并调用所述第一MQTT消息的代码、所述第一业务消息的代码、所述M2M终端中存储的资源的代码、所述M2M终端中存储的资源的标识的代码,以及所述第一公共主题的代码,完成上述过程。The transceiver 32 is configured to receive a first MQTT message sent by an MQTT server, the first MQTT message includes a first business message and a first public topic; the processor 30 is configured to A mapping relationship between a common theme and the identifier of the resource stored in the M2M terminal, searching for the resource stored in the M2M terminal corresponding to the first common theme received by the transceiver 32 identification, and performing an operation related to the first service message on the resource stored in the M2M terminal indicated by the identification of the resource stored in the M2M terminal; the memory 31 is configured to store The code of the first MQTT message, the code of the first service message, the code of the resource stored in the M2M terminal, the code of the identification of the resource stored in the M2M terminal, and the code of the first public topic , and a software program that controls the processor 30 to complete the above process, so that the processor 30 executes the software program and calls the code of the first MQTT message, the code of the first business message, the code of the first business message, the The code of the resource stored in the M2M terminal, the code of the identifier of the resource stored in the M2M terminal, and the code of the first public subject complete the above process.

可选的,所述收发器32,还用于在接收MQTT服务器发送的第一MQTT消息之前,接收所述MQTT服务器发送的第二MQTT消息,并向所述MQTT服务器发送第一订阅主题的消息,所述第二MQTT消息中包含第二业务消息和第一主题,所述第二业务消息中包含所述第一公共主题,所述第一主题中包含所述在所述M2M终端中存储的资源的标识,所述第一订阅主题的消息中包含所述第一公共主题以及所述M2M终端的标识。Optionally, the transceiver 32 is further configured to receive a second MQTT message sent by the MQTT server before receiving the first MQTT message sent by the MQTT server, and send a message of the first subscription topic to the MQTT server , the second MQTT message includes a second service message and a first topic, the second service message includes the first public topic, and the first topic includes the information stored in the M2M terminal A resource identifier, where the message of the first subscription topic includes the first public topic and the identifier of the M2M terminal.

所述处理器30,还用于保存所述收发器接收的所述第一公共主题与所述在所述M2M终端中存储的资源的标识之间的映射关系。The processor 30 is further configured to save a mapping relationship between the first common theme received by the transceiver and the identifier of the resource stored in the M2M terminal.

可选的,所述收发器32,还用于在接收所述MQTT服务器发送的第二MQTT消息之前,向所述MQTT服务器发送第二订阅主题的消息,所述第二订阅主题的消息包含所述M2M终端需要订阅的所述第一主题。Optionally, the transceiver 32 is further configured to send a message of a second subscription topic to the MQTT server before receiving the second MQTT message sent by the MQTT server, and the message of the second subscription topic includes the The first topic that the M2M terminal needs to subscribe to.

本发明实施例提供一种M2M终端,由于该M2M能够接收MQTT服务器发送的第一MQTT消息,并根据保存的该第一公共主题与在该M2M终端中存储的资源的标识之间的映射关系,查找与该第一公共主题对应的资源的标识,以及对该资源的标识指示的资源执行与该第一业务消息相关的操作,该第一MQTT消息中包含第一业务消息和第一公共主题。因此,当M2M服务器需向与该M2M服务器中存储的资源对应的至少两个该M2M终端发送相同内容的第一业务消息时,MQTT服务器只需发送一次第一MQTT消息到MQTT服务器,由于该至少两个M2M终端都订阅了该第一公共主题,因此MQTT服务器会将该第一MQTT消息转发给该至少两个M2M终端,且该至少两个M2M终端中的每个M2M终端能够根据该第一公共主题与在该每个M2M终端中存储的资源的标识之间的映射关系,执行与该第一业务消息相关的操作。与现有技术中MQTT服务器需发送多个包含不同主题的MQTT消息到MQTT服务器相比,本发明实施例提供的M2M终端在与M2M服务器进行通信时,能够减小M2M服务器与MQTT服务器之间的通信开销。An embodiment of the present invention provides an M2M terminal, because the M2M can receive the first MQTT message sent by the MQTT server, and according to the saved mapping relationship between the first common theme and the identifier of the resource stored in the M2M terminal, Finding the identifier of the resource corresponding to the first public topic, and performing an operation related to the first service message on the resource indicated by the resource identifier, where the first MQTT message includes the first service message and the first public topic. Therefore, when the M2M server needs to send the first service message with the same content to at least two M2M terminals corresponding to the resources stored in the M2M server, the MQTT server only needs to send the first MQTT message to the MQTT server once, because the at least Both M2M terminals have subscribed to the first common topic, so the MQTT server will forward the first MQTT message to the at least two M2M terminals, and each M2M terminal in the at least two M2M terminals can be based on the first The mapping relationship between the public subject and the identifier of the resource stored in each M2M terminal executes an operation related to the first service message. Compared with the MQTT server in the prior art that needs to send multiple MQTT messages containing different topics to the MQTT server, the M2M terminal provided by the embodiment of the present invention can reduce the communication between the M2M server and the MQTT server when communicating with the M2M server. communication overhead.

如图15所示,本发明实施例提供一种M2M服务器,该M2M服务器包括:处理器40、存储器41、收发器42,以及系统总线43。所述:处理器40、存储器41以及收发器42之间通过所述系统总线43连接并完成相互间的通信。As shown in FIG. 15 , an embodiment of the present invention provides an M2M server, and the M2M server includes: a processor 40 , a memory 41 , a transceiver 42 , and a system bus 43 . Said: the processor 40 , the memory 41 and the transceiver 42 are connected through the system bus 43 to complete mutual communication.

所述处理器40可以是一个CPU,或者是ASIC,或者是被配置成实施本发明实施例的一个或多个集成电路。The processor 40 may be a CPU, or an ASIC, or one or more integrated circuits configured to implement embodiments of the present invention.

所述收发器42,可以为由独立的接收器和独立的发送器组成的模块,也可以为由接收器和发送器集成的模块。The transceiver 42 may be a module composed of an independent receiver and an independent transmitter, or may be an integrated module of the receiver and the transmitter.

所述存储器41可以包括易失性存储器,例如RAM;所述存储器43也可以包括非易失性存储器,例如ROM,快闪存储器,HDD或SSD;所述存储器41还可以包括上述种类的存储器的组合。Described memory 41 can comprise volatile memory, such as RAM; Described memory 43 also can comprise nonvolatile memory, such as ROM, flash memory, HDD or SSD; Described memory 41 can also comprise the memory of above-mentioned kind. combination.

当所述M2M服务器运行时,所述处理器40、存储器41以及收发器42可以执行图2至图3或图5至图8任意之一所述的方法流程,具体包括:When the M2M server is running, the processor 40, the memory 41, and the transceiver 42 may execute the method flow described in any one of FIG. 2 to FIG. 3 or FIG. 5 to FIG. 8, specifically including:

所述处理器40,用于当需向与所述M2M服务器中存储的第一资源对应的至少两个M2M终端发送相同内容的第一业务消息时,确定为所述第一资源生成的第一公共主题;所述收发器42,用于向MQTT服务器发送一次第一MQTT消息,所述第一MQTT消息中包含所述第一业务消息和所述第一公共主题,所述第一业务消息中包含发送给所述至少两个M2M终端的相同内容;所述存储器41,用于存储所述M2M服务器中存储的第一资源的代码、所述第一MQTT消息的代码、所述第一业务消息、所述第一公共主题以及控制所述处理器40完成上述过程的软件程序,从而所述处理器40通过执行所述软件程序,并调用所述M2M服务器中存储的第一资源的代码、所述第一MQTT消息的代码、所述第一业务消息,以及所述第一公共主题,完成上述过程。The processor 40 is configured to determine the first service message generated for the first resource when the first service message with the same content needs to be sent to at least two M2M terminals corresponding to the first resource stored in the M2M server. Public topic; the transceiver 42 is configured to send a first MQTT message to the MQTT server once, the first MQTT message includes the first business message and the first public topic, and the first business message contains Including the same content sent to the at least two M2M terminals; the memory 41 is used to store the code of the first resource stored in the M2M server, the code of the first MQTT message, the first service message , the first public subject, and a software program that controls the processor 40 to complete the above process, so that the processor 40 executes the software program, and invokes the code of the first resource stored in the M2M server, the The code of the first MQTT message, the first service message, and the first public topic are used to complete the above process.

可选的,所述处理器40,还用于在确定为所述第一资源生成的第一公共主题之前,为所述第一资源生成所述第一公共主题,并将所述至少两个M2M终端中的每一个M2M终端中存储的第二资源的标识作为该M2M终端已经订阅的第一主题包含的内容。Optionally, the processor 40 is further configured to generate the first common theme for the first resource before determining the first common theme generated for the first resource, and combine the at least two The identifier of the second resource stored in each of the M2M terminals is used as the content included in the first topic that the M2M terminal has subscribed to.

所述收发器42,还用于通过所述MQTT服务器向所述至少两个M2M终端中的每一个M2M终端发送一条第二MQTT消息,所述第二MQTT消息中包含第二业务消息和所述第一主题,所述第二业务消息中包含所述第一公共主题。The transceiver 42 is further configured to send a second MQTT message to each of the at least two M2M terminals through the MQTT server, and the second MQTT message includes a second service message and the The first topic, the second service message includes the first public topic.

可选的,当所述第一资源为群组资源时,所述第二资源的标识为所述群组资源中的成员资源的标识,所述处理器40,具体用于在接收到所述群组资源的创建请求消息后,根据为所述群组资源分配的所述群组资源的标识,为所述群组资源生成所述群组资源的第一公共主题,并将所述成员资源的标识,作为与所述成员资源的标识对应的M2M终端已经订阅的第一主题包含的内容,所述群组资源的第一公共主题中包含所述群组资源的标识。其中,所述收发器42发送的所述第二业务消息为所述M2M服务器对与所述成员资源的标识对应的M2M终端的通知消息。Optionally, when the first resource is a group resource, the identifier of the second resource is an identifier of a member resource in the group resource, and the processor 40 is specifically configured to receive the After the creation request message of the group resource, according to the identifier of the group resource assigned to the group resource, generate the first common topic of the group resource for the group resource, and assign the member resource The identifier of the member resource is used as the content included in the first topic that the M2M terminal corresponding to the identifier of the member resource has subscribed to, and the first common topic of the group resource includes the identifier of the group resource. Wherein, the second service message sent by the transceiver 42 is a notification message sent by the M2M server to the M2M terminal corresponding to the identifier of the member resource.

可选的,当所述第一资源为群组资源时,所述第二资源的标识为所述群组资源中的成员资源的标识,所述处理器40,具体用于在接收到对所述群组资源的成员资源的访问请求消息后,根据所述对所述群组资源的成员资源的访问请求消息中包含的所述群组资源的标识确定没有与所述群组资源对应的第一公共主题,并根据所述群组资源的标识,为所述群组资源生成所述群组资源的第一公共主题,以及将所述成员资源的标识,作为与所述成员资源的标识对应的M2M终端已经订阅的第一主题包含的内容,所述群组资源的第一公共主题中包含所述群组资源的标识。Optionally, when the first resource is a group resource, the identifier of the second resource is an identifier of a member resource in the group resource, and the processor 40 is specifically configured to, after receiving the After receiving the access request message of the member resource of the group resource, according to the identifier of the group resource included in the access request message of the member resource of the group resource, it is determined that there is no second group resource corresponding to the group resource. A common topic, and according to the identifier of the group resource, generate the first common topic of the group resource for the group resource, and use the identifier of the member resource as corresponding to the identifier of the member resource The content contained in the first topic that the M2M terminal has subscribed to, and the first public topic of the group resource includes the identifier of the group resource.

其中,所述收发器42发送的所述第二业务消息为所述M2M服务器根据所述对所述群组资源的成员资源的访问请求消息生成的第一访问请求消息,所述第一访问请求消息为所述M2M服务器发送给与所述成员资源的标识对应的M2M终端的访问请求消息。Wherein, the second service message sent by the transceiver 42 is a first access request message generated by the M2M server according to the access request message for member resources of the group resource, and the first access request message The message is an access request message sent by the M2M server to the M2M terminal corresponding to the identifier of the member resource.

可选的,当所述第一资源为订阅资源时,所述处理器40,具体用于当确定所述订阅资源发生变化时,根据所述订阅资源的标识确定没有与所述订阅资源对应的第一公共主题,并根据所述订阅资源的标识,为所述订阅资源生成所述订阅资源的第一公共主题,以及将每一个订阅所述订阅资源的M2M终端中存储的第二资源的标识,作为该M2M终端已经订阅的第一主题包含的内容,所述订阅资源的第一公共主题中包含所述订阅资源的标识。Optionally, when the first resource is a subscription resource, the processor 40 is specifically configured to determine, according to the identifier of the subscription resource, that there is no subscription resource corresponding to the subscription resource when it is determined that the subscription resource changes. The first common topic, and according to the identifier of the subscribed resource, generate the first common topic of the subscribed resource for the subscribed resource, and store the identifier of the second resource stored in each M2M terminal that subscribes to the subscribed resource , as the content included in the first topic that the M2M terminal has subscribed to, the first public topic of the subscription resource includes the identifier of the subscription resource.

其中,所述收发器42发送的所述第二业务消息为对每一个订阅所述订阅资源的M2M终端的订阅通知消息。Wherein, the second service message sent by the transceiver 42 is a subscription notification message for each M2M terminal subscribing to the subscription resource.

可选的,当所述第一资源为订阅资源时,所述处理器40,具体用于当接收到对所述订阅资源的订阅创建请求消息时,根据所述订阅资源的标识,为所述订阅资源生成所述订阅资源的第一公共主题,并将每一个订阅所述订阅资源的M2M终端中存储的第二资源的标识,作为该M2M终端已经订阅的第一主题包含的内容,所述对所述订阅资源的订阅创建请求消息中包含所述订阅资源的标识以及订阅所述订阅资源的M2M终端中存储的第二资源的标识,所述订阅资源的第一公共主题中包含所述订阅资源的标识。Optionally, when the first resource is a subscription resource, the processor 40 is specifically configured to: when receiving a subscription creation request message for the subscription resource, according to the identifier of the subscription resource, provide the The subscription resource generates the first public topic of the subscription resource, and uses the identifier of the second resource stored in each M2M terminal subscribing to the subscription resource as the content contained in the first topic that the M2M terminal has subscribed to, the The subscription creation request message for the subscription resource includes the identifier of the subscription resource and the identifier of the second resource stored in the M2M terminal subscribing to the subscription resource, and the first public topic of the subscription resource includes the subscription The ID of the resource.

其中,所述收发器42发送的所述第二业务消息为所述M2M服务器根据所述对所述订阅资源的订阅创建请求消息生成的订阅创建响应消息,所述订阅创建响应消息为所述M2M服务器需发送给每一个订阅所述订阅资源的M2M终端的响应消息。Wherein, the second service message sent by the transceiver 42 is a subscription creation response message generated by the M2M server according to the subscription creation request message for the subscription resource, and the subscription creation response message is the M2M The server needs to send a response message to each M2M terminal subscribing to the subscription resource.

本发明实施例提供一种M2M服务器,当该M2M服务器需向与该M2M服务器中存储的第一资源对应的至少两个M2M终端发送相同内容的第一业务消息时,该M2M服务器能够确定为该第一资源生成的所述第一公共主题,以及向MQTT服务器发送一次第一MQTT消息,第一MQTT消息中包含第一业务消息和第一公共主题,第一业务消息包含发送给至少两个终端的相同内容。与现有技术中M2M服务器需向MQTT服务器发布多个包含不同的主题的MQTT消息相比,使用本发明实施例提供的M2M服务器,能够减小M2M服务器与MQTT服务器之间的通信开销。An embodiment of the present invention provides an M2M server. When the M2M server needs to send a first service message with the same content to at least two M2M terminals corresponding to the first resource stored in the M2M server, the M2M server can determine that the The first public topic generated by the first resource, and the first MQTT message is sent to the MQTT server once, the first MQTT message includes the first business message and the first public topic, and the first business message includes sending to at least two terminals of the same content. Compared with the prior art where the M2M server needs to issue multiple MQTT messages containing different topics to the MQTT server, using the M2M server provided by the embodiment of the present invention can reduce the communication overhead between the M2M server and the MQTT server.

如图16所示,本发明实施例提供一种业务消息的传输系统,该业务消息的传输系统可以包括:如上述图9或图10所示的M2M终端、如上述图11至图13所示的任一种M2M服务器,以及MQTT服务器,其中,所述MQTT服务器与所述M2M服务器和所述M2M终端进行交互;或者该业务消息的传输系统包括:如上述图14所示的M2M终端、如上述图15所示的M2M服务器,以及MQTT服务器,其中,所述MQTT服务器与所述M2M服务器和所述M2M终端进行交互。As shown in FIG. 16, an embodiment of the present invention provides a service message transmission system. The service message transmission system may include: the M2M terminal shown in FIG. 9 or FIG. 10 above, and the M2M terminal shown in FIG. Any M2M server, and an MQTT server, wherein the MQTT server interacts with the M2M server and the M2M terminal; or the service message transmission system includes: the M2M terminal shown in FIG. 14 above, such as In the M2M server and the MQTT server shown in FIG. 15 above, the MQTT server interacts with the M2M server and the M2M terminal.

在本发明实施例提供的该业务消息的传输系统中,当M2M服务器需向与该M2M服务器中存储的第一资源对应的至少两个M2M终端发送内容相同的第一业务消息时,M2M服务器能够确定为该第一资源生成的公共主题,并向MQTT服务器发送一次第一MQTT消息,该第一MQTT消息中包含该第一业务消息和该第一公共主题,该第一业务消息中包含发送给所述至少两个M2M终端的相同内容。该至少两个M2M终端中的每个M2M终端都能够接收MQTT服务器发送的第一MQTT消息,并根据保存的该第一公共主题与在该M2M终端中存储的资源的标识之间的映射关系,查找与该第一公共主题对应的在该M2M终端中存储的资源的标识,以及对在该M2M终端中存储的资源的标识指示的在该M2M终端中存储的资源执行与该第一业务消息相关的操作。In the service message transmission system provided by the embodiment of the present invention, when the M2M server needs to send a first service message with the same content to at least two M2M terminals corresponding to the first resources stored in the M2M server, the M2M server can Determine the public topic generated for the first resource, and send a first MQTT message to the MQTT server once, the first MQTT message includes the first business message and the first public topic, and the first business message contains the message sent to Same content of the at least two M2M terminals. Each M2M terminal in the at least two M2M terminals can receive the first MQTT message sent by the MQTT server, and according to the saved mapping relationship between the first common topic and the identifier of the resource stored in the M2M terminal, Finding the identifier of the resource stored in the M2M terminal corresponding to the first common theme, and executing the resource stored in the M2M terminal indicated by the identifier of the resource stored in the M2M terminal is related to the first service message operation.

通过本发明实施例提供的业务消息的传输系统,当M2M服务器需向与该M2M服务器中存储的第一资源对应的至少两个M2M终端发送内容相同的业务消息时,M2M服务能够只向MQTT服务器发送一次第一MQTT消息,该至少两个M2M终端中的每个M2M终端都能接收到该第一MQTT消息,并执行相应的操作。与现有技术中M2M服务器需向MQTT服务器发送多个包含不同的主题的MQTT消息相比,本发明实施例提供的业务消息的传输系统,能够减小M2M服务器与MQTT服务器之间的通信开销。Through the service message transmission system provided by the embodiment of the present invention, when the M2M server needs to send a service message with the same content to at least two M2M terminals corresponding to the first resource stored in the M2M server, the M2M service can only send the service message to the MQTT server The first MQTT message is sent once, and each M2M terminal in the at least two M2M terminals can receive the first MQTT message and perform a corresponding operation. Compared with the prior art where the M2M server needs to send multiple MQTT messages containing different topics to the MQTT server, the service message transmission system provided by the embodiment of the present invention can reduce the communication overhead between the M2M server and the MQTT server.

所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,仅以上述各功能模块的划分进行举例说明,实际应用中,可以根据需要而将上述功能分配由不同的功能模块完成,即将装置的内部结构划分成不同的功能模块,以完成以上描述的全部或者部分功能。上述描述的系统,装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that for the convenience and brevity of description, only the division of the above-mentioned functional modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional modules according to needs. The internal structure of the device is divided into different functional modules to complete all or part of the functions described above. For the specific working process of the above-described system, device, and unit, reference may be made to the corresponding process in the foregoing method embodiments, and details are not repeated here.

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

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

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

所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(英文全称:Read-Only Memory,英文缩写:ROM)、随机存取存储器(英文全称:Random Access Memory,英文缩写:RAM)、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is realized in the form of a software function unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the essence of the technical solution of the present invention or the part that contributes to the prior art or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , including several instructions to make a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor execute all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage media include: U disk, mobile hard disk, read-only memory (English full name: Read-Only Memory, English abbreviation: ROM), random access memory (English full name: Random Access Memory, English abbreviation: RAM), magnetic Various media that can store program codes such as discs or optical discs.

以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应所述以权利要求的保护范围为准。The above is only a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Anyone skilled in the art can easily think of changes or substitutions within the technical scope disclosed in the present invention. Should be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.

Claims (19)

1. a kind of transmission method of service message characterized by comprising
Machine To Machine M2M terminal receives the first MQTT message that message sequence telemetering transmission MQTT server is sent, and described the It include the first service message and the first common subject matter in one MQTT message;
The M2M terminal according to the mark of first common subject matter of preservation and the resource stored in the M2M terminal it Between mapping relations, search it is corresponding with first common subject matter described in the mark of resource that is stored in the M2M terminal;
Described in mark instruction of the M2M terminal to the resource stored in the M2M terminal in the M2M terminal The resource of storage executes operation relevant to first service message.
2. the method according to claim 1, wherein the M2M terminal receives first that MQTT server is sent Before MQTT message, the method also includes:
The M2M terminal receives the 2nd MQTT message that the MQTT server is sent, comprising the in the 2nd MQTT message Two service messages and the first theme include first common subject matter in second service message, wrap in first theme Mark containing the resource stored in the M2M terminal;
The M2M terminal saves first common subject matter and described between the mark of the resource stored in the M2M terminal Mapping relations;
The M2M terminal sends the first message for subscribing to theme to the MQTT server, and described first subscribes to the message of theme In the mark comprising first common subject matter and the M2M terminal.
3. according to the method described in claim 2, it is characterized in that, the M2M terminal receives what the MQTT server was sent Before 2nd MQTT message, the method also includes:
The M2M terminal sends the second message for subscribing to theme to the MQTT server, and described second subscribes to the message of theme First theme subscribed to is needed comprising the M2M terminal.
4. a kind of transmission method of service message characterized by comprising
When Machine To Machine M2M server need to the first resource corresponding at least two that is stored in the M2M server When subscribing to the M2M terminal of the first common subject matter and sending the first service message of identical content,
The M2M server is determined as first common subject matter that the first resource generates;
The M2M server to message sequence telemetering transmission MQTT server send a first MQTT message, described first Include first service message and first common subject matter in MQTT message, includes to be sent in first service message The identical content of at least two M2M terminal.
5. according to the method described in claim 4, it is characterized in that, the M2M server is determined as the first resource generation The first common subject matter before, the method also includes:
The M2M server is that the first resource generates first common subject matter;
The M2M server is by the mark of the Secondary resource stored in each of at least two M2M terminal M2M terminal The content that the first theme having subscribed as the M2M terminal includes;
The M2M server is sent by the MQTT server to each of at least two M2M terminal M2M terminal One article of the 2nd MQTT message includes the second service message and first theme, second industry in the 2nd MQTT message It include first common subject matter in message of being engaged in.
6. according to the method described in claim 5, it is characterized in that,
When the first resource is group's resource, the member resource of the Secondary resource being identified as in group's resource Mark, the M2M server are that the first resource generates first common subject matter specifically:
The M2M server is after the request to create message for receiving group's resource, according to for group's resource allocation Group's resource mark, generate the first common subject matter of group's resource, group's money for group's resource It include the mark of group's resource in first common subject matter in source;
The M2M server is by the mark of the Secondary resource stored in each of at least two M2M terminal M2M terminal The content that the first theme having subscribed as the M2M terminal includes specifically:
The M2M server is by the mark of the member resource, as M2M terminal corresponding with the mark of the member resource The content that the first theme through subscribing to includes;
Wherein, second service message is the M2M server pair M2M terminal corresponding with the mark of the member resource Notification message.
7. according to the method described in claim 5, it is characterized in that, when the first resource be group's resource when, described second The mark for the member resource of resource being identified as in group's resource, the M2M server generate institute for the first resource State the first common subject matter specifically:
The M2M server is after receiving to the access request message of the member resource of group's resource, the M2M service The mark for group's resource that device includes in the access request message according to the member resource to group's resource is true Fixed first common subject matter not corresponding with group's resource;
The M2M server generates the first of group's resource according to the mark of group's resource for group's resource Common subject matter includes the mark of group's resource in the first common subject matter of group's resource;
The M2M server is by the mark of the Secondary resource stored in each of at least two M2M terminal M2M terminal The content that the first theme having subscribed as the M2M terminal includes specifically:
The M2M server is by the mark of the member resource, as M2M terminal corresponding with the mark of the member resource The content that the first theme through subscribing to includes;
Wherein, second service message is visit of the M2M server according to the member resource to group's resource Ask request message generate the first access request message, first access request message be the M2M server be sent to The access request message of the corresponding M2M terminal of mark of the member resource.
8. according to the method described in claim 5, it is characterized in that, the M2M takes when the first resource is to subscribe to resource Device be engaged in as first resource generation first common subject matter specifically:
When the M2M server determines that the subscription resource changes, the M2M server is according to the subscription resource Mark determines the first common subject matter not corresponding with the subscription resource;
The M2M server is according to the mark for subscribing to resource, generate the subscription resource for the subscription resource first Common subject matter, it is described subscribe to resource the first common subject matter in comprising it is described subscribe to resource mark;
The M2M server is by the mark of the Secondary resource stored in each of at least two M2M terminal M2M terminal The content that the first theme having subscribed as the M2M terminal includes specifically:
Each is subscribed to the mark of the Secondary resource stored in the M2M terminal for subscribing to resource by the M2M server, as The content that the first theme that the M2M terminal has subscribed includes;
Wherein, second service message is that the M2M server subscribes to ordering for the M2M terminal for subscribing to resource to each Read notification message.
9. according to the method described in claim 5, it is characterized in that,
When the first resource is to subscribe to resource, the M2M server is that the first resource generates the first public master Topic specifically:
It is described that the subscription is provided when the M2M server is received to the subscription request to create message for subscribing to resource Comprising being deposited in the mark for subscribing to resource and the subscription M2M terminal for subscribing to resource in the subscription request to create message in source The mark of the Secondary resource of storage, the M2M server is according to the mark for subscribing to resource, for described in subscription resource generation The first common subject matter of resource is subscribed to, includes the mark for subscribing to resource in first common subject matter for subscribing to resource;
The M2M server is by the mark of the Secondary resource stored in each of at least two M2M terminal M2M terminal The content that the first theme having subscribed as the M2M terminal includes specifically:
Each is subscribed to the mark of the Secondary resource stored in the M2M terminal for subscribing to resource by the M2M server, as The content that the first theme that the M2M terminal has subscribed includes;
Wherein, second service message is the M2M server according to the subscription request to create to the subscription resource The subscription that message generates creates response message, and the subscription creation response message is that the M2M server need to be sent to each Subscribe to the response message of the M2M terminal for subscribing to resource.
10. a kind of Machine To Machine M2M terminal characterized by comprising
Receiving unit, the first MQTT message sent for receiving message sequence telemetering transmission MQTT server, described first It include the first service message and the first common subject matter in MQTT message;
Searching unit, first common subject matter for being saved according to storage unit in money stored in the storage unit Mapping relations between the mark in source are searched corresponding with received first common subject matter of the receiving unit described in institute State the mark of the resource stored in storage unit;
Execution unit, for indicating the mark described in searching unit lookup in resource stored in the storage unit It is described resource stored in the storage unit execute it is related to received first service message of the receiving unit Operation.
11. M2M terminal according to claim 10, which is characterized in that the M2M terminal further includes transmission unit,
The receiving unit is also used to before receiving the first MQTT message that the MQTT server is sent, described in reception The 2nd MQTT message that MQTT server is sent includes the second service message and the first theme, institute in the 2nd MQTT message Stating includes first common subject matter in the second service message, is deposited in the storage unit in first theme comprising described The mark of the resource of storage;
The storage unit, for saving received first common subject matter of the receiving unit with described in the storage list Mapping relations between the mark of the resource stored in member;
The transmission unit, for sending the first message for subscribing to theme to the MQTT server, described first subscribes to theme Message in the mark comprising received first common subject matter of the receiving unit and the M2M terminal.
12. M2M terminal according to claim 11, which is characterized in that
The transmission unit, be also used to the receiving unit receive the 2nd MQTT message that the MQTT server is sent it Before, Xiang Suoshu MQTT server sends the second message for subscribing to theme, and the message of the second subscription theme includes to need to subscribe to First theme.
13. a kind of M2M server characterized by comprising
Determination unit, for public when first need to have been subscribed to corresponding with the first resource stored in storage unit at least two When the M2M terminal of theme sends the first service message of identical content altogether, it is determined as the first resource generates described first Common subject matter;
Transmission unit, for message sequence telemetering transmission MQTT server send a first MQTT message, described first First common subject matter determined in MQTT message comprising first service message and the determination unit, first industry It include the identical content for being sent at least two M2M terminal in business message.
14. M2M server according to claim 13, which is characterized in that the M2M server further include:
Generation unit is determined as before the first common subject matter that the first resource generates for the determination unit, is described First resource generates first common subject matter, and will store in each of at least two M2M terminal M2M terminal The content that the first theme that the mark of Secondary resource has subscribed as the M2M terminal includes;
The transmission unit is also used to whole to each of at least two M2M terminal M2M by the MQTT server End sends one article of the 2nd MQTT message, generates in the 2nd MQTT message comprising the second service message and the generation unit First theme, first common subject matter generated comprising the generation unit in second service message.
15. M2M server according to claim 14, which is characterized in that
When the first resource is group's resource, the member resource of the Secondary resource being identified as in group's resource Mark,
The generation unit, specifically for after the request to create message for receiving group's resource, according to for the group The mark of group's resource of resource allocation generates the first common subject matter of group's resource for group's resource, and By the mark of the member resource, the first theme being had subscribed as M2M terminal corresponding with the mark of the member resource The content for including includes the mark of group's resource in the first common subject matter of group's resource;
Wherein, second service message is the notification message to M2M terminal corresponding with the mark of the member resource.
16. M2M server according to claim 14, which is characterized in that when the first resource is group's resource, institute The mark for the member resource of Secondary resource being identified as in group's resource is stated, the generation unit specifically includes determining module And generation module,
The determining module, for after receiving to the access request message of the member resource of group's resource, according to institute State the group's resource for including in the access request message to the member resource of group's resource mark determine not with Corresponding first common subject matter of group's resource;
The generation module, for determining the first common subject matter not corresponding with group's resource when the determining module When, according to the mark of group's resource, generate the first common subject matter of group's resource for group's resource, and by institute The mark for stating member resource, the first theme having subscribed as M2M terminal corresponding with the mark of the member resource include Content, include the mark of group's resource in the first common subject matter of group's resource;
Wherein, second service message is to be generated according to the access request message of the member resource to group's resource The first access request message, first access request message is to be sent to M2M corresponding with the mark of the member resource The access request message of terminal.
17. M2M server according to claim 14, which is characterized in that when the first resource is to subscribe to resource, institute It states generation unit and specifically includes determining module and generation module,
The determining module, for being determined according to the mark for subscribing to resource when determining that the subscription resource changes First common subject matter not corresponding with the subscription resource;
The generation module, for determining the first common subject matter not corresponding with the subscription resource in the determining module When, according to the mark for subscribing to resource, first common subject matter for subscribing to resource is generated for the subscription resource, and will be every One is subscribed to the mark of Secondary resource stored in the M2M terminal for subscribing to resource, the had subscribed as the M2M terminal The content that one theme includes, it is described subscribe to resource the first common subject matter in comprising it is described subscribe to resource mark;
Wherein, second service message is the subscribing notification message that the M2M terminal for subscribing to resource is subscribed to each.
18. M2M server according to claim 14, which is characterized in that
When the first resource is to subscribe to resource,
The generation unit, specifically for when receive to it is described subscribe to resource subscription request to create message when, according to described The mark of resource is subscribed to, generates first common subject matter for subscribing to resource for the subscription resource, and each is subscribed into institute The mark of the Secondary resource stored in the M2M terminal for subscribing to resource is stated, the first theme having subscribed as the M2M terminal includes Content, it is described to it is described subscribe to resource subscriptions request to create message in comprising it is described subscribe to resource mark and subscription institute The mark of the Secondary resource stored in the M2M terminal for subscribing to resource is stated, includes institute in first common subject matter for subscribing to resource State the mark for subscribing to resource;
Wherein, second service message is according to the subscription generated to the subscription request to create message for subscribing to resource Response message is created, the creation response message of subscribing to is that need to be sent to each to subscribe to the M2M terminal for subscribing to resource Response message.
19. a kind of Transmission system of service message characterized by comprising
At least two such as described in any item Machine To Machine M2M terminals of claim 10-12, as claim 13-18 is any M2M server and message sequence telemetering described in transmit MQTT server.
CN201410727947.2A 2014-12-03 2014-12-03 Method, device and system for transmitting business messages Active CN105722040B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201410727947.2A CN105722040B (en) 2014-12-03 2014-12-03 Method, device and system for transmitting business messages
PCT/CN2015/083224 WO2016086659A1 (en) 2014-12-03 2015-07-02 Service message transmission method, device and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410727947.2A CN105722040B (en) 2014-12-03 2014-12-03 Method, device and system for transmitting business messages

Publications (2)

Publication Number Publication Date
CN105722040A CN105722040A (en) 2016-06-29
CN105722040B true CN105722040B (en) 2019-10-25

Family

ID=56090939

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410727947.2A Active CN105722040B (en) 2014-12-03 2014-12-03 Method, device and system for transmitting business messages

Country Status (2)

Country Link
CN (1) CN105722040B (en)
WO (1) WO2016086659A1 (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106250173B (en) * 2016-07-15 2019-05-07 常州市小先信息技术有限公司 A method of message Remote Installation and unloading advertisement based on MQTT
WO2018035839A1 (en) * 2016-08-26 2018-03-01 华为技术有限公司 Data transmission method, associated apparatus and communication system
CN108696528B (en) * 2018-05-28 2020-12-01 中国联合网络通信集团有限公司 Data transmission method, terminal, acquisition platform and server
CN109474916B (en) * 2018-11-19 2020-09-18 海信集团有限公司 Equipment authentication method, device and machine readable medium
CN113014610B (en) * 2019-12-19 2022-09-02 深圳市宏电技术股份有限公司 Remote access method, device and system
CN111555893B (en) * 2020-04-22 2023-09-12 腾讯科技(深圳)有限公司 Message data transmission method, device, computer equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102986288A (en) * 2009-12-04 2013-03-20 交互数字专利控股公司 Extended local IP access for a converged gateway in a hybrid network
CN103609087A (en) * 2011-06-08 2014-02-26 德国捷德有限公司 Methods and devices for ota management of subscriber identity modules
CN103618800A (en) * 2013-12-05 2014-03-05 华为技术有限公司 Implementation method and device for subscription notification
CN104052653A (en) * 2014-06-23 2014-09-17 广东天波信息技术股份有限公司 Method for state presentation based on MQTT
CN104135429A (en) * 2014-08-12 2014-11-05 中国科学院声学研究所 A method and a device for pushing information
WO2014190177A1 (en) * 2013-05-22 2014-11-27 Convida Wireless, Llc Access network assisted bootstrapping

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10110631B2 (en) * 2009-02-12 2018-10-23 International Business Machines Corporation Introducing encryption, authentication, and authorization into a publication and subscription engine

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102986288A (en) * 2009-12-04 2013-03-20 交互数字专利控股公司 Extended local IP access for a converged gateway in a hybrid network
CN103609087A (en) * 2011-06-08 2014-02-26 德国捷德有限公司 Methods and devices for ota management of subscriber identity modules
WO2014190177A1 (en) * 2013-05-22 2014-11-27 Convida Wireless, Llc Access network assisted bootstrapping
CN103618800A (en) * 2013-12-05 2014-03-05 华为技术有限公司 Implementation method and device for subscription notification
CN104052653A (en) * 2014-06-23 2014-09-17 广东天波信息技术股份有限公司 Method for state presentation based on MQTT
CN104135429A (en) * 2014-08-12 2014-11-05 中国科学院声学研究所 A method and a device for pushing information

Also Published As

Publication number Publication date
WO2016086659A1 (en) 2016-06-09
CN105722040A (en) 2016-06-29

Similar Documents

Publication Publication Date Title
US11368522B2 (en) Lightweight IoT information model
US11071013B2 (en) Method and system for group communication, group server, and group member device
CN105722040B (en) Method, device and system for transmitting business messages
CN106790676B (en) Method and device for realizing subscription notification
US9438601B2 (en) Operating group resources in sub-groups and nested groups
CN103312605B (en) A kind of gateway device identity setting method and management gateway equipment
WO2019042110A1 (en) Subscription publication method, and server
CN107404512B (en) Resource subscription method, resource subscription device and resource subscription system
CN105409248A (en) Systems and methods for enhanced discovery
US10148739B2 (en) M2M data querying and invoking methods, querying and invoking devices, and system
WO2020038443A1 (en) Bridging communication method and device
CN106487864B (en) Method for establishing data connection, server and mobile terminal
CA2467388A1 (en) Event notification over a communications network
CN108259348B (en) A message transmission method and device
CN120568307A (en) Terminal self-discovery method, forwarding device and readable storage medium
CN115334146A (en) Resource publishing method, device, equipment and storage medium of Internet of things
CN110621051A (en) Routing method and device
CN114025016B (en) Data forwarding method, device and storage medium
CN111008254A (en) Object creating method and device, computer equipment and storage medium
CN111193805B (en) Resource discovery method and device
CN105025459A (en) resource notification method and system, local CSE and remote CSE
WO2023206558A1 (en) Address allocation method and apparatus
CN115987939B (en) Methods, electronic devices, and conversion equipment for searching smart devices
CN108574743A (en) A kind of distribution method, equipment and the system of local media accessing to control address
CN120263431A (en) A method, system, related equipment and storage medium for querying access rights

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20220221

Address after: 550025 Huawei cloud data center, jiaoxinggong Road, Qianzhong Avenue, Gui'an New District, Guiyang City, Guizhou Province

Patentee after: Huawei Cloud Computing Technologies Co.,Ltd.

Address before: 518129 Bantian HUAWEI headquarters office building, Longgang District, Guangdong, Shenzhen

Patentee before: HUAWEI TECHNOLOGIES Co.,Ltd.

TR01 Transfer of patent right