WO2018035839A1 - 一种数据传输方法、相关设备及通信系统 - Google Patents

一种数据传输方法、相关设备及通信系统 Download PDF

Info

Publication number
WO2018035839A1
WO2018035839A1 PCT/CN2016/096854 CN2016096854W WO2018035839A1 WO 2018035839 A1 WO2018035839 A1 WO 2018035839A1 CN 2016096854 W CN2016096854 W CN 2016096854W WO 2018035839 A1 WO2018035839 A1 WO 2018035839A1
Authority
WO
WIPO (PCT)
Prior art keywords
message
terminal
application layer
gateway
layer message
Prior art date
Application number
PCT/CN2016/096854
Other languages
English (en)
French (fr)
Inventor
刘清顺
黄正磊
张万强
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Priority to PCT/CN2016/096854 priority Critical patent/WO2018035839A1/zh
Publication of WO2018035839A1 publication Critical patent/WO2018035839A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W4/00Services specially adapted for wireless communication networks; Facilities therefor
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04WWIRELESS COMMUNICATION NETWORKS
    • H04W88/00Devices specially adapted for wireless communication networks, e.g. terminals, base stations or access point devices

Definitions

  • the present invention relates to the field of communications technologies, and in particular, to a data transmission method, a related device, and a communication system.
  • the third-generation mobile communication system (English: 3rd Generation, 3G for short) is conducting research on the Narrow Band Internet of Things (NB-IoT) project, which supports ultra-low complexity through architecture enhancement. IoT devices with limited power and low data rates are studied to support the efficient transmission of small data packets.
  • NB-IoT Narrow Band Internet of Things
  • a Message Queuing Telemetry Transport for Sensor Network (MTTTT-SN) protocol for a sensor network is provided, which is a message queue telemetry transmission (English: Message Queuing Telemetry Transport) , referred to as: MQTT) upgrade version of the protocol, can achieve the transmission of packet data.
  • MQTT Message Queuing Telemetry Transport
  • FIG. 1 which is a basic interaction process of the MQTT-SN.
  • the Broker is a server in the MQTT-SN service, and the client (English: Client) is released to the corresponding Broker through the MQTT-SN Gateway (MQTT-SN Gateway). Message.
  • the process includes steps S101 to S106.
  • the client first sends a connection establishment (English: CONNECT) message to the Broker through the MQTT-SN Gateway, requesting to establish a connection, and the Broker replies to the connection confirmation through the MQTT-SN Gateway (English: CONNACK)
  • the message indicates that the connection has been established, and then the client sends a PUBLISH message to the broker through the MQTT-SN Gateway, and the PUBLISH message carries the data that the client needs to send.
  • the Client In order to enable the Broker to identify the Client, the Client needs to carry the client ID (English: Client ID) when sending the CONNECT message to the Broker.
  • the format of the CONNECT message can be seen in Figure 2.
  • the CONNECT message contains the length (English: Length) field.
  • Message type English: MsgType
  • flag English: Flags
  • protocol identifier English: Protocol
  • duration English: Duration
  • client identifier English: Client ID
  • the data transmitted by the client is 6 bytes, and CONNECT The client ID carried in the message is 23 bytes, which causes excessive transmission resources in the transmission client identifier. Therefore, how to reduce the transmission overhead of the client identifier during the MQTT-SN service transmission process is a technical problem to be solved. .
  • the embodiment of the invention provides a data transmission method, a related device and a communication system, which can reduce the overhead of transmitting the application layer identifier of the terminal and save the air interface transmission resource.
  • a data transmission method including: a first gateway receiving a first application layer message sent by a terminal to an application server, where the first application layer message is an MQTT-SN message. If the first application layer message does not include the terminal identifier field, the first gateway generates a second application layer message according to the first application layer message. Or, if the first application layer message includes a terminal identifier field, and the length of the terminal identifier field is less than or equal to a preset length, the first gateway generates a second application layer message according to the first application layer message. The first gateway sends the second application layer message to the application server, where the second application layer message includes an application layer identifier of the terminal, and the application layer identifier is used by the application server to identify the terminal.
  • the first application layer message sent by the terminal to the first gateway does not include the terminal identifier field, and the first application layer message includes the terminal identifier field, and the length of the terminal identifier field is less than or equal to the preset length, and the preset length is insufficient.
  • the application layer identifier of the terminal is carried, so the first application layer message does not carry the application layer identifier corresponding to the terminal.
  • the first gateway After receiving the first application layer message sent by the terminal, the first gateway generates a second application layer message carrying the application layer identifier of the terminal according to the first application layer message, and then sends the second application layer message to the application server, where the application server is configured according to The application layer identifier carried in the received second application layer message identifies the terminal from which the message is sent, so that the overhead of transmitting the application layer identifier by the terminal can be reduced, and the air interface transmission resource is saved.
  • the method before the first gateway receives the first application layer message sent by the terminal to the application server, the method further includes: the first gateway receiving the mobility management entity (English: Mobility Management) Entity, referred to as MME, creates a session request message, and the session request message includes an application layer identifier and a data type indication information of the terminal, and the data type refers to The indication information is used to indicate that the message sent by the terminal is an MQTT-SN message.
  • MME Mobility Management Entity
  • creates a session request message includes an application layer identifier and a data type indication information of the terminal, and the data type refers to
  • the indication information is used to indicate that the message sent by the terminal is an MQTT-SN message.
  • the first gateway establishes a bearer for the terminal according to the create session request message.
  • the first gateway sends a create session response message to the MME, where the create session response message is used to indicate that the first gateway has successfully established a bearer for the terminal.
  • the first gateway establishes a bearer for the terminal.
  • the first gateway may identify which terminal the data is transmitted according to the bearer, and may also identify the transmitted data packet according to the bearer. Type, so that the overhead of transmitting the application layer identifier of the terminal can be reduced during the data transmission process, and the air interface transmission resource is saved.
  • the second application layer message is an MQTT message.
  • the first gateway has a protocol conversion capability, and can generate an MQTT message according to the MQTT-SN message, and then send the generated MQTT message to the application server.
  • the second application layer message is an MQTT-SN message.
  • the method further includes: the first gateway encapsulating the second application layer message, Obtaining a first encapsulation message, where the first encapsulation message includes a network layer identifier of the terminal, and the network layer identifier is used by the second gateway identification terminal corresponding to the terminal.
  • the first gateway sends the second application layer message to the application server, where the first gateway sends the first encapsulated message to the second gateway. So that the second gateway decapsulates the first encapsulated message, and generates an MQTT message according to the second application layer message, and sends the MQTT message to the application server.
  • the first gateway By performing the above steps, the first gateway generates an MQTT message according to the MQTT-SN message through the second gateway, and sends the MQTT message to the application server.
  • Using a dedicated second gateway to handle the communication process with the application server can improve processing efficiency while reducing the complexity of the first gateway.
  • the method further includes: receiving, by the first gateway, the second gateway
  • the second encapsulated message includes a third application layer message sent by the application server to the terminal and a network layer identifier of the terminal, where the third application layer message is an MQTT-SN message and does not include a terminal identifier field.
  • the first gateway decapsulates the second encapsulated message to obtain a third application layer message and a network layer identifier of the terminal.
  • the first gateway sends a third application layer message to the terminal according to the network layer identifier of the terminal.
  • the network layer of the terminal can be passed between the first gateway and the second gateway. Know to address the terminal.
  • the second aspect provides a data transmission method, including: the terminal generates a first application layer message, where the first application layer message is an MQTT-SN message.
  • the terminal sends the first application layer message to the application server through the first gateway.
  • the first application layer message does not include a terminal identifier field, or the first application layer message includes a terminal identifier field, and the length of the terminal identifier field is less than or equal to a preset length.
  • the first application layer message sent by the terminal to the first gateway does not include the terminal identifier field, and the first application layer message includes the terminal identifier field, and the length of the terminal identifier field is less than or equal to the preset length, and the preset length is insufficient.
  • the application layer identifier of the terminal is carried, so the first application layer message does not carry the application layer identifier corresponding to the terminal.
  • the first gateway After receiving the first application layer message sent by the terminal, the first gateway generates a second application layer message carrying the application layer identifier of the terminal according to the first application layer message, and then sends the second application layer message to the application server, where the application server is configured according to The application layer identifier carried in the received second application layer message identifies the terminal from which the message is sent, so that the overhead of transmitting the application layer identifier by the terminal can be reduced, and the air interface transmission resource is saved.
  • the terminal before the terminal generates the first application layer message, the terminal further includes: the terminal sending an attach request message to the MME, where the attach request message includes the application layer identifier and the data type of the terminal.
  • the indication information, the data type indication information is used to indicate that the message sent by the terminal is an MQTT-SN message.
  • the terminal receives the attach response message sent by the MME, and the attach response message is used to indicate that the first gateway has successfully established a bearer for the terminal.
  • the terminal may send its own application layer identifier and the to-be-type to the first gateway before the data transmission, so that the first gateway establishes a bearer for the terminal.
  • the first gateway may identify the bearer according to the bearer.
  • the data from which the transmitted data is derived, and the type of the data packet transmitted by the bearer may also be identified, so that the overhead of transmitting the application layer identifier of the terminal may be reduced during the data transmission process, and the air interface transmission resource is saved.
  • a gateway is provided, where the gateway is a first gateway, where the first gateway includes a processor, a memory, and a communication interface, where the memory is used to store program code, and the processor is configured to invoke program code to perform the following operations:
  • the first application layer message sent by the terminal to the application server is received through the communication interface, and the first application layer message is a message queue telemetry transmission MQTT-SN message for the sensor network. If the first application layer message does not include the terminal identification field, the processor generates a second application layer message according to the first application layer message. Or If the first application layer message includes the terminal identifier field and the length of the terminal identifier field is less than or equal to the preset length, the processor generates a second application layer message according to the first application layer message. Sending, by the communication interface, the second application layer message to the application server, where the second application layer message includes an application layer identifier of the terminal, and the application layer identifier is used by the application server to identify the terminal.
  • the first application layer message sent by the terminal to the first gateway does not include the terminal identifier field or the first application layer message includes the terminal identifier field, and the length of the terminal identifier field is less than or equal to the preset length, and the preset length is insufficient.
  • the application layer identifier of the terminal is carried, so the first application layer message does not carry the application layer identifier corresponding to the terminal.
  • the first gateway After receiving the first application layer message sent by the terminal, the first gateway generates a second application layer message carrying the application layer identifier of the terminal according to the first application layer message, and then sends the second application layer message to the application server, where the application server is configured according to The application layer identifier carried in the received second application layer message identifies the terminal from which the message is sent, so that the overhead of transmitting the application layer identifier by the terminal can be reduced, and the air interface transmission resource is saved.
  • the processor before the processor receives the first application layer message that is sent by the terminal to the application server, the processor is further configured to: receive, by using the communication interface, the MME sends the A session request message is created.
  • the session request message includes an application layer identifier and a data type indication information of the terminal, where the data type indication information is used to indicate that the message sent by the terminal is an MQTT-SN message.
  • the processor establishes a bearer for the terminal according to the create session request message.
  • the processor sends a create session response message to the MME through the communication interface, and the create session response message is used to indicate that the first gateway has successfully established a bearer for the terminal.
  • the first gateway Before the data transmission, the first gateway establishes a bearer for the terminal.
  • the first gateway may identify which terminal the data is transmitted according to the bearer, and may also identify the transmitted data packet according to the bearer. Type, so that the overhead of transmitting the application layer identifier of the terminal can be reduced during the data transmission process, and the air interface transmission resource is saved.
  • the second application layer message is an MQTT message.
  • the first gateway has a protocol conversion capability, and can generate an MQTT message according to the MQTT-SN message, and then send the generated MQTT message to the application server.
  • the second application layer message is an MQTT-SN message.
  • the processor generates according to the first application layer message After the second application layer message is sent to the application server by using the communication interface, the processor is further configured to: encapsulate the second application layer message to obtain the first encapsulated message, where the first encapsulated message includes the terminal.
  • the network layer identifier is used by the second gateway to identify the terminal.
  • the first gateway establishes a communication connection with the application server through the second gateway, so as to implement message interaction between the terminal and the application server.
  • Using a dedicated second gateway to handle the communication process with the application server can improve processing efficiency while reducing the complexity of the first gateway.
  • the processor is further configured to: receive, by using a communications interface And a second encapsulated message sent by the second gateway, where the second encapsulated message includes a third application layer message sent by the application server to the terminal and a network layer identifier of the terminal, where the third application layer message is an MQTT-SN message and does not include a terminal identifier field. Decapsulating the second encapsulated message to obtain a third application layer message and a network layer identifier of the terminal. The third application layer message is sent to the terminal according to the network layer identifier of the terminal through the communication interface.
  • the terminal can be addressed by the network layer identification of the terminal between the first gateway and the second gateway.
  • a terminal comprising a processor, a memory, and a transceiver, wherein the memory is configured to store program code, and the processor is configured to invoke the program code to perform the following operations:
  • a first application layer message is generated, and the first application layer message is an MQTT-SN message.
  • the first application layer message sent by the terminal to the first gateway does not include the terminal identifier field or the first application layer message includes the terminal identifier field, and the length of the terminal identifier field is less than or equal to the preset length, and the preset length is insufficient.
  • the application layer identifier of the terminal is carried, so the first application layer message does not carry the application layer identifier corresponding to the terminal.
  • the first gateway receives the first application layer sent by the terminal. And generating, by the first application layer message, the second application layer message that carries the application layer identifier of the terminal, and then sending the second application layer message to the application server, where the application server is configured according to the received second application layer message.
  • the layer identifier identifies which terminal the message comes from, so the overhead of transmitting the application layer identifier of the terminal can be reduced, and the air interface transmission resource is saved.
  • the processor before the processor generates the first application layer message, the processor is further configured to: send, by using the transceiver, an attach request message to the MME, where the attach request message includes the terminal.
  • the application layer identifier and the data type indication information are used to indicate that the message sent by the terminal is an MQTT-SN message.
  • the attach response message sent by the MME is received by the transceiver, and the attach response message is used to indicate that the first gateway has successfully established a bearer for the terminal.
  • the terminal may send its own application layer identifier and the to-be-type to the first gateway before the data transmission, so that the first gateway establishes a bearer for the terminal, and in the data transmission process, the first gateway may identify the bearer according to the bearer.
  • the data from which the transmitted data is derived, and the type of the data packet transmitted by the bearer may also be identified, so that the overhead of transmitting the application layer identifier of the terminal may be reduced during the data transmission process, and the air interface transmission resource is saved.
  • a gateway is provided, the gateway being a first gateway, the first gateway comprising a module or unit for performing the above first aspect, or the data transmission method described in any one of the implementation manners of the first aspect .
  • a terminal comprising a module or unit for performing the data transmission method described in the second aspect, or any one of the implementations of the second aspect.
  • a communications system comprising a gateway and a terminal, wherein the gateway is the first gateway according to the third aspect or the fifth aspect, wherein the terminal is the fourth aspect or the sixth aspect Terminal.
  • a computer readable storage medium storing program code for implementing the data transmission method described in any one of the first aspect or the first aspect, the program code includes running The execution instruction of the above data transmission method.
  • a ninth aspect a computer readable storage medium storing program code for implementing the data transmission method described in any one of the second aspect or the second aspect, the program code includes running The execution instruction of the above data transmission method.
  • the preset length is an application layer protocol.
  • FIG. 1 is a basic interaction flowchart of the MQTT-SN
  • FIG. 2 is a schematic structural diagram of a communication system according to an embodiment of the present invention.
  • FIG. 3 is a schematic flowchart of a data transmission method according to an embodiment of the present invention.
  • FIG. 4 is a schematic diagram of a format of a CONNECT message according to an embodiment of the present invention.
  • FIG. 5 is a signaling interaction diagram of a terminal attach process according to an embodiment of the present invention.
  • FIG. 6 is a schematic flowchart diagram of another data transmission method according to an embodiment of the present invention.
  • FIG. 7 is a schematic diagram of a package format of an encapsulated message according to an embodiment of the present invention.
  • FIG. 8 is a schematic diagram of content of a package message according to an embodiment of the present invention.
  • FIG. 9 is a schematic diagram of a format of a CONNACK message according to an embodiment of the present invention.
  • FIG. 10 is a schematic structural diagram of a gateway according to an embodiment of the present disclosure.
  • FIG. 11 is a schematic structural diagram of a terminal according to an embodiment of the present disclosure.
  • FIG. 12 is a schematic structural diagram of another gateway according to an embodiment of the present disclosure.
  • FIG. 13 is a schematic structural diagram of another terminal according to an embodiment of the present invention.
  • the network elements in the communication system 200 mainly include: a terminal (English: User Equipment, UE for short), a base station, and an MME.
  • Service Gateway English: Serving Gateway, S-GW for short
  • Packet Data Network Gateway P-GW
  • Home Subscriber Server English: Home Subscriber Server, HSS for short
  • the communication system may include but is not limited to an evolved packet system (English: Evolved Packet) System, referred to as: EPS).
  • EPS evolved packet system
  • the communication interface between the UE and the base station is a Uu interface
  • the communication interface between the base station and the MME is an S1-MME interface
  • the communication interface between the base station and the S-GW is an S1-U interface
  • the S-GW and the P-GW are
  • the communication interface between the S-GW and the MME is the S11 interface
  • the communication interface between the MME and the HSS is the S6 interface.
  • the UE may be a UE in a cellular Internet of Things (Cellular IoT, referred to as: CIoT).
  • Cellular IoT Cellular IoT
  • a UE refers to a client.
  • the base station can be a base station in the CIoT (English: Base Station, BS for short), or an evolved base station in the Long Term Evolution (LTE) network (English: evolved Node B, referred to as:
  • the eNB may also be a base station in a future 5G system or the like.
  • the UE and the base station communicate with each other using some air interface technology.
  • Air interface technologies may include: 4G (such as FDD LTE, TDD LTE) and 5G systems that will be available in the future.
  • the main functions of the MME include access control (including security and admission control), mobility management (tracking the location of the UE), attach and detach, and session management functions (including Evolved Packet Core (EPC).
  • access control including security and admission control
  • mobility management tilt the location of the UE
  • attach and detach and session management functions
  • EPC Evolved Packet Core
  • the main functions of the S-GW include: routing and forwarding of data packets under the control of the MME, forwarding the received user data to the designated PGW network element, and receiving and transmitting are common data transmission platforms (English: General Data Transfer Platform (GTP) protocol data packet, so there is no need to format the data packet.
  • GTP General Data Transfer Platform
  • SGW is the bidirectional transmission channel of GTP protocol data packet.
  • the main functions of the P-GW include user-based packet filtering, lawful interception, UE IP address allocation, packet transport layer marking in the uplink/downlink, uplink/downlink service level charging, and services. Level-gating, control of service-based uplink/downlink rates, etc.
  • the P-GW also provides uplink/downlink bearer binding and uplink binding check function.
  • the S-GW/P-GW in the present invention also supports a proxy (Proxy) function of the MQTT-SN service, and the Proxy function can be a UE (equivalent to a client in the MQTT-SN service).
  • the client ID field in the sent CONNECT message is set or replaced with the application layer identifier of the UE.
  • the application layer identifier of the terminal includes any one of the following identifiers: International Mobile Subscriber IDentity (IMSI).
  • IMSI and MSISDN are identifiers defined and used inside the mobile network, and their composition and length are standard pre-defined and have standard restrictions.
  • the external identifier that is, the identifier of the UE defined by the mobile network, may be customized by the application server according to service requirements, without any limitation.
  • the UE When transmitting a CONNECT message on an air interface, the UE only needs to transmit a one-byte Client ID (which satisfies the required protocol ID of the client ID), or does not carry any content in the Client ID field, thereby reducing the message length and saving air interface transmission resources.
  • the communication system may further include an MQTT-SN Gateway (ie, a second gateway in the present invention) in the MQTT-SN service, and the S-GW/P-GW also supports a repeater in the MQTT-SN service (English: Forwarder)
  • the function, the S-GW/P-GW completes the forwarding function of the MQTT-SN message (for example, CONNECT message, registration (English: REGISTER) message, etc.), specifically, the S-GW/P-GW pair UE and the MQTT-SN Gateway
  • the transmitted MQTT-SN message is encapsulated, and the encapsulated encapsulated message is forwarded to the MQTT-SN Gateway, and the downlink MQTT-SN encapsulated message sent by the MQTT-SN Gateway can be received and the decapsulated MQTT-SN is received.
  • the message is sent to the UE.
  • the MQTT-SN protocol can be used for communication between the UE and the MQTT-SN Gateway, and the MQTT-SN Gateway and the Broker can communicate with the MQTT.
  • the MQTT-SN Gateway can complete the conversion of the MQTT-SN protocol and the MQTT protocol. .
  • the selection of the MQTT-SN Gateway is completed by the S-GW/P-GW, and the UE does not need the address information of the MQTT-SN Gateway to send the MQTT-SN message, so there is no need to support the discovery of the MQTT-SN Gateway.
  • the :Discovery) process saves the consumption of network resources by the Discovery process broadcast package.
  • the MQTT-SN Gateway can provide an MQTT interface, an Advanced Message Queuing Protocol (AMQP) interface, or a Hypertext Transfer Protocol (HTTP) interface.
  • the MQTT-SN Gateway can be built in the application server.
  • an internal interface can be adopted between the MQTT-SN Gateway and the application server.
  • the MQTT-SN Gateway can obtain the UE Reachability event and then send the downlink MQTT-SN message to the UE through the service creation environment function (English: Service Creation Environment Function, SCEF).
  • SCEF Service Creation Environment Function
  • the MQTT-SN Gateway can also be deployed independently or built into the PGW deployment.
  • the HSS is mainly used to store the user subscription information, and is mainly responsible for managing the user's subscription data and the location information of the mobile user.
  • the application server may include, but is not limited to, a broker in the MQTT-SN service.
  • FIG. 3 is a schematic flowchart diagram of a data transmission method according to an embodiment of the present invention.
  • the method includes, but is not limited to, steps S301 to S304, and detailed descriptions of the steps are as follows.
  • the terminal generates a first application layer message, where the first application layer message is an MQTT-SN message.
  • the first application layer message is a message that the terminal sends to the application server by using the first gateway.
  • the first application layer message includes, but is not limited to, an MQTT-SN message.
  • the first application layer message generated by the terminal does not include the terminal identifier field, or the first application layer message includes the terminal identifier field, and the length of the terminal identifier field is less than or equal to the preset length.
  • the preset length may be the minimum length allowed by the application layer protocol, or may be configured to the length of the terminal through the human-computer interaction interface, and is not limited.
  • the application layer message specifically refers to the MQTT-SN protocol.
  • the terminal identification field in the CONNECT message is ClientID
  • the length of the ClientID specified in the MQTT-SN protocol is 1-23 bytes, and the minimum length is 1.
  • the above preset length can be set to 1 byte.
  • the terminal sends a first application layer message to the first gateway.
  • the first gateway may establish different bearers for different terminals to transmit data.
  • the dedicated bearer of the terminal may be used to transmit the first application layer message.
  • the first gateway identifies the terminal by identifying the bearer used by the terminal to send the first application layer message.
  • the identifier of the terminal can be saved without saving the air interface overhead.
  • the first gateway may also establish different bearers in combination with the message types transmitted by the terminal. Therefore, when the terminal sends the first application layer message to the first gateway, the terminal may use the dedicated bearer corresponding to the MQTT-SN message to transmit the first application layer message. Correspondingly, the first gateway identifies the type of the message by identifying the bearer used by the terminal to send the first application layer message.
  • the first gateway receives the first application layer message sent by the terminal, and if the first application layer message does not include the terminal identifier field, generates a second application layer message according to the first application layer message; or, if the first application layer message includes The first identifier generates a second application layer message according to the first application layer message, where the length of the terminal identifier field is less than or equal to the preset length.
  • the first application layer message is an MQTT-SN message.
  • the first gateway may determine, according to the bearer used by the terminal to send the first application layer message, that the first application layer message is an MQTT-SN message, and may further determine the first application according to the message identification information of the first application layer message.
  • the layer message is an MQTT-SN message.
  • the message identification information is MQTT-SN message indication information, or the message type of the first application layer message.
  • the first gateway determines that the first application layer message is an MQTT-SN message, the first gateway performs an application layer parsing on the first application layer message, and when the first application layer message is parsed, the terminal identifier field is not included, or When the application layer message includes the terminal identifier field and the length of the terminal identifier field is less than or equal to the preset length, the first gateway determines that the first application layer message does not carry the identifier of the terminal, and therefore, to identify the application layer message, the first gateway generates A second application layer message carrying an application layer identifier of the terminal.
  • the method for generating the second application layer message by the first gateway is specifically: adding the application layer identifier of the terminal to the first application layer message, and performing protocol format conversion to obtain a second application layer message, for example, refer to 4, since the ClientID field is at the end of the CONNECT message, occupying the position of the byte index value 6-n, the first gateway may add the application layer identifier of the UE, such as the IMSI, after the byte index value 5 of the CONNECT message. Or replace the content after the byte index value 5 with the IMSI of the UE. At the same time, the first gateway also needs to update the message length corresponding to the byte index value 0.
  • the first gateway is an S-GW or a P-GW.
  • the P-GW is used as an example.
  • the P-GW After receiving the CONNECT message sent by the UE, the P-GW does not include the Client ID field in the CONNECT message. Add the Client ID field at the end of the CONNECT message, and set the Client ID field to the identifier corresponding to the UE, such as IMSI. If the CONNECT message carries the Client ID field, but the Client ID field carries only one byte of any character, the P-GW replaces the Client ID field with the identifier corresponding to the UE, such as IMSI.
  • the first gateway sends the second application layer message to the application server.
  • the first gateway pre-records the mapping between the application layer identifier of the terminal and the application server, and determines the application server corresponding to the terminal according to the application layer identifier of the terminal, and then adds the second application layer identifier of the terminal.
  • the application layer message is sent to the application server corresponding to the terminal.
  • the application server After receiving the second application layer message, the application server identifies, by using the application layer identifier included in the second application layer message, which terminal the application layer message comes from.
  • the MQTT-SN protocol is adopted between the terminal and the first gateway, and the MQTT protocol is adopted between the first gateway and the application server.
  • the first gateway has a protocol conversion capability, and the first gateway may generate a corresponding MQTT message according to the MQTT-SN message sent by the terminal, and then send the generated MQTT message to the application server.
  • the first gateway may also generate a corresponding MQTT-SN message according to the MQTT message sent by the application server, and then send the generated MQTT-SN message to the terminal.
  • the first gateway generates an MQTT message conforming to the MQTT protocol format according to the first application layer message sent by the terminal, where the MQTT message carries the application layer identifier of the terminal, and the first gateway sends the MQTT message to the application server.
  • the message fields carried in the MQTT-SN message and the MQTT message are different.
  • the MQT-SN message includes a Protocol ID field corresponding to the MQTT message, and the field corresponds to a Protocol Name field.
  • the first gateway adds a Client ID field in the CONNECT message, and sets the Client ID field to the identifier of the UE, such as the IMSI. Then perform protocol conversion on the CONNECT message with the Client ID field added, for example, modify the Protocol ID field in the CONNECT message to The Protocol Name field and so on, the resulting CONNECT message is the second application layer message.
  • the application server after receiving the second application layer message sent by the first gateway, the application server sends an application layer message for the terminal to the first gateway, because the application server and the first gateway may establish different interfaces for different terminals.
  • the transmission control protocol (English: Transfer Control Protocol, TCP for short) is connected, so the terminal can be identified by the TCP connection used for transmitting the data. Therefore, the application layer message sent by the application server may not carry the application layer identifier of the terminal.
  • the gateway learns, according to the TCP connection used by the application server to send the application layer message, which terminal is the application layer message, and then sends the application layer message to the terminal after receiving the application layer message.
  • the application layer message sent by the application server to the first gateway is an MQTT message, and the first gateway needs to perform protocol conversion on the application layer message, and sends the generated MQTT-SN message to the terminal.
  • the second application layer message sent by the first gateway to the application server is a CONNECT message
  • the message returned by the application server is a CONNACK message
  • the returned CONNACK message is in the MQTT protocol format.
  • the first gateway needs to perform protocol conversion on the received CONNACK message, converts it into a CONNACK message conforming to the MQTT-SN protocol format, and sends the generated CONNACK message to the corresponding terminal.
  • the first gateway stores the identifiers of the bearers corresponding to the different terminals, and sends the CONNACK message to the corresponding terminal by using the bearer corresponding to the terminal.
  • the application layer message sent by the application server to the first gateway may also carry the application layer identifier of the terminal.
  • the first gateway learns according to the application layer identifier carried in the application layer message.
  • the application layer message is for which terminal, and the application layer identifier of the terminal carried in the application layer message is deleted, and the application layer message with the application layer identifier deleted is sent to the terminal to save the air interface transmission resource.
  • the first gateway does not have the protocol conversion capability, and then an additional second gateway is required to perform the conversion of the MQTT-SN protocol and the MQTT protocol.
  • the first gateway generates an MQTT-SN message carrying the application layer identifier of the terminal according to the first application layer message sent by the terminal, and then sends the MQTT-SN message to the second gateway for protocol conversion, and the second gateway receives the first gateway to send the message.
  • the MQTT-SN message is formatted, and the MQTT-SN message is formatted to generate an MQTT message conforming to the MQTT protocol format, and then the MQTT message is sent to the application server.
  • the method further includes: the terminal initiating an attaching process, where the attaching process is as shown in FIG. Steps S501-S505, the detailed description of each step is as follows:
  • the terminal sends an attach request message to the MME, where the attach request message carries the application layer identifier and the data type indication information of the terminal, where the data type indication information is used to indicate that the message sent by the terminal is an MQTT-SN message.
  • the data type indication information may also indicate that the data packet sent by the terminal is a small data packet.
  • the MME sends a create session request message to the first gateway, where the create session request message includes an application layer identifier and data type indication information of the terminal.
  • the MME After receiving the attach request message sent by the terminal, the MME parses the attach request message, parses the application layer identifier and the data type indication information of the terminal from the attach request message, and sends a create session request message to the first gateway to request the terminal. Establish a bearer.
  • the first gateway receives the create session request message sent by the MME, and establishes a bearer for the terminal according to the create session request message.
  • the first gateway After receiving the create session request message sent by the MME, the first gateway parses the create session request message, and parses the application layer identifier and the data type indication information of the terminal from the create session request message, so that the message that the terminal needs to send is obtained.
  • the MQTT-SN message is used to create a bearer for the terminal. In the data transmission process, when the terminal transmits data through the bearer, the first gateway can learn that the terminal transmits the MQTT-SN message, and the first gateway is also It is possible to know which terminal the transmitted data packet comes from. The first gateway may further determine that the terminal does not need to allocate an IP address according to the data type indication information, so that the IP address resource may also be saved.
  • the first gateway sends a create session response message to the MME, where the session response message is used to indicate that the bearer has been successfully established for the terminal.
  • the create session response message may carry data type indication information, indicating that the data type corresponding to the created bearer is an MQTT-SN data type.
  • S505 The MME sends an attach response message to the terminal, where the attach response message is used to indicate that the bearer has been successfully established for the terminal.
  • the attach accept message may carry data type indication information, indicating that the data type corresponding to the created bearer is an MQTT-SN data type.
  • the terminal may send the bearer used by the first application layer message to identify which terminal the message is from. Therefore, the terminal sends the first application layer.
  • the application layer identifier of the terminal may not be carried, so that the air interface transmission resource can be saved.
  • the first gateway may allocate a second gateway to the terminal, and forward the second application layer message to the application server by using the second gateway. Specifically, the first gateway may allocate the second application layer message sent by the terminal to the terminal.
  • a second gateway may also be configured to allocate a second gateway to the terminal in the process of attaching the terminal, which is not specifically limited in this embodiment of the present invention.
  • the process between the first gateway and the second gateway may be referred to FIG. 6, which mainly includes the following steps S601-S604, and the detailed description of each step is as follows:
  • the first gateway encapsulates the generated second application layer message to obtain a first encapsulated message, where the first encapsulated message includes a second application layer message and a network layer identifier of the terminal, where the network layer identifier is used by the second gateway to identify the terminal. .
  • the network layer identifier includes, but is not limited to, a tunnel endpoint identifier (English: Tunnel Endpoint ID, TEID for short) of the S5/S8 interface;
  • the first gateway sends the first encapsulated message to the second gateway.
  • the second gateway receives the first encapsulated message sent by the first gateway, and decapsulates the first encapsulated message to obtain a second application layer message and a network layer identifier of the terminal.
  • the second gateway may also perform application layer parsing on the second application layer message to obtain the application layer identifier of the terminal, and the second gateway may determine the application corresponding to the terminal according to the pre-stored identifier of the terminal and the mapping table of the application server.
  • the server further establishes a pair of TCP connections to the application server, and binds the application layer identifier of the terminal, the network layer identifier of the terminal, and the TCP identifier, and the second gateway identifies the identifier according to any one of the foregoing three identifiers.
  • the terminal can be identified, so in the subsequent transmission process, the first gateway only needs to send the encapsulation message of the network layer identifier and the application layer message encapsulating the terminal to the second gateway, and the second gateway can identify according to the network layer identifier of the terminal.
  • the application server only needs to send the application layer message to the second gateway by using the TCP connection corresponding to the terminal, and the second gateway can identify which terminal the application layer message corresponds to according to the TCP connection.
  • the network layer identifier of the terminal is used to identify the terminal between the first gateway and the second gateway to implement addressing and routing of the terminal under non-IP conditions.
  • the mapping table of the identifier of the terminal and the application server stored by the second gateway may be sent by the first gateway to the second gateway in advance.
  • the second gateway generates an MQTT message according to the second application layer message.
  • the second gateway has the protocol conversion capability, and the first gateway sends the second gateway to the second gateway.
  • the second application layer message is an MQTT-SN message, and the second gateway receives the MQTT-SN message sent by the first gateway, and generates an MQTT message conforming to the MQTT protocol format according to the MQTT-SN message.
  • the second gateway sends the MQTT message to the application server.
  • the second gateway determines which application server the terminal corresponds to according to the identifier of the pre-stored terminal and the mapping table of the application server, and then sends the MQTT message to the application server.
  • the role of the second gateway is to establish a TCP connection with the application server corresponding to the terminal, and implement message interaction between the terminal and the application server.
  • Using a dedicated second gateway to handle TCP connections can increase processing efficiency while reducing the complexity of the first gateway.
  • the P-GW is used as an example.
  • the P-GW supports the MQTT-SN forwarder function, and the second gateway is the MQTT-SN Gateway.
  • the P-GW sets the Client ID field in the CONNECT message to the IMSI of the UE.
  • the P-GW encapsulates the CONNECT message and obtains the encapsulated message.
  • the encapsulation format of the encapsulated message can be seen in FIG. 7.
  • the encapsulated message includes a Length field, an MsgType field, a control character (English: Ctrl) field, and a wireless node identifier.
  • Wireless Node ID (English: Wireless Node ID) field and MQTT-SN Message (English: MQTT-SN Message) field, wherein the Wireless Node ID identifies the source of the encapsulated message, for example, if the encapsulated message is sent by the first gateway to the second gateway
  • the Wireless Node ID is the ID of the first gateway. If the encapsulated message is sent by the second gateway to the first gateway, the Wireless Node ID is the ID of the second gateway.
  • a description of the various fields of the encapsulated message can be seen in FIG.
  • the P-GW sends the encapsulated message to the second gateway, and the second gateway decapsulates the encapsulated message to obtain a CONNECT message including the IMSI of the UE, and the second gateway may identify, according to the network layer identifier of the UE, the CONNECT message is Which UE sends the CONNECT message to the MQTT Broker corresponding to the UE.
  • each first gateway corresponds to multiple second gateways
  • each second gateway corresponds to multiple first gateways
  • the package may be identified by using a Wireless Node ID field according to an existing encapsulation format.
  • the message is from which gateway, and based on the existing encapsulation format, add another bit to indicate the network layer identifier of the terminal.
  • the source of the encapsulated message may not be indicated, so the wireless Node ID identifier may be used to carry the terminal. Network layer identification, no need to add another indicator bit to save transmission resources.
  • the application server sends the second gateway to the terminal.
  • the third application layer message may not carry the application layer identifier of the terminal, because the terminal may be identified by the TCP connection between the server and the second gateway.
  • the second gateway learns, according to the TCP connection used when the application server sends the third application layer message, which terminal the third application layer message is for.
  • the second gateway encapsulates the third application layer message to obtain a second encapsulated message.
  • the second encapsulated message includes a third application layer message and a network layer identifier of the terminal.
  • the second gateway sends the second encapsulated message to the first gateway.
  • the first gateway receives the second encapsulated message, and decapsulates the second encapsulated message to obtain a third application layer message, a network layer identifier of the terminal, and a network layer identifier of the terminal. And sending a third application layer message to the terminal according to the network layer identifier of the terminal.
  • the first gateway establishes different bearers for different terminals, where the network layer identifier is a tunnel identifier or a bearer identifier, and the first gateway learns, according to the bearer identifier, which terminal corresponds to the third application layer message, and uses the The bearer corresponding to the terminal transmits the third application layer message.
  • the application layer message sent by the application server to the second gateway is an MQTT message
  • the second gateway performs protocol conversion on the MQTT message, generates an MQTT-SN message, and encapsulates the converted MQTT-SN message.
  • the third encapsulates the message and sends the third encapsulated message to the first gateway.
  • the first gateway is a P-GW
  • the P-GW supports the MQTT-SN forwarder function
  • the second gateway is an MQTT-SN Gateway.
  • the MQTT-SN Gateway establishes a TCP connection with the corresponding Broker of the UE, and then carries the UE.
  • the CONNECT message of the IMSI is sent to the Broker.
  • the Broker identifies the UE from which the message is sent according to the IMSI of the CONNECT message, and sends a CONNACK message for the UE to the MQTT-SN Gateway.
  • the format of the CONNACK message can be seen in FIG.
  • the CONNACK message includes a Lenth field, an MsgType field, and a return code (English: ReturnCode) field.
  • the CONNACK message does not carry the IMSI of the UE.
  • the MQTT-SN Gateway identifies the CONNACK message according to the TCP connection used by the Broker to send the CONNACK message.
  • the CONNACK message is encapsulated.
  • the format of the encapsulated message can be seen in Figure 7, where the encapsulated message includes the Wireless Node ID, and the MQTT-SN Gateway sets the Wireless Node ID to the UE.
  • the network layer identifier such as the TEID of the S5/S8 interface, is then sent to the P-GW, and the P-GW decapsulates the encapsulated message to obtain a UE that does not include the UE.
  • the CONNACK message of the IMSI and the network layer identifier of the UE identifies that the CONNACK message is based on the network layer identifier of the UE. Which UE, in turn, sends the CONNACK message to the UE.
  • the application layer identifier of the terminal may also be included in the third application layer message, and the identifier of the TCP connection used by the second gateway according to the application server to send the third application layer message, or the application according to the terminal carried in the third application layer message.
  • the layer identifier is used to learn which terminal the third application layer message is for, and after receiving the third application layer message, the third application layer message is encapsulated to obtain a second encapsulated message, where the second encapsulated message is included.
  • the third application layer message and the network layer identifier of the terminal, and the second encapsulation message is sent to the first gateway, where the first gateway receives the second encapsulation message, decapsulates the second encapsulation message, and obtains the third application layer message and the terminal.
  • the network layer identifier and the network layer identifier of the terminal are deleted, and the application layer identifier of the terminal carried in the third application layer message is deleted, and the third application layer message with the application layer identifier deleted is sent to the terminal according to the network layer identifier of the terminal.
  • the first application layer message sent by the terminal to the first gateway does not include the terminal identifier field or the first application layer message includes the terminal identifier field, and the length of the terminal identifier field is less than or equal to the preset length, and the preset length is insufficient.
  • the application layer identifier of the terminal is carried, so the first application layer message does not carry the application layer identifier corresponding to the terminal.
  • the first gateway After receiving the first application layer message sent by the terminal, the first gateway generates a second application layer message carrying the application layer identifier of the terminal according to the first application layer message, and then sends the second application layer message to the application server, where the application server is configured according to The application layer identifier carried in the received second application layer message identifies the terminal from which the message is sent, so that the overhead of transmitting the application layer identifier by the terminal can be reduced, and the air interface transmission resource is saved.
  • the present invention also provides a related device for implementing the implementation method.
  • FIG. 10 is a schematic structural diagram of a gateway according to an embodiment of the present invention.
  • the gateway is a first gateway, the first gateway may be a P-GW or an S-GW, and the first gateway 100 includes a processor 1001, a memory 1002, a communication interface 1003, and a bus 1004, where the processor 1001
  • the memory 1002 and the communication interface 1003 may be connected by a bus or other means, and FIG. 10 is exemplified by a connection through the bus 1004.
  • the first gateway 100 may further include a power module 1005.
  • the processor 1001 may be a general-purpose processor, such as a central processing unit (CPU: Central Processing Unit, CPU for short).
  • the processor 1001 may further include a hardware chip, and the foregoing hardware chip. It can be a combination of one or more of the following: Application Specific Integrated Circuit (ASIC), Field Programmable Gate Array (FPGA), Complex Programmable Logic Device (English: Complex Programmable Logic Device, referred to as: CPLD).
  • ASIC Application Specific Integrated Circuit
  • FPGA Field Programmable Gate Array
  • CPLD Complex Programmable Logic Device
  • the processor 1001 can process data received through the communication interface 1003.
  • the processor 1001 can also process data to be transmitted to the communication interface 1003 for wired transmission.
  • the memory 1002 is configured to store program code and data, and the memory 1002 may include a volatile memory (English: Volatile Memory), such as a random access memory (English: Random Access Memory, RAM for short); the memory may also include non-volatile Memory (English: Non-Volatile Memory), such as read-only memory (English: Read-Only Memory, ROM: Flash Memory), hard disk (English: Hard Disk Drive, HDD) or A solid state drive (English: Solid-State Drive, SSD for short); the memory 1002 may also include a combination of the above types of memories.
  • the memory 1002 is coupled to the processor 1001 via a bus 1004. Specifically, in the embodiment of the present invention, the memory 1002 specifically stores the data transmission program code and the preset length, the application layer identifier of the terminal, and the like described in the foregoing embodiments.
  • the communication interface 1003 is used for data communication between the first gateway 100 and a terminal (for example, a mobile station (English: Mobile Station, MS for short), a UE in 3G and 4G, and a terminal in a future 5G network).
  • the first gateway 100 can also communicate with the application server using the communication interface 1003.
  • the communication interface 1003 may be an S5/S8 interface, the PGW is connected to the SGW through the S5/S8 interface, and the SGW is connected to the base station through the S1-U interface, and the base station passes the Uu interface and the terminal.
  • the wireless connection enables the PGW to communicate with the terminal.
  • the communication interface 1003 may be an S1-U interface, and the SGW is connected to the base station by using an S1-U interface, and the base station is wirelessly connected to the terminal through the Uu interface, thereby implementing data communication between the SGW and the terminal.
  • the communication interface 1003 may also be an Ethernet interface, and the first gateway 100 communicates with the application server using an Ethernet interface.
  • the bus 1004 may be an industry standard architecture (English: Industry Standard Architecture, ISA for short), a peripheral device interconnection (English: Peripheral Component Interconnect, PCI) bus, and an extended standard architecture (English: Extended Industry Standard Architecture, Abbreviation: EISA) bus, integrated circuit bus (English: Inter Integrated Circuit, Abbreviation: IIC) and so on.
  • ISA Industry Standard Architecture
  • PCI Peripheral Component Interconnect
  • EISA Extended Industry Standard Architecture
  • IIC Inter Integrated Circuit
  • the power module 1005 is configured to supply power to each module of the first gateway 100.
  • the processor 1001 is further configured to invoke the data transmission program code in the memory 1002, and perform the following operations:
  • the processor 1001 receives, by using the communication interface 1003, a first application layer message sent by the terminal to the application server, where the first application layer message is a message queue telemetry transmission MQTT-SN message for the sensor network;
  • the processor 1001 If the first application layer message does not include the terminal identifier field, the processor 1001 generates a second application layer message according to the first application layer message; or if the first application layer message includes the terminal identifier field and the length of the terminal identifier field is less than or equal to the pre- Set a length, the processor 1001 generates a second application layer message according to the first application layer message;
  • the processor 1001 sends a second application layer message to the application server, where the second application layer message includes an application layer identifier of the terminal, and the application layer identifier is used by the application server to identify the terminal.
  • the processor 1001 before the processor 1001 receives the first application layer message sent by the terminal to the application server by using the communication interface 1003, the processor 1001 is further configured to:
  • a create session request message sent by the MME where the session request message includes an application layer identifier and data type indication information of the terminal, where the data type indication information is used to indicate that the message sent by the terminal is an MQTT-SN message;
  • the processor 1001 establishes a bearer for the terminal according to the create session request message.
  • the processor 1001 sends a create session response message to the MME through the communication interface 1003, and the create session response message is used to indicate that the bearer has been successfully established for the terminal.
  • the second application layer message is an MQTT message.
  • the second application layer message is an MQTT-SN message; after the processor 1001 generates the second application layer message according to the first application layer message, and sends the second application layer message to the processor 1001 through the communication interface 1003. Before the application server, the processor 1001 is also used to:
  • the second application layer message is encapsulated to obtain a first encapsulated message, where the first encapsulated message includes a network layer identifier of the terminal, and the network layer identifier is used by the second gateway to identify the terminal;
  • the processor 1001 sends the second application layer message to the application server through the communication interface 1003, including:
  • the processor 1001 sends the first encapsulated message to the second gateway through the communication interface 1003, so that The second gateway decapsulates the first encapsulated message, generates an MQTT message according to the second application layer message, and sends the MQTT message to the application server.
  • the processor 1001 is further configured to:
  • the processor 1001 receives the second encapsulated message sent by the second gateway by using the communication interface 1003.
  • the second encapsulated message includes a third application layer message sent by the application server to the terminal and a network layer identifier of the terminal, where the third application layer message is MQTT-SN.
  • the message does not contain the terminal identification field;
  • the processor 1001 decapsulates the second encapsulated message to obtain a third application layer message and a network layer identifier of the terminal.
  • the processor 1001 sends a third application layer message to the terminal according to the network layer identifier of the terminal.
  • first gateway 100 described in this embodiment of the present invention may be used to perform the steps of the first gateway in the embodiment shown in FIG. 3 or FIG. 5 or FIG. 6, and details are not described herein again.
  • FIG. 11 is a schematic structural diagram of a terminal according to an embodiment of the present invention.
  • the terminal 110 shown in FIG. 11 includes a processor 1101 including one or more processing cores, a memory 1102 storing one or more computer programs, a transceiver 1103, an input device 1104, an output device 1105, a sensor 1106, The audio circuit 1107, the Wireless Fidelity (WiFi) module 1108, and the power supply 1109 and the like.
  • the terminal structure shown in FIG. 11 does not constitute a limitation to the terminal, and may include more or less components than those illustrated, or a combination of certain components, or different component arrangements. among them:
  • the transceiver 1103 can be used for receiving and transmitting signals during and after receiving or transmitting information, in particular, receiving downlink information of the base station and then processing it by one or more processors 1101; and transmitting data related to the uplink to the base station.
  • the transceiver 1103 includes, but is not limited to, an antenna, at least one amplifier, a tuner, one or more oscillators, a Subscriber Identity Module (SIM) card, a transceiver, a coupler, and low noise.
  • SIM Subscriber Identity Module
  • Amplifier English: Low Noise Amplifier, referred to as: LNA
  • duplexer etc.
  • the transceiver 1103 can also communicate with the network and other terminals through wireless communication.
  • Wireless communication can use any communication standard or protocol, including but not limited to GSM, General Packet Radio Service (GPRS: GPRS), CDMA, WCDMA, LTE, e-mail, short message service (English: Short) Messaging Service, referred to as: SMS).
  • GSM Global System for Mobile Communications
  • GPRS General Packet Radio Service
  • CDMA Code Division Multiple Access
  • WCDMA Wideband Code Division Multiple Access
  • LTE Long Term Evolution
  • e-mail e-mail
  • SMS short message service
  • the memory 1102 can be used to store programs and modules, and the processor 1101 executes various functional applications and data processing by running computer programs and modules stored in the memory 1102.
  • the memory 1102 can mainly include a storage program area and a storage data area, wherein the storage program area can store an operating system, an application required for at least one function (such as a sound playing function, an image playing function, etc.), and the like; the storage data area can be stored according to The data created by the use of the terminal 110 (such as photographed photos, audio data, video data, etc.) and the like.
  • memory 1102 can include high speed random access memory, and can also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other volatile solid state storage device. Accordingly, memory 1102 can also include a memory controller to provide access to memory 1102 by processor 1101 and input device 1104.
  • Input device 1104 can be used to receive input numeric or character information, as well as to generate keyboard, mouse, joystick, optical or trackball signal inputs related to user settings and function controls.
  • input device 1104 can include touch-sensitive surface 11041 as well as other input devices 11042.
  • Touch-sensitive surface 11041 also referred to as a touch display panel or trackpad, can collect touch operations on or near the user (eg, the user uses a finger, stylus, etc., on any touch-sensitive surface 11041 or on the touch-sensitive surface 11041 The operation near the touch-sensitive surface 11041) and driving the corresponding connecting device according to a preset program.
  • the touch-sensitive surface 11041 can include two portions of a touch detection device and a touch controller.
  • the touch detection device detects the touch orientation of the user, and detects a signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts the touch information into contact coordinates, and sends the touch information.
  • the processor 1101 is provided and can receive commands from the processor 1101 and execute them.
  • the touch sensitive surface 11041 can be implemented in various types such as resistive, capacitive, infrared, and surface acoustic waves.
  • the input device 1104 can also include other input devices 11042.
  • other input devices 11042 may include, but are not limited to, one or more of a physical keyboard, function keys (such as volume control buttons, switch buttons, etc.), trackballs, mice, joysticks, and the like.
  • the output device 1105 can be used to display information entered by the user or information provided to the user and various graphical user interfaces of the terminal 110, which can be composed of graphics, text, icons, video, and any combination thereof.
  • the output device 1105 can include a display panel 11051.
  • the display panel 11051 can be in the form of a liquid crystal display (LCD) or an organic light-emitting diode (English: Organic Light-Emitting Diode, OLED for short). To configure.
  • LCD liquid crystal display
  • OLED Organic Light-Emitting Diode
  • touch-sensitive surface 11041 can cover the display panel 11041 when the touch-sensitive surface 11041 Upon detecting a touch operation on or near it, it is transmitted to the processor 1101 to determine the type of touch event, and then the processor 1101 provides a corresponding visual output on the display panel 11051 depending on the type of touch event.
  • touch-sensitive surface 11041 and display panel 11051 are implemented as two separate components to implement input and input functions, in some embodiments, touch-sensitive surface 11041 can be integrated with display panel 11051 for input. And output function.
  • Terminal 110 may also include at least one type of sensor 1106, such as a light sensor, motion sensor, and other sensors.
  • the light sensor may include an ambient light sensor and a proximity sensor, wherein the ambient light sensor may adjust the brightness of the display panel 11051 according to the brightness of the ambient light, and the proximity sensor may close the display panel 11051 when the terminal 110 moves to the ear. / or backlight and so on.
  • the gravity acceleration sensor can detect the magnitude of acceleration in each direction (generally three axes), and can detect the magnitude and direction of gravity when stationary, and can be used to identify the attitude of the terminal 110 (such as horizontal and vertical screen switching, Related games, magnetometer attitude calibration), vibration recognition related functions (such as pedometer, tapping), etc.; as well as other sensors such as gyroscopes, barometers, hygrometers, thermometers, infrared sensors, etc., which can be configured in the terminal 110, here No longer.
  • An audio circuit 1107, a speaker 11071, and a microphone 11072 can provide an audio interface between the user and the terminal 110.
  • the audio circuit 1107 can transmit the converted electrical data of the received audio data to the speaker 11071, and convert it into a sound signal output by the speaker 11071; on the other hand, the microphone 11072 converts the collected sound signal into an electrical signal, and the audio circuit 1107 After receiving, it is converted into audio data, and then processed by the audio data output processor 1101, transmitted to the terminal, for example, via the transceiver 1103, or the audio data is output to the memory 1102 for further processing.
  • the audio circuit 1107 may also include an earbud jack to provide communication of the peripheral earphones with the terminal 110.
  • WiFi is a short-range wireless transmission technology
  • the terminal 110 can help users to send and receive emails, browse web pages, and access streaming media through the WiFi module 1108, which provides wireless broadband Internet access for users.
  • FIG. 11 shows the WiFi module 1108, it can be understood that it does not belong to the essential configuration of the terminal 110, and may be omitted as needed within the scope of not changing the essence of the invention.
  • the processor 1101 is the control center of the terminal 110, connecting various portions of the entire terminal 110 using various interfaces and lines, by running or executing computer programs and/or modules stored in the memory 1102, and recalling data stored in the memory 1102.
  • the various functions and processing data of the terminal 110 are executed to perform overall monitoring of the terminal 110.
  • the processor 1101 may include one or more
  • the processor 1101 can integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, an application, etc., and the modem processor mainly processes wireless communication. It can be understood that the above modem processor may not be integrated into the processor 1101.
  • the terminal 110 further includes a power source 1109 (such as a battery) for supplying power to the various components.
  • the power source can be logically connected to the processor 1101 through the power management system to implement functions such as managing charging, discharging, and power management through the power management system.
  • the power supply 1109 may also include any one or more of a DC or AC power source, a recharging system, a power failure detection circuit, a power converter or inverter, a power status indicator, and the like.
  • the terminal 110 may further include a camera, a Bluetooth module, and the like, and details are not described herein again.
  • the processor 1101 is configured to call a data transfer program stored in the memory 1102 (non-volatile memory) and perform the following operations:
  • the processor 1101 generates a first application layer message, where the first application layer message is an MQTT-SN message;
  • the processor 1101 sends a first application layer message to the application server by using the first gateway; where the first application layer message does not include the terminal identifier field, or the first application layer message includes the terminal identifier field, and the length of the terminal identifier field is less than or equal to the pre- Set the length.
  • the processor 1101 before the processor 1101 generates the first application layer message, the processor 1101 is further configured to:
  • the transceiver 1103 And sending, by the transceiver 1103, an attach request message to the MME, where the attach request message includes an application layer identifier and data type indication information of the terminal, where the data type indication information is used to indicate that the message sent by the terminal is an MQTT-SN message;
  • the processor 1101 receives the attach response message sent by the MME through the transceiver 1103, where the attach response message is used to indicate that the bearer has been successfully established for the terminal.
  • terminal 110 described in the embodiment of the present invention may be used to perform the steps of the terminal in the embodiment shown in FIG. 3 or FIG. 5 or FIG. 6, and details are not described herein again.
  • FIG. 12 is a schematic structural diagram of another gateway according to an embodiment of the present invention. As shown in FIG. 12, the gateway is a first gateway, and the first gateway 120 includes: a first receiving unit 1201, a generating unit 1202, and a first sending unit 1203, where
  • the first receiving unit 1201 is configured to receive a first application layer message sent by the terminal to the application server, where The first application layer message is an MQTT-SN message;
  • the generating unit 1202 is configured to: if the first application layer message received by the first receiving unit 1201 includes a terminal identifier field, generate a second application layer message according to the first application layer message; or, if the first receiving unit 1201 receives the first An application layer message includes a terminal identifier field, and the length of the terminal identifier field is less than or equal to a preset length, and generates a second application layer message according to the first application layer message.
  • the first sending unit 1203 is configured to send the second application layer message generated by the generating unit 1202 to the application server, where the second application layer message includes an application layer identifier of the terminal, and the application layer identifier is used by the application server to identify the terminal.
  • the first gateway 120 is presented in the form of a functional unit.
  • the "unit” herein may refer to an application specific integrated circuit (ASIC), a processor and memory that executes one or more software or firmware programs, integrated logic circuits, and/or other functions that can be provided. Device.
  • the first gateway 120 can take the form shown in FIG.
  • the first receiving unit 1201 and the first sending unit 1203 may be implemented by the communication interface 1003 in FIG. 10, and the generating unit 1202 may be implemented by the processor 1001 in FIG.
  • the first gateway 120 further includes:
  • the second receiving unit is configured to: before the first receiving unit 1201 receives the first application layer message sent by the terminal to the application server, receive a create session request message sent by the MME, where the session request message includes the application layer identifier and the data type of the terminal.
  • the indication information, the data type indication information is used to indicate that the message sent by the terminal is an MQTT-SN message;
  • An establishing unit configured to establish a bearer for the terminal according to the create session request message received by the second receiving unit
  • the second sending unit is configured to send a create session response message to the MME, where the create session response message is used to indicate that the bearer has been successfully established for the terminal.
  • the first gateway 120 further includes:
  • the encapsulating unit is configured to encapsulate the second application layer message after the generating unit 1202 generates the second application layer message according to the first application layer message, and before the first sending unit 1203 sends the second application layer message to the application server Obtaining a first encapsulated message, where the first encapsulated message includes a network layer identifier of the terminal, and the network layer identifier is used by the second gateway to identify the terminal;
  • the first sending unit 1203 is specifically configured to:
  • the first gateway 120 further includes:
  • a third receiving unit configured to: after the first sending unit 1203 sends the first encapsulated message to the second gateway, receive the second encapsulated message sent by the second gateway, where the second encapsulated message includes the third application sent by the application server to the terminal a layer message and a network layer identifier of the terminal, where the third application layer message is an MQTT-SN message and does not include a terminal identifier field;
  • a decapsulating unit configured to decapsulate the second encapsulated message received by the third receiving unit, to obtain a third application layer message
  • the fourth sending unit is configured to send, according to the network layer identifier of the terminal, the third application layer message obtained by the decapsulation unit to the terminal.
  • first gateway 120 described in the embodiment of the present invention may be used to perform the steps of the first gateway in the embodiment shown in FIG. 3 or FIG. 5 or FIG. 6, and details are not described herein again.
  • FIG. 13 is a schematic structural diagram of another terminal according to an embodiment of the present invention. As shown in FIG. 13, the terminal 130 includes: a generating unit 1301 and a first sending unit 1302, where
  • the generating unit 1301 is configured to generate a first application layer message, where the first application layer message is an MQTT-SN message;
  • the first sending unit 1302 is configured to send, by using the first gateway, the first application layer message generated by the generating unit 1301 to the application server, where the first application layer message does not include the terminal identifier field, or the first application layer message includes the terminal identifier.
  • the field and the length of the terminal identification field are less than or equal to the preset length.
  • the terminal 130 is presented in the form of a functional unit.
  • a "unit” herein may refer to an ASIC, a processor and memory that executes one or more software or firmware programs, integrated logic circuitry, and/or other devices that provide functionality.
  • the terminal 130 can take the form shown in FIG.
  • the generating unit 1301 can be implemented by the processor 1101 in FIG. 11, and the first sending unit 1302 can be implemented by the transceiver 1103 in FIG.
  • the terminal 130 further includes:
  • the second sending unit 1303 is configured to send an attach request message to the MME before the generating unit 1301 generates the first application layer message, where the attach request message includes an application layer identifier and data type indication information of the terminal, where the data type indication information is used to indicate
  • the message sent by the terminal is an MQTT-SN message;
  • the receiving unit 1304 is configured to receive an attach response message sent by the MME, where the attach response message is used to indicate that the bearer has been successfully established for the terminal.
  • terminal 130 described in the embodiment of the present invention may be used to perform the steps of the terminal in the embodiment shown in FIG. 3 or FIG. 5 or FIG. 6, and details are not described herein again.
  • an embodiment of the present invention further provides a computer readable storage medium storing one or more computer programs, wherein the computer readable
  • the storage medium may be a magnetic disk, an optical disk, a ROM, or a RAM.
  • the one or more computer programs are executed on a processor of one or more of the first gateways, and the computer program, when executed, can implement the method embodiment as shown in FIG. 3 or FIG. 5 or FIG. The process corresponding to the first gateway.
  • the one or more computer programs are executed on a processor of one or more of the terminals, and the computer program, when executed, can be implemented in the method embodiment as shown in FIG. 3 or FIG. 5 or FIG. The process of the terminal.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

本发明公开了一种数据传输方法、相关设备及通信系统,该方法包括:第一网关接收终端发送给应用服务器的第一应用层消息,第一应用层消息为MQTT-SN消息;若第一应用层消息不包含终端标识字段,则第一网关根据第一应用层消息生成第二应用层消息;或者,若第一应用层消息包含终端标识字段且终端标识字段的长度小于或等于预设长度,则第一网关根据第一应用层消息生成第二应用层消息;第一网关将第二应用层消息发送给应用服务器,其中,第二应用层消息包括终端的应用层标识,应用层标识用于应用服务器识别终端。采用本发明,可以降低终端传输应用层标识的开销,节省空口传输资源。

Description

一种数据传输方法、相关设备及通信系统 技术领域
本发明涉及通信技术领域,尤其涉及一种数据传输方法、相关设备及通信系统。
背景技术
目前,第三代移动通信系统(英文:3rd Generation,简称:3G)正在开展窄带物联网(英文:Narrow Band Internet of Things,简称:NB-IoT)项目研究,通过架构增强以支持超低复杂度、功率受限、低数据速率的物联网设备,研究如何支持小数据包的有效传输。
现有技术中提供了一种用于传感器网络的消息队列遥测传输(英文:Message Queuing Telemetry Transport for Sensor Network,简称:MQTT-SN)协议,该协议是消息队列遥测传输(英文:Message Queuing Telemetry Transport,简称:MQTT)协议的升级版本,可实现小包数据的传输。具体可参见图1,是MQTT-SN的基本交互流程,其中,Broker是MQTT-SN业务中的服务器,客户端(英文:Client)通过MQTT-SN网关(MQTT-SN Gateway)向对应的Broker发布消息。Client在向Broker发布消息之前,需要建立连接,并且保持心跳,即在逻辑上和Broker保持一条不断线的双向通道。具体的,该过程包括步骤S101至步骤S106,Client首先通过MQTT-SN Gateway向Broker发送建立连接(英文:CONNECT)消息,请求建立连接,Broker通过MQTT-SN Gateway向Client回复连接确认(英文:CONNACK)消息,指示连接已建立,然后Client再通过MQTT-SN Gateway向Broker发送发布(英文:PUBLISH)消息,该PUBLISH消息中携带该Client需要发送的数据。
为了能够使得Broker识别Client,Client在向Broker发送CONNECT消息时,需要携带客户端标识(英文:Client ID),CONNECT消息的格式可参见图2所示,CONNECT消息包含长度(英文:Length)字段、消息类型(英文:MsgType)字段、标识位(英文:Flags)字段、协议标识(英文:Protocol  ID)字段、持续时长(英文:Duration)字段和客户端标识(英文:Client ID)字段。MQTT-SN协议规定Client ID的开销最大可以为23字节,对于传输小数据的MQTT-SN业务来说,Client ID的开销会很大,例如,Client传输的数据为6个字节,而CONNECT消息中携带的Client ID为23个字节,导致在传输客户端标识占用了过多的传输资源,因此,如何在MQTT-SN业务传输过程中降低客户端标识的传输开销是需要解决的技术问题。
发明内容
本发明实施例提供一种数据传输方法、相关设备及通信系统,可以降低终端传输应用层标识的开销,节省空口传输资源。
第一方面,提供了一种数据传输方法,包括:第一网关接收终端发送给应用服务器的第一应用层消息,第一应用层消息为MQTT-SN消息。若第一应用层消息不包含终端标识字段,则第一网关根据第一应用层消息生成第二应用层消息。或者,若第一应用层消息包含终端标识字段且终端标识字段的长度小于或等于预设长度,则第一网关根据第一应用层消息生成第二应用层消息。第一网关将第二应用层消息发送给应用服务器,其中,第二应用层消息包括终端的应用层标识,应用层标识用于应用服务器识别终端。
通过执行上述步骤,终端向第一网关发送的第一应用层消息中不包含终端标识字段或者第一应用层消息包含终端标识字段且终端标识字段的长度小于或等于预设长度,预设长度不足以携带终端的应用层标识,因此第一应用层消息中不携带终端对应的应用层标识。第一网关接收到终端发送的第一应用层消息后,根据第一应用层消息生成携带终端的应用层标识的第二应用层消息,进而将第二应用层消息发送给应用服务器,应用服务器根据接收到的第二应用层消息中携带的应用层标识来识别消息来自哪一个终端,因此可以降低终端传输应用层标识的开销,节省空口传输资源。
结合第一方面,在第一方面的第一种实现方式中,第一网关接收终端发送给应用服务器的第一应用层消息之前,还包括:第一网关接收移动性管理实体(英文:Mobility Management Entity,简称:MME)发送的创建会话请求消息,创建会话请求消息中包括终端的应用层标识和数据类型指示信息,数据类型指 示信息用于指示终端发送的消息为MQTT-SN消息。第一网关根据创建会话请求消息为终端建立承载。第一网关向MME发送创建会话响应消息,创建会话响应消息用于指示第一网关已成功为终端建立承载。
通过执行上述步骤,在数据传输之前,第一网关为终端建立承载,在数据传输过程中,第一网关可以根据承载识别传输的数据来自哪一终端,并且还可以根据承载识别传输的数据包的类型,从而可以在数据传输过程中降低终端传输应用层标识的开销,节省空口传输资源。
结合第一方面,或第一方面的第一种实现方式,在第一方面的第一种实现方式中,第二应用层消息为MQTT消息。第一网关具有协议转换能力,可以根据MQTT-SN消息生成MQTT消息,进而将生成的MQTT消息发送给应用服务器。
结合第一方面,或第一方面的第一种实现方式,在第一方面的第三种实现方式中,第二应用层消息为MQTT-SN消息。在第一网关根据第一应用层消息生成第二应用层消息之后,以及在第一网关将第二应用层消息发送给应用服务器之前,还包括:第一网关对第二应用层消息进行封装,得到第一封装消息,第一封装消息中包括终端的网络层标识,网络层标识用于终端对应的第二网关识别终端。第一网关将第二应用层消息发送给应用服务器,包括:第一网关将第一封装消息发送至第二网关。,以使得第二网关对第一封装消息进行解封装,并根据第二应用层消息生成MQTT消息,并将MQTT消息发送给应用服务器。
通过执行上述步骤,第一网关通过第二网关根据MQTT-SN消息生成MQTT消息,并将MQTT消息发送给应用服务器。用一个专门的第二网关来处理与应用服务器的通信过程可以提高处理效率,同时降低第一网关的复杂度。
结合第一方面的第三种实现方式,在第一方面的第四种实现方式中,第一网关将第一封装消息发送至第二网关之后,还包括:第一网关接收第二网关发送的第二封装消息,第二封装消息包括应用服务器发送给终端的第三应用层消息和终端的网络层标识,第三应用层消息为MQTT-SN消息且不包含终端标识字段。第一网关对第二封装消息进行解封装,得到第三应用层消息和终端的网络层标识。第一网关根据终端的网络层标识,将第三应用层消息发送给终端。
通过执行上述步骤,可以在第一网关与第二网关之间通过终端的网络层标 识来对终端进行寻址。
第二方面,提供了一种数据传输方法,包括:终端生成第一应用层消息,第一应用层消息为MQTT-SN消息。终端通过第一网关向应用服务器发送第一应用层消息。其中第一应用层消息不包含终端标识字段,或者,第一应用层消息包含终端标识字段且终端标识字段的长度小于或等于预设长度。
通过执行上述步骤,终端向第一网关发送的第一应用层消息中不包含终端标识字段或者第一应用层消息包含终端标识字段且终端标识字段的长度小于或等于预设长度,预设长度不足以携带终端的应用层标识,因此第一应用层消息中不携带终端对应的应用层标识。第一网关接收到终端发送的第一应用层消息后,根据第一应用层消息生成携带终端的应用层标识的第二应用层消息,进而将第二应用层消息发送给应用服务器,应用服务器根据接收到的第二应用层消息中携带的应用层标识来识别消息来自哪一个终端,因此可以降低终端传输应用层标识的开销,节省空口传输资源。
结合第二方面,在第二方面的第一种实现方式中,终端生成第一应用层消息之前,还包括:终端向MME发送附着请求消息,附着请求消息中包括终端的应用层标识和数据类型指示信息,数据类型指示信息用于指示终端发送的消息为MQTT-SN消息。终端接收MME发送的附着响应消息,附着响应消息用于指示第一网关已成功为终端建立承载。
通过执行上述步骤,在数据传输之前,终端可以将自身的应用层标识以及待类型发送给第一网关,以使第一网关为终端建立承载,在数据传输过程中,第一网关可以根据承载识别传输的数据来自哪一终端,并且还可以根据承载识别传输的数据包的类型,从而可以在数据传输过程中降低终端传输应用层标识的开销,节省空口传输资源。
第三方面,提供了一种网关,网关为第一网关,第一网关包括处理器、存储器以及通信接口,其中,存储器用于存储程序代码,处理器用于调用程序代码来执行如下操作:
通过通信接口接收终端发送给应用服务器的第一应用层消息,第一应用层消息为用于传感器网络的消息队列遥测传输MQTT-SN消息。若第一应用层消息不包含终端标识字段,处理器根据第一应用层消息生成第二应用层消息。或 者,若第一应用层消息包含终端标识字段且终端标识字段的长度小于或等于预设长度,处理器根据第一应用层消息生成第二应用层消息。通过通信接口将第二应用层消息发送给应用服务器,其中第二应用层消息包括终端的应用层标识,应用层标识用于应用服务器识别终端。
通过执行上述操作,终端向第一网关发送的第一应用层消息中不包含终端标识字段或者第一应用层消息包含终端标识字段且终端标识字段的长度小于或等于预设长度,预设长度不足以携带终端的应用层标识,因此第一应用层消息中不携带终端对应的应用层标识。第一网关接收到终端发送的第一应用层消息后,根据第一应用层消息生成携带终端的应用层标识的第二应用层消息,进而将第二应用层消息发送给应用服务器,应用服务器根据接收到的第二应用层消息中携带的应用层标识来识别消息来自哪一个终端,因此可以降低终端传输应用层标识的开销,节省空口传输资源。
结合第三方面,在第三方面的第一种实现方式中,在处理器通过通信接口接收终端发送给应用服务器的第一应用层消息之前,处理器还用于:通过通信接口接收MME发送的创建会话请求消息,创建会话请求消息中包括终端的应用层标识和数据类型指示信息,数据类型指示信息用于指示终端发送的消息为MQTT-SN消息。处理器根据创建会话请求消息为终端建立承载。处理器通过通信接口向MME发送创建会话响应消息,创建会话响应消息用于指示第一网关已成功为终端建立承载。
通过执行上述操作,在数据传输之前,第一网关为终端建立承载,在数据传输过程中,第一网关可以根据承载识别传输的数据来自哪一终端,并且还可以根据承载识别传输的数据包的类型,从而可以在数据传输过程中降低终端传输应用层标识的开销,节省空口传输资源。
结合第三方面,或第三方面的第一种实现方式,在第三方面的第二种实现方式中,第二应用层消息为MQTT消息。第一网关具有协议转换能力,可以根据MQTT-SN消息生成MQTT消息,进而将生成的MQTT消息发送给应用服务器。
结合第三方面,或第三方面的第一种实现方式,在第三方面的第三种实现方式中,第二应用层消息为MQTT-SN消息。处理器根据第一应用层消息生成 第二应用层消息之后,通过通信接口将第二应用层消息发送给应用服务器之前,处理器还用于:对第二应用层消息进行封装,得到第一封装消息,第一封装消息中包括终端的网络层标识,网络层标识用于第二网关识别终端。
处理器通过通信接口将第二应用层消息发送给应用服务器,包括:处理器通过通信接口将第一封装消息发送至第二网关。,以使得第二网关对第一封装消息进行解封装,并根据第二应用层消息生成MQTT消息,并将MQTT消息发送给应用服务器。
通过执行上述操作,第一网关通过第二网关与应用服务器建立通信连接,实现终端和应用服务器之间的消息交互。用一个专门的第二网关来处理与应用服务器的通信过程可以提高处理效率,同时降低第一网关的复杂度。
结合第三方面的第三种实现方式,在第三方面的第四种实现方式中,处理器通过通信接口将第一封装消息发送至第二网关之后,处理器还用于:通过通信接口接收第二网关发送的第二封装消息,第二封装消息包括应用服务器发送给终端的第三应用层消息和终端的网络层标识,第三应用层消息为MQTT-SN消息且不包含终端标识字段。对第二封装消息进行解封装,得到第三应用层消息和终端的网络层标识。通过通信接口根据终端的网络层标识,将第三应用层消息发送给终端。
通过执行上述操作,可以在第一网关与第二网关之间通过终端的网络层标识来对终端进行寻址。
第四方面,提供了一种终端,终端包括处理器、存储器以及收发器,其中,存储器用于存储程序代码,处理器用于调用程序代码来执行如下操作:
生成第一应用层消息,第一应用层消息为MQTT-SN消息。通过第一网关向应用服务器发送第一应用层消息,其中,第一应用层消息不包含终端标识字段,或者,第一应用层消息包含终端标识字段且终端标识字段的长度小于或等于预设长度。
通过执行上述操作,终端向第一网关发送的第一应用层消息中不包含终端标识字段或者第一应用层消息包含终端标识字段且终端标识字段的长度小于或等于预设长度,预设长度不足以携带终端的应用层标识,因此第一应用层消息中不携带终端对应的应用层标识。第一网关接收到终端发送的第一应用层消 息后,根据第一应用层消息生成携带终端的应用层标识的第二应用层消息,进而将第二应用层消息发送给应用服务器,应用服务器根据接收到的第二应用层消息中携带的应用层标识来识别消息来自哪一个终端,因此可以降低终端传输应用层标识的开销,节省空口传输资源。
结合第四方面,在第四方面的第一种实现方式中,处理器生成第一应用层消息之前,处理器还用于:通过收发器向MME发送附着请求消息,附着请求消息中包括终端的应用层标识和数据类型指示信息,数据类型指示信息用于指示终端发送的消息为MQTT-SN消息。通过收发器接收MME发送的附着响应消息,附着响应消息用于指示第一网关已成功为终端建立承载。
通过执行上述操作,在数据传输之前,终端可以将自身的应用层标识以及待类型发送给第一网关,以使第一网关为终端建立承载,在数据传输过程中,第一网关可以根据承载识别传输的数据来自哪一终端,并且还可以根据承载识别传输的数据包的类型,从而可以在数据传输过程中降低终端传输应用层标识的开销,节省空口传输资源。
第五方面,提供了一种网关,该网关为第一网关,该第一网关包括用于执行上述第一方面,或第一方面任意一种实现方式中所描述的数据传输方法的模块或单元。
第六方面,提供了一种终端,该终端包括用于执行上述第二方面,或第二方面的任意一种实现方式中所描述的数据传输方法的模块或单元。
第七方面,提供了一种通信系统,该通信系统包括网关和终端,其中,网关为上述第三方面或第五方面所述的第一网关,终端为上述第四方面或第六方面所述的终端。
第八方面,提供了一种计算机可读存储介质,该可读存储介质上存储有实现第一方面或第一方面任意一种实现方式所描述的数据传输方法的程序代码,该程序代码包含运行上述数据传输方法的执行指令。
第九方面,提供了一种计算机可读存储介质,该可读存储介质上存储有实现第二方面或第二方面任意一种实现方式所描述的数据传输方法的程序代码,该程序代码包含运行上述数据传输方法的执行指令。
结合上述任意方面,在本发明的一些实现方式中,预设长度为应用层协议 允许的最小长度。
附图说明
为了更清楚地说明本发明实施例的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,下面描述中的附图是本发明的一些实施例。
图1是MQTT-SN的基本交互流程图;
图2是本发明实施例涉及的一种通信系统的架构示意图;
图3是本发明实施例提供的一种数据传输方法的流程示意图;
图4是本发明实施例提供的CONNECT消息的格式示意图;
图5是本发明实施例提供的终端附着过程的信令交互图;
图6是本发明实施例提供的另一种数据传输方法的流程示意图;
图7是本发明实施例提供的封装消息的封装格式的示意图;
图8是本发明实施例提供的封装消息的内容示意图;
图9是本发明实施例提供的CONNACK消息的格式示意图;
图10是本发明实施例提供的一种网关的结构示意图;
图11是本发明实施例提供的一种终端的结构示意图;
图12是本发明实施例提供的另一种网关的结构示意图;
图13是本发明实施例提供的另一种终端的结构示意图。
具体实施方式
本发明的实施方式部分使用的术语仅用于对本发明的具体实施例进行解释,而非旨在限定本发明。下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚地描述。
请参见图2,是本发明实施例涉及的一种通信系统的架构示意图,在图2中,通信系统200中的网元主要包括:终端(英文:User Equipment,简称:UE)、基站、MME、服务网关(英文:Serving Gateway,简称:S-GW)、分组数据网络网关(英文:Packet Data Network Gateway,简称:P-GW)、归属签约用户服务器(英文:Home Subscriber Server,简称:HSS)和应用服务器。其中,该通信系统可以包括但不限于演进分组系统(英文:Evolved Packet  System,简称:EPS)。UE与基站之间的通信接口为Uu接口,基站与MME之间的通信接口为S1-MME接口,基站与S-GW之间的通信接口为S1-U接口,S-GW与P-GW之间的通信接口为S5/S8接口,S-GW与MME之间的通信接口为S11接口,MME与HSS之间的通信接口为S6接口。
其中,UE可以为蜂窝物联网(英文:Cellular IoT,简称:CIoT)中的UE,针对MQTT-SN协议来说,UE指客户端。
基站可以为CIoT中的基站(英文:Base Station,简称:BS),也可以为长期演进技术(英文:Long Term Evolution,简称:LTE)网络中的演进型基站(英文:evolved Node B,简称:eNB),还可以是未来5G系统中的基站等等。UE与基站之间采用某种空口技术相互通信。空口技术可包括:4G(如FDD LTE、TDD LTE)以及未来即将面市的5G系统等。
MME的主要功能包括接入控制(包括安全和许可控制)、移动性管理(跟踪UE的位置)、附着与去附着、会话管理功能(包括对分组核心演进(英文:Evolved Packet Core,简称:EPC)承载的建立、修改和释放)、S-GW与P-GW的选择等。
S-GW的主要功能包括:在MME的控制下进行数据包的路由和转发,即将接收到的用户数据转发给指定的PGW网元,又因为接收和发送均为通用数据传输平台(英文:General Data Transfer Platform,简称:GTP)协议数据包,从而也不需要对数据包进行格式转化,简单来讲SGW就是GTP协议数据包的双向传输通道。
P-GW的主要功能包括基于用户的包过滤功能、合法侦听功能、UE的IP地址分配功能、在上/下行链路中进行数据包传输层标记、进行上/下行业务等级计费以及业务级门控、进行基于业务的上/下行速率的控制等。另外,P-GW还提供上/下行链路承载绑定和上行链路绑定校验功能。
此外,在现有功能的基础上,本发明中的S-GW/P-GW还支持MQTT-SN业务的代理(Proxy)功能,Proxy功能可以将UE(相当于MQTT-SN业务中的Client)发送的CONNECT消息中的Client ID字段设置或替换为UE的应用层标识,终端的应用层标识包括以下标识中的任意一种:国际移动用户标志(英文:International Mobile Subscriber IDentity,简称:IMSI)、国际移动用户综合 业务数字网(英文:Integrated Services Digital Network,简称:ISDN)/公共交换电话网络(英文:Public Switched Telephone Network,简称:PSTN)号码(Mobile Subscriber International ISDN/PSTN Number,简称:MSISDN)IMSI、MSISDN或其他外部标识(External ID)等,其中,IMSI、MSISDN是移动网络内部定义和使用的标识,其组成和长度都是标准预先定义的,有标准的限制。外部标识,即由移动网络外部定义的UE标识,标识的组成内容和长度可以由应用服务器根据业务需要自定义,没有一定的限制。UE在空口传输CONNECT消息时,只需要传输一字节的Client ID(满足Client ID必选的协议要求),或者在Client ID字段中不携带任何内容,从而降低消息长度,节省空口传输资源。
另外,该通信系统还可以包括MQTT-SN业务中的MQTT-SN Gateway(即本发明中的第二网关),S-GW/P-GW还支持MQTT-SN业务中的转发器(英文:Forwarder)功能,S-GW/P-GW完成MQTT-SN消息(例如CONNECT消息、注册(英文:REGISTER)消息等)的转发功能,具体的,S-GW/P-GW对UE和MQTT-SN Gateway之间传输的MQTT-SN消息进行封装,并将封装后得到的封装消息转发给MQTT-SN Gateway,并且可以接收MQTT-SN Gateway发送的下行MQTT-SN封装消息并把解封装后的MQTT-SN消息发送给UE。需要说明的是,UE与MQTT-SN Gateway之间可以采用MQTT-SN协议进行通信,MQTT-SN Gateway与Broker之间采用MQTT进行通信,MQTT-SN Gateway可完成MQTT-SN协议和MQTT协议的转换。
针对MQTT-SN业务来说,MQTT-SN Gateway的选择由S-GW/P-GW完成,UE发送MQTT-SN消息无需MQTT-SN Gateway的地址信息,因此无需支持MQTT-SN Gateway的发现(英文:Discovery)过程,节省Discovery过程广播包对网络资源的消耗。
MQTT-SN Gateway可以为应用服务器提供MQTT接口、高级消息队列协议(英文:Advanced Message Queuing Protocol,简称:AMQP)接口或超文本传输协议(英文:Hyper Text Transfer Protocol,简称:HTTP)接口。可选的,MQTT-SN Gateway可以内置于应用服务器中,当MQTT-SN Gateway内置于应用服务器时,MQTT-SN Gateway和应用服务器之间可采用内部接口。 MQTT-SN Gateway可通过业务创建环境功能(英文:Service Creation Environment Function,简称:SCEF)获取UE Reachability事件后来发送下行MQTT-SN消息给UE。可选的,MQTT-SN Gateway还可以独立部署或者内置到PGW部署。
HSS主要用于存储用户签约信息的服务器,主要负责管理用户的签约数据及移动用户的位置信息。
应用服务器可以包括但不限于:MQTT-SN业务中的Broker。
请参见图3,是本发明实施例提供的一种数据传输方法的流程示意图,该方法包括但不限于步骤S301至S304,各个步骤的详细描述如下。
S301、终端生成第一应用层消息,第一应用层消息为MQTT-SN消息。
本发明实施例中,第一应用层消息为终端通过第一网关发给应用服务器的消息。第一应用层消息包括但不限于MQTT-SN消息。
为了节省传输第一应用层消息的空口开销,终端生成的第一应用层消息中不包含终端标识字段,或者第一应用层消息中包含终端标识字段并且终端标识字段的长度小于或等于预设长度。该预设长度可以为应用层协议允许的最小长度,也可以通过人机交互接口配置给终端的长度,不予限制。针对MQTT-SN消息来说,该应用层消息具体指MQTT-SN协议。
以MQTT-SN协议来说,若第一应用层消息为CONNECT消息,则CONNECT消息中的终端标识字段为ClientID,MQTT-SN协议中规定ClientID的长度为1-23个字节,最小长度为1个字节,则上述预设长度可以设置为1个字节。在本发明实施例中,CONNECT消息中可以不携带ClientID字段,也即是说,CONNECT消息中只包含Length字段、MsgType字段、Flags字段、Protocol ID字段和Duration字段。因此,CONNECT消息共占用6个字节,由此节约的开销最大为23/23+6=79.3%。或者,CONNECT消息中携带1字节长度的ClientID字段,终端可以在该ClientID字段中添加1字节长度的任意内容,由此节约的开销最大为22/23+6=75.9%。
S302、终端向第一网关发送第一应用层消息。
具体的,第一网关可以为不同的终端建立不同的承载来传输数据。终端在 向第一网关发送第一应用层消息时,可以采用该终端的专用承载来传输第一应用层消息。相应地,第一网关通过识别终端发送第一应用层消息所采用的承载来识别终端。
因此,在第一应用层消息中就可以不用携带终端的标识,节省空口开销。
此外,第一网关还可以结合终端传输的消息类型建立不同的承载。因此,终端在向第一网关发送第一应用层消息时,可以采用MQTT-SN消息对应的专用承载来传输第一应用层消息。相应地,第一网关通过识别终端发送第一应用层消息所采用的承载来识别消息的类型。
S303、第一网关接收终端发送的第一应用层消息,若第一应用层消息不包含终端标识字段,则根据第一应用层消息生成第二应用层消息;或者,若第一应用层消息包含终端标识字段且终端标识字段的长度小于或等于预设长度,则第一网关根据所述第一应用层消息生成第二应用层消息。
其中,第一应用层消息为MQTT-SN消息。
具体的,第一网关可以根据终端发送第一应用层消息所采用的承载来确定出第一应用层消息为MQTT-SN消息,还可以根据第一应用层消息的消息识别信息来确定第一应用层消息为MQTT-SN消息。例如,消息识别信息为MQTT-SN消息指示信息,或者,第一应用层消息的消息类型。
若第一网关确定出第一应用层消息为MQTT-SN消息,第一网关会对第一应用层消息进行应用层解析,当解析出第一应用层消息中不包含终端标识字段,或者,第一应用层消息中包含终端标识字段且终端标识字段的长度小于或等于预设长度时,第一网关确定第一应用层消息未携带终端的标识,因此为了标识该应用层消息,第一网关生成携带终端的应用层标识的第二应用层消息。可选的,第一网关生成第二应用层消息的方式具体为:将终端的应用层标识添加到第一应用层消息中,并进行协议格式转换,得到第二应用层消息,例如,可参见图4,由于ClientID字段是在CONNECT消息的最后,占用字节索引值6-n的位置,因此第一网关可以将UE的应用层标识,如IMSI,添加在CONNECT消息的字节索引值5之后,或者将字节索引值5之后的内容替换为UE的IMSI。同时,第一网关还需要更新字节索引值0对应的消息长度。由此节约的开销为:如果不携带ClientID字段,节约的开销最大为23/23+6=79.3%。如果ClientID 字段的长度为1个字节长度,且携带1字节的任意字符串,节约的开销最大为22/23+6=75.9%。
例如,第一网关为S-GW或P-GW,以P-GW为例进行说明,P-GW接收到UE发送的CONNECT消息后,若解析出CONNECT消息中不包含Client ID字段,P-GW在CONNECT消息的最后添加Client ID字段,并将Client ID字段设置成UE对应的标识,例如IMSI。若解析出CONNECT消息中携带Client ID字段,但是Client ID字段只携带了一个字节的任意字符,P-GW将Client ID字段替换成UE对应的标识,例如IMSI。
S304、第一网关将第二应用层消息发送给应用服务器。
本发明实施例中,第一网关预先记录有终端的应用层标识与应用服务器的映射表,根据终端的应用层标识可以确定终端对应的应用服务器,进而将添加了终端的应用层标识的第二应用层消息发送给终端对应的应用服务器,应用服务器接收到第二应用层消息后,通过第二应用层消息中包含的应用层标识来识别该应用层消息来自哪一个终端。
需要说明的是,终端与第一网关之间采用的是MQTT-SN协议,第一网关与应用服务器之间采用的是MQTT协议。
在第一种实现方式中,第一网关具备协议转换能力,第一网关可以根据终端发送的MQTT-SN消息生成相应的MQTT消息,进而将生成的MQTT消息发送给应用服务器。第一网关还可以根据应用服务器发送的MQTT消息生成相应的MQTT-SN消息,再将生成的MQTT-SN消息发送给终端。在本实施例中,第一网关根据终端发送的第一应用层消息生成符合MQTT协议格式的MQTT消息,该MQTT消息携带终端的应用层标识,第一网关再将MQTT消息发给应用服务器。需要说明的是,MQTT-SN消息和MQTT消息中携带的消息字段不同。例如,在MQTT-SN消息中包含协议ID(Protocol ID)字段,对应到MQTT消息,该字段对应为协议名称(Protocol Name)字段。
例如,如果UE发送的第一应用层消息为不携带Client ID的CONNECT消息,那么第一网关在CONNECT消息中添加Client ID字段,并将Client ID字段设置为UE的标识,例如IMSI。再对添加了Client ID字段的CONNECT消息进行协议转换,例如,将CONNECT消息中的Protocol ID字段修改为 Protocol Name字段等等,最终得到的CONNECT消息即为第二应用层消息。
可选的,应用服务器接收到第一网关发送的第二应用层消息后,向第一网关发送针对该终端的应用层消息,由于应用服务器与第一网关之间可以针对不同的终端建立不同的传输控制协议(英文:Transfer Control Protocol,简称:TCP)连接,因此可以通过传输数据所采用的TCP连接来识别终端,因此应用服务器发送的应用层消息中可以不携带终端的应用层标识,第一网关根据应用服务器发送该应用层消息采用的TCP连接来获知该应用层消息是针对哪一个终端的,进而在接收到该应用层消息之后,将该应用层消息发送给该终端。具体的,应用服务器发给第一网关的应用层消息为MQTT消息,第一网关需要对该应用层消息进行协议转换,并将生成的MQTT-SN消息发送给终端。
例如,如果第一网关发给应用服务器的第二应用层消息是CONNECT消息,那么应用服务器返回的消息为CONNACK消息,返回的CONNACK消息为MQTT协议格式。第一网关需要对接收到的CONNACK消息进行协议转换,转换为符合MQTT-SN协议格式的CONNACK消息,并将生成的CONNACK消息发送给相应的终端。具体的,第一网关存储有不同终端各自对应的承载的标识,采用终端对应的承载将CONNACK消息发送给相应的终端。
或者,应用服务器发送给第一网关的应用层消息中也可以携带终端的应用层标识,第一网关接收到应用服务器发送的应用层消息之后,根据该应用层消息中携带的应用层标识来获知该应用层消息是针对哪一个终端的,并且将该应用层消息中携带的终端的应用层标识删除,再将删除了应用层标识的应用层消息发送给终端,以节省空口传输资源。
在第二种实现方式中,第一网关不具备协议转换能力,那么需要额外的第二网关来进行MQTT-SN协议和MQTT协议的转换。第一网关根据终端发送的第一应用层消息生成携带终端的应用层标识的MQTT-SN消息,再将该MQTT-SN消息发送给第二网关进行协议转换,第二网关接收第一网关发送的MQTT-SN消息,并将接收到的MQTT-SN消息进行格式转换,生成符合MQTT协议格式的MQTT消息,再将MQTT消息发给应用服务器。
可选的,在步骤S302终端在向第一网关发送第一应用层消息之前,上述方法还包括:终端发起附着过程,该附着过程可参见图5所示,主要包括以下 步骤S501-S505,各个步骤的详细描述如下:
S501、终端向MME发送附着请求消息,附着请求消息中携带终端的应用层标识和数据类型指示信息,该数据类型指示信息用于指示终端发送的消息为MQTT-SN消息。
该数据类型指示信息还可以指示终端发送的数据包为小数据包。
S502、MME向第一网关发送创建会话请求消息,该创建会话请求消息中包括终端的应用层标识和数据类型指示信息。
MME接收到终端发送的附着请求消息后,解析该附着请求消息,从该附着请求消息中解析到终端的应用层标识和数据类型指示信息,进而向第一网关发送创建会话请求消息以请求为终端建立承载。
S503、第一网关接收MME发送的创建会话请求消息,根据创建会话请求消息,为终端建立承载。
第一网关接收到MME发送的创建会话请求消息后,解析该创建会话请求消息,从该创建会话请求消息中解析到终端的应用层标识和数据类型指示信息,因此可以获知终端需要发送的消息为MQTT-SN消息,进而为终端创建承载,后续在数据传输过程中,终端通过该承载传输数据时,第一网关即可获知该终端传输的为MQTT-SN消息,并且通过该承载第一网关还可以获知传输的数据包来自哪一个终端。第一网关还可以根据数据类型指示信息确定出不需要为终端分配IP地址,因此还可以节省IP地址资源。
S504、第一网关向MME发送创建会话响应消息,创建会话响应消息用于指示已成功为终端建立承载。
可选的,创建会话响应消息中可以携带数据类型指示信息,指示创建的承载对应的数据类型为MQTT-SN数据类型。
S505、MME向终端发送附着响应消息,附着响应消息用于指示已成功为终端建立承载。
可选的,附着接受消息中可以携带数据类型指示信息,指示创建的承载对应的数据类型为MQTT-SN数据类型。
第一网关为终端建立了承载之后,就可以通过终端发送第一应用层消息所采用的承载来识别该消息是来自于哪个终端,因此,终端在发送第一应用层消 息时就可以不携带终端的应用层标识,因此可以节省空口传输资源。
第一网关可以为终端分配一个第二网关,通过该第二网关将第二应用层消息转发给应用服务器,具体的,第一网关可以在接收到终端发送的第一应用层消息之后为终端分配一个第二网关,也可以是在终端的附着过程中为终端分配一个第二网关,本发明实施例不作具体限定。具体的,结合图3所实施例,第一网关与第二网关之间的处理过程可参见图6,主要包括以下步骤S601-S604,各个步骤的详细描述如下:
S601、第一网关对生成的第二应用层消息进行封装,得到第一封装消息,第一封装消息中包括第二应用层消息和终端的网络层标识,网络层标识用于第二网关识别终端。
其中,网络层标识包括但不限于:S5/S8接口的隧道端点标识符(英文:Tunnel Endpoint ID,简称:TEID);
S602、第一网关将第一封装消息发送至第二网关。
S603、第二网关接收第一网关发送的第一封装消息,并对第一封装消息进行解封装,得到第二应用层消息和终端的网络层标识。
第二网关还可以对第二应用层消息进行应用层解析,从而获取终端的应用层标识,第二网关根据预先存储的终端的标识与应用服务器的映射表,可以确定出该终端所对应的应用服务器,进而与该应用服务器建立一对应该终端的TCP连接,并将终端的应用层标识、终端的网络层标识以及TCP标识进行绑定,第二网关根据上述三个标识中的任意一个标识就可以识别出终端,因此在后续传输过程中,第一网关只需要将封装有终端的网络层标识和应用层消息的封装消息发给第二网关,第二网关就可以根据终端的网络层标识识别出该应用层消息来自哪个终端,而应用服务器只需要采用终端对应的TCP连接将应用层消息发给第二网关,第二网关就可以根据TCP连接识别出该应用层消息是对应哪个终端的。其中,终端的网络层标识用于在第一网关与第二网关之间识别终端,以实现非IP条件下对终端的寻址和路由。第二网关存储的终端的标识与应用服务器的映射表可以是第一网关预先发给第二网关的。
S604、第二网关根据第二应用层消息生成MQTT消息。
需要说明的是,第二网关具备协议转换能力,第一网关发给第二网关的第 二应用层消息是MQTT-SN消息,第二网关接收第一网关发送的MQTT-SN消息,并根据该MQTT-SN消息生成符合MQTT协议格式的MQTT消息。
S605、第二网关将MQTT消息发送给应用服务器。
第二网关根据预先存储的终端的标识与应用服务器的映射表来确定该终端对应哪一个应用服务器,进而将MQTT消息发送给应用服务器。
需要说明的是,第二网关的作用是与终端对应的应用服务器建立TCP连接,实现终端和应用服务器之间的消息交互。用一个专门的第二网关来处理TCP连接可以提高处理效率,同时降低第一网关的复杂度。
具体的,以P-GW为例进行说明,P-GW支持MQTT-SN转发器功能,第二网关为MQTT-SN Gateway,P-GW将CONNECT消息中的Client ID字段设置成UE的IMSI后,P-GW对CONNECT消息进行封装,得到封装消息,该封装消息的封装格式可以参见图7,在图7中,封装消息包含Length字段、MsgType字段、控制符(英文:Ctrl)字段、无线节点标识(英文:Wireless Node ID)字段和MQTT-SN消息(英文:MQTT-SN Message)字段,其中,Wireless Node ID标识封装消息的来源,例如,如果封装消息是由第一网关发送给第二网关的,那么Wireless Node ID为第一网关的ID,如果封装消息是由第二网关发送给第一网关的,那么Wireless Node ID为第二网关的ID。封装消息的各个字段的描述可参见图8。然后P-GW将该封装消息发送给第二网关,第二网关对该封装消息进行解封装,得到包含UE的IMSI的CONNECT消息,第二网关可以根据UE的网络层标识来识别该CONNECT消息是由哪个UE发送的,进而将该CONNECT消息发送给该UE对应的MQTT Broker。
需要说明是的,如果每个第一网关对应多个第二网关,且每个第二网关又对应多个第一网关的话,可以按照现有的封装格式,用Wireless Node ID字段来标识该封装消息是来自哪一个网关,并且在现有的封装格式的基础上,再增加一位来指示终端的网络层标识。或者,如果每个第一网关对应唯一的一个第二网关,且每个第二网关又唯一对应一个第一网关的话,可以不用指示封装消息的来源,因此即可使用Wireless Node ID标识来携带终端的网络层标识,无需再增加一位指示位,节省传输资源。
可选的,应用服务器收到第二应用层消息后,向第二网关发送针对该终端 的第三应用层消息。由于服务器与第二网关之间通过TCP连接可以标识终端,因此第三应用层消息中可以不携带终端的应用层标识。第二网关根据应用服务器发送第三应用层消息时采用的TCP连接来获知该第三应用层消息是针对哪一个终端的。第二网关在接收到该第三应用层消息之后,对第三应用层消息进行封装,得到第二封装消息。第二封装消息中包括第三应用层消息和终端的网络层标识。第二网关将第二封装消息发送给第一网关。第一网关接收第二封装消息,对第二封装消息进行解封装,得到第三应用层消息和终端的网络层标识和终端的网络层标识。进而根据终端的网络层标识将第三应用层消息发送给终端。由于第一网关为不同的终端建立了不同的承载,此处的网络层标识即为隧道标识,或者承载标识,第一网关根据该承载标识获知第三应用层消息对应哪一个终端,并采用该终端对应的承载来传输第三应用层消息。
需要说明的是,应用服务器发给第二网关的应用层消息为MQTT消息,第二网关对该MQTT消息进行协议转换,生成MQTT-SN消息,并将转换后的MQTT-SN消息进行封装,得到第三封装消息,并将第三封装消息发给第一网关。
具体的,第一网关为P-GW,P-GW支持MQTT-SN转发器功能,第二网关为MQTT-SN Gateway,MQTT-SN Gateway与UE对应的Broker建立TCP连接,进而将携带有UE的IMSI的CONNECT消息发送给该Broker,Broker根据CONNECT消息中UE的IMSI来识别该消息来自哪一个UE,进而向MQTT-SN Gateway发送针对该UE的CONNACK消息,CONNACK消息的格式可参见图9所示,CONNACK消息中包含Lenth字段、MsgType字段和返回码(英文:ReturnCode)字段,CONNACK消息中不携带UE的IMSI,MQTT-SN Gateway根据Broker发送CONNACK消息采用的TCP连接来识别该CONNACK消息是针对哪一个UE的,在接收到该CONNACK消息之后,对该CONNACK消息进行封装,封装消息的格式可参见图7所示,其中,封装消息包含Wireless Node ID,MQTT-SN Gateway将Wireless Node ID设置为UE的网络层标识,如S5/S8接口的TEID,然后将该封装消息发送给P-GW,P-GW对该封装消息进行解封装,得到不包含UE的IMSI的CONNACK消息和UE的网络层标识,P-GW根据UE的网络层标识来识别该CONNACK消息是针对 哪个UE的,进而将该CONNACK消息发送给该UE。
或者,第三应用层消息中也可以包括终端的应用层标识,第二网关根据应用服务器发送第三应用层消息时采用的TCP连接的标识,或者根据第三应用层消息中携带的终端的应用层标识来获知该第三应用层消息是针对哪一个终端的,进而在接收到该第三应用层消息之后,对第三应用层消息进行封装,得到第二封装消息,第二封装消息中包括第三应用层消息和终端的网络层标识,进而将第二封装消息发送给第一网关,第一网关接收第二封装消息,对第二封装消息进行解封装,得到第三应用层消息和终端的网络层标识和终端的网络层标识,进而将第三应用层消息中携带的终端的应用层标识删除,再根据终端的网络层标识将删除了应用层标识的第三应用层消息发送给终端,以节省空口传输资源。
综上所述,终端向第一网关发送的第一应用层消息中不包含终端标识字段或者第一应用层消息包含终端标识字段且终端标识字段的长度小于或等于预设长度,预设长度不足以携带终端的应用层标识,因此第一应用层消息中不携带终端对应的应用层标识。第一网关接收到终端发送的第一应用层消息后,根据第一应用层消息生成携带终端的应用层标识的第二应用层消息,进而将第二应用层消息发送给应用服务器,应用服务器根据接收到的第二应用层消息中携带的应用层标识来识别消息来自哪一个终端,因此可以降低终端传输应用层标识的开销,节省空口传输资源。
为了便于更好地实施本发明实施例的数据传输方法,本发明还提供了用于实现实施方法的相关设备。
请参见图10,是本发明实施例提供的一种网关的结构示意图。如图10所示,该网关为第一网关,该第一网关可以为P-GW或S-GW,第一网关100包括处理器1001、存储器1002、通信接口1003和总线1004,其中处理器1001、存储器1002和通信接口1003可以通过总线或其他方式连接,图10以通过总线1004连接为例。
可选的,第一网关100还可以包括电源模块1005。
其中,处理器1001可以是通用处理器,例如中央处理器(英文:Central Processing Unit,简称:CPU),处理器1001还可包括硬件芯片,上述硬件芯片 可以是以下一种或多种的组合:专用集成电路(英文:Application Specific Integrated Circuit,简称:ASIC)、现场可编程逻辑门阵列(英文:Field Programmable Gate Array,简称:FPGA),复杂可编程逻辑器件(英文:Complex Programmable Logic Device,简称:CPLD)。处理器1001可处理通过通信接口1003接收到的数据。处理器1001还可处理将被发送到通信接口1003以进行有线传输的数据。
存储器1002用于存储程序代码和数据,存储器1002可以包括易失性存储器(英文:Volatile Memory),例如随机存取存储器(英文:Random Access Memory,简称:RAM);存储器也可以包括非易失性存储器(英文:Non-Volatile Memory),例如只读存储器(英文:Read-Only Memory,简称:ROM)、快闪存储器(英文:Flash Memory)、硬盘(英文:Hard Disk Drive,简称:HDD)或固态硬盘(英文:Solid-State Drive,简称:SSD);存储器1002还可以包括上述种类的存储器的组合。存储器1002通过总线1004与处理器1001相连接。具体的,在本发明实施例中,存储器1002具体存储数据传输程序代码以及上述实施例中所描述的预设长度、终端的应用层标识等数据。
通信接口1003用于第一网关100与终端(例如,2G中的移动台(英文:Mobile Station,简称:MS)、3G和4G中的UE以及未来5G网络中的终端等)进行数据通信。第一网关100还可以使用通信接口1003与应用服务器进行通信。具体实现中,如果第一网关100为PGW,通信接口1003可以是S5/S8接口,PGW通过S5/S8接口与SGW有线连接,SGW通过S1-U接口与基站有线连接,基站通过Uu接口与终端无线连接,从而实现PGW与终端进行数据通信。如果第一网关100为SGW,通信接口1003可以是S1-U接口,SGW通过S1-U接口与基站有线连接,基站通过Uu接口与终端无线连接,从而实现SGW与终端进行数据通信。通信接口1003还可以是以太网接口,第一网关100使用以太网接口与应用服务器进行通信。
总线1004可以是工业标准体系结构(英文:Industry Standard Architecture,简称:ISA)总线、外部设备互连(英文:Peripheral Component Interconnect,简称:PCI)总线、扩展标准体系结构(英文:Extended Industry Standard Architecture,简称:EISA)总线、集成电路总线(英文:Inter Integrated Circuit, 简称:IIC)等。
电源模块1005用于为第一网关100的各个模块供电。
本发明实施例中,处理器1001还用于调用存储器1002中的数据传输程序代码,执行如下操作:
处理器1001通过通信接口1003接收终端发送给应用服务器的第一应用层消息,第一应用层消息为用于传感器网络的消息队列遥测传输MQTT-SN消息;
若第一应用层消息不包含终端标识字段,处理器1001根据第一应用层消息生成第二应用层消息;或者,若第一应用层消息包含终端标识字段且终端标识字段的长度小于或等于预设长度,处理器1001根据第一应用层消息生成第二应用层消息;
处理器1001将第二应用层消息发送给应用服务器,其中第二应用层消息包括终端的应用层标识,应用层标识用于应用服务器识别终端。
可选的,在处理器1001通过通信接口1003接收终端发送给应用服务器的第一应用层消息之前,处理器1001还用于:
通过通信接口1003接收MME发送的创建会话请求消息,创建会话请求消息中包括终端的应用层标识和数据类型指示信息,数据类型指示信息用于指示终端发送的消息为MQTT-SN消息;
处理器1001根据创建会话请求消息为终端建立承载;
处理器1001通过通信接口1003向MME发送创建会话响应消息,创建会话响应消息用于指示已成功为终端建立承载。
可选的,第二应用层消息为MQTT消息。
可选的,第二应用层消息为MQTT-SN消息;在处理器1001根据第一应用层消息生成第二应用层消息之后,以及在处理器1001通过通信接口1003将第二应用层消息发送给应用服务器之前,处理器1001还用于:
对第二应用层消息进行封装,得到第一封装消息,第一封装消息中包括终端的网络层标识,网络层标识用于第二网关识别终端;
处理器1001通过通信接口1003将第二应用层消息发送给应用服务器,包括:
处理器1001通过通信接口1003将第一封装消息发送至第二网关,以使得 第二网关对第一封装消息进行解封装,并根据第二应用层消息生成MQTT消息,并将MQTT消息发送给应用服务器。
可选的,在处理器1001通过通信接口1003将第一封装消息发送至第二网关之后,处理器1001还用于:
处理器1001通过通信接口1003接收第二网关发送的第二封装消息,第二封装消息包括应用服务器发送给终端的第三应用层消息和终端的网络层标识,第三应用层消息为MQTT-SN消息且不包含终端标识字段;
处理器1001对第二封装消息进行解封装,得到第三应用层消息和终端的网络层标识;
处理器1001根据终端的网络层标识,将第三应用层消息发送给终端。
需要说明的是,本发明实施例所描述的第一网关100可以用于执行图3或图5或图6所示实施例中第一网关的步骤,此处不再赘述。
请参见图11,是本发明实施例提供的一种终端的结构示意图。如图11所示的终端110包括:包括有一个或多个处理核心的处理器1101、存储有一个或多个计算机程序的存储器1102、收发器1103、输入装置1104、输出装置1105、传感器1106、音频电路1107、无线保真(英文:Wireless Fidelity,简称:WiFi)模块1108、以及电源1109等部件。本领域技术人员可以理解,图11中示出的终端结构并不构成对终端的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。其中:
收发器1103可用于收发信息或通话过程中,信号的接收和发送,特别地,将基站的下行信息接收后,交由一个或多个处理器1101处理;另外,将涉及上行的数据发送给基站。通常,收发器1103包括但不限于天线、至少一个放大器、调谐器、一个或多个振荡器、用户身份模块(英文:Subscriber Identity Module,简称:SIM)卡、收发信机、耦合器、低噪声放大器(英文:Low Noise Amplifier,简称:LNA)、双工器等。此外,收发器1103还可以通过无线通信与网络和其他终端进行通信。无线通信可以使用任一通信标准或协议,包括但不限于GSM、通用分组无线服务(英文:General Packet Radio Service,简称:GPRS)、CDMA、WCDMA、LTE、电子邮件、短消息服务(英文:Short Messaging  Service,简称:SMS)等。
存储器1102可用于存储程序以及模块,处理器1101通过运行存储在存储器1102的计算机程序以及模块,从而执行各种功能应用以及数据处理。存储器1102可主要包括存储程序区和存储数据区,其中,存储程序区可存储操作系统、至少一个功能所需的应用程序(比如声音播放功能、图像播放功能等)等;存储数据区可存储根据终端110的使用所创建的数据(比如拍摄的照片、音频数据、视频数据等)等。此外,存储器1102可以包括高速随机存取存储器,还可以包括非易失性存储器,例如至少一个磁盘存储器件、闪存器件、或其他易失性固态存储器件。相应地,存储器1102还可以包括存储器控制器,以提供处理器1101和输入装置1104对存储器1102的访问。
输入装置1104可用于接收输入的数字或字符信息,以及产生与用户设置以及功能控制有关的键盘、鼠标、操作杆、光学或者轨迹球信号输入。具体地,输入装置1104可包括触敏表面11041以及其他输入设备11042。触敏表面11041,也称为触摸显示面板或者触控板,可收集用户在其上或附近的触摸操作(比如用户使用手指、触笔等任何适合的物体或附件在触敏表面11041上或在触敏表面11041附近的操作),并根据预先设定的程式驱动相应的连接装置。可选的,触敏表面11041可包括触摸检测装置和触摸控制器两个部分。其中,触摸检测装置检测用户的触摸方位,并检测触摸操作带来的信号,将信号传送给触摸控制器;触摸控制器从触摸检测装置上接收触摸信息,并将它转换成触点坐标,再送给处理器1101,并能接收处理器1101发来的命令并加以执行。此外,可以采用电阻式、电容式、红外线以及表面声波等多种类型实现触敏表面11041。除了触敏表面11041,输入装置1104还可以包括其他输入设备11042。具体地,其他输入设备11042可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆等中的一种或多种。
输出装置1105可用于显示由用户输入的信息或提供给用户的信息以及终端110的各种图形用户界面,这些图形用户界面可以由图形、文本、图标、视频和其任意组合来构成。输出装置1105可包括显示面板11051,可选的,显示面板11051可以采用液晶显示器(英文:Liquid Crystal Display,简称:LCD)、有机发光二极管(英文:Organic Light-Emitting Diode,简称:OLED)等形式来配置。进一步的,触敏表面11041可覆盖显示面板11041,当触敏表面11041 检测到在其上或附近的触摸操作后,传送给处理器1101以确定触摸事件的类型,随后处理器1101根据触摸事件的类型在显示面板11051上提供相应的视觉输出。虽然在图11中,触敏表面11041与显示面板11051是作为两个独立的部件来实现输入和输入功能,但是在某些实施例中,可以将触敏表面11041与显示面板11051集成而实现输入和输出功能。
终端110还可包括至少一种传感器1106,比如光传感器、运动传感器以及其他传感器。具体地,光传感器可包括环境光传感器及接近传感器,其中,环境光传感器可根据环境光线的明暗来调节显示面板11051的亮度,接近传感器可在终端110移动到耳边时,关闭显示面板11051和/或背光等。作为运动传感器的一种,重力加速度传感器可检测各个方向上(一般为三轴)加速度的大小,静止时可检测出重力的大小及方向,可用于识别终端110姿态的应用(比如横竖屏切换、相关游戏、磁力计姿态校准)、振动识别相关功能(比如计步器、敲击)等;至于终端110还可配置的陀螺仪、气压计、湿度计、温度计、红外线传感器等其他传感器,此处不再赘述。
音频电路1107、扬声器11071,传声器11072可提供用户与终端110之间的音频接口。音频电路1107可将接收到的音频数据转换后的电信号,传输到扬声器11071,由扬声器11071转换为声音信号输出;另一方面,传声器11072将收集的声音信号转换为电信号,由音频电路1107接收后转换为音频数据,再将音频数据输出处理器1101处理后,经收发器1103以发送给比如另一终端,或者将音频数据输出至存储器1102以便进一步处理。音频电路1107还可能包括耳塞插孔,以提供外设耳机与终端110的通信。
WiFi属于短距离无线传输技术,终端110通过WiFi模块1108可以帮助用户收发电子邮件、浏览网页和访问流式媒体等,它为用户提供了无线的宽带互联网访问。虽然图11示出了WiFi模块1108,但是可以理解的是,其并不属于终端110的必须构成,完全可以根据需要在不改变发明的本质的范围内而省略。
处理器1101是终端110的控制中心,利用各种接口和线路连接整个终端110的各个部分,通过运行或执行存储在存储器1102内的计算机程序和/或模块,以及调用存储在存储器1102内的数据,执行终端110的各种功能和处理数据,从而对终端110进行整体监控。可选的,处理器1101可包括一个或多 个处理核心;优选的,处理器1101可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器1101中。
终端110还包括给各个部件供电的电源1109(比如电池),优选的,电源可以通过电源管理系统与处理器1101逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。电源1109还可以包括一个或多个直流或交流电源、再充电系统、电源故障检测电路、电源转换器或者逆变器、电源状态指示器等任意组件。
尽管未示出,终端110还可以包括摄像头、蓝牙模块等,此处不再赘述。处理器1101用于调用存储器1102(非易失性存储器)存储的数据传输程序,并执行如下操作:
处理器1101生成第一应用层消息,第一应用层消息为MQTT-SN消息;
处理器1101通过第一网关向应用服务器发送第一应用层消息;其中第一应用层消息不包含终端标识字段,或者,第一应用层消息包含终端标识字段且终端标识字段的长度小于或等于预设长度。
可选的,在处理器1101生成第一应用层消息之前,处理器1101还用于:
通过收发器1103向MME发送附着请求消息,附着请求消息中包括终端的应用层标识和数据类型指示信息,数据类型指示信息用于指示终端发送的消息为MQTT-SN消息;
处理器1101通过收发器1103接收MME发送的附着响应消息,附着响应消息用于指示已成功为终端建立承载。
需要说明的是,本发明实施例所描述的终端110可以用于执行图3或图5或图6所示实施例中终端的步骤,此处不再赘述。
请参见图12,是本发明实施例提供的另一种网关的结构示意图。如图12所示,网关为第一网关,第一网关120包括:第一接收单元1201、生成单元1202和第一发送单元1203,其中,
第一接收单元1201,用于接收终端发送给应用服务器的第一应用层消息, 第一应用层消息为MQTT-SN消息;
生成单元1202,用于若第一接收单元1201接收到的第一应用层消息包含终端标识字段,根据第一应用层消息生成第二应用层消息;或者,若第一接收单元1201接收到的第一应用层消息包含终端标识字段且终端标识字段的长度小于或等于预设长度,根据第一应用层消息生成第二应用层消息;
第一发送单元1203,用于将生成单元1202生成的第二应用层消息发送给应用服务器,其中第二应用层消息中包括终端的应用层标识,应用层标识用于应用服务器识别终端。
在本实施例中,第一网关120是以功能单元的形式来呈现。这里的“单元”可以指特定应用集成电路(英文:Application Specific Integrated Circuit,简称:ASIC),执行一个或多个软件或固件程序的处理器和存储器,集成逻辑电路,和/或其他可以提供功能的器件。第一网关120可以采用图10所示的形式。其中,第一接收单元1201和第一发送单元1203可以通过图10中的通信接口1003来实现,生成单元1202可以通过图10中的处理器1001来实现。
可选的,第一网关120还包括:
第二接收单元,用于在第一接收单元1201接收终端发送给应用服务器的第一应用层消息之前,接收MME发送的创建会话请求消息,创建会话请求消息中包括终端的应用层标识和数据类型指示信息,数据类型指示信息用于指示终端发送的消息为MQTT-SN消息;
建立单元,用于根据第二接收单元接收到的创建会话请求消息为终端建立承载;
第二发送单元,用于向MME发送创建会话响应消息,创建会话响应消息用于指示已成功为终端建立承载。
可选的,第一网关120还包括:
封装单元,用于在生成单元1202根据第一应用层消息生成第二应用层消息之后,以及在第一发送单元1203将第二应用层消息发送给应用服务器之前,对第二应用层消息进行封装,得到第一封装消息,第一封装消息中包括终端的网络层标识,网络层标识用于第二网关识别终端;
第一发送单元1203具体用于:
将第一封装消息发送至第二网关,以使得第二网关对第一封装消息进行解封装,并根据第二应用层消息生成MQTT消息,并将MQTT消息发送给应用服务器。
可选的,第一网关120还包括:
第三接收单元,用于在第一发送单元1203将第一封装消息发送至第二网关之后,接收第二网关发送的第二封装消息,第二封装消息包括应用服务器发送给终端的第三应用层消息和终端的网络层标识,第三应用层消息为MQTT-SN消息且不包含终端标识字段;
解封装单元,用于对第三接收单元接收到的第二封装消息进行解封装,得到第三应用层消息;
第四发送单元,用于根据终端的网络层标识,将解封装单元得到的第三应用层消息发送给终端。
需要说明的是,本发明实施例中所描述的第一网关120可以用于执行图3或图5或图6所示实施例中第一网关的步骤,此处不再赘述。
请参见图13,是本发明实施例提供的另一种终端的结构示意图。如图13所示,终端130包括:生成单元1301和第一发送单元1302,其中,
生成单元1301,用于生成第一应用层消息,第一应用层消息为MQTT-SN消息;
第一发送单元1302,用于通过第一网关向应用服务器发送生成单元1301生成的第一应用层消息,其中,第一应用层消息不包含终端标识字段,或者,第一应用层消息包含终端标识字段且终端标识字段的长度小于或等于预设长度。
在本实施例中,终端130是以功能单元的形式来呈现。这里的“单元”可以指ASIC,执行一个或多个软件或固件程序的处理器和存储器,集成逻辑电路,和/或其他可以提供功能的器件。终端130可以采用图11所示的形式。其中,生成单元1301可以通过图11中的处理器1101来实现,第一发送单元1302可以通过图11中的收发器1103来实现。
可选的,终端130还包括:
第二发送单元1303,用于在生成单元1301生成第一应用层消息之前,向MME发送附着请求消息,附着请求消息中包括终端的应用层标识和数据类型指示信息,数据类型指示信息用于指示终端发送的消息为MQTT-SN消息;
接收单元1304,用于接收MME发送的附着响应消息,附着响应消息用于指示已成功为终端建立承载。
需要说明的是,本发明实施例中所描述的终端130可以用于执行图3或图5或图6所示实施例中终端的步骤,此处不再赘述。
为了便于更好地实施本发明实施例,本发明实施例进一步地提供了一种计算机可读存储介质,所述计算机可读存储介质存储有一个或多个计算机程序,其中,所述计算机可读存储介质可为磁碟、光盘、ROM或RAM等。所述一个或多个计算机程序运行在第一网关中的一个或多个的处理器上,所述计算机程序在运行时,可实现如所述图3或图5或图6所示方法实施例中对应第一网关的流程。所述一个或多个计算机程序运行在终端中的一个或多个的处理器上,所述计算机程序在运行时,可实现如所述图3或图5或图6所示方法实施例中对应终端的流程。
尽管在此结合各实施例对本发明进行了描述,然而不能以此来限定本发明之权利范围,在实施所要求保护的本发明过程中,本领域技术人员通过查看所述附图、公开内容、以及所附权利要求书,可理解并实现所述实施例的全部或部分流程,并依本发明权利要求所作的等同变化,仍属于发明所涵盖的范围。在权利要求中,“包括”一词不排除其他组成部分或步骤,“一”或“一个”不排除多个的情况。相互不同的从属权利要求所记载了某些措辞,但这并不表示这些措辞不能组合起来产生良好的效果。计算机程序可以存储/分布在合适的介质中,例如:光存储介质或固态介质,与其他硬件一起提供或作为硬件的一部分,也可以采用其他分布方式,如通过因特网或其他有线或无线系统。

Claims (22)

  1. 一种数据传输方法,其特征在于,包括:
    第一网关接收终端发送给应用服务器的第一应用层消息,所述第一应用层消息为用于传感器网络的消息队列遥测传输MQTT-SN消息;
    若所述第一应用层消息不包含终端标识字段,则所述第一网关根据所述第一应用层消息生成第二应用层消息;或者,若所述第一应用层消息包含终端标识字段且所述终端标识字段的长度小于或等于预设长度,则所述第一网关根据所述第一应用层消息生成第二应用层消息;
    所述第一网关将所述第二应用层消息发送给所述应用服务器,其中,所述第二应用层消息包括所述终端的应用层标识,所述应用层标识用于所述应用服务器识别所述终端。
  2. 根据权利要求1所述的方法,其特征在于,在所述第一网关接收终端发送给应用服务器的第一应用层消息之前,还包括:
    所述第一网关接收移动性管理实体MME发送的创建会话请求消息,所述创建会话请求消息包括所述终端的应用层标识和数据类型指示信息,所述数据类型指示信息用于指示所述终端发送的消息为MQTT-SN消息;
    所述第一网关根据所述创建会话请求消息,为所述终端建立承载;
    所述第一网关向所述MME发送创建会话响应消息,所述创建会话响应消息用于指示已成功为所述终端建立承载。
  3. 根据权利要求1或2所述的方法,其特征在于,所述第二应用层消息为消息队列遥测传输MQTT消息。
  4. 根据权利要求1或2所述的方法,其特征在于,所述第二应用层消息为MQTT-SN消息;在所述第一网关根据所述第一应用层消息生成第二应用层消息之后,以及在所述第一网关将所述第二应用层消息发送给所述应用服务器之前,还包括:
    所述第一网关对所述第二应用层消息进行封装,得到第一封装消息,所述第一封装消息包括所述终端的网络层标识,所述网络层标识用于第二网关识别所述终端;
    所述第一网关将所述第二应用层消息发送给所述应用服务器,包括:
    所述第一网关将所述第一封装消息发送至所述第二网关,以使得所述第二网关对所述第一封装消息进行解封装,并根据所述第二应用层消息生成MQTT消息,并将所述MQTT消息发送给所述应用服务器。
  5. 根据权利要求4所述的方法,其特征在于,所述第一网关将所述第一封装消息发送至第二网关之后,还包括:
    所述第一网关接收所述第二网关发送的第二封装消息,所述第二封装消息包括所述应用服务器发送给所述终端的第三应用层消息和所述网络层标识,所述第三应用层消息为MQTT-SN消息且不包含终端标识字段;
    所述第一网关对所述第二封装消息进行解封装,得到所述第三应用层消息和所述终端的网络层标识;
    所述第一网关根据所述终端的网络层标识,将所述第三应用层消息发送给所述终端。
  6. 一种数据传输方法,其特征在于,包括:
    终端生成第一应用层消息,所述第一应用层消息为用于传感器网络的消息队列遥测传输MQTT-SN消息;
    所述终端通过第一网关向应用服务器发送所述第一应用层消息;其中,所述第一应用层消息不包含终端标识字段,或者,所述第一应用层消息包含终端标识字段且所述终端标识字段的长度小于或等于预设长度。
  7. 根据权利要求6所述的方法,其特征在于,在所述终端生成第一应用层消息之前,还包括:
    所述终端向移动性管理实体MME发送附着请求消息,所述附着请求消息包括所述终端的应用层标识和数据类型指示信息,所述数据类型指示信息用于 指示所述终端发送的消息为MQTT-SN消息;
    所述终端接收所述MME发送的附着响应消息,所述附着响应消息用于指示已成功为所述终端建立承载。
  8. 一种网关,其特征在于,所述网关为第一网关,所述第一网关包括处理器、存储器以及通信接口,其中,所述存储器用于存储程序代码,所述处理器用于调用所述程序代码来执行如下操作:
    所述处理器通过所述通信接口接收终端发送给应用服务器的第一应用层消息,所述第一应用层消息为用于传感器网络的消息队列遥测传输MQTT-SN消息;
    若所述第一应用层消息不包含终端标识字段,所述处理器根据所述第一应用层消息生成第二应用层消息;或者,若所述第一应用层消息包含终端标识字段且所述终端标识字段的长度小于或等于预设长度,所述处理器根据所述第一应用层消息生成第二应用层消息;
    所述处理器通过所述通信接口将所述第二应用层消息发送给所述应用服务器,其中,所述第二应用层消息包括所述终端的应用层标识,所述应用层标识用于所述应用服务器识别所述终端。
  9. 根据权利要求8所述的网关,其特征在于,所述处理器通过所述通信接口接收终端发送给应用服务器的第一应用层消息之前,所述处理器还用于:
    通过所述通信接口接收移动性管理实体MME发送的创建会话请求消息,所述创建会话请求消息中包括所述终端的应用层标识和数据类型指示信息,所述数据类型指示信息用于指示所述终端发送的消息为MQTT-SN消息;
    所述处理器根据所述创建会话请求消息,为所述终端建立承载;
    所述处理器通过所述通信接口向所述MME发送创建会话响应消息,所述创建会话响应消息用于指示已成功为所述终端建立承载。
  10. 根据权利要求8或9所述的网关,其特征在于,所述第二应用层消息为消息队列遥测传输MQTT消息。
  11. 根据权利要求8或9所述的网关,其特征在于,所述第二应用层消息为MQTT-SN消息;在所述处理器根据所述第一应用层消息生成第二应用层消息之后,以及在所述处理器通过所述通信接口将所述第二应用层消息发送给所述应用服务器之前,所述处理器还用于:
    所述处理器对所述第二应用层消息进行封装,得到第一封装消息,所述第一封装消息中包括所述终端对应的网络层标识,所述网络层标识用于第二网关识别所述终端;
    所述处理器通过所述通信接口将所述第二应用层消息发送给所述应用服务器,包括:
    所述处理器通过所述通信接口将所述第一封装消息发送至所述第二网关,以使得所述第二网关对所述第一封装消息进行解封装,并根据所述第二应用层消息生成MQTT消息,并将所述MQTT消息发送给所述应用服务器。
  12. 根据权利要求11所述的网关,其特征在于,所述处理器通过所述通信接口将所述第一封装消息发送至第二网关之后,所述处理器还用于:
    所述处理器通过所述通信接口接收所述第二网关发送的第二封装消息,所述第二封装消息包括所述应用服务器发送给所述终端的第三应用层消息和所述网络层标识,所述第三应用层消息为MQTT-SN消息且不包含终端标识字段;
    所述处理器对所述第二封装消息进行解封装,得到所述第三应用层消息和所述终端的网络层标识;
    所述处理器通过所述通信接口根据所述终端的网络层标识,将所述第三应用层消息发送给所述终端。
  13. 一种终端,其特征在于,所述终端包括处理器、存储器以及收发器,其中,所述存储器用于存储数据传输程序代码,所述处理器用于调用所述数据传输程序代码来执行如下操作:
    所述处理器生成第一应用层消息,所述第一应用层消息为用于传感器网络的消息队列遥测传输MQTT-SN消息;
    所述处理器通过第一网关向应用服务器发送所述第一应用层消息;其中,所述第一应用层消息不包含终端标识字段,或者,所述第一应用层消息包含终端标识字段且所述终端标识字段的长度小于或等于预设长度。
  14. 根据权利要求13所述的终端,其特征在于,在所述处理器生成第一应用层消息之前,所述处理器还用于:
    通过所述收发器向移动性管理实体MME发送附着请求消息,所述附着请求消息中包括所述终端的应用层标识和数据类型指示信息,所述数据类型指示信息用于指示所述终端发送的消息为MQTT-SN消息;
    通过所述收发器接收所述MME发送的附着响应消息,所述附着响应消息用于指示已成功为所述终端建立承载。
  15. 一种网关,其特征在于,所述网关为第一网关,所述第一网关包括:
    第一接收单元,用于接收终端发送给应用服务器的第一应用层消息,所述第一应用层消息为用于传感器网络的消息队列遥测传输MQTT-SN消息;
    生成单元,用于若所述第一接收单元接收的所述第一应用层消息不包含终端标识字段,根据所述第一应用层消息生成第二应用层消息;或者,若所述第一接收单元接收到的所述第一应用层消息包含终端标识字段且所述终端标识字段的长度小于或等于预设长度,根据所述第一应用层消息生成第二应用层消息;
    第一发送单元,用于将所述生成单元生成的所述第二应用层消息发送给所述应用服务器,所述第二应用层消息中包括所述终端的应用层标识,所述应用层标识用于所述应用服务器识别所述终端。
  16. 根据权利要求15所述的网关,其特征在于,还包括:
    第二接收单元,用于在所述第一接收单元接收终端发送给应用服务器的第一应用层消息之前,接收移动性管理实体MME发送的创建会话请求消息,所述创建会话请求消息中包括所述终端的应用层标识和数据类型指示信息,所述数据类型指示信息用于指示所述终端发送的消息为MQTT-SN消息;
    建立单元,用于根据所述第二接收单元接收到的所述创建会话请求消息为所述终端建立承载;
    第二发送单元,用于向所述MME发送创建会话响应消息,所述创建会话响应消息用于指示已成功为所述终端建立承载。
  17. 根据权利要求15或16所述的网关,其特征在于,所述第二应用层消息为消息队列遥测传输MQTT消息。
  18. 根据权利要求15或16所述的网关,其特征在于,还包括:
    封装单元,用于在所述生成单元根据所述第一应用层消息生成第二应用层消息之后,所述第一发送单元将所述第二应用层消息发送给所述应用服务器之前,对所述第二应用层消息进行封装,得到第一封装消息,所述第一封装消息中包括所述终端对应的网络层标识,所述网络层标识用于第二网关识别所述终端;
    所述第一发送单元具体用于:
    将所述第一封装消息发送至所述第二网关,以使得所述第二网关对所述第一封装消息进行解封装,并根据所述第二应用层消息生成MQTT消息,并将所述MQTT消息发送给所述应用服务器。
  19. 根据权利要求18所述的网关,其特征在于,还包括:
    第三接收单元,用于在所述第一发送单元将所述第一封装消息发送至所述第二网关之后,接收所述第二网关发送的第二封装消息,所述第二封装消息包括所述应用服务器发送给所述终端的第三应用层消息和所述第二网关添加的所述网络层标识,所述第三应用层消息为MQTT-SN消息且不包含终端标识字段;
    解封装单元,用于对所述第三接收单元接收到的所述第二封装消息进行解封装,得到所述第三应用层消息和所述终端的网络层标识;
    第三发送单元,用于根据所述终端的网络层标识,将所述解封装单元得到的所述第三应用层消息发送给所述终端。
  20. 一种终端,其特征在于,包括:
    生成单元,用于生成第一应用层消息,所述第一应用层消息为用于传感器网络的消息队列遥测传输MQTT-SN消息;
    第一发送单元,用于通过第一网关向应用服务器发送所述生成单元生成的所述第一应用层消息;其中,所述第一应用层消息不包含终端标识字段,或者,所述第一应用层消息包含终端标识字段且所述终端标识字段的长度小于或等于预设长度。
  21. 根据权利要求20所述的终端,其特征在于,还包括:
    第二发送单元,用于在所述生成单元生成第一应用层消息之前,向移动性管理实体MME发送附着请求消息,所述附着请求消息中包括所述终端的应用层标识和数据类型指示信息,所述数据类型指示信息用于指示所述终端发送的消息为MQTT-SN消息;
    接收单元,用于接收所述MME发送的附着响应消息,所述附着响应消息用于指示已成功为所述终端建立承载。
  22. 一种通信系统,其特征在于,包括第一网关和终端,其中,所述第一网关为权利要求8至12,或者权利要求15至19任一项所述的第一网关,所述终端为权利要求13或14,或者权利要求20或21所述的终端。
PCT/CN2016/096854 2016-08-26 2016-08-26 一种数据传输方法、相关设备及通信系统 WO2018035839A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/CN2016/096854 WO2018035839A1 (zh) 2016-08-26 2016-08-26 一种数据传输方法、相关设备及通信系统

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2016/096854 WO2018035839A1 (zh) 2016-08-26 2016-08-26 一种数据传输方法、相关设备及通信系统

Publications (1)

Publication Number Publication Date
WO2018035839A1 true WO2018035839A1 (zh) 2018-03-01

Family

ID=61245936

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/096854 WO2018035839A1 (zh) 2016-08-26 2016-08-26 一种数据传输方法、相关设备及通信系统

Country Status (1)

Country Link
WO (1) WO2018035839A1 (zh)

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110138860A (zh) * 2019-05-16 2019-08-16 广州云智易物联网有限公司 一种基于物联网的数据通讯方法及装置
CN111953640A (zh) * 2019-05-17 2020-11-17 阿里巴巴集团控股有限公司 通信方法、通信系统、云节点和可读存储介质
CN112073944A (zh) * 2020-08-10 2020-12-11 武汉慧联无限科技有限公司 基于物联网通信的快速系统开发的模块与组件设计方法
WO2021102641A1 (en) * 2019-11-25 2021-06-03 Telefonaktiebolaget Lm Ericsson (Publ) Method and network node for communication with a non-ip device
CN113067882A (zh) * 2021-03-31 2021-07-02 建信金融科技有限责任公司 一种消息处理方法、装置、电子设备及介质
CN113890824A (zh) * 2021-10-21 2022-01-04 北京天融信网络安全技术有限公司 网络加速方法、装置、网关设备及计算机可读存储介质
CN114172973A (zh) * 2021-11-30 2022-03-11 深圳市国电科技通信有限公司 一种基于mqtt协议和698协议的数据转换处理方法及电子设备

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080285557A1 (en) * 2007-05-18 2008-11-20 Huawei Technologies Co., Ltd. Method, System and Relay Device for Transmitting Packet
CN102026200A (zh) * 2009-09-16 2011-04-20 中兴通讯股份有限公司 中继链路中用户的标识方法与装置
CN102377803A (zh) * 2010-08-12 2012-03-14 华为技术有限公司 一种数据处理方法、装置和系统
CN105471897A (zh) * 2015-12-28 2016-04-06 上海庆科信息技术有限公司 一种嵌入式设备云服务接入方法及系统
CN105722040A (zh) * 2014-12-03 2016-06-29 华为技术有限公司 一种业务消息的传输方法、装置及系统

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080285557A1 (en) * 2007-05-18 2008-11-20 Huawei Technologies Co., Ltd. Method, System and Relay Device for Transmitting Packet
CN102026200A (zh) * 2009-09-16 2011-04-20 中兴通讯股份有限公司 中继链路中用户的标识方法与装置
CN102377803A (zh) * 2010-08-12 2012-03-14 华为技术有限公司 一种数据处理方法、装置和系统
CN105722040A (zh) * 2014-12-03 2016-06-29 华为技术有限公司 一种业务消息的传输方法、装置及系统
CN105471897A (zh) * 2015-12-28 2016-04-06 上海庆科信息技术有限公司 一种嵌入式设备云服务接入方法及系统

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110138860A (zh) * 2019-05-16 2019-08-16 广州云智易物联网有限公司 一种基于物联网的数据通讯方法及装置
CN110138860B (zh) * 2019-05-16 2022-02-22 广州云智易物联网有限公司 一种基于物联网的数据通讯方法及装置
CN111953640A (zh) * 2019-05-17 2020-11-17 阿里巴巴集团控股有限公司 通信方法、通信系统、云节点和可读存储介质
WO2021102641A1 (en) * 2019-11-25 2021-06-03 Telefonaktiebolaget Lm Ericsson (Publ) Method and network node for communication with a non-ip device
CN112073944A (zh) * 2020-08-10 2020-12-11 武汉慧联无限科技有限公司 基于物联网通信的快速系统开发的模块与组件设计方法
CN112073944B (zh) * 2020-08-10 2023-08-11 武汉慧联无限科技有限公司 基于物联网通信的快速系统开发的模块与组件设计方法
CN113067882A (zh) * 2021-03-31 2021-07-02 建信金融科技有限责任公司 一种消息处理方法、装置、电子设备及介质
CN113890824A (zh) * 2021-10-21 2022-01-04 北京天融信网络安全技术有限公司 网络加速方法、装置、网关设备及计算机可读存储介质
CN114172973A (zh) * 2021-11-30 2022-03-11 深圳市国电科技通信有限公司 一种基于mqtt协议和698协议的数据转换处理方法及电子设备
CN114172973B (zh) * 2021-11-30 2023-12-19 深圳市国电科技通信有限公司 一种基于mqtt协议和698协议的数据转换处理方法及电子设备

Similar Documents

Publication Publication Date Title
WO2018035839A1 (zh) 一种数据传输方法、相关设备及通信系统
US11463937B2 (en) Data transmission method and apparatus
JP7247344B2 (ja) データ伝送の保証方法及び通信機器
KR102570017B1 (ko) 세션 관리 방법 및 장치
EP3614742B1 (en) Relaying taking into consideration quality of service between a terminal and a wireless network
CN109982383B (zh) 数据发送方法、装置及设备
CN110036661A (zh) 一种上行数据传输方法、终端、网络侧设备及系统
CN111182580B (zh) 业务传输方法、终端和网络侧设备
KR102375445B1 (ko) 데이터 전송 방법 및 관련 제품
WO2019019486A1 (zh) 下行数据包配置方法及装置
WO2018195924A1 (zh) 网络连接配置方法及相关产品
JP2021521739A (ja) Rrc接続再確立のベアラ設定方法、端末及びネットワーク機器
WO2019144768A1 (zh) 一种网络注册模式切换的方法及终端
US20180176340A1 (en) Data transmission method, and related device and system
US20210289434A1 (en) Method for controlling network access and communications device
TWI678903B (zh) 一種上行資料傳輸方法及終端
CN110351784A (zh) 一种信息传输方法及装置
CN111194085B (zh) 一种通道资源的控制方法、终端和通信网元
CN109962822B (zh) 无线侧传输时延获取方法及装置
CN112543172A (zh) 一种ims呼叫方法、终端和网络功能
CN113329322A (zh) 数据传输方法、装置、终端及网络侧设备
RU2781146C1 (ru) Способ обеспечения передачи данных и устройство связи
CN112543173B (zh) 一种ims信息传输方法、终端、装置和设备
CN109644377A (zh) 一种上行数据传输方法、终端、网络侧设备及系统

Legal Events

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

Ref document number: 16913861

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16913861

Country of ref document: EP

Kind code of ref document: A1