A communication method, device and system based on MQTT
Patent Information
- Application Number
- CN202611252421.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-18
- Publication Date
- 2026-10-13
AI Technical Summary
如果在eSIM卡侧的应用组件中直接实现MQTT协议栈,则会增加eSIM卡侧软件实现复杂度,并占用eSIM卡的存储资源和处理资源,从而不利于eSIM卡侧应用组件的轻量化实现
在本申请实施例中,可以提供一种应用于eSIM卡的通信方法,该eSIM卡与终端设备之间通过CAT框架进行交互,终端设备支持MQTT协议。基于此,首先,eSIM卡生成第一消息,第一消息为基于CAT框架的主动式命令格式扩展得到的MQTT控制命令,第一消息用于指示终端设备执行MQTT协议相关的操作;接着,eSIM卡通过CAT框架向终端设备发送第一消息,使终端设备可以根据该第一消息执行MQTT协议相关的操作;然后,eSIM卡通过CAT框架接收第一消息对应的第二消息,其中第二消息基于操作的执行结果、MQTT链路状态和/或MQTT服务端下行消息生成;最后,eSIM卡基于第二消息进行业务处理。可见,eSIM卡并非是直接生成和解析完整的MQTT协议报文来与MQTT服务端通信,而是通过CAT框架向支持MQTT协议的终端设备发送用于指示MQTT协议相关操作的第一消息,并通过CAT框架接收终端设备基于MQTT交互情况返回的第二消息。由于MQTT协议相关操作由支持MQTT协议的终端设备执行,eSIM卡侧只需生成用于指示终端设备执行操作的第一消息,并基于终端设备返回的第二消息进行业务处理,因此可以减少eSIM卡侧应用组件对完整MQTT协议栈的依赖。进一步地,由于eSIM卡与终端设备之间通过CAT框架进行交互,该交互路径属于eSIM卡与终端设备之间既有的卡应用交互机制,因此可以在eSIM卡侧通过该交互机制调用终端设备已有的MQTT协议能力,从而降低eSIM卡侧应用组件使用MQTT协议进行通信时的软件复杂度和资源占用,从而有助于eSIM卡侧应用组件的轻量化实现。
Smart Images

Figure CN122909552A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a communication method, apparatus and system based on MQTT. Background Technology
[0002] In IoT communication scenarios, terminal devices typically need to remotely interact with platform-side servers to complete functions such as device configuration, service status reporting, and platform command reception. For example, the Message Queuing Telemetry Transport (MQTT) protocol is often used for communication between IoT terminal devices and platform-side servers due to its lightweight nature, suitability for low-bandwidth networks, and support for publish / subscribe communication modes.
[0003] In practical applications, taking a system based on an embedded Subscriber Identity Module (eSIM) for the Internet of Things as an example, an application component for performing service management can be set up on the eSIM card side. If the MQTT protocol stack is directly implemented in the application component on the eSIM card side, it will increase the complexity of the eSIM card side software implementation and consume the storage and processing resources of the eSIM card, thus hindering the lightweight implementation of the eSIM card side application component. Summary of the Invention
[0004] This application provides an MQTT-based communication method, apparatus, and system to reduce the complexity of eSIM card-side software implementation, reduce the storage and processing resources occupied by the eSIM card, thereby facilitating the lightweight implementation of eSIM card-side application components.
[0005] In a first aspect, embodiments of this application provide a communication method based on MQTT. The method is applied to an embedded user identification module (eSIM) card, where the eSIM card interacts with a terminal device via a CAT framework. The terminal device supports the Message Queuing Telemetry Transmission (MQTT) protocol. The method includes: Generate a first message, which is an MQTT control command obtained by extending the active command format based on the CAT framework. The first message is used to instruct the terminal device to perform operations related to the MQTT protocol. The first message is sent to the terminal device through the CAT framework; The second message corresponding to the first message is received through the CAT framework. The second message is generated based on the execution result of the operation, the MQTT link status, and / or the downlink message from the MQTT server. Business processing is performed based on the second message.
[0006] Optionally, the first message includes at least one of the following: A connection command used to instruct the terminal device to establish a connection with the MQTT server; A topic subscription command used to instruct the terminal device to subscribe to a topic; A message publishing command used to instruct the terminal device to publish a message to the MQTT server; This command is used to instruct the terminal device to maintain the heartbeat keep-alive command of the MQTT link. An unsubscribe command used to instruct the terminal device to unsubscribe from the topic; A disconnect command used to instruct the terminal device to disconnect from the MQTT server.
[0007] Optionally, the connection command includes at least one of the following connection parameters: the address, port, client identifier, authentication information, heartbeat cycle, session identifier, and will parameter of the MQTT server. The connection command is used to instruct the terminal device to establish a network link with the MQTT server based on the connection parameters and generate an MQTT connection message. The topic subscription command includes a topic to be subscribed to and / or a subscription service quality level. The topic subscription command is used to instruct the terminal device to generate an MQTT subscription message based on the topic to be subscribed to and / or the subscription service quality level, and to send the MQTT subscription message to the MQTT server. The message publishing command includes at least one of the following publishing parameters: target topic, message payload, quality of service level, and reserved identifier. The message publishing command is used to instruct the terminal device to encapsulate an MQTT publishing message based on the publishing parameters and send the MQTT publishing message to the MQTT server.
[0008] Optionally, the second message is derived based on the event download format extension of the CAT framework, and the second message includes at least one of the following: A connection response event used to report MQTT connection results; Subscription response events used to report the results of topic subscriptions; Platform downlink message events used to transmit messages sent by the MQTT server; Heartbeat response events used to report heartbeat response results; A cancellation response event used to report the cancellation result; Link disconnection event used to report abnormal MQTT link status.
[0009] Optionally, the business processing based on the second message includes: If the second message is the connection response event, determine whether the MQTT link has been successfully established based on the connection status code and / or session recovery identifier in the connection response event; If the second message is the subscription response event, determine whether the business topic has been successfully subscribed based on the subscription topic, authorized service quality level and / or subscription result in the subscription response event; When the second message is a downlink message event of the platform, business logic parsing is performed based on the message topic, message payload, quality of service level and / or message identifier in the downlink message event of the platform. If the second message is the link abnormal disconnection event, reconnection processing or abnormal handling is triggered based on the abnormal cause and / or disconnection time in the link abnormal disconnection event.
[0010] Optionally, the eSIM card is equipped with an Internet of Things Profile Assistant (IPAe) component, which is used to generate the first message and perform business processing based on the second message.
[0011] Secondly, embodiments of this application provide an MQTT-based communication method. The method is applied to a terminal device, which interacts with an embedded user identification module (eSIM) via a CAT framework. The terminal device supports the Message Queuing Telemetry Transmission (MQTT) protocol. The method includes: The first message is received through the CAT framework. The first message is an MQTT control command obtained by extending the active command format based on the CAT framework. The first message is used to instruct the terminal device to perform operations related to the MQTT protocol. The second message corresponding to the first message is sent to the eSIM card through the CAT framework. The second message is generated based on the execution result of the operation, the MQTT link status and / or the MQTT server downlink message. The second message is used by the eSIM card to perform service processing based on the second message.
[0012] Thirdly, embodiments of this application provide an MQTT-based communication device. The device is applied to an embedded user identification module (eSIM) card. The eSIM card interacts with a terminal device via a CAT framework. The terminal device supports the Message Queuing Telemetry Transmission (MQTT) protocol. The device includes: The message generation module is used to generate a first message, which is an MQTT control command obtained by extending the active command format based on the CAT framework. The first message is used to instruct the terminal device to perform operations related to the MQTT protocol. The first message sending module is used to send the first message to the terminal device through the CAT framework; The first message receiving module is used to receive the second message corresponding to the first message through the CAT framework. The second message is generated based on the execution result of the operation, the MQTT link status and / or the downlink message from the MQTT server. The business processing module is used to perform business processing based on the second message.
[0013] Fourthly, embodiments of this application provide an MQTT-based communication device. The device is applied to a terminal device, which interacts with an embedded subscriber identity module (eSIM) card via a CAT framework. The terminal device supports the Message Queuing Telemetry Transmission (MQTT) protocol. The device includes: The second message receiving module is used to receive a first message through the CAT framework. The first message is an MQTT control command obtained by extending the active command format based on the CAT framework. The first message is used to instruct the terminal device to perform operations related to the MQTT protocol. The second message sending module is used to send a second message corresponding to the first message to the eSIM card through the CAT framework. The second message is generated based on the execution result of the operation, the MQTT link status and / or the MQTT server downlink message. The second message is used by the eSIM card to perform service processing based on the second message.
[0014] Fifthly, embodiments of this application provide an MQTT-based communication system, including: an embedded user identification module (eSIM) card and a terminal device, wherein the terminal device and the eSIM card interact through a CAT framework, and the terminal device supports the Message Queuing Telemetry Transmission (MQTT) protocol; The eSIM card is used to perform any of the implementation steps of the MQTT-based communication method described in the first aspect above; The terminal device is used to execute any implementation step of the MQTT-based communication method described in the second aspect above.
[0015] As can be seen from the above technical solutions, the embodiments of this application have the following advantages: In this embodiment, a communication method for an eSIM card is provided. The eSIM card interacts with a terminal device via a CAT framework, and the terminal device supports the MQTT protocol. Based on this, firstly, the eSIM card generates a first message, which is an MQTT control command derived from an active command format extension based on the CAT framework. This first message instructs the terminal device to perform MQTT protocol-related operations. Next, the eSIM card sends the first message to the terminal device via the CAT framework, enabling the terminal device to perform MQTT protocol-related operations based on the first message. Then, the eSIM card receives a second message corresponding to the first message via the CAT framework. This second message is generated based on the operation execution result, the MQTT link status, and / or downlink messages from the MQTT server. Finally, the eSIM card performs service processing based on the second message. It is evident that the eSIM card does not directly generate and parse complete MQTT protocol messages to communicate with the MQTT server. Instead, it sends a first message instructing MQTT protocol-related operations to a terminal device supporting the MQTT protocol via the CAT framework, and receives a second message returned by the terminal device based on the MQTT interaction status via the CAT framework. Since MQTT protocol-related operations are performed by terminal devices that support the MQTT protocol, the eSIM card only needs to generate a first message to instruct the terminal device to perform the operation and process the service based on the second message returned by the terminal device. This reduces the eSIM card application components' dependence on the complete MQTT protocol stack. Furthermore, since the eSIM card and terminal device interact through the CAT framework, this interaction path belongs to the existing card application interaction mechanism between the eSIM card and terminal device. Therefore, the eSIM card can call the existing MQTT protocol capabilities of the terminal device through this interaction mechanism, thereby reducing the software complexity and resource consumption of the eSIM card application components when using the MQTT protocol for communication, thus contributing to the lightweight implementation of the eSIM card application components. Attached Figure Description
[0016] Figure 1 A flowchart illustrating an MQTT-based communication method provided in an embodiment of this application; Figure 2 A schematic diagram of the structure of an MQTT-based communication system provided in an embodiment of this application; Figure 3 A schematic diagram of the structure of an MQTT-based communication device provided in an embodiment of this application; Figure 4 This is a schematic diagram of another MQTT-based communication device provided in an embodiment of this application. Detailed Implementation
[0017] As mentioned earlier, in IoT scenarios, terminal devices typically need to communicate with platform-side servers. For example, IoT terminal devices can report device status, business data, or configuration requests to the platform-side server, and can also receive business instructions, configuration parameters, or query responses from the platform-side server. In these communication scenarios, the MQTT protocol, due to its lightweight nature and suitability for publish / subscribe patterns, is often used for data interaction between IoT terminal devices and platform-side servers.
[0018] MQTT is a communication protocol for message publishing and subscription. In MQTT communication, terminal devices typically act as MQTT clients, while the platform can configure an MQTT server, also known as an MQTT Broker. An MQTT Broker can be understood as a message broker server, responsible for receiving messages from publishers and distributing them to subscribers based on topics. A topic can be understood as a message classification path; for example, different business functions can correspond to different topics. Clients can subscribe to a topic to receive downstream messages for that topic, and they can also publish upstream messages to a topic.
[0019] For ease of understanding, let's take a system based on an embedded Subscriber Identity Module (eSIM) as an example. An application component for performing service management can be configured on the eSIM card side. In an IoT eSIM system conforming to the SGP.32 specification, this application component can be an IoT Profile Assistant (IPA). Accordingly, the IPA can be configured on either the terminal device side or the eSIM card side. The IPA configured on the terminal device side can be called IPAd, and the IPA configured on the eSIM card side can be called IPAe. When the IPA is configured on the eSIM card side, the IPAe needs to communicate with the platform-side server.
[0020] However, if the IPAe is required to implement a complete MQTT protocol stack, the eSIM card will not only need to handle business logic but also communication protocol details such as MQTT connection establishment, message encapsulation, data transmission and reception, heartbeat keep-alive, protocol parsing, and acknowledgment interaction. This increases the software development complexity of the eSIM card and the consumption of hardware resources such as storage and computing resources. Especially in eSIM chips with relatively limited resources, fully porting and maintaining the MQTT protocol stack may increase implementation costs, thus hindering the lightweight implementation of the IPAe.
[0021] To address the aforementioned issues, this application provides a communication method for an eSIM card. The eSIM card interacts with a terminal device via a CAT framework, and the terminal device supports the MQTT protocol. First, the eSIM card generates a first message, which is an MQTT control command derived from an active command format extension based on the CAT framework. This first message instructs the terminal device to perform MQTT protocol-related operations. Next, the eSIM card sends the first message to the terminal device via the CAT framework, enabling the terminal device to perform MQTT protocol-related operations based on the first message. Then, the eSIM card receives a second message corresponding to the first message via the CAT framework. This second message is generated based on the operation execution result, the MQTT link status, and / or MQTT server downlink messages. Finally, the eSIM card performs service processing based on the second message.
[0022] As can be seen, the eSIM card does not directly generate and parse complete MQTT protocol messages to communicate with the MQTT server. Instead, it sends a first message instructing MQTT-related operations to the MQTT-enabled terminal device via the CAT framework, and receives a second message returned by the terminal device based on the MQTT interaction. Since the MQTT-related operations are performed by the MQTT-enabled terminal device, the eSIM card only needs to generate the first message instructing the terminal device to perform the operation and process the business based on the second message returned by the terminal device. This reduces the dependence of the eSIM card application components on the complete MQTT protocol stack. Furthermore, since the eSIM card and the terminal device interact through the CAT framework, this interaction path belongs to the existing card application interaction mechanism between the eSIM card and the terminal device. Therefore, the eSIM card can call the existing MQTT protocol capabilities of the terminal device through this interaction mechanism, thereby reducing the software complexity and resource consumption of the eSIM card application components when using the MQTT protocol for communication, thus contributing to the lightweight implementation of the eSIM card application components.
[0023] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of this application.
[0024] Figure 1 A flowchart illustrating an MQTT-based communication method provided in an embodiment of this application. (In conjunction with...) Figure 1As shown in the embodiments of this application, the MQTT-based communication method can be described using the interaction between the eSIM card and the terminal device as the execution subject. The eSIM card and the terminal device interact through the CAT framework, and the terminal device supports the MQTT protocol.
[0025] It should be noted that the Card Application Toolkit (CAT) framework refers to a standardized card application interaction framework for interaction between eSIM cards or UICC / eSIMs and terminal devices. Through the CAT framework, eSIM cards can send proactive commands to terminal devices to instruct them to perform certain operations; terminal devices can also report certain events and event-related data to the eSIM card through an event download mechanism. This application's embodiment utilizes the bidirectional interaction capabilities between the eSIM card and the terminal device within the CAT framework to extend MQTT-related commands and events, enabling the eSIM card to instruct the terminal device to perform MQTT-related operations through a first message and to obtain the execution result, link status, or server downlink messages through a second message.
[0026] The terminal device supports the MQTT protocol, which can be understood as having MQTT client protocol capabilities. It can perform at least one operation such as MQTT connection establishment, topic subscription, message publishing, heartbeat keep-alive, unsubscribing, disconnection, server message reception, and corresponding message processing.
[0027] Based on this, the corresponding communication method is described in detail below, which may include the following steps S101-S104.
[0028] S101: The eSIM card generates a first message, which is an MQTT control command obtained by extending the active command format based on the CAT framework. This first message is used to instruct the terminal device to perform operations related to the MQTT protocol.
[0029] The first message refers to the interactive message generated and sent by the eSIM card to the terminal device. This first message does not necessarily have to be a standard MQTT message itself, but rather it's used to express to the eSIM card's service components what MQTT operation the terminal device wants the terminal device to perform. In other words, the first message's role is to translate the eSIM card's service communication requirements into operational instructions that the terminal device can recognize.
[0030] In practical implementation, the eSIM card can be configured with a card-side application component. This component can generate MQTT communication requirements based on business logic. For example, when the eSIM card needs to establish a connection with the platform server, it can generate a requirement to establish an MQTT connection; when it needs to receive downlink messages for a certain type of service, it can generate a requirement to subscribe to a specific topic; when it needs to report service data to the platform server, it can generate a requirement to publish a message. The eSIM card can generate a first message based on these business communication requirements, enabling the terminal device to invoke its own MQTT protocol processing capabilities to perform corresponding operations based on the first message.
[0031] Accordingly, MQTT protocol-related operations can include operations related to the MQTT communication process, such as establishing a connection, subscribing to a topic, publishing a message, sending a heartbeat, unsubscribing, and disconnecting. Establishing a connection refers to the MQTT client and MQTT server establishing a communication session; subscribing to a topic means the MQTT client declares to the MQTT server that it wants to receive messages under a certain topic; publishing a message means the MQTT client sends a message payload to a certain topic; heartbeat keep-alive refers to maintaining the link online through heartbeat messages in long-connection communication; unsubscribing means stopping receiving messages corresponding to a certain topic; and disconnecting means actively releasing the MQTT session and the underlying network link.
[0032] In this way, since the first message is used to instruct the terminal device to perform MQTT protocol-related operations, the eSIM card side does not need to directly perform complete MQTT message encapsulation and protocol interaction. Instead, the protocol operation tasks can be delegated to terminal devices that support the MQTT protocol. This reduces the dependence of eSIM card side application components on the complete MQTT protocol stack, helping to reduce the complexity of eSIM card side software implementation.
[0033] Furthermore, in practical implementation, the CAT framework includes a proactive command mechanism. A proactive command refers to a command actively issued by the eSIM card to the terminal device. Correspondingly, upon receiving a proactive command, the terminal device can parse the command type and parameters within it, and execute the corresponding operation based on the parsing result.
[0034] Based on this, in the embodiments of this application, the first message can be obtained by extending the active command format of the CAT framework. That is, the message structure and transmission method of the CAT active command can be used, and the command type or command content representing MQTT-related operations can be extended to obtain the first message, thereby enabling the terminal device to recognize the active command as an MQTT-related operation instruction. For ease of understanding, the first message is described below with reference to various possible implementation methods.
[0035] As one possible implementation, the first message may include a connection command instructing the terminal device to establish a connection with the MQTT server, for example, the connection command being 0x90.
[0036] The connection command instructs the terminal device to establish a connection with the MQTT server. The MQTT server can be an eIM platform or an MQTT Broker connected to the eIM platform. Upon receiving the connection command, the terminal device can invoke its native MQTT client capabilities to establish the underlying network link and generate an MQTT connection message. This connection message corresponds to the CONNECT message in MQTT. The terminal device can then send this CONNECT message to the MQTT server to complete connection authentication and session establishment. Through this connection command, the eSIM card does not need to handle the encapsulation and transmission of the MQTT CONNECT message itself, thus reducing the implementation complexity on the eSIM card side.
[0037] In practical implementation, the connection command may include at least one of the following connection parameters: MQTT server address, port, client identifier, authentication information, heartbeat cycle, session identifier, and will parameter. The MQTT server address is used to enable the terminal device to determine the location of the server to connect to; the port is used to determine the access port through which the MQTT service is provided; the client identifier, also known as ClientID, is used to identify a client on the MQTT server side; the authentication information may include account, password, or other information used for identity verification; the heartbeat cycle is used to indicate the keep-alive interval for the terminal device to maintain the MQTT long connection; the session identifier can be used to indicate whether to clean up existing sessions, such as the CleanSession identifier; and the will parameter is used by the MQTT server to publish a preset will message according to the MQTT mechanism when the client disconnects abnormally.
[0038] By including at least one of the connection parameters mentioned above in the connection command, the eSIM card can transmit the key information required to establish an MQTT connection to the terminal device, enabling the terminal device to establish a communication link with the MQTT server based on these parameters.
[0039] As another possible implementation, the first message may include a topic subscription command for instructing the terminal device to subscribe to a topic, for example, the topic subscription command is 0x91.
[0040] Specifically, the topic subscription command instructs the terminal device to subscribe to a topic. The topic subscription command can include the topic to be subscribed to and / or the subscription quality of service (QoS) level. The topic to be subscribed to, also known as a Topic, represents the type or path of service messages that the eSIM card-side service component hopes to receive. The subscription QoS level can correspond to the QoS level in MQTT, representing the message transmission reliability requirements. After receiving the topic subscription command, the terminal device can generate an MQTT subscription message based on the topic to be subscribed to and / or the subscription QoS level, and send the MQTT subscription message to the MQTT server. This MQTT subscription message can correspond to the SUBSCRIBE message in MQTT.
[0041] Through this process, the eSIM card can request the terminal device to complete the topic subscription via command, without having to generate a complete SUBSCRIBE message on the eSIM card side.
[0042] As another possible implementation, the first message may include a message publishing command that instructs the terminal device to publish a message to the MQTT server, for example, the message publishing command is 0x92.
[0043] Specifically, a message publishing command instructs a terminal device to publish a message to an MQTT server. The message publishing command can include at least one of the following publishing parameters: target topic, message payload, quality of service (QoS) level, and retention flag. The target topic indicates the Topic to which the message should be published; the message payload carries the business data, status data, or configuration request data to be sent; the QoS level indicates the reliability requirements of the message publishing process; and the retention flag, which may correspond to the Retain flag in MQTT, indicates whether the MQTT server retains the last message under that topic. After receiving the message publishing command, the terminal device can encapsulate an MQTT publish message based on the publishing parameters and send the MQTT publish message to the MQTT server. This MQTT publish message may correspond to a PUBLISH message in MQTT.
[0044] Through this process, the eSIM card only needs to provide the service information to be published and the publishing requirements to the terminal device, while the terminal device is responsible for MQTT PUBLISH message encapsulation and sending, which helps reduce the message processing workload on the eSIM card side.
[0045] As another possible implementation, the first message may include a heartbeat keep-alive command instructing the terminal device to maintain the MQTT link, for example, the heartbeat keep-alive command is 0x93.
[0046] Specifically, the heartbeat keep-alive command instructs the terminal device to maintain the MQTT link. MQTT typically communicates via long-lived connections; if there is no data exchange for an extended period, a heartbeat mechanism is needed to keep the link online. Upon receiving the heartbeat keep-alive command, the terminal device can send an MQTT heartbeat request message based on the heartbeat period or heartbeat timeout threshold, and receive a heartbeat response message from the MQTT server. Here, the MQTT heartbeat request message can correspond to a PINGREQ message, and the heartbeat response message can correspond to a PINGRESP message.
[0047] Through this heartbeat keep-alive command, the eSIM card can control or trigger the terminal device to maintain the MQTT long connection without the eSIM card directly maintaining the underlying communication link.
[0048] As another possible implementation, the first message may include an unsubscribe command to instruct the terminal device to unsubscribe from the topic, for example, the unsubscribe command being 0x94.
[0049] Specifically, the unsubscribe command instructs the terminal device to unsubscribe from a topic. The unsubscribe command can carry the topic to be unsubscribed from. After receiving the unsubscribe command, the terminal device can generate an MQTT unsubscribe message and send it to the MQTT server. This unsubscribe message can correspond to an UNSUBSCRIBE message.
[0050] Through this process, the eSIM card can enable the terminal device to terminate message reception for the corresponding topic.
[0051] As another possible implementation, the first message may include a disconnect command instructing the terminal device to disconnect from the MQTT server, for example, the disconnect command being 0x95.
[0052] Specifically, the disconnect command instructs the terminal device to disconnect from the MQTT server. Upon receiving the disconnect command, the terminal device can send an MQTT disconnect message and release the MQTT session and underlying network link. This disconnect message can correspond to a DISCONNECT message.
[0053] Through this process, the eSIM card side can control the terminal device to release MQTT communication resources normally after the service is completed.
[0054] It should be noted that the aforementioned different commands can be identified by different command types. As an example, the connection command, topic subscription command, message publish command, heartbeat keep-alive command, unsubscribe command, and disconnect command can each be associated with different CAT proactive command types. For instance, unused command type values can be used to represent MQTT connection commands, MQTT topic subscription commands, MQTT message publish commands, MQTT heartbeat keep-alive commands, MQTT unsubscribe commands, and MQTT disconnect commands. The specific command type value can be determined based on the protocol extension design, and this application embodiment is not specifically limited to it. In this way, MQTT-related commands can be extended without disrupting the basic format of the CAT framework.
[0055] S102: The eSIM card sends the first message to the terminal device via the CAT framework.
[0056] After the eSIM card generates the first message, it can send the first message to the terminal device through the CAT framework.
[0057] Since the CAT framework is an existing card application interaction mechanism between the eSIM card and the terminal device, the first message can be transmitted using the interaction channel in the CAT framework. This way, no new dedicated hardware connection needs to be established between the eSIM card and the terminal device, nor does it require changing the basic interaction relationship between them.
[0058] S103: The terminal device sends the second message corresponding to the first message to the eSIM card through the CAT framework. The second message is generated based on the execution result of the operation, the MQTT link status and / or the downlink message of the MQTT server.
[0059] After the eSIM card sends the first message to the terminal device via the CAT framework, the terminal device can perform corresponding MQTT protocol operations based on the first message. Subsequently, the terminal device can generate a second message corresponding to the first message based on the operation execution status, MQTT link status, or downlink messages received from the MQTT server, and send it to the eSIM card via the CAT framework.
[0060] The second message refers to the interactive message returned by the terminal device to the eSIM card. Its purpose is to relay the result of the MQTT operation performed by the terminal device, the MQTT link status, or the business message sent by the MQTT server to the application component on the eSIM card side.
[0061] For example, the execution results of the above operations may include whether the connection is successful, whether the subscription is successful, or whether the unsubscription is successful; the MQTT link status may include whether the link is online, the heartbeat is normal, or the link is abnormally disconnected; the downlink messages of the MQTT server may include business instructions, configuration parameters, or query responses pushed by the platform-side server to the terminal device and processed by the eSIM card-side application component.
[0062] Since the first message can be obtained by extending the CAT proactive command format, the terminal device only needs to add the recognition and processing of MQTT-related commands to its existing CAT parsing logic to respond to MQTT operation requests from the eSIM card side. This helps reduce the amount of terminal device modification and allows reuse of the terminal device's existing MQTT client protocol capabilities.
[0063] Furthermore, in practical implementation, the CAT framework includes an event download mechanism. This event download mechanism refers to the mechanism by which the terminal device reports events and related data to the eSIM card.
[0064] Based on this, in the embodiments of this application, the second message can be obtained by extending the event download format based on the CAT framework. That is, the message structure and transmission method of CAT event download can be used, but the event type or event content representing MQTT-related events can be extended to obtain the second message, thereby enabling the terminal device to feed back MQTT-related information to the eSIM card via event download. For ease of understanding, the first message is described below with examples of various possible implementation methods.
[0065] As one possible implementation, the second message may include a connection response event 0x51 for reporting the MQTT connection result.
[0066] The connection response event is used to report the MQTT connection result. After the terminal device establishes a connection with the MQTT server according to the connection command, the MQTT server can return a connection response message. This connection response message corresponds to the CONNACK message in MQTT. The terminal device can generate a connection response event based on the CONNACK message and report it to the eSIM card through the CAT framework.
[0067] In practice, connection response events may include connection status codes and / or session recovery identifiers. Connection status codes can indicate successful connection, authentication failure, service unavailability, or other connection outcomes; session recovery identifiers can indicate whether the MQTT server has resumed the previous session.
[0068] Through the connection response event, the eSIM card-side application component can know whether the MQTT link has been successfully established, and thus decide whether to continue to execute subsequent subscription or publish services.
[0069] As another possible implementation, the second message may include a subscription response event 0x52 for reporting the topic subscription result.
[0070] The subscription response event is used to report the topic subscription result. When the terminal device sends a subscription message to the MQTT server according to the topic subscription command, the MQTT server can return a subscription response message. This subscription response message can correspond to a SUBACK message. The terminal device can generate a subscription response event based on the SUBACK message and report it to the eSIM card through the CAT framework.
[0071] In practice, a subscription response event may include the subscription topic, the authorized quality of service (QoS) level, and / or the subscription result. The authorized QoS level can represent the QoS level ultimately allowed by the MQTT server.
[0072] By subscribing to response events, the eSIM card-side application component can confirm whether the service topic has been successfully subscribed to, thereby determining whether the service downlink channel is ready.
[0073] As another possible implementation, the second message may include platform downlink message event 0x53 for transparently transmitting messages sent by the MQTT server.
[0074] Among them, the platform downlink message event is used to transparently transmit messages sent by the MQTT server. When the MQTT server pushes downlink MQTT messages such as business instructions, configuration parameters, and query responses to the terminal device, the terminal device can receive the downlink MQTT message and send the message-related content to the eSIM card through the platform downlink message event.
[0075] In practical implementation, a platform downlink message event can include a message topic, message payload, quality of service (QoS) level, and / or message identifier. The message topic indicates the Topic to which the downlink message belongs; the message payload carries the business data sent by the platform; the QoS level indicates the corresponding QoS level of the message; and the message identifier can be used to identify the corresponding MQTT message.
[0076] Through the platform's downlink message events, the terminal device can pass through the messages sent by the MQTT server to the eSIM card-side application component, which will then perform business logic parsing and processing, without the terminal device needing to process the business meaning.
[0077] As another possible implementation, the second message may include a heartbeat response event 0x54 for reporting the heartbeat response result.
[0078] The heartbeat response event is used to report the heartbeat response result. When a terminal device sends an MQTT heartbeat request message and receives a heartbeat response message from the MQTT server, the terminal device can generate a heartbeat response event and report it to the eSIM card. In specific implementations, this heartbeat response event may include information such as the link online status.
[0079] By using the heartbeat response event, the eSIM card can know the keep-alive status of the MQTT long connection, thereby determining whether the communication link is still available.
[0080] As another possible implementation, the second message may include a cancel subscription response event 0x55 for reporting the unsubscription result.
[0081] The unsubscribe response event is used to report the unsubscribe result. When the terminal device sends a unsubscribe message to the MQTT server according to the unsubscribe command, the MQTT server can return a unsubscribe response message. This unsubscribe response message can correspond to an UNSUBACK message. The terminal device can generate a unsubscribe response event and report it to the eSIM card through the CAT framework.
[0082] In practice, the unsubscribe response event may include the unsubscribe result and / or the corresponding Topic.
[0083] By checking the unsubscribe response event, the eSIM card can confirm whether the reception of messages for the corresponding topic has been terminated.
[0084] As another possible implementation, the second message may include a link failure disconnection event 0x56 for reporting an abnormal MQTT link status.
[0085] The link disconnection event is used to report abnormal MQTT link status. When the terminal device detects an MQTT link timeout, network disconnection, or the MQTT server actively disconnecting the connection, the terminal device can generate a link disconnection event and report it to the eSIM card through the CAT framework.
[0086] In practice, a link disconnection event can include the cause of the error and / or the time of disconnection. The cause of the error can be network outage, timeout, server disconnection, or other link-related issues.
[0087] Through the link failure event, the eSIM card side application component can detect the link failure in a timely manner, thereby triggering reconnection processing or failure handling.
[0088] It should be noted that the aforementioned different events can be identified by different event types. As an example, connection response events, subscription response events, platform downlink message events, heartbeat response events, unsubscribe response events, and link disconnection events can each be associated with different event type values. For instance, extended event types can be used to represent CONNACK, SUBACK, PUBLISH downlink, PINGRESP, UNSUBACK, and link disconnection. The specific event type value can be determined based on the protocol extension design, and this application embodiment does not specifically limit it. In this way, MQTT-related events can be extended without disrupting the basic format of CAT event download.
[0089] It should be noted that, in this embodiment, extending the CAT framework does not mean changing the overall interaction architecture of the CAT framework. Rather, it means adding content to represent MQTT-related operations or events on the basis of the CAT proactive command format and event download format. That is, the first message can use the unified format of the CAT proactive command, and the second message can use the unified format of the CAT event download; the difference lies in the command type, event type, or parameters used to express the MQTT-related meaning. This allows the eSIM card and terminal device to have MQTT operation indication and MQTT event feedback capabilities while maintaining the compatibility of the CAT framework.
[0090] In this way, since the second message is generated based on the execution result of the MQTT operation, the MQTT link status, and / or the downlink message generated by the MQTT server, the eSIM card can obtain the communication results and data related to business processing without directly parsing the complete MQTT interaction process. This helps to achieve closed-loop communication between the eSIM card application components and the MQTT server.
[0091] S104: The eSIM card performs service processing based on the second message.
[0092] Here, service processing refers to the eSIM card-side application component executing corresponding service logic based on communication results, link status, or platform downlink data. For example, if the second message indicates a successful connection, the eSIM card-side application component can continue to initiate topic subscription; if the second message indicates a successful subscription, the eSIM card-side application component can confirm that the service channel has been established; if the second message carries a service message sent by the platform, the eSIM card-side application component can parse the service message and execute the corresponding service action; if the second message indicates an abnormal link disconnection, the eSIM card-side application component can trigger reconnection processing or exception handling.
[0093] To facilitate understanding, the following example illustrates the implementation process of eSIM card service processing using different second messages.
[0094] As one possible implementation, if the second message is a connection response event, the eSIM card can determine whether the MQTT link has been successfully established based on the connection status code and / or session recovery identifier in the connection response event.
[0095] Specifically, if the connection status code indicates a successful connection, the eSIM card-side application component can assume that the MQTT link has been established and continue to generate topic subscription commands or message publishing commands; if the connection status code indicates a connection failure, the eSIM card-side application component can handle the exception according to the reason for the failure, such as waiting for reconnection or stopping subsequent service requests.
[0096] This processing method allows the eSIM card to control business processes based on the connection results returned by the terminal device, without needing to process the complete CONNACK message returned by the MQTT server itself.
[0097] As another possible implementation, in the case that the second message is a subscription response event, the eSIM card can determine whether the service topic has been successfully subscribed based on the subscription topic, authorized service quality level and / or subscription result in the subscription response event.
[0098] Specifically, if the subscription result indicates that the subscription was successful, the eSIM card-side application component can confirm that the downlink channel for the corresponding Topic has been established, and can then wait for the platform's downlink message event; if the subscription result indicates that the subscription failed, the eSIM card-side application component can re-initiate the topic subscription command or perform exception handling.
[0099] This processing method allows the eSIM card side to confirm the status of the service channel through event feedback, improving the controllability of the service process.
[0100] As another possible implementation, when the second message is a platform downlink message event, the eSIM card can perform business logic parsing processing based on the message topic, message payload, quality of service level and / or message identifier in the platform downlink message event.
[0101] Specifically, after receiving a downlink MQTT message from the MQTT server, the terminal device can choose not to parse the message's business meaning, but instead pass the message subject and payload to the eSIM card through a downlink message event on the platform. Upon receiving this event, the eSIM card-side application component can determine the corresponding business category based on the message subject and parse the message payload. For example, the message payload can carry business instructions, configuration parameters, or query responses, and the eSIM card-side application component can perform corresponding business processing based on the payload content.
[0102] This approach allows the terminal device to handle the MQTT communication protocol, while the eSIM card-side application component handles the business logic, thus clarifying the functional boundaries between the terminal device's communication layer and the eSIM card's service layer.
[0103] As another possible implementation, in the case that the second message is a link abnormal disconnection event, the eSIM card can trigger reconnection processing or abnormal handling based on the abnormal cause and / or disconnection time in the link abnormal disconnection event.
[0104] Specifically, if the cause of the error is a network disconnection, the eSIM card-side application component can wait for the terminal device's network to recover and then regenerate the connection command; if the cause of the error is that the MQTT server actively disconnects, the eSIM card-side application component can decide whether to reconnect based on the business policy; if the cause of the error is a heartbeat timeout, the eSIM card-side application component can trigger the re-establishment of the MQTT link.
[0105] This processing method allows the eSIM card to detect link anomalies in a timely manner and instruct the terminal device to perform reconnection operations by regenerating the first message, thereby improving the reliability of the communication process.
[0106] As another possible implementation, in the case that the second message is a heartbeat response event, the eSIM card can determine whether the MQTT link remains online based on the link online status in the heartbeat response event.
[0107] Specifically, if the link online status indicates normal operation, the eSIM card-side application component can continue to maintain the current service process; if the link online status indicates an anomaly, the eSIM card-side application component can trigger an exception handling mechanism. Through this handling method, the eSIM card side can detect the persistent connection keep-alive status.
[0108] As another possible implementation, if the second message is a cancellation response event, the eSIM card can confirm whether the corresponding service topic has been cancelled based on the cancellation result and / or the corresponding Topic in the cancellation response event.
[0109] Specifically, if the subscription is successfully canceled, the eSIM card application component can stop waiting for downlink messages under that Topic; if the subscription fails, the eSIM card application component can regenerate the subscription cancellation command as needed.
[0110] In this way, because the eSIM card side processes the execution results, link status, or downlink service data transmitted through the CAT framework, rather than all the communication details in the complete MQTT protocol stack, the eSIM card side application components can remain lightweight. This step enables the eSIM card side application components to complete the service loop, namely, sending operation requests, receiving operation feedback, and processing downlink data or abnormal states.
[0111] Based on the relevant content of steps S101-S104 above, it can be seen that in this embodiment, the eSIM card does not directly generate and parse complete MQTT protocol messages to communicate with the MQTT server. Instead, it sends a first message indicating MQTT protocol-related operations to a terminal device that supports the MQTT protocol through the CAT framework, and receives a second message returned by the terminal device based on the MQTT interaction through the CAT framework. Since the MQTT protocol-related operations are executed by the terminal device that supports the MQTT protocol, the eSIM card only needs to generate a first message indicating the terminal device to perform the operation and perform business processing based on the second message returned by the terminal device. Therefore, the dependence of the eSIM card application components on the complete MQTT protocol stack can be reduced. Furthermore, since the eSIM card and the terminal device interact through the CAT framework, this interaction path belongs to the existing card application interaction mechanism between the eSIM card and the terminal device. Therefore, the eSIM card can call the existing MQTT protocol capabilities of the terminal device through this interaction mechanism, thereby reducing the software complexity and resource consumption when the eSIM card application components use the MQTT protocol for communication, thus contributing to the lightweight implementation of the eSIM card application components.
[0112] Based on the MQTT-based communication method provided in the above embodiments, this application can also provide an MQTT-based communication system. The MQTT-based communication system will be described below with reference to embodiments and accompanying drawings.
[0113] Figure 2 This is a schematic diagram of the structure of an MQTT-based communication system provided in an embodiment of this application. (In conjunction with...) Figure 2 As shown, an MQTT-based communication system may include an eSIM card, a terminal device, and an MQTT server.
[0114] An eSIM card may include an eSIM service layer and an extended CAT adaptation layer. The eSIM service layer may include IPAe components or other card-side application components for generating service communication requirements and processing service data. The extended CAT adaptation layer is used to convert the MQTT operation requests of the eSIM service layer into a first message and send it to the terminal device through the CAT framework; the extended CAT adaptation layer is also used to receive the second message returned by the terminal device through the CAT framework and provide the execution result, link status, or downlink message therein to the eSIM service layer.
[0115] The terminal device may include a CAT parsing and adaptation module and an MQTT client protocol stack. The CAT parsing and adaptation module receives and parses the first message sent by the eSIM card through the CAT framework, identifies the MQTT protocol-related operation indicated by the first message, and passes the operation request to the MQTT client protocol stack on the terminal device side. The MQTT client protocol stack performs communication with the MQTT server, including establishing a connection, encapsulating MQTT messages, sending data, receiving data, processing heartbeats, and parsing server responses. The MQTT server can be an eIM platform or an MQTT Broker connected to the eIM platform.
[0116] Specifically, the eSIM card service layer can send a connection request to the extended CAT adapter layer. The extended CAT adapter layer generates a connection command and sends it to the terminal device through the CAT framework. The terminal device establishes a connection with the MQTT server through the MQTT client protocol stack. After the connection is established, the terminal device returns a connection response event to the eSIM card through the CAT framework. Afterward, the eSIM card service layer can continue to initiate requests such as topic subscription, message publishing, heartbeat keep-alive, unsubscribing, or disconnection. Thus, the system forms a layered interaction structure between the eSIM card service layer, the extended CAT adapter layer, the terminal MQTT communication layer, and the MQTT server.
[0117] For example, the aforementioned MQTT-based communication system uses an IoT eSIM system conforming to the SGP.32 specification. The eSIM card contains an IPAe component, which generates a first message and performs business processing based on a second message. The terminal device is an IoT terminal device, and the MQTT server can be an eIM platform or an MQTTBroker connected to the eIM platform. The IPAe component can extend the CAT framework to call existing MQTT client capabilities on the terminal device side to complete communication with the eIM platform. Since the terminal device typically already implements the MQTT protocol, the IPAe component does not need to be ported, developed, and adapted to the complete MQTT protocol stack on the eSIM card side.
[0118] Accordingly, in practical implementation, the IPAe component can generate MQTT connection, subscription, or publish operation requests based on SGP.32-related business requirements. For example, when the IPAe component needs to report status data to the eIM platform, it can generate a message publish command; when it needs to receive business instructions from the eIM platform, it can generate a topic subscribe command; and when it needs to maintain the communication link with the eIM platform, it can generate a heartbeat keep-alive command. The terminal device uses these commands to invoke its MQTT client protocol stack to complete the actual communication with the eIM platform or MQTT Broker. After the platform downlink messages are received by the terminal device, the platform downlink message events obtained through CAT event download format extension are passed through to the IPAe component, which performs business logic parsing and processing. In this way, the complexity of the IPAe software can be reduced, the IPAe program's occupation of eSIM hardware resources can be reduced, and the cost of eSIM products can be reduced.
[0119] Based on the MQTT-based communication method provided in the above embodiments, this application can also provide an MQTT-based communication device. The MQTT-based communication device will now be described in conjunction with embodiments and accompanying drawings.
[0120] Figure 3 This is a schematic diagram of a communication device based on MQTT provided in an embodiment of this application. (In conjunction with...) Figure 3 As shown in the embodiment of this application, the MQTT-based communication device 300 is applied to an embedded user identification module (eSIM) card. The eSIM card interacts with the terminal device through a CAT framework. The terminal device supports the Message Queuing Telemetry Transmission (MQTT) protocol. The MQTT-based communication device 300 includes: Message generation module 301 is used to generate a first message, which is used to instruct the terminal device to perform operations related to the MQTT protocol. The first message sending module 302 is used to send the first message to the terminal device through the CAT framework; The second message receiving module 303 is used to receive the second message corresponding to the first message through the CAT framework. The second message is generated based on the execution result of the operation, the MQTT link status and / or the downlink message of the MQTT server. The business processing module 304 is used to perform business processing based on the second message.
[0121] Optionally, the first message is derived from an extension of the active command format of the CAT framework, and the first message includes at least one of the following: A connection command used to instruct the terminal device to establish a connection with the MQTT server; A topic subscription command used to instruct the terminal device to subscribe to a topic; A message publishing command used to instruct the terminal device to publish a message to the MQTT server; This command is used to instruct the terminal device to maintain the heartbeat keep-alive command of the MQTT link. An unsubscribe command used to instruct the terminal device to unsubscribe from the topic; A disconnect command used to instruct the terminal device to disconnect from the MQTT server.
[0122] Optionally, the connection command includes at least one of the following connection parameters: the address, port, client identifier, authentication information, heartbeat cycle, session identifier, and will parameter of the MQTT server. The connection command is used to instruct the terminal device to establish a network link with the MQTT server based on the connection parameters and generate an MQTT connection message. The topic subscription command includes a topic to be subscribed to and / or a subscription service quality level. The topic subscription command is used to instruct the terminal device to generate an MQTT subscription message based on the topic to be subscribed to and / or the subscription service quality level, and to send the MQTT subscription message to the MQTT server. The message publishing command includes at least one of the following publishing parameters: target topic, message payload, quality of service level, and reserved identifier. The message publishing command is used to instruct the terminal device to encapsulate an MQTT publishing message based on the publishing parameters and send the MQTT publishing message to the MQTT server.
[0123] Optionally, the second message is derived based on the event download format extension of the CAT framework, and the second message includes at least one of the following: A connection response event used to report MQTT connection results; Subscription response events used to report the results of topic subscriptions; Platform downlink message events used to transmit messages sent by the MQTT server; Heartbeat response events used to report heartbeat response results; A cancellation response event used to report the cancellation result; Link disconnection event used to report abnormal MQTT link status.
[0124] Optionally, the service processing module 304 is specifically used for: If the second message is the connection response event, determine whether the MQTT link has been successfully established based on the connection status code and / or session recovery identifier in the connection response event; If the second message is the subscription response event, determine whether the business topic has been successfully subscribed based on the subscription topic, authorized service quality level and / or subscription result in the subscription response event; When the second message is a downlink message event of the platform, business logic parsing is performed based on the message topic, message payload, quality of service level and / or message identifier in the downlink message event of the platform. If the second message is the link abnormal disconnection event, reconnection processing or abnormal handling is triggered based on the abnormal cause and / or disconnection time in the link abnormal disconnection event.
[0125] Optionally, the eSIM card is equipped with an Internet of Things Profile Assistant (IPAe) component, which is used to generate the first message and perform business processing based on the second message.
[0126] Figure 4 This is a schematic diagram of a communication device based on MQTT provided in an embodiment of this application. (In conjunction with...) Figure 4 As shown in the embodiment of this application, the MQTT-based communication device 400 is applied to a terminal device. The terminal device interacts with the embedded user identification module (eSIM) card via a CAT framework. The terminal device supports the Message Queuing Telemetry Transmission (MQTT) protocol. The MQTT-based communication device 400 includes: The first message receiving module 401 is used to receive a first message through the CAT framework, wherein the first message is used to instruct the terminal device to perform operations related to the MQTT protocol. The second message sending module 402 is used to send a second message corresponding to the first message to the eSIM card through the CAT framework. The second message is generated based on the execution result of the operation, the MQTT link status and / or the downlink message of the MQTT server. The second message is used by the eSIM card to perform service processing based on the second message.
[0127] Optionally, the first message is derived from an extension of the active command format of the CAT framework, and the first message includes at least one of the following: A connection command used to instruct the terminal device to establish a connection with the MQTT server; A topic subscription command used to instruct the terminal device to subscribe to a topic; A message publishing command used to instruct the terminal device to publish a message to the MQTT server; This command is used to instruct the terminal device to maintain the heartbeat keep-alive command of the MQTT link. An unsubscribe command used to instruct the terminal device to unsubscribe from the topic; A disconnect command used to instruct the terminal device to disconnect from the MQTT server.
[0128] Optionally, the connection command includes at least one of the following connection parameters: the address, port, client identifier, authentication information, heartbeat cycle, session identifier, and will parameter of the MQTT server. The connection command is used to instruct the terminal device to establish a network link with the MQTT server based on the connection parameters and generate an MQTT connection message. The topic subscription command includes a topic to be subscribed to and / or a subscription service quality level. The topic subscription command is used to instruct the terminal device to generate an MQTT subscription message based on the topic to be subscribed to and / or the subscription service quality level, and to send the MQTT subscription message to the MQTT server. The message publishing command includes at least one of the following publishing parameters: target topic, message payload, quality of service level, and reserved identifier. The message publishing command is used to instruct the terminal device to encapsulate an MQTT publishing message based on the publishing parameters and send the MQTT publishing message to the MQTT server.
[0129] Optionally, the second message is derived based on the event download format extension of the CAT framework, and the second message includes at least one of the following: A connection response event used to report MQTT connection results; Subscription response events used to report the results of topic subscriptions; Platform downlink message events used to transmit messages sent by the MQTT server; Heartbeat response events used to report heartbeat response results; A cancellation response event used to report the cancellation result; Link disconnection event used to report abnormal MQTT link status.
[0130] Optionally, the second message is specifically used for: If the second message is the connection response event, determine whether the MQTT link has been successfully established based on the connection status code and / or session recovery identifier in the connection response event; If the second message is the subscription response event, determine whether the business topic has been successfully subscribed based on the subscription topic, authorized service quality level and / or subscription result in the subscription response event; When the second message is a downlink message event of the platform, business logic parsing is performed based on the message topic, message payload, quality of service level and / or message identifier in the downlink message event of the platform. If the second message is the link abnormal disconnection event, reconnection processing or abnormal handling is triggered based on the abnormal cause and / or disconnection time in the link abnormal disconnection event.
[0131] Optionally, the eSIM card is equipped with an Internet of Things Profile Assistant (IPAe) component, which is used to generate the first message and perform business processing based on the second message.
[0132] Furthermore, this application embodiment also provides an MQTT-based communication system, characterized in that it includes: an embedded user identification module (eSIM) card and a terminal device, wherein the terminal device and the eSIM card interact through a CAT framework, and the terminal device supports the Message Queuing Telemetry Transmission (MQTT) protocol; The eSIM card is used to execute any of the implementation steps of the MQTT-based communication method executed by the eSIM card described above; The terminal device is used to execute any implementation step of the MQTT-based communication method executed by the terminal device.
[0133] As can be seen from the above description of the embodiments, those skilled in the art can clearly understand that all or part of the steps in the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, a server, or a network communication device such as a media gateway, etc.) to execute the methods described in various embodiments or some parts of the embodiments of this application. It should be noted that the various embodiments in this specification are described in a progressive manner, and each embodiment focuses on describing the differences from other embodiments. The same or similar parts between the various embodiments can be referred to mutually.
[0134] The system disclosed in the embodiments is described in a relatively simple manner because it corresponds to the method disclosed in the embodiments. For relevant details, please refer to the method section.
[0135] It should also be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0136] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A communication method based on MQTT, characterized in that, The method is applied to an embedded user identification module (eSIM) card, wherein the eSIM card interacts with the terminal device via a CAT framework, and the terminal device supports the Message Queuing Telemetry Transmission (MQTT) protocol. The method includes: Generate a first message, which is an MQTT control command obtained by extending the active command format based on the CAT framework. The first message is used to instruct the terminal device to perform operations related to the MQTT protocol. The first message is sent to the terminal device through the CAT framework; The second message corresponding to the first message is received through the CAT framework. The second message is generated based on the execution result of the operation, the MQTT link status, and / or the downlink message from the MQTT server. Business processing is performed based on the second message.
2. The method according to claim 1, characterized in that, The first message includes at least one of the following: A connection command used to instruct the terminal device to establish a connection with the MQTT server; A topic subscription command used to instruct the terminal device to subscribe to a topic; A message publishing command used to instruct the terminal device to publish a message to the MQTT server; This command is used to instruct the terminal device to maintain the heartbeat keep-alive command of the MQTT link. An unsubscribe command used to instruct the terminal device to unsubscribe from the topic; A disconnect command used to instruct the terminal device to disconnect from the MQTT server.
3. The method according to claim 2, characterized in that, The connection command includes at least one of the following connection parameters: the address, port, client identifier, authentication information, heartbeat cycle, session identifier, and will parameter of the MQTT server. The connection command is used to instruct the terminal device to establish a network link with the MQTT server based on the connection parameters and generate an MQTT connection message. The topic subscription command includes a topic to be subscribed to and / or a subscription service quality level. The topic subscription command is used to instruct the terminal device to generate an MQTT subscription message based on the topic to be subscribed to and / or the subscription service quality level, and to send the MQTT subscription message to the MQTT server. The message publishing command includes at least one of the following publishing parameters: target topic, message payload, quality of service level, and reserved identifier. The message publishing command is used to instruct the terminal device to encapsulate an MQTT publishing message based on the publishing parameters and send the MQTT publishing message to the MQTT server.
4. The method according to claim 1, characterized in that, The second message is derived from an extension of the event download format of the CAT framework, and includes at least one of the following: A connection response event used to report MQTT connection results; Subscription response events used to report the results of topic subscriptions; Platform downlink message events used to transmit messages sent by the MQTT server; Heartbeat response events used to report heartbeat response results; A cancellation response event used to report the cancellation result; Link disconnection event used to report abnormal MQTT link status.
5. The method according to claim 4, characterized in that, The business processing based on the second message includes: If the second message is the connection response event, determine whether the MQTT link has been successfully established based on the connection status code and / or session recovery identifier in the connection response event; In the case that the second message is the subscription response event, it is determined whether the business topic has been successfully subscribed based on the subscription topic, authorized service quality level and / or subscription result in the subscription response event; In the case that the second message is a downlink message event of the platform, business logic parsing is performed based on the message topic, message payload, quality of service level and / or message identifier in the downlink message event of the platform. If the second message is the link abnormal disconnection event, reconnection processing or abnormal handling is triggered based on the abnormal cause and / or disconnection time in the link abnormal disconnection event.
6. The method according to any one of claims 1 to 5, characterized in that, The eSIM card is equipped with an Internet of Things Profile Assistant (IPAe) component, which is used to generate the first message and perform business processing based on the second message.
7. A communication method based on MQTT, characterized in that, The method is applied to a terminal device, which interacts with an embedded user identification module (eSIM) card via a CAT framework. The terminal device supports the Message Queuing Telemetry Transmission (MQTT) protocol. The method includes: The first message is received through the CAT framework. The first message is an MQTT control command obtained by extending the active command format based on the CAT framework. The first message is used to instruct the terminal device to perform operations related to the MQTT protocol. The second message corresponding to the first message is sent to the eSIM card through the CAT framework. The second message is generated based on the execution result of the operation, the MQTT link status and / or the MQTT server downlink message. The second message is used by the eSIM card to perform service processing based on the second message.
8. A communication device based on MQTT, characterized in that, The device is applied to an embedded user identification module (eSIM) card. The eSIM card interacts with the terminal device via a CAT framework. The terminal device supports the Message Queuing Telemetry Transmission (MQTT) protocol. The device includes: The message generation module is used to generate a first message, which is an MQTT control command obtained by extending the active command format based on the CAT framework. The first message is used to instruct the terminal device to perform operations related to the MQTT protocol. The first message sending module is used to send the first message to the terminal device through the CAT framework; The second message receiving module is used to receive the second message corresponding to the first message through the CAT framework. The second message is generated based on the execution result of the operation, the MQTT link status and / or the downlink message from the MQTT server. The business processing module is used to perform business processing based on the second message.
9. A communication device based on MQTT, characterized in that, The device is applied to a terminal device, which interacts with an embedded user identification module (eSIM) card via a CAT framework. The terminal device supports the Message Queuing Telemetry Transmission (MQTT) protocol. The device includes: The first message receiving module is used to receive a first message through the CAT framework. The first message is an MQTT control command obtained by extending the active command format based on the CAT framework. The first message is used to instruct the terminal device to perform operations related to the MQTT protocol. The second message sending module is used to send a second message corresponding to the first message to the eSIM card through the CAT framework. The second message is generated based on the execution result of the operation, the MQTT link status and / or the downlink message of the MQTT server. The second message is used by the eSIM card to perform service processing based on the second message.
10. A communication system based on MQTT, characterized in that, include: An embedded user identification module (eSIM) card and a terminal device are provided. The terminal device and the eSIM card interact through a CAT framework. The terminal device supports the Message Queuing Telemetry Transmission (MQTT) protocol. The eSIM card is used to perform the steps of the MQTT-based communication method according to any one of claims 1 to 6; The terminal device is used to execute the steps of the MQTT-based communication method as described in claim 7.