Data transmission method and apparatus, and storage medium

By standardizing the data packet format at the MAC layer of the gateway, the problem of smart home devices being unable to communicate with each other due to different communication protocols was solved, achieving interoperability between devices and reducing costs.

WO2024234858A1PCT designated stage expired Publication Date: 2024-11-21ZTE CORP
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/085747
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-05-16
Filing Date
2024-04-03
Publication Date
2024-11-21

AI Technical Summary

Technical Problem

Different smart home devices cannot communicate with each other due to different communication protocols. Existing solutions, such as the Matter protocol, are complex and costly, requiring high-performance chips.

Method used

By unifying data packets into a target format at the gateway's MAC layer, and supporting at least two communication protocols at the link layer, the upper layers of the gateway do not distinguish between communication protocols, thus achieving a unified data packet format.

Benefits of technology

It enables interoperability between different smart home devices, reduces the limitations and complexity of network protocols, eliminates the need for high-performance chips, and lowers usage costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024085747_21112024_PF_FP_ABST
    Figure CN2024085747_21112024_PF_FP_ABST
Patent Text Reader

Abstract

Provided are a data transmission method and apparatus, and a storage medium. The data transmission method is applied to a gateway, and comprises: when receiving or sending data messages, then within a MAC layer, unifying the data messages into a target format; the layer below the MAC layer being a link layer supporting at least two communication protocols; the layer above the MAC layer not distinguishing between the at least two communication protocols; and the layer above the MAC layer comprising: a network layer, a transmission layer, and an application layer.
Need to check novelty before this filing date? Find Prior Art

Description

Data transmission method, device and storage medium

[0001] This disclosure claims priority to Chinese patent application No. 202310555951.4, filed on May 16, 2023, the entire contents of which are incorporated herein by reference. Technical Field

[0002] The present disclosure relates to the field of communication technologies, and in particular to a data transmission method and device, and a storage medium. Background Art

[0003] Smart home is an Internet of Things (IoT) device with broad market prospects. However, there are currently many smart home manufacturers, and the communication protocols used by smart homes produced by different manufacturers are different, which leads to the inability of smart homes to communicate with each other.

[0004] Summary of the Invention

[0005] In one aspect, embodiments of the present disclosure provide a data transmission method, applied to a gateway. The data transmission method includes: when receiving or sending data packets, unifying the data packets into a target format at a media access control (MAC) layer; the lower layer of the MAC layer is a link layer that supports at least two communication protocols; the upper layer of the MAC layer does not distinguish between the at least two communication protocols; the upper layers of the MAC layer include: a network layer, a transport layer, and an application layer.

[0006] In another aspect, an embodiment of the present disclosure provides a data transmission device. The data transmission device includes: a data message unification unit configured to unify the data messages into a target format at a MAC layer when receiving or sending data messages; a lower layer of the MAC layer is a link layer that supports at least two communication protocols; an upper layer of the MAC layer does not distinguish between the at least two communication protocols; and the upper layers of the MAC layer include: a network layer, a transport layer, and an application layer.

[0007] In another aspect, an embodiment of the present disclosure provides a data transmission device comprising: a memory and a processor; the memory and the processor are coupled; the memory is configured to store a computer program; and the processor implements the data transmission method described in any of the above aspects when executing the computer program.

[0008] In another aspect, an embodiment of the present disclosure provides a computer-readable storage medium having computer program instructions stored thereon, which, when executed by a processor, implement the data transmission method described in any one of the above aspects.

[0009] In another aspect, an embodiment of the present disclosure provides a computer program product, which includes computer program instructions, and when the computer program instructions are executed by a processor, implements the data transmission method described in any one of the above aspects. BRIEF DESCRIPTION OF THE DRAWINGS

[0010] In order to more clearly illustrate the technical solutions in the present disclosure, the following briefly introduces the drawings required for use in some embodiments of the present disclosure. Obviously, the drawings described below are only drawings of some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can also be obtained based on these drawings.

[0011] FIG1 is a schematic diagram of an implementation environment involved in a data transmission method according to some embodiments.

[0012] FIG2 is a schematic diagram of a gateway layer model according to some embodiments.

[0013] FIG3 is a flow chart of a data transmission method according to some embodiments.

[0014] FIG4 is a schematic diagram of a target format according to some embodiments.

[0015] FIG5 is a schematic diagram of an intermediate data message according to some embodiments.

[0016] FIG6 is a schematic diagram of a second data message according to some embodiments.

[0017] FIG7 is a schematic diagram of a data message encapsulation and decapsulation process according to some embodiments.

[0018] FIG8 is a schematic structural diagram of a data transmission device according to some embodiments.

[0019] FIG9 is a schematic structural diagram of another data transmission device according to some embodiments. DETAILED DESCRIPTION

[0020] The following will clearly and completely describe the technical solutions of this disclosure in conjunction with the accompanying drawings. Obviously, the embodiments described are only some of the embodiments of this disclosure, not all of them. All other embodiments derived by persons of ordinary skill in the art based on the embodiments of this disclosure without inventive effort are within the scope of protection of this disclosure.

[0021] It should be noted that in this disclosure, expressions such as "exemplarily" or "for example" are used to indicate examples, illustrations, or explanations. Any embodiment or design described in this disclosure as "exemplary" or "for example" should not be construed as being preferred or advantageous over other embodiments or designs. Rather, the use of expressions such as "exemplarily" or "for example" is intended to present the relevant concepts in a detailed manner.

[0022] In the following, the terms "first" and "second" are used for descriptive purposes only and should not be understood to indicate or imply relative importance or implicitly specify the quantity of the technical features indicated. Therefore, a feature specified as "first" or "second" may explicitly or implicitly include one or more of the features.

[0023] In the description of this disclosure, unless otherwise specified, " / " means "or". For example, A / B can mean A or B. "And / or" in this document is simply a description of the association relationship between related objects, indicating that three relationships can exist. For example, A and / or B can mean: only A, only B, and A and B. In addition, "at least one" means one or more, and "a plurality" means two or more.

[0024] Different smart homes cannot communicate with each other due to the different communication protocols they use. To solve this problem, some technologies have proposed the Matter protocol, an application layer protocol based on IPv6. This protocol relies on underlying protocols such as Wireless Fidelity (WiFi), Ethernet, and Thread that are compatible with IPv6. To use the Matter protocol, a smart home must support any of the three protocols: WiFi, Ethernet, or Thread. In addition, the Matter protocol architecture is relatively complex, and smart homes using this protocol must be equipped with high-performance chips. Therefore, the Matter protocol has certain requirements for the network supported by the smart home, and the cost of using this protocol is relatively high.

[0025] Based on this, an embodiment of the present disclosure proposes a data transmission method, which is applied to a gateway. The lower layer of the MAC layer of the gateway is a link layer that supports at least two communication protocols. When the gateway receives or sends a data message, the format of the data message is unified into a target format at the MAC layer, so that the upper layer of the MAC layer no longer distinguishes the communication protocol of the data message when processing the data message. In this method, since the lower layer of the MAC layer of the gateway is a link layer that supports at least two communication protocols, the gateway can process data messages of at least two communication protocols. At the same time, since the gateway performs format unification processing at the lower MAC layer of the network layer, this method has no network restrictions compared to the traditional technology where the Matter protocol is limited to the network protocol of IPv6, and the implementation complexity of the method disclosed in the present disclosure is reduced. The gateway does not need to be equipped with a high-performance chip, which can reduce the cost of use.

[0026] The implementation of the embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings.

[0027] FIG1 shows an implementation environment involved in a data transmission method provided by an embodiment of the present disclosure, which includes: a first device 110 , a second device 120 , and a gateway 130 .

[0028] The first device 110 and the second device 120 are two devices with different communication protocols. The first device 110 and the second device 120 can unify the format of the transmitted data message through the gateway 130 to complete the communication.

[0029] Figure 1 shows a gateway 130 connected to multiple smart devices, where a first device 110 and a second device 120 are any two of the multiple devices shown in Figure 1. For example, the first device 110 and the second device 120 can be smart lights, smart door locks, smart curtains, smart monitoring systems, smart TVs, or smart terminals.

[0030] Gateway 130, also known as a gateway or protocol converter, is used between systems with different communication protocols, data formats, languages, or even completely different architectures. It enables interconnection between network devices using different protocols. Gateway 130 can be used to interconnect both wide area networks and local area networks.

[0031] In the embodiment of the present disclosure, FIG2 shows a layered model of the gateway 130 . The gateway 130 includes a physical layer, a data link layer, a network layer, a transport layer, and an application layer.

[0032] Physical layer: The hardware part responsible for transmitting bit streams, including various transmission media (for example, copper wires, optical fibers, or wireless channels, etc.).

[0033] Data Link Layer: Responsible for encapsulating data packets sent from the network layer into frames and transmitting data packets on the transmission medium of the physical layer. In the disclosed embodiment, the data link layer includes a protocol link layer and a unified MAC layer. The protocol link layer is below the MAC layer. The MAC layer unifies the format of received or sent data packets. The lower layers of the MAC layer include multiple protocol link layers such as the Bluetooth link layer, ZigBee link layer, Z-Wave link layer, and Thread link layer.

[0034] Network layer: Provides host-to-host services. The network layer determines the communication path from the sending device to the receiving device, encapsulating the Internet Protocol (IP) addresses of the sending and receiving devices into the IP header field. The network layer supports both IPv4 and IPv6 network protocols. In this disclosure, the network layer does not distinguish between IPv4 and IPv6 network protocols.

[0035] Transport layer: Provides end-to-end services. The transport layer obtains services from the network layer and provides services to the application layer. The transport layer supports the Transmission Control Protocol (TCP) or the User Datagram Protocol (UDP).

[0036] Application layer: provides data transmission services for applications. In the embodiment of the present disclosure, the application is an application installed in the device connected to the gateway (eg, the first device 110 or the second device 120).

[0037] The working process of the gateway 130 in the embodiment of the present disclosure is: receiving the data packet sent by the first device 110 from the physical layer, unifying the format at the MAC layer of the data link layer, decapsulating it layer by layer through the network layer, transport layer and application layer to obtain the target data, and then transmitting it from the application layer, transport layer and network layer to the MAC layer of the data link layer, unifying the format at the MAC layer to obtain a second data packet, and then decapsulating and reassembling the second data packet based on the communication protocol used by the second device 120 to obtain a third data packet sent to the second device 120.

[0038] As described above, the first device 110 and the second device 120 are both connected to the gateway 130 via a wired or wireless connection, and the first device 110 and the second device 120 can communicate with each other through the gateway 130. The first device 110 and the second device 120 can be one or more, respectively. The embodiments of the present disclosure do not limit the number of first devices 110 and second devices 120.

[0039] In one scenario, first device 110 is a smart monitor, and second device 120 is a smart washing machine. The first and second devices 110 and 120 are connected via gateway 130. A user sends control commands to the smart washing machine through the smart monitor to control its operation. The smart monitor sends these control commands to gateway 130, which restructures the control commands based on the target format and then sends them to the washing machine, thereby controlling its operation.

[0040] The data transmission method provided by the embodiment of the present disclosure is described below.

[0041] The data transmission method provided in the embodiment of the present disclosure can be applied to the gateway 130. The execution subject of the data transmission method provided in the embodiment of the present disclosure can also be a data transmission device. The data transmission device can be a gateway, or an application (application, APP) installed on the gateway that provides a data transmission function, or a central processing unit (CPU) in the gateway, or a control module in the gateway for executing the data transmission method. The following description is based on the method provided in the embodiment of the present disclosure as an example of a gateway.

[0042] The disclosed embodiments provide a data transmission method in which a lower layer of a gateway's MAC layer is a link layer that supports at least two communication protocols, and an upper layer of the MAC layer does not distinguish between the at least two communication protocols. When the gateway receives or sends a data message, the MAC layer unifies the data message into a target format.

[0043] Figure 3 is a flow chart of a data transmission method according to some embodiments. The method is applied to a gateway, which is connected to a first device and a second device, and the first device and the second device use different communication protocols, as shown in Figure 3. The method may include S101 to S106.

[0044] S101: The gateway establishes a device mapping table.

[0045] The device mapping table is a table including the correspondence between the IP address, control identifier, and link layer identifier of the communication protocol used by the device accessing the gateway.

[0046] The control identifier of a device connected to the gateway includes the identifier of the device and the identifier of the communication protocol used by the device. For example, the gateway uses DCI to represent the control identifier. DCI consists of two parts (for example, DI and CI). DI is the identifier of the device, and CI is the identifier of the communication protocol used by the device.

[0047] The communication protocols used by the above devices include but are not limited to: WiFi, Bluetooth, ZigBee, z-wave or Thread, etc.

[0048] In one implementation, the gateway obtains the IP addresses of the connected first device and the second device, and allocates a control identifier DCI and a link layer identifier of the communication protocol used by the first device and the second device to the first device and the second device respectively, and stores them in a device mapping table.

[0049] In one example, for a first device and a second device connected to a gateway, if the communication protocol used by the first device is the Bluetooth protocol, the gateway uses "A" to represent the identifier of the first device, "1" to represent the Bluetooth protocol, and "x1" to represent the link layer identifier of the Bluetooth protocol. In this case, the DCI of the first device is A1, and the link layer identifier of the communication protocol used by the first device is "x1." If the communication protocol used by the second device is the WiFi protocol, the gateway uses "B" to represent the identifier of the second device, "2" to represent the WiFi protocol, and "x2" to represent the link layer identifier of the WiFi protocol. In this case, the DCI of the second device is B2, and the link layer identifier of the communication protocol used by the second device is "x2." The gateway stores the above information in a device mapping table, such as the device mapping table shown in Table 1, which includes the correspondence between "IP address," "control identifier DCI," and "communication protocol link layer identifier."

[0050] Table 1

[0051] The gateway stores the obtained IP address and other information of the connected device in the device mapping table. When the devices communicate with each other subsequently, the gateway can directly query the pre-stored information of each device in the device mapping table, quickly complete the subsequent decapsulation and reassembly workflow of the data message, and improve the processing speed of the disclosed method.

[0052] S102: The gateway receives a first data packet sent by the first device to the second device.

[0053] The first data message includes target data and is in a format specified by a communication protocol used by the first device.

[0054] The target data is the data that the first device actually wants to send to the second device. For example, if the first device is a smart monitor and the second device is a smart curtain, and the smart monitor needs to control the smart curtain to open, the target data is: open the curtain.

[0055] The first data message is a message obtained by the first device encapsulating the target data in a format specified by the communication protocol used by the first device. The first data message also includes: the IP address of the first device and the IP address of the second device.

[0056] In an example, the communication protocol used by the first device is the Bluetooth protocol, and the first data message is a message obtained by the first device encapsulating the target data based on the format specified by the Bluetooth protocol.

[0057] S103 (in some embodiments): The gateway sets a sending priority for the first data packet.

[0058] The sending priority indicates the order in which the gateway sends the first data message.

[0059] When the gateway receives multiple data messages, the gateway sends the multiple data messages in the order of their sending priorities. The multiple data messages include the first data message.

[0060] In one implementation, if a gateway simultaneously receives data packets sent by multiple devices, the gateway sets a transmission priority for each data packet based on the number of data packets cached by the multiple devices in the gateway. For example, the more data packets sent by a first device cached in the gateway, the higher the transmission priority set by the gateway for the first data packet.

[0061] In one example, before receiving the first data packet sent by the first device, the gateway has already cached 10 data packets sent by the first device and 2 data packets sent by a third device (for example, as shown in Figure 1, the third device can be any device connected to the gateway other than the first and second devices). At this time, if the gateway simultaneously receives the first data packet sent by the first device and the data packet sent by the third device, the gateway sets a higher sending priority for the first data packet than the sending priority set for the data packet sent by the third device.

[0062] Since the first device has cached a large number of data packets in the gateway, when the first device continues to send the first data packet to the gateway, in order to avoid the data packets sent by the first device from being backlogged in the gateway, the gateway sets a higher priority for the packets sent by the first device.

[0063] In another implementation, if the gateway receives data packets from only one device, the gateway sets a priority for the data packets sent by the device based on the time sequence of the data packets received. The earlier the data packet is received by the gateway, the higher the priority of the data packet.

[0064] S104: The gateway converts the first data message into a second data message according to the target format at the MAC layer.

[0065] The second data packet includes target data.

[0066] In some embodiments, Figure 4 is a schematic diagram of a target format according to some embodiments. In Figure 4, the target format includes: an identification field, a MAC header field, a control field, and a data field arranged in sequence. In some embodiments, the target format also includes: a padding field.

[0067] The identification field is used to carry: the identification of the device sending the data message, the identification of the communication protocol used by the device sending the data message; or the identification of the device receiving the data message, the identification of the communication protocol used by the device receiving the data message.

[0068] The MAC header field is used to carry: the MAC address of the device sending and receiving the data message.

[0069] The control field is used to carry the data format of the data field, for example, the encoding method of the data field (such as Manchester encoding) and the total length set for the data field.

[0070] The data field is used to carry: the IP address and target data of the device sending and receiving the data message.

[0071] The above data field may also be referred to as a service data unit (SDU).

[0072] The padding field is used to carry preset characters, and the preset characters are used to fill the data field with data when the data length of the data field is less than the total length of the data field.

[0073] In one example, when the total length of the data field set by the control field is 100 bytes, and the actual data length of the IP address of the device sending and / or receiving the data message and the target data is 80 bytes, the remaining 20 bytes are filled with preset characters. At this time, the 20 bytes of preset characters are the filling field.

[0074] In some embodiments, in S103, the gateway may carry the sending priority set for the first data message in the target format. For example, if the target format includes a control field, the sending priority set for the first data message may be carried in the control field of the target format.

[0075] The priority of sending a message is carried in the control field, which is a better setting method, and is convenient for the gateway to manage the message. Of course, the sending priority can also be carried in other fields of the message, and the embodiment of the present disclosure does not limit this.

[0076] A method for implementing S104 is proposed below. S104 includes S104a to S104d.

[0077] S104a: The gateway decapsulates and reassembles the first data message according to the target format at the MAC layer based on the IP address of the first device and the first corresponding relationship to obtain an intermediate data message.

[0078] The first correspondence is a correspondence between the IP address of the first device, the control identifier of the first device, and the link layer identifier of the communication protocol used by the first device. The control identifier of the first device includes the identifier of the first device and the identifier of the communication protocol used by the first device.

[0079] The intermediate data message includes but is not limited to the control identifier of the first device, the IP address of the second device and the target data.

[0080] In one example, FIG5 is a schematic diagram of an intermediate data message conforming to a target format according to some embodiments. The intermediate data message shown in FIG5 includes: an identification field, a MAC header field, a control field, a data field, and a padding field. The identification field carries the control identification of the first device, the MAC header field carries the MAC address of the first device and the MAC address of the gateway, the control field carries the total length set for the data field (for example, 10 bytes), the data field carries the IP address of the first device, the IP address of the second device, and the target data, and the padding field carries preset characters.

[0081] In some embodiments, in S101, the device mapping table includes a first correspondence, and the gateway finds the control identifier of the first device corresponding to the IP address of the first device in the intermediate data message based on the IP address of the first device and the first correspondence in the device mapping table.

[0082] S104b: The gateway transmits the intermediate data message from the MAC layer to the upper layer.

[0083] The gateway decapsulates the intermediate data message through the network layer, transport layer and application layer to obtain the target data.

[0084] In this process, the network layer, transport layer and application layer unpack the intermediate data message layer by layer, which is a process of removing the header field of each layer, and finally obtaining the target data after reaching the application layer.

[0085] S104c: After the upper layer of the MAC layer of the gateway obtains the target data, it encapsulates the target data from top to bottom and transmits it to the MAC layer of the gateway.

[0086] The upper layers of the MAC layer include: network layer, transport layer and application layer.

[0087] After the gateway obtains the target data at the upper layer of the MAC layer, it encapsulates it again from the application layer, transport layer and network layer in sequence and transmits it down to the MAC layer. The upper layer of the gateway's MAC layer encapsulates the target data in accordance with the target format unified by the MAC layer when encapsulating the target data in sequence, and no longer distinguishes the formats specified by each protocol.

[0088] Since the port number in the header field removed when the intermediate data message passes through the transport layer in S104b is different from the port number in the header field assigned by the gateway to the intermediate data at the transport layer in S104c, the gateway needs to transmit the intermediate data message to the upper layer first, and then transmit it from the upper layer to the lower layer to encapsulate the new port number.

[0089] S104d: After the gateway obtains the target data in the intermediate data message at the upper layer of the MAC layer, based on the IP address of the second device and the second corresponding relationship, the gateway encapsulates the target data into a second data message in the target format at the MAC layer.

[0090] The second data message includes but is not limited to: a control identifier of the second device, an IP address of the second device, and target data.

[0091] The second correspondence is a correspondence between the IP address of the second device, the control identifier of the second device, and the link layer identifier of the communication protocol used by the second device. The control identifier of the second device includes the identifier of the second device and the identifier of the communication protocol used by the second device.

[0092] In some embodiments, the device mapping table includes a second corresponding relationship, and the gateway obtains the second corresponding relationship based on the device mapping table.

[0093] In one example, FIG6 is a schematic diagram of a second data message conforming to a target format according to some embodiments. The second data message shown in FIG6 includes: an identification field, a MAC header field, a control field, a data field, and a padding field. The identification field carries the control identification of the second device, the MAC header field carries the MAC address of the gateway and the MAC address of the second device, the control field carries the total length set for the data field (for example, 10 bytes), the data field carries the IP address of the first device, the IP address of the second device, and the target data, and the padding field carries preset characters.

[0094] In some embodiments, in S101, the device mapping table includes a second correspondence, and the gateway finds the control identifier of the second device corresponding to the IP address of the second device included in the second data message based on the IP address of the second device and the second correspondence in the device mapping table.

[0095] In S104, the gateway converts the first data message into the second data message according to the target format, that is, S104 is the process of unifying the first data message into the target format. In the implementation method of S104a to S104d, the gateway no longer distinguishes the formats of various communication protocols at the upper layer of the MAC layer, that is, after the gateway proposed in the embodiment of the present disclosure unifies the data message format at the MAC layer, there is no restriction on usage scenarios.

[0096] S105: The gateway converts the second data message into a third data message based on a format specified by the communication protocol used by the second device.

[0097] The third data packet includes the target data. In some embodiments, the third data packet also includes the IP address of the second device.

[0098] For example, first, the gateway obtains the communication protocol used by the second device through the control identifier of the second device included in the second data message.

[0099] Secondly, the gateway decapsulates and reassembles the second data message according to the format specified by the communication protocol used by the second device to obtain a third data message.

[0100] Since the second device can only recognize data packets encapsulated in the format specified by the communication protocol it uses, the gateway needs to convert the format of the second data packet into a data packet format that the second device can recognize (i.e., the third data packet) before sending the second data packet.

[0101] S106: The gateway sends the third data packet to the second device.

[0102] In some embodiments, the gateway sends the third data packet to the second device via a link layer of a communication protocol used by the second device.

[0103] Since the device mapping relationship table stores the IP address of the second device and the link layer identifier of the communication protocol used by the second device, the gateway can determine the link layer of the communication protocol used by the second device through the mapping relationship table.

[0104] As shown in Figure 2, since the gateway's MAC layer in the data link layer unifies the link layers of different communication protocols, when the gateway transmits the third data packet from the MAC layer to the lower physical layer, it needs to be transmitted to the physical layer based on the link layer channel of the communication protocol of the third data packet.

[0105] The method proposed in the embodiment of the present disclosure, first, can unify the format of the data message received or sent in the lower MAC layer of the network layer, that is, it can be known that the data message no longer distinguishes the message format at the network layer. Therefore, the method proposed in the embodiment of the present disclosure is not limited by the network protocol and can be compatible with communication protocols using both IPv4 and IPv6 network protocols. Secondly, the method proposed in the embodiment of the present disclosure reduces the complexity of implementation and does not require the gateway to be equipped with a high-performance chip, thereby reducing the cost of use. Finally, using the method of the embodiment of the present disclosure, there is no need to pay authorization and authentication fees, which can also save usage costs.

[0106] In one example, FIG7 illustrates the process of executing S102 to S106. FIG7 is a schematic diagram of the detailed encapsulation and decapsulation and reassembly process of the target data in the gateway layered model shown in FIG2 when the first device sends the target data to the second device through the gateway. The process includes, for example: receiving a first data packet from the communication protocol link layer used by the first device, decapsulating and reassembling the first data packet into an intermediate data packet at the MAC layer, decapsulating the intermediate data packet through the upper layer of the MAC layer, and encapsulating the MAC layer to obtain a second data packet, decapsulating and reassembling the second data packet into a third data packet, and sending the third data packet from the communication protocol link layer used by the second device. The data field of the above-mentioned data packet includes an IP header field, a TCP header field, and target data. The IP header field includes the IP address of the first device and the IP address of the second device. The port number in the TCP header field during the decapsulation of the intermediate data packet is the port number assigned by the first device when encapsulating the first data packet. The port number is different from the port number in the TCP header field during the gateway encapsulation of the target data.

[0107] It is understandable that, in order to realize the above functions, the data transmission device includes hardware structures and / or software modules corresponding to the execution of each function. It should be easily appreciated by those skilled in the art that, in combination with the algorithm steps of each example described in the embodiments of the present disclosure, the present disclosure can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in a hardware or computer software driven hardware manner depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present disclosure.

[0108] The embodiment of the present disclosure can divide the data transmission device into functional modules according to the above-mentioned method embodiment. For example, each functional module can be divided corresponding to each function, or two or more functions can be integrated into one functional module. The above-mentioned integrated module can be implemented in the form of hardware or software. It should be noted that the division of modules in the embodiment of the present disclosure is exemplary and is only a logical function division. There may be other division methods in actual implementation. The following is an example of dividing each functional module corresponding to each function.

[0109] FIG8 is a schematic structural diagram of a data transmission device according to some embodiments. For example, the data transmission device may be the gateway shown in FIG1 . The data transmission device may execute the data transmission method provided by the above-mentioned method embodiment. As shown in FIG8 , the data transmission device 200 includes: a data message format unification unit 201: when receiving or sending a data message, the data message is unified into a target format at the MAC layer; the lower layer of the MAC layer is a link layer that supports at least two communication protocols; the upper layer of the MAC layer does not distinguish between at least two communication protocols; the upper layer of the MAC layer includes: a network layer, a transport layer, and an application layer. For example, the data message format unification unit 201 is applied to S103 in the method embodiment.

[0110] In some embodiments, a gateway connects a first device and a second device, the communication protocols used by the first device and the second device are different, and the link layers of at least two communication protocols include the link layer of the communication protocol used by the first device and the second device; the gateway also includes a receiving unit 202, which is used to receive a first data message sent by the first device to the second device before the MAC layer unifies the data message into a target format; the first data message is a data message received by the gateway; the first data message includes target data; the format of the first data message is the format specified by the communication protocol used by the first device; the data message format unification unit 201 is used to convert the first data message into a second data message according to the target format at the MAC layer; the second data message includes target data; the data message format unification unit 201 is also used to convert the second data message into a third data message based on the format specified by the communication protocol used by the second device after the MAC layer unifies the data message into the target format; the third data message is a data message sent by the gateway; the third data message includes target data; the gateway also includes a sending unit 203, which is used to send the third data message to the second device. For example, as shown in FIG3 , the receiving unit 202 is applied to S102 in the method embodiment, the data message format unifying unit 201 is applied to S103 and S104 in the method embodiment, and the sending unit 203 is applied to S105 in the method embodiment.

[0111] In some embodiments, the first data message further includes an IP address of the first device and an IP address of the second device. The data message format unification unit 201 is configured to, based on the IP address of the first device and the first correspondence, decapsulate and reassemble the first data message in a target format at the MAC layer to obtain an intermediate data message. The first correspondence includes a correspondence between the IP address of the first device and a control identifier of the first device, where the control identifier of the first device includes an identifier of the first device and an identifier of the communication protocol used by the first device. The intermediate data message includes the control identifier of the first device, the IP address of the second device, and target data. After obtaining the target data in the intermediate data message at an upper layer of the MAC layer, the target data is encapsulated in a target format into a second data message at the MAC layer based on the IP address of the second device and the second correspondence. The second correspondence includes a correspondence between the IP address of the second device and the control identifier of the second device, where the control identifier of the second device includes an identifier of the second device and an identifier of the communication protocol used by the second device. The second data message includes: the control identifier of the second device, the IP address of the second device, and the target data. For example, the data message format unification unit 201 is applied to S104a to S104d in the method embodiment.

[0112] In some embodiments, the gateway further includes an acquisition unit 204 configured to, before receiving a first data packet sent from the first device to the second device, respectively acquire the IP address of the first device, the control identifier of the first device, the IP address of the second device, and the control identifier of the second device, and establish a first correspondence and a second correspondence. For example, as shown in FIG3 , the acquisition unit 204 is applied to S101 in the method embodiment.

[0113] In some embodiments, the second correspondence further includes a correspondence between the IP address of the second device and a link layer identifier of the communication protocol used by the second device; the sending unit 203 is configured to send the third data packet to the second device via the link layer of the communication protocol used by the second device. For example, as shown in FIG3 , the sending unit 203 is implemented in S106 of the method embodiment.

[0114] In some embodiments, the target format includes: an identification field, a MAC header field, a control field and a data field which are arranged in sequence; the identification field is used to carry: the identification of the device that sends / receives the data message, and the identification of the communication protocol used by the device that sends / receives the data message; the MAC header field is used to carry: the MAC address of the device that sends and receives the data message; the control field is used to carry the data format of the data field; the data field is used to carry: the IP address of the device that sends and receives the data message and the target data.

[0115] In some embodiments, the target format further includes a padding field; the padding field is used to carry preset characters, and the preset characters are used to fill the data field with data when the data length of the data field is less than the total length of the data field.

[0116] In some embodiments, the target format is further used to carry the sending priority of the data message; the sending unit 203 is further used to, when the gateway receives multiple data messages, send the multiple data messages in the order of the sending priority of the multiple data messages; the multiple data messages include the first data message. For example, the sending unit 203 is used in S103 of the method embodiment.

[0117] In some embodiments, the sending priority of the data packet is determined based on the number of data packets cached in the gateway; when the number of data packets sent by the first device cached in the gateway is greater, the sending priority set for the first data packet is higher.

[0118] In some embodiments, when the target format includes a control field, the control field is also used to carry the sending priority of the data packet.

[0119] In some embodiments, the communication protocol includes: WiFi, Bluetooth, ZigBee, z-wave, or Thread.

[0120] In the case of implementing the functions of the above-mentioned integrated modules in hardware, the embodiments of the present disclosure provide another structure of the data transmission device involved in the above-mentioned embodiments, as shown in Figure 9. The data transmission device 300 includes: a processor 302 and a bus 304. In some embodiments, the data transmission device may also include a memory 301; in some embodiments, the data transmission device may also include a communication interface 303.

[0121] Processor 302 may implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the embodiments of the present disclosure. Processor 302 may be a central processing unit, a general-purpose processor, a digital signal processor, an application-specific integrated circuit, a field-programmable gate array, or other programmable logic device, a transistor logic device, a hardware component, or any combination thereof. Processor 302 may implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the embodiments of the present disclosure. Processor 302 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.

[0122] The communication interface 303 is used to connect to other devices via a communication network, such as Ethernet, wireless access network, or wireless local area network (WLAN).

[0123] The memory 301 may be a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a random access memory (RAM) or other type of dynamic storage device that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto.

[0124] As an implementation, the memory 301 can exist independently of the processor 302. The memory 301 can be connected to the processor 302 via a bus 304 to store instructions or program codes. When the processor 302 calls and executes the instructions or program codes stored in the memory 301, the data transmission method provided in the embodiment of the present disclosure can be implemented.

[0125] In another implementation, the memory 301 may also be integrated with the processor 302 .

[0126] Bus 304 can be an Extended Industry Standard Architecture (EISA) bus, etc. Bus 304 can be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, FIG9 shows only one thick line, but this does not mean that there is only one bus or only one type of bus.

[0127] Some embodiments of the present disclosure provide a computer-readable storage medium (e.g., a non-transitory computer-readable storage medium), which stores computer program instructions. When the computer program instructions are executed on a computer, the computer executes the data transmission method described in any of the above embodiments.

[0128] Exemplarily, the above-mentioned computer-readable storage media may include, but are not limited to: magnetic storage devices (e.g., hard disks, floppy disks, or magnetic tapes, etc.), optical disks (e.g., compact disks (CDs), digital versatile disks (DVDs), etc.), smart cards, and flash memory devices (e.g., erasable programmable read-only memories (EPROMs), cards, sticks, or key drives, etc.). The various computer-readable storage media described in the present disclosure may represent one or more devices and / or other machine-readable storage media for storing information. The term "machine-readable storage medium" may include, but is not limited to, wireless channels and various other media capable of storing, containing, and / or carrying instructions and / or data.

[0129] An embodiment of the present disclosure provides a computer program product comprising instructions. When the computer program product is run on a computer, the computer is enabled to execute the data transmission method described in any one of the above embodiments.

[0130] The above is only a specific embodiment of the present disclosure, but the scope of protection of the present disclosure is not limited thereto. Any changes or replacements within the technical scope disclosed in the present disclosure should be included in the scope of protection of the present disclosure. Therefore, the scope of protection of the present disclosure should be based on the scope of protection of the claims.

Claims

1. A data transmission method, in, The method is applied to a gateway and comprises: In the case of receiving or sending a data message, the data message is unified into a target format at the MAC layer; the lower layer of the MAC layer is a link layer supporting at least two communication protocols; The upper layer of the MAC layer does not distinguish between the at least two communication protocols; the upper layer of the MAC layer includes: a network layer, a transport layer and an application layer.

2. The method according to claim 1, in, The gateway connects a first device and a second device, the first device and the second device use different communication protocols, and the link layers of the at least two communication protocols include the link layer of the communication protocol used by the first device and the second device; before unifying the data message into a target format at the MAC layer, the method further includes: receiving a first data message sent by the first device to the second device; wherein the first data message is a data message received by the gateway; the first data message includes target data; and the format of the first data message is a format specified by a communication protocol used by the first device; The step of unifying the data packets into a target format at the MAC layer includes: Converting the first data message into a second data message according to the target format at the MAC layer; the second data message includes the target data; After unifying the data messages into a target format at the MAC layer, the method further includes: Based on the format specified by the communication protocol used by the second device, convert the second data message into a third data message; wherein the third data message is a data message sent by the gateway; and the third data message includes the target data; The third data packet is sent to the second device.

3. The method according to claim 2, in, The first data message also includes an Internet Protocol IP address of the first device and an IP address of the second device, and the converting the first data message into a second data message according to a target format at the MAC layer includes: Based on the IP address of the first device and the first corresponding relationship, the first data message is decapsulated and reassembled in a target format at the MAC layer to obtain an intermediate data message; wherein the first corresponding relationship includes a corresponding relationship between the IP address of the first device and the control identifier of the first device, and the control identifier of the first device includes an identifier of the first device and an identifier of a communication protocol used by the first device; the intermediate data message includes the control identifier of the first device, the IP address of the second device and the target data; After obtaining the target data in the intermediate data message at the upper layer of the MAC layer, based on the IP address of the second device and the second correspondence, the target data is encapsulated into the second data message in accordance with the target format at the MAC layer; wherein the second correspondence includes the correspondence between the IP address of the second device and the control identifier of the second device, and the control identifier of the second device includes the identifier of the second device and the identifier of the communication protocol used by the second device; the second data message includes: the control identifier of the second device, the IP address of the second device and the target data.

4. The method according to claim 3, in, Before receiving the first data message sent by the first device to the second device, the method further includes: Respectively obtain the IP address of the first device, the control identifier of the first device, the IP address of the second device, and the control identifier of the second device; The first corresponding relationship and the second corresponding relationship are established.

5. The method according to claim 3 or 4, in, The second correspondence further includes a correspondence between the IP address of the second device and a link layer identifier of a communication protocol used by the second device; The sending the third data message to the second device includes: The third data message is sent to the second device through a link layer of a communication protocol used by the second device.

6. The method according to any one of claims 1 to 4, in, The target format includes: an identification field, a MAC header field, a control field and a data field which are arranged in sequence; The identification field is used to carry: the identification of the device sending / receiving the data message, and the identification of the communication protocol used by the device sending / receiving the data message; The MAC header field is used to carry: the MAC address of the device sending and receiving the data message; The control field is used to carry the data format of the data field; The data field is used to carry: the IP address of the device sending and receiving the data message, and the target data.

7. The method according to claim 6, in, The target format also includes a padding field; The padding field is used to carry preset characters, and the preset characters are used to fill the data field with data when the data length of the data field is less than the total length of the data field.

8. The method according to any one of claims 1 to 4, in, The target format is also used to carry the sending priority of the data message; the method also includes: When the gateway receives multiple data packets, the gateway sends the multiple data packets respectively according to the order of their sending priorities; wherein the multiple data packets include the first data packet.

9. The method according to claim 8, in, The sending priority of the data message is determined based on the number of data messages cached by the gateway; When the number of data packets sent by the first device cached in the gateway is greater, a higher sending priority is set for the first data packet.

10. The method according to claim 6, in, In the case where the target format includes the control field, the control field is also used to carry the sending priority of the data message.

11. The method according to any one of claims 1 to 4, in, The communication protocols include: Wireless Fidelity WiFi, Bluetooth, ZigBee, z-wave or Thread.

12. A data transmission device, comprising a memory and a processor; the memory and the processor are coupled; the memory is used to store computer program code, the computer program code comprising computer instructions; in, When the processor executes the computer instructions, the data transmission device executes the data transmission method according to any one of claims 1-11.

13. A computer-readable storage medium, in, The computer-readable storage medium stores computer instructions; wherein, when the computer instructions are executed on a data transmission device, the data transmission device executes the data transmission method according to any one of claims 1-11.

Citation Information

Patent Citations

  • Data transmission method and device and storage medium

    CN116781798A

  • Internet of things gateway data processing method, device, storage medium and gateway device

    CN109040144A

  • Gateway equipment, multi-protocol data transmission method and computer equipment

    CN111163147A

  • Message processing method and device, equipment and storage medium

    CN113595931A

  • Packet conversion method and device

    WO2016191990A1