Data transmission method, apparatus, and computer program
The data transmission method and device unify packet formats at the MAC layer to enable interoperability among smart home devices with diverse communication protocols, reducing costs and complexity by eliminating the need for high-performance chips and network protocol restrictions.
Patent Information
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- ZTE CORP
- Filing Date
- 2024-04-03
- Publication Date
- 2026-06-02
AI Technical Summary
Smart home devices from different manufacturers use different communication protocols, preventing interoperability and necessitating high-cost, complex solutions like the Matter protocol that require high-performance chips.
A data transmission method and device that unify data packets into a target format at the MAC layer, supporting multiple communication protocols without distinguishing between them, eliminating the need for high-performance chips and reducing implementation complexity.
Enables seamless interconnection of smart home devices with reduced costs and complexity by unifying packet formats at the MAC layer, supporting multiple protocols and avoiding network protocol restrictions.
Smart Images

Figure 2026517845000001_ABST
Abstract
Description
Technical Field
[0001] (Cross - reference to Related Applications) This application claims priority based on a Chinese patent application with application number 202310555951.4 filed on May 16, 2023 as the basic application, and all of its disclosure content is incorporated herein by reference.
[0002] This disclosure relates to the field of communication technologies, and particularly to a data transmission method, apparatus, and Computer program related thereto.
Background Art
[0003] Smart homes are Internet of Things (IoT) devices with a broad market outlook. However, currently, there are many smart home manufacturers, and smart homes produced by different manufacturers use different communication protocols, resulting in the problem that smart homes cannot be interconnected with each other.
Summary of the Invention
Means for Solving the Problems
[0004] In one aspect, embodiments of this disclosure provide a data transmission method to a gateway. This data transmission method includes the step of unifying data packets into a target format in the media access control (MAC) layer when sending and receiving data packets. The lower layer of the MAC layer is a link layer that supports at least two types of communication protocols. The upper layer of the MAC layer does not distinguish between at least two types of communication protocols. The upper layer of the MAC layer includes a network layer, a transport layer, and an application layer.
[0005] In another embodiment, an embodiment of the present disclosure provides a data transmission device. This data transmission device includes a data packet unification unit at the MAC layer for unifying data packets into a target format when sending and receiving data packets. The lower layer of the MAC layer is a link layer supporting at least two types of communication protocols, and the upper layer of the MAC layer does not distinguish between at least two types of communication protocols. The upper layer of the MAC layer includes a network layer, a transport layer, and an application layer.
[0006] In yet another embodiment, an embodiment of the present disclosure provides a data transmission device. This data transmission device includes memory and a processor. The memory and the processor are coupled. The memory is used to store computer programs. The processor executes the computer programs as described above. state The data transmission method described in the instructions will be implemented.
[0007] In yet another embodiment, an embodiment of the present disclosure provides a computer-readable storage medium which stores computer program instructions, and when these computer program instructions are executed by a processor, the above state The data transmission method described in the instructions will be implemented.
[0008] In yet another embodiment, an embodiment of the present disclosure provides a computer program product which includes computer program instructions, when these computer program instructions are executed by a processor, the above state The data transmission method described in the instructions will be implemented.
[0009] To more clearly illustrate the technical solutions of this disclosure, the drawings used in some embodiments of this disclosure are briefly described below. Obviously, the drawings in the following description are only those of some embodiments of this disclosure, and those skilled in the art can obtain other drawings based on these. [Brief explanation of the drawing]
[0010] [Figure 1] This figure shows the implementation environment for data transmission methods in several embodiments. [Figure 2] This figure shows a hierarchical gateway model relating to several embodiments. [Figure 3] This is a flowchart of a data transmission method according to several embodiments. [Figure 4] This figure shows the target format for several embodiments. [Figure 5] This figure shows intermediate data packets relating to several embodiments. [Figure 6] This figure shows a second data packet relating to several embodiments. [Figure 7] This figure shows the data packet encapsulation and decapsulation processes according to several embodiments. [Figure 8] This figure shows the configuration of a data transmission device according to several embodiments. [Figure 9] This figure shows the configuration of another data transmission device according to several embodiments. [Modes for carrying out the invention]
[0011] The following will clearly and completely describe the technical solutions of this disclosure with reference to the drawings of this disclosure. Obviously, the embodiments described are only some, and not all, embodiments of this disclosure. All other embodiments that a person skilled in the art can obtain without creative work based on the embodiments of this disclosure are within the scope of this disclosure.
[0012] In this disclosure, expressions such as "exemplary" or "for example" are used to provide examples, illustrations, or explanations. None of the embodiments or design solutions described as "exemplary" or "for example" in this disclosure should be construed as having priority or superiority over other embodiments or design solutions. More precisely, the use of expressions such as "exemplary" or "for example" is intended to illustrate the relevant concepts in detail.
[0013] Hereafter, terms such as "First," "Second," etc., are used solely for explanatory purposes and should not be understood as indicating or implying relative importance, or implicitly indicating the number of designated technical features. Thus, features limited by "First," "Second," etc., may explicitly or implicitly include one or more of those features.
[0014] In this disclosure, unless otherwise specified, " / " means "or". For example, A / B can mean A or B. In this text, "and / or" describes only the relationship between related objects and indicates that there may be three types of relationships. For example, A and / or B can mean that only A exists, only B exists, or both A and B exist. Also, "at least one" refers to one or more, and "multiple" refers to two or more.
[0015] Different smart home products have a problem with interoperability due to the use of different communication protocols. To solve this smart home interoperability problem, some technologies propose the Matter protocol, an application layer protocol based on IPv6. This protocol relies on IPv6-compliant lower-layer protocols such as Wireless Fidelity (WiFi), Ethernet (registered trademark), and Thread, and smart home products must support one of these three protocols in order to use Matter. Furthermore, the architecture of the Matter protocol is relatively complex, and smart home products that use this protocol need to be equipped with high-performance chips. Therefore, the Matter protocol imposes certain requirements on the network supported by smart home products, and the cost of using this protocol is also high.
[0016] Based on this, embodiments of the present disclosure provide a data transmission method. This method connects to a gateway. Therefore it is executed 1. The lower layer of the MAC layer of this gateway is a link layer that supports at least two types of communication protocols. When this gateway sends and receives data packets, the MAC layer unifies the format of the data packets into the target format. As a result, when the upper layer of the MAC layer processes data packets, there is no need to distinguish the communication protocols of the data packets. In this method, since the lower layer of the MAC layer of the gateway is a link layer that supports at least two types of communication protocols, this gateway can process data packets of at least two types of communication protocols. At the same time, since this gateway performs format unification processing in the MAC layer, which is the lower layer of the network layer, this method has no network restrictions compared with the prior art where the Matter protocol is limited to the IPv6 network protocol. Furthermore, the method of the present disclosure reduces the complexity of implementation, does not require the gateway to be equipped with a high-performance chip, and can reduce the usage cost.
[0017] Hereinafter, the embodiments of the examples of the present disclosure will be described in detail with reference to the drawings.
[0018] FIG. 1 shows an implementation environment related to a data transmission method provided by an embodiment of the present disclosure. This implementation environment includes a first device 110, a second device 120, and a gateway 130.
[0019] 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 data packets transmitted via the gateway 130 and complete the communication.
[0020] FIG. 1 shows the gateway 130 connected to a plurality of smart devices, where the first device 110 and the second device 120 are any two of the plurality of devices shown in FIG. 1. Exemplarily, the first device 110 and the second device 120 can each be a device such as smart lighting, a smart door lock, smart curtains, a smart surveillance camera, a smart TV, or a smart terminal.
[0021] The gateway 130 is also called an inter-network connector or a protocol converter. The gateway 130 is used between two systems with completely different communication protocols, data formats or languages, and even architectures, and can realize the interconnection between two network devices with different protocols. The gateway 130 can be used for the interconnection of wide area networks as well as for the interconnection of local area networks.
[0022] In an embodiment of the present disclosure, FIG. 2 shows a hierarchical 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.
[0023] Physical layer: It is the hardware part responsible for the transmission of bit streams and includes various transmission media (such as copper wires, optical fibers, or wireless channels, etc.).
[0024] Data link layer: It is responsible for encapsulating the data packets sent from the network layer into frames and transmitting the data packets on the transmission media of the physical layer. In an embodiment of the present disclosure, the data link layer includes a protocol link layer and a unified mac layer. The protocol link layer is located below the mac layer, and the mac layer unifies the format of the data packets to be transmitted and received. The lower layer of the mac layer includes various protocol link layers such as Bluetooth (registered trademark) link layer, ZigBee (registered trademark) link layer, z-wave link layer, and thread link layer.
[0025] Network Layer: Provides host-to-host services. The network layer determines the communication path from a transmitting device to a receiving device and can encapsulate the Internet Protocol (IP) addresses of the transmitting and receiving devices in an IP header field. The network layer can support IPv4 and IPv6 network protocols. In this disclosure, this network layer does not distinguish between IPv4 and IPv6 network protocols.
[0026] Transport Layer: Provides end-to-end services. The transport layer obtains services from the network layer and delivers them to the application layer. The transport layer supports either the transmission control protocol (TCP) or the user datagram protocol (UDP).
[0027] Application layer: Provides data transmission services to the application. In embodiments of this disclosure, the application is an application installed on a device connected to the gateway (e.g., first device 110 or second device 120).
[0028] In the embodiment of this disclosure, the operation process of the gateway 130 is as follows: it receives data packets transmitted by the first device 110 from the physical layer, performs format unification at the MAC layer of the data link layer, then decapsulates them step by step through the network layer, transport layer and application layer to obtain the target data, then transmits the data packets from the application layer, transport layer and network layer to the MAC layer of the data link layer, performs format unification at the MAC layer to obtain the second data packet, and then decapsulates and reconstructs the second data packet based on the communication protocol used by the second device 120 to obtain a third data packet to be transmitted to the second device 120.
[0029] As described above, both the first device 110 and the second device 120 are connected to the gateway 130 by wired or wireless means, and the first device 110 and the second device 120 can communicate with each other via the gateway 130. There may be one or more first devices 110 and second devices 120, and the embodiments of this disclosure do not limit the number of first devices 110 and second devices 120.
[0030] In one scenario, if the first device 110 is a smart surveillance camera and the second device 120 is a smart washing machine, the first device 110 and the second device 120 establish a connection via the gateway 130. The user sends control commands to the smart washing machine via the smart surveillance camera to control the operation of the smart washing machine. These control commands are sent from the smart surveillance camera to the gateway 130, which reconstructs the control commands to be sent from the smart surveillance camera to the smart washing machine based on the target format, and then sends them to the smart washing machine, thereby controlling the operation of the smart washing machine.
[0031] The data transmission method provided by the embodiments of this disclosure will be described below.
[0032] The data transmission method provided by the embodiments of this disclosure is connected to gateway 130 Therefore, The entity that implements the data transmission method provided by the embodiments of this disclosure may be a data transmission device. This data transmission device may be a gateway, or an application (APP) installed on the gateway that provides data transmission functionality, or a central processing unit (CPU) within the gateway, or a control module for executing the data transmission method within the gateway. The following describes the method provided by the embodiments of this disclosure. Executing body Let's explain using the example of a gateway.
[0033] Embodiments of this disclosure provide a data transmission method. In this data transmission method, the lower layer of the MAC layer of the gateway is a link layer that supports at least two types of communication protocols, and the upper layer of the MAC layer does not distinguish between at least two types of communication protocols. When the gateway sends and receives data packets, the MAC layer unifies the data packets into a target format.
[0034] Figure 3 is a flowchart of a data transmission method according to several embodiments. This method is connected to a gateway. Therefore, This gateway is connected to the first and second devices, and the communication protocols used by the first and second devices are different. As shown in Figure 3, this method may include S101 to S106.
[0035] S101: The gateway creates a device mapping table.
[0036] The device mapping table is a table that contains the correspondence between the IP address, control identifier, and link layer identifier of the communication protocol used by the device accessing the gateway.
[0037] The control identifier of a device accessing the gateway includes the identifier of the device and the identifier of the communication protocol used by that device. For example, a gateway might use a DCI as its control identifier, which consists of two parts (e.g., DI and CI), where DI is the device identifier and CI is the identifier of the communication protocol used by the device.
[0038] The communication protocols used by the above devices include, but are not limited to, WiFi, Bluetooth, ZigBee, z-wave, and Thread.
[0039] In one implementation, the gateway obtains the IP addresses of the accessed first and second devices, assigns a control identifier (DCI) and a link layer identifier for the communication protocol used by the first and second devices to each device, and stores this information in the device mapping table.
[0040] In one example, for two devices, the first and second, accessed by the gateway, if the first device uses the Bluetooth protocol, and the gateway represents "A" as the identifier of the first device, "1" as the Bluetooth protocol, and "x1" as the link layer identifier of the Bluetooth protocol, then 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 second device uses the WiFi protocol, and the gateway represents "B" as the identifier of the second device, "2" as the WiFi protocol, and "x2" as the WiFi link layer identifier, then 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 the device mapping table. The device mapping table shown in Table 1 includes the correspondence between "IP address", "control identifier DCI", and "communication protocol link layer identifier".
[0041] [Table 1]
[0042] The gateway stores information such as the IP address of the acquired access device in a device mapping table. When each device communicates with the others later, the gateway can directly query the pre-stored information for each device in the device mapping table, quickly completing the data packet decapsulation and reconstruction workflow and improving the processing speed of the method disclosed herein.
[0043] S102: The gateway receives the first data packet transmitted from the first device to the second device.
[0044] The first data packet contains the target data. The format of the first data packet is the format specified by the communication protocol used by the first device.
[0045] The target data is the data that the first device actually transmits to the second device. For example, if the first device is a smart security camera and the second device is a smart curtain, and the smart security camera needs to be controlled to open the smart curtain, the target data would be "open curtain".
[0046] The first data packet is a packet obtained after the first device has encapsulated the target data in a format specified by the communication protocol used by the first device. This first data packet further includes the IP address of the first device and the IP address of the second device.
[0047] In one example, if the communication protocol used by the first device is the Bluetooth protocol, the first data packet is a packet obtained after the first device has encapsulated the target data in the format specified by the Bluetooth protocol.
[0048] S103 (In some embodiments): The gateway sets a transmission priority for the first data packet.
[0049] The transmission priority indicates the order in which gateways send the first data packets.
[0050] When a gateway receives multiple data packets, it transmits them in order of their transmission priority. These multiple data packets include the first data packet.
[0051] In one implementation, when a gateway simultaneously receives data packets transmitted by multiple devices, the transmission priority that the gateway sets for each data packet is determined based on the number of data packets that each device has cached at the gateway. For example, the more data packets transmitted by the first device that are cached at the gateway, the higher the transmission priority that the gateway sets for the first data packet.
[0052] In one example, suppose the gateway has already cached 10 data packets sent by the first device before receiving the first data packet sent by the first device, and simultaneously caches 2 data packets sent by the third device (for example, as shown in Figure 1, the third device could be any device connected to the gateway other than the first and second devices). If the gateway then simultaneously receives the first data packet sent by the first device and the data packets sent by the third device, the gateway sets a higher transmission priority for the first data packet than for the data packets sent by the third device.
[0053] Since the first device already caches a relatively large number of data packets within the gateway, if the first device continues to send first data packets to the gateway, the gateway will set a higher priority for the packets sent by the first device to avoid data packets from accumulating within the gateway.
[0054] In another implementation, if a gateway receives only data packets transmitted by a single device, the gateway sets transmission priorities for the data packets transmitted by that device in the order in which they were received. The earlier the gateway receives a data packet, the higher its priority.
[0055] S104: The gateway converts the first data packet into a second data packet at the MAC layer according to the target format.
[0056] The second data packet contains the target data.
[0057] In some embodiments, Figure 4 shows a target format according to some embodiments. In Figure 4, the target format includes sequentially set identifier fields, a MAC header field, a control field, and a data field. In some embodiments, the target format further includes a padding field.
[0058] The identifier field is used to store the identifier of the device sending the data packet, the identifier of the communication protocol used by the device sending the data packet, or the identifier of the device receiving the data packet, or the identifier of the communication protocol used by the device receiving the data packet.
[0059] The MAC header field is used to carry the MAC addresses of the devices sending and receiving data packets.
[0060] The control field is used to convey the data format of the data field. For example, this includes the encoding scheme of the data field (e.g., Manchester coding) and the total length set for the data field.
[0061] The data field is used to carry the IP addresses of the devices sending and receiving the data packet, as well as the target data.
[0062] The above data fields are also called Service Data Units (SDUs).
[0063] A padding field is used to carry a predetermined character, which is used to pad a data field when the data length of the data field is shorter than the total length of the data field.
[0064] In one example, if the total length of the control field set for the data field is 100 bytes, and the actual data length of the IP address of the device sending and / or receiving the data packet and the target data is 80 bytes, the remaining 20 bytes are filled with predetermined characters. In this case, these 20 bytes of predetermined characters become the padding field.
[0065] In some embodiments, in S103, the transmission priority set in the first data packet may be carried within the target format. For example, if the target format includes a control field, the transmission priority set in the first data packet is carried within the control field of the target format.
[0066] Transporting packet transmission priority to a control field is a preferred configuration method for gateways to manage packets. Of course, transmission priority can also be transported to other fields of the packet, but the embodiments of this disclosure are not limited to this.
[0067] The following provides one way to implement S104. S104 includes S104a to S104d.
[0068] S104a: The gateway decapsulates and reconstructs the first data packet at the MAC layer according to the target format based on the IP address of the first device and the first correspondence, and obtains the intermediate data packet.
[0069] The first correspondence is the 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.
[0070] The intermediate data packet includes, but is not limited to, the control identifier of the first device, the IP address of the second device, and the target data.
[0071] In one example, Figure 5 shows an intermediate data packet conforming to a target format according to several embodiments. The intermediate data packet shown in Figure 5 includes an identifier field, a MAC header field, a control field, a data field, and a padding field. The identifier field carries the control identifier 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 full length (e.g., 10 bytes) set in the data field, 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 a predetermined character.
[0072] In some embodiments, in S101, the device mapping table includes a first correspondence, and the gateway searches for the control identifier of the first device corresponding to the IP address of the first device in the intermediate data packet, based on the IP address of the first device and the first correspondence in the device mapping table.
[0073] S104b: The gateway transmits intermediate data packets from the MAC layer to higher layers.
[0074] The gateway decapsulates intermediate data packets layer by layer—through the network layer, transport layer, and application layer—before obtaining the target data.
[0075] In this process, the network layer, transport layer, and application layer decapsulate the intermediate data packets layer by layer, which involves removing the header fields from each layer. Finally, after reaching the application layer, the target data is obtained.
[0076] S104c: After the upper layers of the gateway's MAC layer acquire the target data, the target data is encapsulated from top to bottom and transmitted to the gateway's MAC layer.
[0077] The layers above the mac layer include the network layer, transport layer, and application layer.
[0078] After the gateway acquires the target data in the layers above the MAC layer, it sequentially encapsulates it again through the application layer, transport layer, and network layer, and transmits it downwards to the MAC layer. When the gateway's layers above the MAC layer sequentially encapsulate the target data, it encapsulates it according to the target format unified in the MAC layer, and does not distinguish between formats specified by each protocol.
[0079] The port number in the header field that was removed when the intermediate data packet passed through the transport layer in S104b, and the intermediate data at the transport layer when the gateway passed through the transport layer in S104c packet Because the port numbers in the header fields assigned to each packet are different, the gateway must first transmit the intermediate data packet to the upper layer, and then transmit it again from the upper layer to the lower layer to encapsulate the new port number.
[0080] S104d: The gateway obtains the target data within the intermediate data packet at a higher layer than the MAC layer. Based on the IP address of the second device and the second correspondence, it encapsulates the target data according to the target format at the MAC layer, creating a second data packet.
[0081] The second data packet includes, but is not limited to, the control identifier of the second device, the IP address of the second device, and the target data.
[0082] The second correspondence is the 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.
[0083] In some embodiments, the device mapping table includes a second correspondence, and the gateway obtains the second correspondence based on the device mapping table.
[0084] In one example, Figure 6 shows a second data packet conforming to a target format according to several embodiments. The second data packet shown in Figure 6 includes an identifier field, a MAC header field, a control field, a data field, and a padding field. The identifier field carries the control identifier 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 (e.g., 10 bytes) set in the data field, 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 a predetermined character.
[0085] In some embodiments, in S101, the device mapping table includes a second correspondence, and the gateway searches for the control identifier of the second device corresponding to the IP address of the second device contained in the second data packet, based on the IP address of the second device and the second correspondence in the device mapping table.
[0086] In S104, the gateway converts the first data packet into a second data packet according to the target format. In other words, S104 is the process of unifying the first data packet into the target format, and this process, through the implementation methods of S104a to S104d, eliminates the distinction between the formats of each communication protocol at the layers above the MAC layer of the gateway. In short, the gateway provided by the embodiment of this disclosure has no restrictions on usage scenarios after unifying the data packet format at the MAC layer.
[0087] S105: The gateway converts the second data packet into a third data packet based on the format specified by the communication protocol used by the second device.
[0088] The third data packet contains the target data. In some embodiments, the third data packet further contains the IP address of the second device.
[0089] For example, first, the gateway obtains the communication protocol used by the second device through the control identifier of the second device contained in the second data packet.
[0090] Next, the gateway decapsulates and reconstructs the second data packet in the format specified by the communication protocol used by the second device, and obtains the third data packet.
[0091] Since the second device can only recognize data packets encapsulated in the format specified by the communication protocol it uses, the gateway must first convert the format of the second data packet to a format that the second device can recognize (i.e., the third data packet) before sending the second data packet.
[0092] S106: The gateway sends the third data packet to the second device.
[0093] In some embodiments, the gateway transmits the third data packet to the second device via the link layer of the communication protocol used by the second device.
[0094] Equipment mapping Gut The cable stores the IP address of the second device and the link layer identifier of the communication protocol used by the second device, therefore the gateway device Mappin Gut The link layer of the communication protocol used by the second device can be determined through the cable.
[0095] As shown in Figure 2, the gateway unifies the link layers of different communication protocols at the MAC layer within the data link layer. Therefore, when the gateway transmits a third data packet from the MAC layer to the lower physical layer, it needs to transmit it to the physical layer based on the link layer channel of the third data packet's communication protocol.
[0096] First, the method provided by the embodiments of this disclosure can unify the format of received or transmitted data packets at the MAC layer, which is a lower layer of the network layer. As a result, the data packets no longer distinguish between packet formats at the network layer, and the method provided by the embodiments of this disclosure is not restricted by network protocols and can simultaneously maintain compatibility with communication protocols using IPv4 and IPv6 network protocols. Second, the method provided by the embodiments of this disclosure reduces implementation complexity, eliminates the need for gateways to incorporate high-performance chips, and therefore reduces usage costs. Finally, using the method provided by the embodiments of this disclosure eliminates the need to pay licensing or certification fees, thus saving on usage costs.
[0097] In one example, Figure 7 shows the process of executing S102 to S106. Figure 7 shows the detailed encapsulation and decapsulation / reconstruction process in the gateway hierarchy model shown in Figure 2 when the first device transmits target data to the second device via the gateway. This process involves, for example, the communication protocol link layer used by the first device to the first data Upon receiving the packet, the first at the MAC layer data Decapsulate and reconstruct the packets to obtain intermediate data It is treated as a packet and passes through the layers above the MAC layer to the intermediate layer. data The packets are decapsulated and then encapsulated at the MAC layer. data Capture the packet and the second data Decapsulating and reconstructing the packet into a third data The packet is a communication protocol used by the second device, ranging from the link layer to the third layer. data This includes sending packets. data The packet's data fields include the IP header field, the TCP header field, and the target data. The IP header field includes the IP address of the first device and the IP address of the second device. data During the packet decapsulation process, the port number in the TCP header field is determined by the first device. data This is the port number assigned when encapsulating the packet, and it is different from the port number in the TCP header field during the gateway's process of encapsulating the target data.
[0098] To ensure understanding, in order for a data transmission device to perform the functions described above, the data transmission device includes corresponding hardware structures and / or software modules for performing each function. Those skilled in the art should readily recognize that the disclosure can be implemented in hardware or in a combination of hardware and computer software by combining the algorithmic steps of each example described in the embodiments of this disclosure. Whether a particular function is performed by hardware or by hardware driven by computer software depends on the specific application and design constraints of the technical solution. While skilled technicians may implement the described functions using different methods for their respective specific applications, such implementations are not considered beyond the scope of this disclosure.
[0099] Embodiments of this disclosure can be used to divide the functional modules of a data transmission device according to embodiments of the method described above. For example, each functional module can be divided according to each function, or two or more functions can be integrated into one functional module. The integrated module described above may be implemented in hardware form or in software form. The module division in embodiments of this disclosure is illustrative and merely a division of logical functions, and other division methods may be used in actual implementation. The following describes an example in which each functional module is divided according to each function.
[0100] Figure 8 is a diagram showing the configuration of a data transmission device according to several embodiments, for example, this data transmission device may be the gateway shown in Figure 1. This data transmission device can perform the data transmission method provided by the embodiments of the method described above. As shown in Figure 8, the data transmission device 200 includes a data packet format unification unit 201 for unifying data packets to a target format at the MAC layer when sending and receiving data packets. The lower layer of the MAC layer is the link layer, which supports at least two types of communication protocols. The upper layer of the MAC layer does not distinguish between at least two types of communication protocols. The upper layer of the MAC layer includes the network layer, the transport layer, and the application layer. For example, the data packet format unification unit 201 is applied to S103 of the embodiment of the method.
[0101] In some embodiments, the gateway is connected to a first device and a second device, and the communication protocols used by the first and second devices are different. The link layers of at least two types of communication protocols include the link layers of the communication protocols used by the first and second devices. The gateway further includes a receiving unit 202 for receiving a first data packet transmitted from the first device to the second device before unifying the data packets to a target format at the MAC layer. The first data packet is the data packet received by the gateway. The first data packet contains target data. The format of the first data packet is the format specified by the communication protocol used by the first device. A data packet format unification unit 201 is used at the MAC layer to convert the first data packet to a second data packet according to the target format. The second data packet contains target data. The data packet format unification unit 201 is further used after unifying the data packets to a target format at the MAC layer to convert the second data packet to a third data packet based on the format specified by the communication protocol used by the second device. The third data packet is the data packet transmitted by the gateway. The third data packet contains the target data. The gateway further includes a transmitting unit 203 for transmitting the third data packet to the second device. For example, as shown in Figure 3, the receiving unit 202 is applied in S102 of the embodiment of the method, the data packet format unification unit 201 is applied in S103 and S104 of the embodiment of the method, and the transmitting unit 203 is applied in S105 of the embodiment of the method.
[0102] In some embodiments, the first data packet further includes the IP address of the first device and the IP address of the second device, and the data packet format unification unit 201 is used to decapsulate and reconstruct the first data packet according to the target format at the MAC layer based on the IP address of the first device and a first correspondence, and to obtain an intermediate data packet. The first correspondence includes the correspondence 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 the identifier of the first device and the identifier of the communication protocol used by the first device. The intermediate data packet 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 packet at a higher layer than the MAC layer, The data packet format unification unit 201 further: Based on the IP address of the second device and the second correspondence, the MAC layer encapsulates the target data according to the target format, creating a second data packet. Used for The second correspondence includes the correspondence between the IP address of the second device and the control identifier of 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. The second data packet includes the control identifier of the second device, the IP address of the second device, and the target data. For example, the data packet format unification unit 201 is applied to S104a to S104d of the embodiment of the method.
[0103] In some embodiments, the gateway further includes an acquisition unit 204 for acquiring 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, respectively, before receiving the first data packet transmitted from the first device to the second device, and for establishing a first correspondence and a second correspondence. For example, as shown in Figure 3, the acquisition unit 204 is applied to S101 of an embodiment of the method.
[0104] In some embodiments, the second correspondence further includes a correspondence between the IP address of the second device and the link-layer identifier of the communication protocol used by the second device. The transmitting unit 203 is used to transmit 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 Figure 3, the transmitting unit 203 is applied to S106 of an embodiment of the method.
[0105] In some embodiments, the target format includes sequentially configured identifier fields, a MAC header field, a control field, and a data field. The identifier field is used to carry the identifier of the device sending / receiving the data packet and the identifier of the communication protocol used by the device. The MAC header field is used to carry the MAC address of the device sending and receiving the data packet. 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 packet and the target data.
[0106] In some embodiments, the target format further includes a padding field. The padding field is used to carry a predetermined character, which is used to fill the data field with data when the data length of the data field is shorter than the total length of the data field.
[0107] In some embodiments, the target format is further used to carry the transmission priority of data packets. The transmission unit 203 is further used to transmit multiple data packets according to the transmission priority order of the multiple data packets when the gateway receives multiple data packets. The multiple data packets include the first data packet. For example, the transmission unit 203 is applied to S103 of an embodiment of the method.
[0108] In some embodiments, the transmission priority of a data packet is determined based on the number of data packets cached by the gateway. The more data packets sent from the first device that are cached by the gateway, the higher the transmission priority set for the first data packet.
[0109] In some embodiments, if the target format includes a control field, the control field is further used to carry the transmission priority of the data packet.
[0110] In some embodiments, the communication protocol includes WiFi, Bluetooth, ZigBee, z-wave, or Thread.
[0111] When the functions of the integrated module described above are implemented in hardware form, embodiments of this disclosure provide another structure of a data transmission device related to the embodiments described above. 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 further include a memory 301. In some embodiments, the data transmission device may further include a communication interface 303.
[0112] The processor 302 may implement or execute various exemplary logic blocks, modules, and circuits described in relation to embodiments of the present disclosure. The 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. The processor 302 may implement or execute various exemplary logic blocks, modules, and circuits described in relation to embodiments of the present disclosure. The processor 302 may include combinations that implement arithmetic functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and so on.
[0113] The communication interface 303 is used to connect to other devices via a communication network. This communication network may be Ethernet, a wireless access network, a wireless local area network (WLAN), or the like.
[0114] The memory 301 may be a read-only memory (ROM) or another type of static storage device capable of storing static information and instructions, a random access memory (RAM) or another type of dynamic storage device capable of storing information and instructions, and the memory 301 may be an electrically erasable programmable read-only memory (EEPROM), a disk storage medium or other magnetic storage device, or any other medium accessible by a computer that can be used to carry or store desired program code having instruction or data structure form.
[0115] One implementation method involves the memory 301 existing independently of the processor 302, being connected to the processor 302 via the bus 304, and used to store instructions or program code. When the processor 302 calls and executes the instructions or program code stored in the memory 301, the data transmission method provided by the embodiment of this disclosure can be realized.
[0116] In another implementation, the memory 301 may be integrated with the processor 302.
[0117] Bus 304 may be an extended industry standard architecture (EISA) bus, etc. Bus 404 can be divided into an address bus, a data bus, a control bus, etc. For simplicity of representation, Figure 13 shows only one thick line, but this does not mean that there is only one bus or only one type of bus.
[0118] Some embodiments of the present disclosure provide a computer-readable storage medium (e.g., a non-temporary computer-readable storage medium) on which computer program instructions are stored, and when the computer program instructions are executed on a computer, the computer is caused to execute a data transmission method described in any of the embodiments described above.
[0119] Exemplary computer-readable storage media may include, but are not limited to, magnetic storage devices (e.g., hard disks, floppy disks, magnetic tapes, etc.), optical discs (e.g., Compact Disks (CDs), Digital Versatile Disks (DVDs), etc.), smart cards, and flash memory devices (e.g., Erasable Programmable Read-Only Memory (EPROMs), cards, sticks, or key drives, etc.). The various computer-readable storage media described in this disclosure may represent one or more devices and / or other machine-readable storage media for storing information. The term “machine-readable storage media” includes, but is not limited to, a variety of other media that can store, contain, and / or carry wireless channels, instructions and / or data.
[0120] Embodiments of this disclosure provide a computer program product including instructions. When the computer program product is executed on a computer, it causes the computer to execute a data transmission method described in any of the embodiments described above.
[0121] The foregoing describes only specific embodiments of the Disclosure, and the scope of protection of the Disclosure is not limited thereto. Any modifications or substitutions within the technical scope disclosed herein shall be included within the scope of protection of the Disclosure. Accordingly, the scope of protection of the Disclosure shall be governed by the scope of protection of the claims.
Claims
1. A data transmission method applicable to a gateway, The steps include: when sending and receiving data packets, the MAC layer unifies the data packets into a target format, wherein the lower layer of the MAC layer is a link layer supporting at least two types of communication protocols, the upper layer of the MAC layer does not distinguish between the at least two types of communication protocols, and the upper layer of the MAC layer includes a network layer, a transport layer, and an application layer. method.
2. The gateway is connected to a first device and a second device, the communication protocols used by the first device and the second device are different, the link layer of the at least two types of communication protocols includes the link layer of the communication protocols used by the first device and the second device, and the method, before unifying the data packets into a target format in the MAC layer, The step of receiving a first data packet transmitted from the first device to the second device, further comprising the step of the first data packet being a data packet received by the gateway, the first data packet including target data, and the format of the first data packet being a format specified by the communication protocol used by the first device, The step of unifying the data packets to the target format in the MAC layer is: A step in the mac layer to convert the first data packet into a second data packet according to the target format, wherein the second data packet includes the target data. After unifying the data packets to the target format at the MAC layer, the method is as follows: A step of converting the second data packet into a third data packet based on a format specified in the communication protocol used by the second device, wherein the third data packet is a data packet transmitted by the gateway, and the third data packet includes the target data. The step further includes transmitting the third data packet to the second device, The method according to claim 1.
3. The first data packet further includes the Internet Protocol IP address of the first device and the IP address of the second device, and the step of converting the first data packet into a second data packet according to the target format at the MAC layer is: A step of obtaining an intermediate data packet by decapsulating and reconstructing the first data packet in the mac layer according to a target format based on the IP address of the first device and a first correspondence, wherein the first correspondence includes a correspondence between the IP address of the first device and the control identifier of 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, and the intermediate data packet includes the control identifier of the first device, the IP address of the second device, and the target data. The steps include: obtaining the target data in the intermediate data packet at a higher layer of the mac layer; encapsulating the target data in the mac layer according to the target format based on the IP address of the second device and a second correspondence, thereby forming a second data packet, wherein the second correspondence includes a correspondence between the IP address of the second device and the control identifier of 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, and the second data packet includes the control identifier of the second device, the IP address of the second device, and the target data; The method according to claim 2.
4. Before receiving the first data packet transmitted from the first device to the second device, the method: The steps include obtaining 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, respectively. The step of establishing the first correspondence and the second correspondence is further included, The method according to claim 3.
5. The second correspondence further includes a correspondence between the IP address of the second device and the link layer identifier of the communication protocol used by the second device, and the step of transmitting the third data packet to the second device is: The process includes the step of transmitting the third data packet to the second device via the link layer of the communication protocol used by the second device, The method according to claim 3 or 4.
6. The aforementioned target format includes sequentially set identifier fields, mac header fields, control fields, and data fields. The identifier field is used to carry the identifier of the device that transmits / receives the data packet, and the identifier of the communication protocol used by the device that transmits / receives the data packet. The mac header field is used to carry the mac address of the device that transmits and receives the data packet. The control field is used to carry the data format of the data field. The aforementioned data field is used to carry the IP address of the device that transmits and receives the data packet and the target data. The method according to any one of claims 1 to 4.
7. The aforementioned target format further includes a padding field, The padding field is used to transport a predetermined character, and the predetermined character is used to fill the data field with data when the data length of the data field is shorter than the total length of the data field. The method according to claim 6.
8. The aforementioned target format is further used to carry the transmission priority of data packets, and the method is When the gateway receives a plurality of data packets, the step of transmitting the plurality of data packets in order of transmission priority of the plurality of data packets, further comprising the step of the plurality of data packets including the first data packet, The method according to any one of claims 1 to 4.
9. The transmission priority of the data packets is determined based on the number of data packets cached by the gateway. The more data packets transmitted from the first device are cached in the gateway, the higher the transmission priority set for the first data packet. The method according to claim 8.
10. If the target format includes the control field, the control field is further used to carry the transmission priority of the data packet. The method according to claim 6.
11. The aforementioned communication protocol includes Wireless Fidelity Wi-Fi, Bluetooth, ZigBee, z-wave, or Thread. The method according to any one of claims 1 to 4.
12. A data transmission device including memory and a processor, The memory and the processor are coupled, the memory is used to store computer program code, the computer program code includes computer instructions, and when the processor executes the computer instructions, it causes the data transmission device to execute the data transmission method according to any one of claims 1 to 11. Data transmission device.
13. A computer-readable storage medium, The computer-readable storage medium stores computer instructions, and when the computer instructions are executed by the data transmission device, the data transmission device is instructed to execute the data transmission method according to any one of claims 1 to 11. A computer-readable storage medium.