Packet processing method, electronic device, and related apparatus

By segmenting and splicing the messages, the problem of low communication efficiency between micro sensors and the central control center in the coal mine production environment was solved, improving transmission efficiency and bandwidth utilization, and achieving more efficient data transmission.

CN120896948BActive Publication Date: 2025-12-05HUAWEI TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511422851.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-09-30
Publication Date
2025-12-05
Estimated Expiration
2045-09-30

AI Technical Summary

Technical Problem

In coal mine production environments, the communication efficiency between micro sensors and the central control center is low, failing to fully utilize the high bandwidth advantage of the Industrial Internet, resulting in low transmission efficiency.

Method used

By fragmenting the message, the message is divided into multiple segments between the gateway device and the first device, and then spliced ​​between the gateway device and the second device, leveraging the high bandwidth advantage of the Industrial Internet to improve transmission efficiency.

Benefits of technology

It effectively improves message transmission efficiency and bandwidth utilization, reduces transmission delay and fragmentation frequency, and enhances the overall performance of the communication system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120896948B_ABST
    Figure CN120896948B_ABST
Patent Text Reader

Abstract

The application provides a message processing method, an electronic device and related devices, and relates to the technical field of terminals. The method can be applied to a mine communication system including a gateway device, a first device and a second device. In the method, the first device splits a first target message to obtain at least one first message segment, and the length of the message content in the first message segment is a first length. The first device sends the at least one first message segment to the gateway device. For any first message segment, the gateway device splits the first message segment to obtain X second message segments, the length of the message content in the second message segment is a second length, and the first length is X times the second length. Then, the gateway device sends the X second message segments to the second device. In this way, by setting the length of the message split by the first device and the length of the message split by the gateway device in a multiple relationship, the transmission delay of the message in the mine scene is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of terminals, and more particularly to a message processing method, electronic device, and related apparatus. Background Technology

[0002] Miniature sensors are typically deployed in coal mine production environments. These sensors are usually networked with mining gateway devices via near-field communication or fieldbus, while the mining gateway devices are connected to the central control center via industrial ring network switches.

[0003] Different network connection methods have different maximum transmission unit limits. Currently, the message size of industrial control requests issued by the central control center is usually set to be the same as the message size transmitted by near-field communication or fieldbus. This will result in the inability to fully utilize the high bandwidth advantage of the industrial Internet, which will also result in low transmission efficiency between the central control center and the mining gateway device. Summary of the Invention

[0004] This application provides a message processing method, electronic device, and related apparatus to reduce message transmission delay between a first device and a second device in a coal mine production environment.

[0005] In a first aspect, embodiments of this application provide a message processing method applied to a communication system, wherein the communication system includes: a gateway device, a first device, and a second device, the gateway device being used to transmit data between the first device and the second device, the method comprising:

[0006] The first device segments the first target message to obtain at least one first message fragment, wherein the length of the message content in the first message fragment is a first length; the first device sends at least one first message fragment to the gateway device;

[0007] For any one of the first message segments, the gateway device segments the first message segment to obtain X second message segments. The length of the message content in the second message segment is the second length, and the first length is X times the second length, where X is an integer greater than or equal to 1. The gateway device sends the X second message segments to the second device.

[0008] This implementation effectively utilizes the high bandwidth advantage of the Industrial Internet by fragmenting the packets, thereby improving bandwidth utilization. Furthermore, by setting the first and second lengths as multiples of each other, the waiting time when the packets are further fragmented at the gateway device can be reduced, effectively improving packet transmission efficiency.

[0009] In one possible implementation, the quantity X is proportional to the bandwidth difference between the first bandwidth and the second bandwidth, where the first bandwidth is the transmission bandwidth between the first device and the gateway device, and the second bandwidth is the transmission bandwidth between the second device and the gateway device; and the quantity X is inversely proportional to the first delay, where the first delay is the delay at which the second device responds to the message after receiving it.

[0010] In this implementation, the larger the difference between the first bandwidth and the second bandwidth, the larger the value of X can be set, so that the length of the first packet segment is longer, thereby improving the utilization rate of the first bandwidth. Conversely, the larger the first latency, the smaller the value of X can be set, so that the length of the first packet segment is shorter, reducing the number of fragmentation times at the gateway device, thereby improving the transmission efficiency of the first target packet.

[0011] In one possible implementation, the quantity X is proportional to a first requirement parameter, which indicates the bandwidth utilization required to transmit the first target message; and / or, the quantity X is inversely proportional to a second requirement parameter, which indicates the reliability required to transmit the first target message.

[0012] In this implementation, when the first demand is greater, the value of X can be set to be larger, so that the length of the first message segment is longer, improving the utilization of the first bandwidth and thus improving the transmission efficiency of the first target message. Conversely, when the second demand is greater, the value of X can be set to be smaller, so that the length of the first message segment is shorter, reducing the number of fragmentation operations at the gateway device and thus improving the reliability of the transmission of the first target message.

[0013] In one possible implementation, the access type between the second device and the gateway device is the first type; wherein, the total length of the second message segment is less than or equal to the MTU corresponding to the first type, and the total length of the second message segment is equal to the second length of the message content plus the third length of the message header.

[0014] In this implementation, by setting the total length of the second message segment to be less than or equal to the MTU corresponding to the first type, the second message segment can be transmitted between the second device and the gateway device.

[0015] In one possible implementation, the total length of the second message segment is determined based on a first mapping table, which indicates the total length of message segments corresponding to each of the various access types.

[0016] In this implementation, the total length of the second message segment can be determined through the first mapping table, thereby enabling the first device to determine the length of the first message segment.

[0017] In one possible implementation, the first device segments the first target message to obtain at least one first message fragment, including: the first device segments the message content in the first target message according to a first length to obtain at least one segmented message fragment; and adds a message header to each of the at least one segmented message fragment to obtain at least one first message fragment.

[0018] In this implementation, message segmentation involves dividing the message content and adding a message header after segmentation to ensure message integrity.

[0019] In one possible implementation, after the first device segments the first target message, it will also obtain a third message segment. The third message segment is the last message segment segmented from the first target message, and the length of the third message segment is less than or equal to the first length.

[0020] The method further includes: a first device sending a third message segment to a gateway device; the gateway device segmenting the third message segment to obtain at least one second message segment and / or one fourth message segment, wherein the fourth message segment is the last message segment segmented from the third message segment, and the length of the fourth message segment is less than or equal to the second length; and the gateway device sending at least one second message segment and / or one fourth message segment obtained after segmenting the third message segment to a second device.

[0021] In this implementation, after the first target message is segmented, a third message segment with a message content length less than or equal to the first length is also obtained. The third message segment can also be segmented to ensure that all fragments of the first target message can be transmitted to the second device.

[0022] In one possible implementation, the header of the initial first segment in at least one first segment contains a first identifier, which indicates that the initial first segment is the first fragment; the headers of the remaining first segments in at least one first segment, excluding the initial first segment, contain a second identifier, which indicates that the remaining first segments are intermediate fragments; and the header of the third segment contains a third identifier, which indicates that the third segment is the last fragment.

[0023] In this implementation, each segment's header carries a fragmentation identifier, enabling the gateway device to quickly locate the first, middle, and last fragments of the packet during the fragmentation process, thereby reducing packet processing latency.

[0024] In one possible implementation, the header of the initial second segment in at least one second segment contains a first identifier, which indicates that the initial second segment is the first fragment; the headers of the remaining second segments in at least one second segment, excluding the initial second segment, contain a second identifier, which indicates that the remaining first segments are intermediate fragments; and the header of the fourth segment contains a third identifier, which indicates that the fourth segment is the last fragment.

[0025] In this implementation, each segment's header carries a fragment identifier. During the reassembly of the received fragmented messages, the second device can quickly locate the first, middle, and last fragments of the message, thereby reducing message processing latency.

[0026] Secondly, embodiments of this application provide a message processing method applied to a communication system, the communication system including: a gateway device, a first device, and a second device, the gateway device being used to transmit data between the first device and the second device, the method including:

[0027] The second device sends multiple fifth message fragments to the gateway device. The length of the message content in each fifth message fragment is the second length. The gateway device concatenates every X fifth message fragments in the multiple fifth message fragments to obtain at least one sixth message fragment. The length of the message content in the sixth message fragment is the first length, which is X times the second length, where X is an integer greater than or equal to 1.

[0028] The gateway device sends at least one sixth message fragment to the first device; the first device splices the at least one sixth message fragment to obtain the second target message.

[0029] In this implementation, by setting the first length and the second length to a multiple relationship, the waiting time for packet reassembly at the gateway device can be reduced, effectively improving packet transmission efficiency. Furthermore, by reassembling the fragmented packets, the high bandwidth advantage of the Industrial Internet can be effectively utilized, improving bandwidth utilization.

[0030] In one possible implementation, the header of the initial fifth segment in at least one fifth segment contains a first identifier, which is used to indicate that the initial fifth segment is the first fragment.

[0031] At least one fifth message segment, excluding the initial fifth message segment and the last fifth message segment, contains a second identifier in its header. The second identifier is used to indicate that the remaining fifth message segments are intermediate fragments.

[0032] At least one fifth segment in a fifth segment contains a third identifier in its header, which indicates that the last fifth segment is the last fragment.

[0033] In one possible implementation, the gateway device sequentially concatenates every X fifth message segments from a plurality of fifth message segments to obtain at least one sixth message segment, including: the gateway device sequentially concatenates every X fifth message segments according to the identifier contained in the message header of each of the plurality of fifth message segments to obtain at least one sixth message segment.

[0034] In one possible implementation, the header of the initial sixth segment in at least one sixth segment contains a first identifier, which is used to indicate that the initial sixth segment is the first fragment.

[0035] At least one sixth message segment, excluding the initial sixth message segment and the last sixth message segment, contains a second identifier in its message header. The second identifier is used to indicate that the remaining sixth message segments are intermediate fragments.

[0036] At least one sixth segment in a sixth segment contains a third identifier in its header, which indicates that the last sixth segment is the last fragment.

[0037] In one possible implementation, the first device splices at least one sixth message segment to obtain a second target message, including: the first device sequentially splices at least one sixth message segment according to the identifier contained in the message header of each of the at least one sixth message segment to obtain the second target message.

[0038] In one possible implementation, the quantity X is proportional to the bandwidth difference between the first bandwidth and the second bandwidth, where the first bandwidth is the transmission bandwidth between the first device and the gateway device, and the second bandwidth is the transmission bandwidth between the second device and the gateway device.

[0039] The quantity X is inversely proportional to the first delay, which is the delay for the second device to respond to the message after receiving it.

[0040] In one possible implementation, the quantity X is proportional to a first requirement parameter, which indicates the bandwidth utilization required for transmitting the second target message; and / or, the quantity X is inversely proportional to a second requirement parameter, which indicates the reliability required for transmitting the second target message.

[0041] In one possible implementation, the access type between the second device and the gateway device is the first type; wherein, the total length of the sixth message segment is less than or equal to the MTU corresponding to the first type, and the total length of the sixth message segment is equal to the second length of the message content plus the third length of the message header.

[0042] In one possible implementation, the total length of the sixth message segment is determined based on a first mapping table, which indicates the total length of message segments corresponding to each of the various access types.

[0043] Thirdly, embodiments of this application provide a message processing method applied to a gateway device, the gateway device being used to transmit data between a first device and a second device, the method comprising:

[0044] Receive at least one first message segment sent by a first device, wherein the length of the message content in the first message segment is a first length, wherein at least one first message segment is obtained by segmenting a first target message;

[0045] For any one of the first message segments in at least one first message segment, the first message segment is divided into X second message segments, the length of the message content in the second message segment is the second length, the first length is X times the second length, and X is an integer greater than or equal to 1;

[0046] Send X second message fragments to the second device.

[0047] In one possible implementation, the quantity X is proportional to the bandwidth difference between the first bandwidth and the second bandwidth, where the first bandwidth is the transmission bandwidth between the first device and the gateway device, and the second bandwidth is the transmission bandwidth between the second device and the gateway device; the quantity X is inversely proportional to the first delay, where the first delay is the delay at which the second device responds to the message after receiving it.

[0048] In one possible implementation, the quantity X is proportional to a first requirement parameter, which indicates the bandwidth utilization required to transmit the first target message; and / or, the quantity X is inversely proportional to a second requirement parameter, which indicates the reliability required to transmit the first target message; wherein the first target message is a message transmitted from the first device to the second device.

[0049] In one possible implementation, the access type between the second device and the gateway device is the first type; wherein, the total length of the second message segment is less than or equal to the MTU corresponding to the first type, and the total length of the second message segment is equal to the second length of the message content plus the third length of the message header.

[0050] In one possible implementation, the total length of the second message segment is determined based on a first mapping table, which indicates the total length of message segments corresponding to each of the various access types.

[0051] In one possible implementation, after the first target message is segmented, a third message segment is obtained. The third message segment is the last message segment segmented from the first target message, and the length of the third message segment is less than or equal to the length of the first message segment.

[0052] The method further includes: receiving a third message segment sent by a first device; segmenting the third message segment to obtain at least one second message segment and a fourth message segment, wherein the fourth message segment is the last message segment segmented from the third message segment, and the length of the fourth message segment is less than or equal to the second length; and sending at least one second message segment and a fourth message segment obtained after segmenting the third message segment to a second device.

[0053] In one possible implementation, the header of the initial first segment in at least one first segment contains a first identifier, which indicates that the initial first segment is the first fragment; the headers of the remaining first segments in at least one first segment, excluding the initial first segment, contain a second identifier, which indicates that the remaining first segments are intermediate fragments; and the header of the third segment contains a third identifier, which indicates that the third segment is the last fragment.

[0054] In one possible implementation, the header of the initial second segment in at least one second segment contains a first identifier, which indicates that the initial second segment is the first fragment; the headers of the remaining second segments in at least one second segment, excluding the initial second segment, contain a second identifier, which indicates that the remaining first segments are intermediate fragments; and the header of the fourth segment contains a third identifier, which indicates that the fourth segment is the last fragment.

[0055] Fourthly, embodiments of this application provide a message processing method applied to a gateway device, which is used to transmit data between a first device and a second device. The method includes:

[0056] Receive multiple fifth message segments sent by the second device, wherein the length of the message content in the fifth message segment is the second length;

[0057] Each of the X fifth message segments from the multiple fifth message segments is concatenated sequentially to obtain at least one sixth message segment. The length of the message content in the sixth message segment is the first length, which is X times the second length, where X is an integer greater than or equal to 1.

[0058] At least one sixth message fragment is sent to the first device, and the at least one sixth message fragment is used to splice together to obtain the second target message.

[0059] In one possible implementation, the header of the initial fifth segment in at least one fifth segment contains a first identifier, which indicates that the initial fifth segment is the first fragment; the headers of the remaining fifth segments in at least one fifth segment, excluding the initial fifth segment and the last fifth segment, contain a second identifier, which indicates that the remaining fifth segments are intermediate fragments; and the header of the last fifth segment in at least one fifth segment contains a third identifier, which indicates that the last fifth segment is the last fragment.

[0060] In one possible implementation, each X fifth message segments from a plurality of fifth message segments are sequentially concatenated to obtain at least one sixth message segment, including: concatenating each X fifth message segments sequentially according to the identifier contained in the message header of each of the plurality of fifth message segments to obtain at least one sixth message segment.

[0061] In one possible implementation, the header of the initial sixth segment in at least one sixth segment contains a first identifier, which indicates that the initial sixth segment is the first fragment; the headers of the remaining sixth segments in at least one sixth segment, excluding the initial sixth segment and the last sixth segment, contain a second identifier, which indicates that the remaining sixth segments are intermediate fragments; and the header of the last sixth segment in at least one sixth segment contains a third identifier, which indicates that the last sixth segment is the last fragment.

[0062] In one possible implementation, the identifier contained in the header of each of at least one sixth message segment is used to indicate that at least one sixth message segment is concatenated sequentially to obtain a second target message.

[0063] In one possible implementation, the quantity X is proportional to the bandwidth difference between the first bandwidth and the second bandwidth, where the first bandwidth is the transmission bandwidth between the first device and the gateway device, and the second bandwidth is the transmission bandwidth between the second device and the gateway device; the quantity X is inversely proportional to the first delay, where the first delay is the delay at which the second device responds to the message after receiving it.

[0064] In one possible implementation, the quantity X is proportional to a first requirement parameter, which indicates the bandwidth utilization required to transmit the second target message; and / or, the quantity X is inversely proportional to a second requirement parameter, which indicates the reliability required to transmit the second target message; wherein the first target message is a message transmitted from the first device to the second device.

[0065] In one possible implementation, the access type between the second device and the gateway device is the first type; wherein, the total length of the sixth message segment is less than or equal to the MTU corresponding to the first type, and the total length of the sixth message segment is equal to the second length of the message content plus the third length of the message header.

[0066] In one possible implementation, the total length of the sixth message segment is determined based on a first mapping table, which indicates the total length of message segments corresponding to each of the various access types.

[0067] Fifthly, embodiments of this application provide an electronic device including a processor and a memory, the memory for storing code instructions, and the processor for running the code instructions to perform the methods described in the first to fourth aspects or any possible implementation of the first to fourth aspects.

[0068] Sixthly, embodiments of this application provide a computer-readable storage medium storing a computer program or instructions that, when executed on a computer, cause the computer to perform the methods described in the first to fourth aspects or any possible implementation thereof.

[0069] In a seventh aspect, embodiments of this application provide a computer program product including a computer program, which, when run on a computer, causes the computer to perform the methods described in the first to fourth aspects or any possible implementation of the first to fourth aspects.

[0070] Eighthly, this application provides a chip or chip system including at least one processor and a communication interface, the communication interface and the at least one processor being interconnected via a circuit, the at least one processor being used to run computer programs or instructions to perform the methods described in the first to fourth aspects or any possible implementations of the first to fourth aspects. The communication interface in the chip can be an input / output interface, pins, or circuits, etc.

[0071] In one possible implementation, the chip or chip system described above in this application further includes at least one memory storing instructions. The memory can be an internal storage unit of the chip, such as a register or cache, or it can be a storage unit of the chip itself (e.g., read-only memory, random access memory, etc.).

[0072] It should be understood that the second to eighth aspects of this application correspond to the technical solutions of the first aspect of this application, and the beneficial effects achieved by each aspect and the corresponding feasible implementation are similar, and will not be repeated here. Attached Figure Description

[0073] Figure 1 A schematic diagram of a monitoring network for the coal mine production environment provided in this application embodiment;

[0074] Figure 2 A schematic diagram of the working process of a gas monitoring system for a coal mine production environment provided in this application embodiment;

[0075] Figure 3 A schematic diagram of the message fragmentation method provided in the embodiments of this application. Figure 1 ;

[0076] Figure 4 A schematic diagram of the message fragmentation method provided in the embodiments of this application. Figure 2 ;

[0077] Figure 5 A schematic diagram of the message fragmentation method provided in the embodiments of this application. Figure 3 ;

[0078] Figure 6 A schematic diagram of the message fragmentation method provided in the embodiments of this application. Figure 4 ;

[0079] Figure 7 A schematic diagram of the message fragmentation method provided in the embodiments of this application. Figure 5 ;

[0080] Figure 8 Signaling interaction for the message transmission method provided in the embodiments of this application Figure 1 ;

[0081] Figure 9 A schematic diagram of the fragmentation method in the message transmission process provided in the embodiments of this application. Figure 1 ;

[0082] Figure 10 A schematic diagram of the fragmentation method in the message transmission process provided in the embodiments of this application. Figure 2 ;

[0083] Figure 11A schematic diagram of the fragmentation method in the message transmission process provided in the embodiments of this application. Figure 3 ;

[0084] Figure 12 This is a schematic diagram illustrating the message segment length relationship provided in the embodiments of this application;

[0085] Figure 13 This is a schematic diagram illustrating the content of the message header during message transmission, provided in an embodiment of this application.

[0086] Figure 14 Signaling interaction for the message transmission method provided in the embodiments of this application Figure 2 ;

[0087] Figure 15 A schematic diagram of the fragmentation method in the message transmission process provided in the embodiments of this application. Figure 4 ;

[0088] Figure 16 A schematic diagram of the fragmentation method in the message transmission process provided in the embodiments of this application. Figure 5 ;

[0089] Figure 17 A schematic diagram of the fragmentation method in the message transmission process provided in the embodiments of this application. Figure 6 . Detailed Implementation

[0090] To facilitate understanding of the embodiments of this application, the following points will be explained first:

[0091] In this application, "instruction" can include direct instruction, indirect instruction, explicit instruction, and implicit instruction. When describing a certain instruction information for the purpose of instructing A, it can be understood that the instruction information carries A, directly instructs A, or indirectly instructs A.

[0092] In this application, " / " can indicate that the objects before and after are in an "or" relationship. For example, A / B can mean A or B. "And / or" can be used to describe three relationships between the related objects. For example, A and / or B can mean: A exists alone, A and B exist simultaneously, and B exists alone. A and B can be singular or plural.

[0093] In this application, "at least one" means one or more, and "more than one" means two or more, such as three, four, or more. Similar expressions (such as at least one, at least one, etc.) are used in the same way. "At least one of the following," "one or more of the following," or similar expressions refer to any combination of these items, which may include only a single item or a combination of multiple items. For example, at least one of a, b, or c can mean: a, or b, or c; a and b; or a and c; or b and c; or a, b, and c. Where a, b, and c can be single or multiple.

[0094] In this application, for the convenience of describing the technical solutions of the embodiments of this application, the terms "first" and "second" may be used to distinguish them. The terms "first" and "second" do not limit the quantity or execution order, and the terms "first" and "second" are not necessarily different.

[0095] In this application, the words "exemplary," "example," or "for example" are used to indicate examples, illustrations, or descriptions. Any embodiment or design described as "exemplary," "example," or "for example" should not be construed as being more preferred or advantageous than other embodiments or designs. The use of the words "exemplary," "example," or "for example" is intended to present the relevant concepts in a specific manner to facilitate understanding.

[0096] In this application, "sending information / data" only indicates the direction of information / data transmission, including direct transmission via the device's communication interface (such as an air interface, or simply air interface). "Sending" can also be understood as the "output" of a module interface. "Sending" can also include indirect transmission by the processing unit through the communication interface, meaning that after the processing unit outputs information / data through the module interface, it is transmitted to the device's communication interface and then sent out. "Receiving information / data" only indicates the direction of information / data transmission, including direct reception via the communication interface. "Receiving" can also be understood as the "input" of a module interface. "Receiving information / data" can also include indirect reception by the processing unit through the communication interface, meaning that after the communication interface receives information / data, it is transmitted to the processing unit's module interface and then input to the processing unit. "Sending information / data to… (such as a terminal)" can be understood as the destination of the information being the terminal. It can include sending information / data directly or indirectly to the terminal. "Receiving information / data from… (such as a terminal)" can be understood as the source of the information being the terminal, and can include receiving information / data directly or indirectly from the terminal. Information / data may undergo necessary processing, such as format changes, between the source and destination, but the destination can understand the valid information / data from the source. Similar statements in this application can be understood in a similar way, and will not be repeated here.

[0097] Furthermore, for ease of understanding, the relevant terms and concepts involved in the embodiments of this application will be introduced below:

[0098] 1. MTU: Maximum Transmission Unit (MTU) refers to the maximum size of a data packet that a network can transmit, measured in bytes. The MTU determines the maximum number of bytes a sender can transmit in a single message. For example, if the MTU exceeds the maximum data packet capacity of the receiver, or if the MTU exceeds the maximum data packet capacity of a device along the transmission path, it will increase the burden on network transmission and may cause packet fragmentation or loss. Conversely, if the MTU is too small, meaning the actual amount of data transmitted is too small, it will affect the transmission efficiency of the data packets.

[0099] 2. Message: A message is a data unit exchanged and transmitted in a network; that is, a block of data that a station sends at one time. Messages are used to transmit information between source and destination nodes, and typically include the actual data to be sent as well as necessary control information to ensure that the data arrives at the destination node correctly and efficiently.

[0100] A message typically consists of two parts: a header and a body. The header usually includes control information that instructs network devices how to process the message; it may include information such as the source address, destination address, protocol type, data length, and error checksum. The body typically contains the actual data to be transmitted.

[0101] The message transmission process can be described, for example, as follows: When a device wants to communicate with a remote server, data can be encapsulated into individual messages, each containing a source address, a destination address, and other information. These messages are transmitted over the network, forwarded by multiple intermediate nodes (such as routers and switches), and finally reach the target server. The server can then open the messages, parse the data content, and respond accordingly based on the source address.

[0102] 3. Packet Fragmentation: Packet fragmentation refers to the process of splitting a data packet into multiple smaller segments (fragments) for transmission when the size of the data packet exceeds the maximum transmission unit (MTU) of the network, and then reassembling them at the receiving end. Fragmentation can ensure correct data reassembly through fields such as identifier (ID), offset, and morefragment (MF), thereby solving the problem of transmission compatibility of large data packets in heterogeneous networks (such as industrial Ethernet and wireless sensor networks coexisting in a coal mine).

[0103] 4. Near Field Communication: In this embodiment, near field communication refers to short-range wireless communication, a general term for technologies that use radio waves to achieve wireless data transmission between devices within a limited space. Its communication distance typically ranges from a few centimeters to one hundred meters. Short-range wireless communication features low power consumption, high convenience, and low cost, making it suitable for scenarios with short distances and low requirements for transmission distance, such as consumer electronics, industrial control, and smart homes. Mainstream technologies include Bluetooth, Wi-Fi, Zigbee, Near Field Communication (NFC), StarFlash, and the recommended standard RS-485.

[0104] 5. Kuanghong Operating System: Kuanghong Operating System is an industrial-grade IoT operating system designed for the mining industry to address issues such as difficulties in interconnecting coal mine equipment, data silos, and low levels of intelligence. Based on OpenHarmony, the system features a layered and decoupled architecture. Through distributed soft bus technology, it enables unified protocol interaction between heterogeneous devices such as sensors, programmable logic controllers (PLCs), and robots, and supports edge computing and cloud-based collaboration.

[0105] The core advantage of the Kuanghong operating system lies in its ability to support functional decoupling and flexible customization. It is suitable for various equipment, from sensors to coal mining machines and hydraulic supports, forming a unified operating system architecture. Furthermore, by supporting unified protocols in the coal mining industry, it enables data sharing and unified management between devices, ensuring high-speed data transmission on the basis of high security and high reliability.

[0106] Furthermore, the Kuanghong operating system also supports human-machine interaction and machine-machine interaction, enhancing the real-time perception capabilities of underground equipment. For example, in intelligent coal mining scenarios, the Kuanghong operating system can coordinate coal mining machines, hydraulic supports, and belt conveyors in real time, and combine with 5G networks to achieve remote control and artificial intelligence (AI) early warning, promoting the upgrading of mine production towards less manned and unmanned operations.

[0107] The following is combined Figure 1 This application describes the scenarios to which the message processing method described in this application applies. Figure 1 This is a schematic diagram of a monitoring network for the coal mine production environment provided in an embodiment of this application.

[0108] In the complex and safety-critical production environment of coal mines, achieving equipment interconnection and automated control of production processes is crucial for improving production safety and efficiency. To monitor the real-time operating status of production equipment or key parameters of the production environment, miniature sensors are typically deployed within the production system to achieve real-time monitoring of both equipment and the environment.

[0109] However, the miniature sensors widely deployed in production systems (such as temperature sensors for monitoring ambient temperature, and gas sensors for monitoring methane concentration and carbon monoxide content) are typically single-function, low-power dedicated devices designed to reliably collect and transmit raw data, rather than handle complex network communication protocols. Therefore, most of them lack the ability to directly run the Transmission Control Protocol (TCP) / Internet Protocol (IP) stack and cannot natively connect to the Industrial Internet.

[0110] For these miniature sensor devices that do not support the Industrial Internet, the networking configuration between them and the central control center is typically as follows: Figure 1 As shown. (Refer to...) Figure 1 Miniature sensors can typically be connected to mining gateway devices via near-field communication such as StarFlash, RS485, or fieldbus. The mining gateway devices are then connected to the central control center via an industrial ring network switch.

[0111] exist Figure 1 Based on the network environment described, for example, industrial control requests can typically be issued by the central control center, sent to the mining gateway device via the Industrial Internet, and then sent by the mining gateway device to the micro-sensor via near-field communication or fieldbus. Data (such as data collected by the micro-sensor, or response data to industrial control requests) can typically be issued by the micro-sensor, sent to the mining gateway device via near-field communication or fieldbus, and then sent by the mining gateway device to the central control center via the Industrial Internet.

[0112] To better understand Figure 1 The following describes the various devices in the network configuration. Figure 1 Each of the included devices will be introduced separately.

[0113] As mentioned above, miniature sensors are small, low-power devices capable of detecting and measuring the operating status of production equipment or key parameters of the production environment. In coal mine production systems, miniature sensors are typically responsible for data monitoring and acquisition. They can transmit the acquired data to mine gateway devices via near-field communication or fieldbus.

[0114] Near-field communication (NFC) is a short-range wireless communication technology that allows two parties to exchange data over a very short distance. Fieldbus, on the other hand, is a wired communication technology, an industrial data bus that connects different devices via a shared physical medium (such as a cable or fiber optic cable) to achieve data transmission and device control. In other words, miniature sensors can transmit collected data to mining gateway devices via wired or wireless means.

[0115] Mining gateway devices, also known as internetwork connectors or protocol converters, are network devices that convert between different network protocols. They are typically used to connect two networks with different high-level protocols. In other words, a mining gateway connects to various field devices using different protocols on one end—meaning it can receive data from various sensors in a coal mine production environment—and connects to the upper-level network, namely the control center in the coal mine production environment, on the other end.

[0116] In a coal mine production environment, mining gateway devices are responsible for receiving data from various sensors, performing preliminary processing or protocol conversion, and then transmitting the processed data to the ground control center via a highly reliable industrial ring network switch using standard industrial internet protocols. Simultaneously, the mining gateway devices can also receive instructions from the control center and forward them to the corresponding actuators or sensors.

[0117] Industrial ring network switches are network devices specifically designed for industrial environments; they are network devices capable of encapsulating and forwarding data packets. Switches establish temporary switching paths between the data sender and receiver, allowing data to travel from the source address to the destination address. Unlike ordinary industrial switches, industrial ring network switches form a ring topology. When a cable break or equipment failure occurs at any point in the ring network, it can self-heal within a very short time (usually <50ms), restoring network communication and ensuring uninterrupted production network operation. This is crucial for the high reliability of industrial networks.

[0118] The centralized control center, or central control hub, is the "brain" of the entire monitoring system. For example, it can be responsible for centralized monitoring, analysis, storage, and visualization of data across the entire network. When environmental or data anomalies are detected, or when remote intervention is required for other reasons, or when the system needs to automatically execute control based on logical judgment, the centralized control center can send control commands. These commands travel down the same path in reverse, passing through the industrial ring network switch to the mining gateway device in the target area. The gateway then acts as a "translator," converting the industrial internet protocol into a protocol that sensors or actuators can understand. Finally, the commands are sent to the sensor or actuator device via wired or wireless means, achieving a complete "perception-decision-control" closed loop, thereby realizing equipment interconnection and automated management of the production process.

[0119] The following is combined Figure 2 To illustrate the workflow of a monitoring system, we will take a gas monitoring system for a coal mine production environment as an example. Figure 2 This is a schematic diagram illustrating the workflow of a gas monitoring system for a coal mine production environment, provided in an embodiment of this application.

[0120] like Figure 2 As shown, for example, a gas sensor can be installed on the mining face to monitor the concentration of methane gas in the coal mine production environment. The sensor can be connected to a nearby mining gateway device via a fieldbus. A series of industrial network switches can be deployed in the mine, which can be connected to a redundant ring network via optical fiber. The mining gateway device and the ground control center can be connected to this ring network.

[0121] Gas sensors, for example, can continuously monitor methane concentration in the coal mine production environment and transmit the concentration data to a mining gateway device via a fieldbus. The mining gateway device, for example, can acquire the data monitored by the sensor, convert the data packets used by the fieldbus protocol into TCP / IP protocol data packets, and then send these data packets via a network cable to the nearest industrial ring network switch. The switch, for example, can transmit the data all the way to the ground-based central control center via an industrial fiber optic ring network.

[0122] After receiving the data, the server at the central control center can display it, for example, on monitoring software. If the methane concentration exceeds the safety threshold, the central control center can issue an industrial control request. This request is generated by the central control center's server, packaged into a network data packet, and then transmitted down the industrial ring network to the mining gateway device. The mining gateway device can, for example, convert the TCP / IP protocol data packet into a protocol supported by the field devices and send the industrial control request to the field devices via the fieldbus.

[0123] It is understandable that the above-described example of the sensor reporting data to the central control center and the central control center issuing industrial control requests is only an example. In a real production environment, it is also possible that the central control center sends a request to the micro-sensor, and the micro-sensor responds to the request.

[0124] It is understandable that the data or industrial control requests described above are typically transmitted in the form of messages. However, there are size limitations when messages are transmitted over a network; that is, there is a limit to the maximum data packet size (MTU) that a network can transmit. The MTU varies depending on the transmission method. For example, the MTU of a fieldbus (such as RS485) is 256 bytes, the MTU of Bluetooth Low Energy (BLE), a near-field communication technology, is 512 bytes, and the MTU of another near-field communication technology, StarScan, is 1024 bytes.

[0125] Therefore, in one implementation, the control center and the mining gateway device can use, for example, the Modbus TCP protocol to transmit industrial control requests or data packets, and the device gateway and the micro-sensors can use, for example, the Modbus RTU protocol. Here, RTU stands for Remote Terminal Unit.

[0126] Modbus is a widely used communication protocol in industrial fields. It's an application-layer message transmission protocol primarily used to connect various devices, enabling data exchange and control between them. Modbus RTU and Modbus TCP are two different communication modes of the Modbus protocol.

[0127] Specifically, the Modbus RTU protocol is a traditional serial communication protocol with advantages such as low cost and high versatility. However, its communication speed and transmission distance are limited, and it is usually used for small-scale device interconnection.

[0128] The Modbus TCP protocol is an implementation of the Modbus protocol on Ethernet. Based on the TCP / IP protocol, it can utilize the high speed and long-distance transmission capabilities of Ethernet, making it more suitable for modern industrial networks that require large data transmission and system integration.

[0129] In this implementation, the Modbus RTU protocol can transmit a relatively small maximum message size, while the Modbus TCP protocol can transmit a relatively large maximum message size. To accommodate the limitations of the maximum message size that near-field communication (NFC) or fieldbus can transmit, the total message length between the control center and the mining gateway device can be controlled to be the same as the maximum message size that NFC or fieldbus can transmit. For example, in one implementation, the total message length between the control center and the mining gateway device, as well as the total message length between the mining gateway device and the micro-sensor, can both be controlled to 256 bytes.

[0130] It's understandable that the total message length between the control center and the device gateway is similar to that of near-field communication (NFC) or fieldbus, while the bandwidth of the Industrial Internet is much higher. Therefore, limiting the total message length between the control center and the device gateway to 256 bytes in this implementation would prevent full utilization of the Industrial Internet's bandwidth advantage between them. This would result in low transmission efficiency and low bandwidth utilization between the control center and the device gateway.

[0131] In one implementation, for example, the low transmission efficiency of messages between the central control center and the device gateway may further lead to low overall message transmission efficiency between the central control center and the micro-sensors.

[0132] To address the issue of low bandwidth utilization between the control center and device gateways due to the short message lengths transmitted between them, as described above, this application proposes a solution. For example, increasing the message length transmitted between the control center and device gateways can improve bandwidth utilization. However, it is understood that due to MTU limitations, increasing the message length necessitates considering message fragmentation.

[0133] In other words, to fully utilize the bandwidth advantages of the Industrial Internet, one implementation can employ packet fragmentation for data transmission. Specifically, packets exceeding the network's maximum data packet length limit can be fragmented for data transmission. The following section will combine... Figures 3-7 This section introduces methods for message fragmentation. Figure 3 A schematic diagram of the message fragmentation method provided in the embodiments of this application. Figure 1 ; Figure 4 A schematic diagram of the message fragmentation method provided in the embodiments of this application. Figure 2 ; Figure 5 A schematic diagram of the message fragmentation method provided in the embodiments of this application. Figure 3; Figure 6 A schematic diagram of the message fragmentation method provided in the embodiments of this application. Figure 4 ; Figure 7 A schematic diagram of the message fragmentation method provided in the embodiments of this application. Figure 5 .

[0134] For example, in one implementation, the maximum message length that can be transmitted between the central control center and the mining gateway device is 1000 bytes, and the maximum message length that can be transmitted between the mining gateway device and the micro sensor is 300 bytes. In this implementation, for example, during the downlink transmission of message data, that is, during the process of the central control center sending a protocol request message to the micro sensor, the message body length sent by the central control center to the micro sensor is 3000 bytes.

[0135] It's important to understand that a message typically consists of a header and a body. Message fragmentation is essentially fragmenting the message body while simultaneously copying the header. Each fragment needs its own header added, and the actual length of the message is the sum of the header and body lengths. It should be understood that, for the sake of clarity and numerical explanation, the header length is not considered in this example; only the length of an exemplary message body is used to analyze the problem.

[0136] like Figure 3 As shown, firstly, the central control center can generate a message 300 containing the content to be sent, with a message length of, for example, 3000 bytes. Since this message length exceeds the maximum message length of 1000 bytes that can be transmitted between the central control center and the mining gateway device, the central control center can, for example, fragment the complete message 300 before sending. Specifically, the central control center can divide the 3000-byte message into message fragments A, B, and C, each 1000 bytes long. Then, the central control center can sequentially send the fragmented message fragments A, B, and C to the mining gateway device via the Industrial Internet.

[0137] This can be understood as follows: the central control center first sends message segment A to the mining gateway device via the Industrial Internet. After message segment A is transmitted, the central control center sends message segment B to the mining gateway device again via the Industrial Internet. Similarly, after message segment B is transmitted, the central control center sends message segment C to the mining gateway device again via the Industrial Internet. In this way, the central control center can make full use of the bandwidth advantage of the Industrial Internet and send messages to the mining gateway device while meeting the MTU of the industrial ring network switch.

[0138] The mining gateway device receives message fragments A, B, and C from the central control center. It needs to perform protocol conversion on these message fragments and forward them to the micro-sensors. Since the length of these message fragments exceeds the maximum message length of 300 bytes that can be transmitted between the micro-sensors and the mining gateway device, the mining gateway device needs to further fragment the received message fragments before forwarding them.

[0139] Specifically, after receiving message segment A, the mining gateway device performs protocol conversion on it, and then fragments message segment A into segments, for example, A1, A2, A3, and A4, each 300 bytes in length. The mining gateway device then sequentially sends these segments to the miniature sensor via near-field communication or fieldbus. Similarly, after receiving message segments B and C, the mining gateway device can also perform protocol conversion and message fragmentation on them, and then sequentially send the fragmented messages to the miniature sensor.

[0140] It's understandable that when forwarding these packet fragments, the gateway device needs to wait for the previous packet fragment to complete its transmission before transmitting the next. For example, packet fragment A2 can only be transmitted after packet fragment A1 has been transmitted, and so on. Packet fragment A4 can be transmitted after packet fragment A3 has been transmitted. However, packet fragment A4's length does not reach the maximum transmittable length. To conserve network resources, it can be reassembled with subsequent packet fragments before transmission.

[0141] In one implementation, for example, after message segment A3 is transmitted, if the mining gateway device has not yet received message segment B, then message segment A4 needs to wait for the mining gateway device to receive message segment B before performing protocol conversion. Afterwards, message segment B is fragmented; for example, it can be first divided into message segment B1 of length 200 bytes, and then the remaining segment is divided into message segments of length 300 bytes.

[0142] Then, message fragment A4 and message fragment B1 are reassembled into a single 300-byte message fragment for transmission. This process may increase message processing latency, and the computational complexity of message re-fragmentation / reassembly is high, which may also affect message forwarding speed. In other words, it increases the total time of message transmission and affects transmission efficiency.

[0143] The following section, with reference to the accompanying diagram, describes the fragmentation and transmission of received packets by the mining gateway device. (Refer to...) Figure 4For example, when a mining gateway device receives message segment A from the central control center at time T0, it performs protocol conversion and then segments it into segments A1, A2, A3, and A4, based on the maximum message length of 300 bytes that can be transmitted between the mining gateway device and the micro-sensor. Then, at time T1, the mining gateway device sends A1 to the micro-sensor via near-field communication or fieldbus. After A1 is transmitted, at time T2, the mining gateway device sends A2 to the micro-sensor in the same way. Similarly, after A2 is transmitted, at time T3, the mining gateway device sends A3 to the micro-sensor in the same way.

[0144] After segment A3 is transmitted, at time T4, since segment A4 is 100 bytes long, which is less than the maximum message length that can be transmitted between the miniature sensor and the mining gateway device, to save network resources, it can wait for segment B to arrive at the mining gateway device at time T5. After the mining gateway device receives segment B and performs protocol conversion, it can fragment B into a 200-byte segment B1, and then fragment the remaining portion into 300-byte segments. B1 is used to reassemble with A4 into a single 300-byte segment, which is then sent to the miniature sensor.

[0145] This can be understood as follows: at time T5, the mining gateway device receives message segment B, performs protocol conversion, and then fragments segment B. First, it creates a 200-byte segment B1, and then divides the remaining portion into 300-byte segments. After fragmentation, for example, the unsent segment A4 can be reassembled with the fragmented segment B1 to form a 300-byte message. At time T6, this reassembled 300-byte segment can be sent to the microsensor. After this segment transmission is complete, the remaining segments can be sent to the microsensor sequentially using the same method. Message segment C sent to the central control center is also sent to the microsensor in the same manner.

[0146] After receiving all the aforementioned message fragments in sequence, namely fragments A1, A2, A3, A4+B1, ..., the micro-sensor can, for example, reassemble these fragments to obtain the complete message content, thereby enabling the processing of messages issued by the central control center.

[0147] Similarly, during the uplink transmission of message data, that is, during the process of the micro-sensor sending message data to the central control center, the length of the message body sent by the micro-sensor to the central control center is 3000 bytes.

[0148] It's important to understand that a message typically consists of a header and a body. Message fragmentation is essentially fragmenting the message body while simultaneously copying the header. Each fragment needs its own header added, and the actual length of the message is the sum of the header and body lengths. It should be understood that, for the sake of clarity and numerical explanation, the header length is not considered in this example; only the length of an exemplary message body is used to analyze the problem.

[0149] like Figure 5 As shown, firstly, the miniature sensor can generate a message 500 containing the content to be sent, with a message length of, for example, 3000 bytes. Since this message length exceeds the maximum message length of 300 bytes that can be transmitted between the miniature sensor and the mining gateway device, the miniature sensor can, for example, fragment the complete message 500 before sending.

[0150] Specifically, the miniature sensor can divide a 3000-byte message into 300-byte segments (1, 2, 3, 4, ...). The central control center can then use the Industrial Internet to sequentially send these segmented segments (1, 2, 3, 4, ...) to the mining gateway device. The specific sending method can be understood by referring to the downlink transmission process described above, where the central control center sends message segments to the mining gateway device; it will not be elaborated upon here.

[0151] The mining gateway device receives message fragments 1, 2, 3, 4, ... from the miniature sensor. It needs to perform protocol conversion on these message fragments and forward them to the central control center. Since the length of these message fragments is less than the maximum message length that the Industrial Internet can transmit, in order to take advantage of the bandwidth of the Industrial Internet, these fragments can be reassembled before forwarding.

[0152] The following section, with reference to the accompanying diagram, describes the reassembly and transmission of received messages by the mining gateway device. (Refer to...) Figure 6 In one implementation, for example, a mining gateway device can reassemble and / or segment message segments if the total length of the received message segments is greater than or equal to the maximum message length that the Industrial Internet can transmit.

[0153] Specifically, the mining gateway device receives message segment 1 from the micro-sensor at time T7. Since the message length has not yet reached the maximum message length that the Industrial Internet can transmit, it does not send the message at time T7 and waits for subsequent message segments. It receives message segment 2 from the micro-sensor at time T8, message segment 3 from the micro-sensor at time T9, and message segment 4 from the micro-sensor at time T10.

[0154] At this point, the length of the received message is greater than the maximum message length that the Industrial Internet can transmit. Therefore, after performing protocol conversion on these segments, the last received message segment 4 needs to be segmented in chronological order, dividing 4 into 4a and 4b, where 4a is 100 bytes long and 4b is 200 bytes long.

[0155] Next, the mining equipment gateway reassembles fragments 1, 2, 3, and 4a into message fragment 10, and sends message fragment 10 to the central control center via the industrial internet at time T11.

[0156] It is understandable that after message segment 10 is transmitted, the mining equipment gateway can transmit the next message segment to the central control center. However, the message length of message segment 4b does not reach the maximum message length that can be transmitted. In order to save network resources, it can be reassembled with subsequent message segments before transmission.

[0157] In one implementation, for example, after message segment 10 is transmitted, the mining gateway device has not yet received subsequent message segments, or the sum of the lengths of the received message segments has not yet reached the maximum message length that can be transmitted. In this case, message segment 4b continues to wait for subsequent message segments until the message segments to be forwarded by the mining gateway device are greater than or equal to the maximum message length that the industrial internet can transmit. Then, these message segments are reassembled and / or segmented, and the reassembled message segments, i.e., 20 and 30, are sent to the central control center.

[0158] This process may increase message processing latency and has high computational complexity for message reassembly, which may also affect message forwarding speed. In other words, it will increase the total time of message transmission and affect transmission efficiency.

[0159] In another implementation, refer to Figure 7 For example, mining gateway devices can receive message fragments and reassemble them until the maximum message length that the Industrial Internet can transmit is reached.

[0160] Specifically, the mining gateway device receives message segment 1 from the micro-sensor at time T7 and message segment 2 at time T8. After performing protocol conversion on segments 1 and 2, the mining gateway device can reassemble segments 1 and 2. Then, at time T9, it receives message segment 3. After performing protocol conversion on segment 3, the mining gateway device can reassemble segments 1 and 2 with segment 3.

[0161] Next, message segment 4 is received at time T10. Since the sum of the lengths of messages 1+2+3 and 4 exceeds the maximum message length that the Industrial Internet can transmit, message segment 4 needs to be segmented after protocol conversion. Message segment 4 is divided into 4a and 4b, where 4a is 100 bytes long and 4b is 200 bytes long. Then, 1+2+3 and 4a are reassembled into message segment 10, which is then sent to the central control center via the Industrial Internet at time T11.

[0162] It is understandable that after message segment 10 is transmitted, the mining equipment gateway can transmit the next message segment to the central control center. However, the message length of message segment 4b does not reach the maximum message length that can be transmitted. In order to save network resources, it can be reassembled with subsequent message segments before transmission.

[0163] In one implementation, for example, after message segment 10 is transmitted, the mining gateway device has not yet received subsequent message segments. Similarly, message segment 4b continues to wait for subsequent message segments, reassembles them with the subsequently received message segments, and sends the reassembled message segments, i.e., 20 and 30, to the central control center.

[0164] This process may also increase message processing latency, and the computational complexity of message reassembly is high, which may also affect message forwarding speed. In other words, it will increase the total time of message transmission and affect transmission efficiency.

[0165] After receiving all the aforementioned message fragments, namely fragments 10, 20, and 30, the central control center can, for example, reassemble these fragments to obtain the complete message content 500, thereby enabling it to process the messages sent by the central control center.

[0166] It should be noted that the times T0-T6 mentioned above are examples of message segment reception, fragmentation / reassembly, and transmission during downlink transmission, while times T7-T11 are examples of message segment reception, fragmentation / reassembly, and transmission during uplink transmission. There is no sequential relationship between times T0-T6 and times T7-T11. In other words, in a scenario where the control center issues a request and the micro-sensor responds, times T0-T6 may occur first, followed by times T7-T11; conversely, in a scenario where the micro-sensor reports data and the control center responds, times T7-T11 may occur first, followed by times T0-T6.

[0167] Based on the above, it can be understood that because different transmission methods can transmit different maximum message sizes, fragmented messages need to be re-fragmented / reassembled when transmitted to the mining gateway device. To conserve resources, if the message length is insufficient to transmit the maximum message size during re-fragmentation / reassembly, it can wait for the next message. However, waiting for the next message may incur latency. This process may increase processing delays, and the computational complexity of message re-fragmentation / reassembly is high, which may also affect message forwarding speed. In other words, it increases the total message transmission time and impacts transmission efficiency.

[0168] To address the issues described above, this application proposes a technical concept: deploying the Mining Hong Operating System on the central control center, mining gateway equipment, and micro sensors, along with a unified industrial control protocol, enabling intelligent fragmentation and reassembly functions. Then, at the central control center, the fragment size is dynamically calculated based on factors such as device type, service type, and real-time latency. At the gateway, the integer multiple relationship between input and output fragments is used to avoid complex reassembly calculations, improve forwarding efficiency, and consequently enhance message transmission efficiency between the central control center and the micro sensors.

[0169] The message transmission method provided in this application will be described below with reference to embodiments. These embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.

[0170] Figure 8 Signaling interaction for the message transmission method provided in the embodiments of this application Figure 1 , Figure 9 A schematic diagram of the fragmentation method in the message transmission process provided in the embodiments of this application. Figure 1 , Figure 10 A schematic diagram of the fragmentation method in the message transmission process provided in the embodiments of this application. Figure 2 , Figure 11 A schematic diagram of the fragmentation method in the message transmission process provided in the embodiments of this application. Figure 3 .

[0171] Reference Figure 8 The message transmission method provided in this application embodiment may include:

[0172] S801, the first device segments the first target message to obtain at least one first message segment and one third message segment.

[0173] In one implementation, the first device can be, for example, a central control center, which can monitor data in the coal mine production environment and send requests to the second device via a gateway device. These requests can be used to request data reporting from the second device, or to instruct the second device to execute certain control commands.

[0174] The first target message can be understood as a message sent by the first device to the second device. For example, the first target message may include a message header and a message body, where the message body can also be called message content. The message header may include, for example, relevant configuration information and control information of the first target message, and the message content of the first target message may include, for example, the request content sent by the first device to the second device.

[0175] In one implementation, the first device may encapsulate the request content to be sent to the second device into a message body and assemble it with a message header to obtain the first target message.

[0176] In this embodiment of the application, the first device needs to send the first target message to the gateway device first. As can be understood from the above description, the access method between the first device and the gateway device usually corresponds to the MTU limitation. In order to enable the first device to send the first target message to the gateway device while meeting the MTU limitation, the first device can, for example, segment the first target message to obtain at least one message segment that meets the MTU limitation.

[0177] For example, after the first device fragments the first target message, it can obtain at least one first message fragment and one third message fragment. In the first message fragment, the length of the message content can be, for example, a first length, and the length of the third message fragment can be, for example, less than or equal to the first length.

[0178] It is understood that the first target message includes a message header and a message body. In the implementation of the first device segmenting the first target message, for example, the first device may segment the message body of the first target message to obtain at least one message fragment. In one implementation, for example, the first device may segment the message body of the first target message sequentially with a first length as the segmentation unit length, thereby obtaining the message body corresponding to at least one first message fragment.

[0179] For example, you can refer to Figure 9 To understand. For example Figure 9As shown, the first target message may contain a message header and a message body, where the length of the message header can be, for example, a third length L. During the segmentation of the first target message, the message body of the first target message can be segmented multiple times according to the first length. (Refer to...) Figure 9 After segmenting the message body of the first target message, for example, we can obtain... Figure 9 The shown segments are 901, 902, 903, and 904. The lengths of segments 901 to 903 can be, for example, a first length, and the length of the last remaining segment 904 can be, for example, P, where P can be less than or equal to the first length.

[0180] like Figure 9 As shown, these fragments can be, for example, multiple first message segments and third message segments, each with its own corresponding message body. Then, for example, corresponding message headers can be added to these message bodies to obtain... Figure 9 The first message segment A1, the first message segment A2, ..., the first message segment A3, and the third message segment A4 are shown in the figure. Figure 9 In the example, the length of the header of each first message segment and the third message segment is L. The header added for the first message segment can be obtained by copying the header of the first target message.

[0181] Furthermore, it is understood that the length of the last remaining message segment after segmentation may be less than the first length. Therefore, in this embodiment of the application, in addition to at least one first message segment, a third message segment is also included in the multiple message fragments obtained by the first device segmenting the message body of the first target message. The third message segment can be understood as the last message segment obtained after segmentation.

[0182] Similar to the above description, for example, the first device can segment the body of the first target message sequentially using a first length as the unit length, and then use the last remaining segment as the body of the third message segment. Then, a corresponding header is added to the body of the third message segment to obtain the complete third message segment. The header added to the third message segment can, for example, be obtained by copying the header of the first target message.

[0183] It should be understood that in the embodiments of this application, segmentation can also be referred to as piecework, division, segmentation, or any other name, and the embodiments of this application do not specifically limit it in this way.

[0184] S802, the first device sends a first message fragment and a third message fragment to the gateway device, and the gateway device receives the first message fragment and the third message fragment accordingly.

[0185] In one implementation, the gateway device is a device used for protocol conversion. For example, the gateway device can connect a first device and a second device. Exemplarily, the first device can operate on Ethernet, and for example, it can use the TCP / IP protocol suite, or it may also use higher-level protocols such as Modbus TCP / IP. Meanwhile, the micro-sensors in a coal mine production environment (such as the second device in this embodiment) typically have limited resources and may use simpler protocols such as Modbus RTU. The gateway device acts as a "translator" between these protocols, converting requests from the central control center or data reported by the micro-sensors from one protocol format to another.

[0186] For example, after segmenting the first target message, the first device can sequentially send at least one first message fragment and a third message fragment to the gateway device. For instance, the first device can send at least one first message fragment and a third message fragment to the gateway device via an industrial ring network switch.

[0187] When the first device sends message segments to the gateway device, it can send the message segments sequentially, that is, send them in the order they appear. For example, after the first message segment is transmitted, the first device sends the second message segment to the gateway device, and so on. After the last message segment is transmitted, the first device sends the third message segment to the gateway device.

[0188] It is understandable that after the third message segment is transmitted, the first device completes the operation of sending the first target message to the gateway device.

[0189] S803, the gateway device segments the first and third message segments to obtain at least one second message segment and one fourth message segment.

[0190] In this embodiment of the application, the gateway device needs to send the first and third message segments obtained after segmentation to the second device. As can be understood from the above description, the access method between the gateway device and the second device usually corresponds to an MTU limitation. In order for the gateway device to send the first and third message segments to the second device while meeting the MTU limitation, the gateway device can, for example, segment the first and third message segments to obtain at least one message segment that meets the MTU limitation.

[0191] In one implementation, the gateway device may, for example, segment a first message segment to obtain at least one second message segment, wherein the length of the message content in the second message segment can be, for example, a second length. Furthermore, the gateway device may also segment a third message segment to obtain at least one message segment. It is understood that if the third message segment is the last fragment, then the at least one message segment obtained after segmenting the third message segment will also contain the last fragment.

[0192] In other words, after fragmenting the third message segment, in addition to potentially obtaining at least one second message segment with a message content length equal to the second length, it is also possible to obtain a fourth message segment with a message content length less than or equal to the second length. The fourth message segment can be understood as the last message segment after fragmenting the third message segment.

[0193] It is understood that the first and third message fragments also include a message header and a message body. In the implementation of the gateway device segmenting the first and third message fragments, for example, the gateway device could segment the message bodies of the first and third message fragments to obtain at least one message fragment. In one implementation, for example, the gateway device could segment the message bodies of the first and third message fragments sequentially using a second length as the segmentation unit length, thereby obtaining the message bodies corresponding to at least one second message fragment and the message body of a fourth message fragment.

[0194] First, combine Figure 10 This section explains the implementation of segmenting a first message segment to obtain at least one second message segment.

[0195] like Figure 10 As shown, the first message segment may include a message header and a message body, where the length of the message body is a first length, and the length of the message header may be, for example, L. After receiving the first message segment, the gateway device may, for example, decapsulate the first message segment and extract the message header and message body. Then, the gateway device may, for example, fragment the message body of the first message segment.

[0196] During the process of segmenting the first packet fragment by the gateway device, for example, the packet body of the first packet fragment can be segmented multiple times according to a second length, where the first length is X times the second length, and X is an integer greater than or equal to 1. (Refer to...) Figure 10 After segmenting the message body of the first message segment, for example, we can obtain... Figure 10The fragments shown are 1001, 1002, and 1003. The length of fragments 1001-1003 can be, for example, a second length. That is, the gateway device can, for example, completely divide the body of a first message fragment of length 1 into X message fragments of length 2.

[0197] Because there is an integer multiple relationship of X between the first length and the second length as described here, after the first message segment is segmented, exactly X second message segments can be obtained. This avoids the delay caused by the remaining content after segmenting a message segment, which requires waiting for the next message segment to obtain a complete fragment, as described above. Therefore, the technical solution of this application embodiment can effectively reduce the waiting time required when the message is fragmented again at the gateway device.

[0198] like Figure 10 As shown, these fragments can, for example, serve as the message bodies corresponding to multiple second message segments. Then, for example, message headers can be added to these message bodies to obtain... Figure 10 The second message segment B1, second message segment B2, ..., second message segment BX are shown in the diagram. Figure 10 In the example, the length of the header of each second message segment is L. The header added to the message body can be, for example, a newly generated header based on the protocol between the gateway device and the second device, or the header added to the message body can be the header of the first message segment. This embodiment does not limit this.

[0199] It is understood that for any first message segment sent by the first device, the gateway device can fragment it in the manner described here to obtain at least one second message segment.

[0200] And then combine below Figure 11 This section explains the implementation of segmenting a third message segment to obtain a second and / or fourth message segment.

[0201] As explained above, the length of the third message segment's body is less than or equal to the first length. This is because the length of the third message segment's content is the remaining length after the first target message is sequentially segmented according to the first length. In the current embodiment, the third message segment's content needs to be segmented according to the second length. Therefore, the length of the third message segment's content could have two possibilities: either the third message segment's content is less than the second length, or the third message segment's content is greater than the second length.

[0202] First, let's explain the case where the content of the third message segment is shorter than the second segment's length. Figure 11 As shown in (a), the third message segment may include a message header and a message body, wherein the length of the message body is less than the second length, and the length of the message header may be, for example, L. In the current embodiment, the message content of the third message segment needs to be segmented according to the second length. However, since the length of the message content of the third message segment is less than the second length, in this case, the gateway device, after receiving the third message segment, does not need to fragment the message body of the third message segment; it only needs to perform protocol conversion.

[0203] Specifically, after receiving a third packet fragment, the gateway device can, for example, descramble the third packet fragment, extract its header and body, and then, for example, directly treat the packet body of the third packet content as a fragment. Figure 11 The fragment 1101 shown is shown. Afterwards, the gateway device can, for example, add a header to the beginning of the message body 1101 to obtain the fourth message fragment C1.

[0204] Similar to the above description, the header added to the message body can be, for example, a newly generated header based on the protocol between the gateway device and the second device, or the header added to the message body can be the header of a third message segment. This embodiment does not limit this.

[0205] Next, we will explain the case where the content of the third message segment is longer than the second segment's length, such as... Figure 11 As shown in (b), the third message fragment may include a message header and a message body, wherein the length of the message body is greater than the second length, and the length of the message header may be, for example, L. In the current embodiment, the message content of the third message fragment needs to be segmented according to the second length. Since the length of the message content of the third message fragment is greater than the second length, the gateway device needs to perform fragmentation operations on the received third message fragment. Specifically, after receiving the third message fragment, the gateway device may first, for example, descramble the third message fragment and extract the message header and message body.

[0206] Next, the gateway device can, for example, segment the message body of the third message segment. During the segmentation process, the gateway device can, for example, segment the message body of the third message segment according to the second length. (See reference...) Figure 11 In (b), after segmenting the message body of the third message segment, for example, we can obtain... Figure 11The fragments 1101, ..., 1102 are shown in (b) in the diagram. The length of fragment 1101 can be, for example, the second length, and fragment 1102 can be understood as the last fragment remaining after the message body of the third message segment is divided. Therefore, the length of fragment 1102 can be less than or equal to the second length.

[0207] like Figure 11 As shown in (b), these fragments can, for example, serve as the message bodies corresponding to at least one second message fragment and a fourth message fragment, and then, for example, message headers can be added to these message bodies to obtain... Figure 11 The second message fragments C1, ..., C2 are shown in (b) of the diagram. Figure 10 In the example, the length of the header of each second message segment and the header of the fourth message segment is L.

[0208] It is understood that the length of the last remaining message segment after segmentation may be less than the second length. Therefore, in this embodiment of the application, the message fragments obtained by the gateway device segmenting the message body of the third message segment will contain at least one second message segment and a fourth message segment. The fourth message segment can be understood as the last message segment obtained after segmentation.

[0209] Similar to the above, for example, a gateway device can segment the body of the third message segment sequentially using the second length as the unit length, and then use the last remaining message segment 1102 as the body of the fourth message segment. Then, a new message header is added to the body of the fourth message segment to obtain the complete fourth message segment C2.

[0210] The above description describes the implementation of segmenting the first and third message fragments. It's understandable that when the first device sends message fragments to the gateway device, it needs to follow the order of the fragments; for example, the second first message fragment is sent only after the first one has been transmitted. Therefore, the gateway device can, for example, segment a first message fragment as soon as it receives it. In other words, the gateway device does not need to wait to receive all the first and third message fragments before starting processing.

[0211] S804, the gateway device sends a second message fragment and a fourth message fragment to the second device; correspondingly, the second device receives the second message fragment and the fourth message fragment.

[0212] In one implementation, the second device may be, for example, a miniature sensor deployed in the coal mine production environment. The second device may collect data from the coal mine production environment and report the collected data to the central control center to monitor the coal mine production environment.

[0213] For example, after segmenting the first and third message segments, the gateway device can sequentially send at least one second message segment and a fourth message segment to the second device. For instance, the gateway device can send at least one second message segment and a fourth message segment to the second device via near-field communication or a fieldbus.

[0214] It's understandable that when the first device sends message segments to the gateway device, it must follow the order of the message segments; the second first message segment can only be sent after the first one has been transmitted completely. Furthermore, the gateway device can process a first message segment immediately upon receiving it, without waiting for all first and third message segments to be received. Therefore, after processing a first message segment, the gateway device can send it sequentially to the second device without waiting for all first and third message segments to be processed before starting transmission.

[0215] It can be understood that when the gateway device sends message segments to the second device, it can send the message segments sequentially. That is, the message segments are sent in the order they appear. For example, after the first second message segment is transmitted, the gateway device sends the second second message segment to the second device, and so on, until the last second message segment is transmitted, at which point the gateway device sends the fourth message segment to the second device.

[0216] Therefore, after the fourth message segment is transmitted, the gateway device has completed the operation of sending the second message segment and the fourth message segment to the second device.

[0217] S805, the second device reassembles the second message segment and the fourth message segment to obtain the first target message, and processes the first target message.

[0218] After receiving at least one second message fragment and one fourth message fragment forwarded by the gateway device, the second device may, for example, reassemble the at least one second message fragment and one fourth message fragment in sequence to obtain the first target message sent by the first device.

[0219] The second device can, for example, deseal the first target message according to the transmission protocol, i.e., the protocol used for the transmission method (near field communication or fieldbus) between the gateway device and the second device. After desealing, for example, the request sent by the first device to the second device can be obtained, which is the first target message described in this embodiment. Furthermore, the second device can also, for example, respond to the request sent by the first device; the operation of the second device after receiving the request is not limited in this embodiment.

[0220] In the above embodiments, by fragmenting the message, the message can be sent from the first device to the second device. Specifically, by dividing the first target message into relatively large segments between the first device and the gateway device, the high bandwidth advantage of the Industrial Internet can be effectively utilized, improving bandwidth utilization. Furthermore, by setting the first length and the second length to a multiple relationship, the waiting time when the message is further fragmented at the gateway device can be reduced. These two key operations effectively improve message transmission efficiency.

[0221] Based on the above embodiments, the implementation method for determining the relevant lengths of the first and second message segments will be further described below.

[0222] The following can be combined Figure 12 To understand, Figure 12 This is a schematic diagram illustrating the message segment length relationship provided in the embodiments of this application.

[0223] Based on the above explanation, it can be understood that the length of the message body in the first message segment is the first length, and the length of the message header is the third length L. Therefore... Figure 12 The length M of the first message segment shown x Its size is equal to the sum of the first length and the third length L of the message header.

[0224] Furthermore, the length of the message body in the second message segment is the second length, and the length of the message header is the third length L. Therefore... Figure 11 The length M of the second message segment shown min Its size is equal to the sum of the second length and the third length L of the message header.

[0225] Based on this, the implementation of determining the length of various types of message fragments will be introduced below.

[0226] In one possible implementation, before fragmenting the first target message, the first device may, for example, first determine the length M of the second message segment. min The size of the first message segment, and the value of the multiple X between the first and second lengths, can be used to calculate the length M of the first message segment. xThe size is determined by the first length.

[0227] Therefore, the following section first determines the length M of the second message segment. min The implementation of the size will be introduced.

[0228] In one implementation, M min The size depends on the access type of the second device and the gateway device. For example, if the access type of the second device and the gateway device is type 1, then M can be set to... min The MTU should be less than or equal to that of the first type, so that the final segmented second packet fragment can meet the MTU limit between the second device and the gateway device.

[0229] Furthermore, you can refer to Formula 1 for further understanding.

[0230] M min = M n (Target device access type) Formula 1

[0231] Among them, M n (Target device access type) is the MTU function mapped based on the access type. The access type of the target device is the same as the access type of the second device and the gateway device. In other words, the MTU can be determined based on the mapping of the access types of the second device and the gateway device. min Size.

[0232] For example, a first mapping table can be pre-constructed, and then the total length of the second message segment can be determined based on the first mapping table, wherein the first mapping table is used to indicate the total length of the message segments corresponding to each of the various access types. For example, the first mapping table can be understood with reference to Table 1 below.

[0233] Table 1

[0234]

[0235] Referring to Table 1, the access type refers to the message transmission method between the second device and the gateway device in this embodiment of the application.

[0236] This can be understood as follows: when transmitting messages between the second device and the gateway device via a fieldbus, the MTU is 256 bytes. In this case, the MTU is... min The size can be 256 bytes.

[0237] When transmitting messages between the second device and the gateway device via BLE, the MTU is 512 bytes. That is, in this case, M... min The size can be 512 bytes.

[0238] When the second device and the gateway device transmit messages via StarFlash, the MTU is 1024 bytes. That is, in this case, M... min The size can be 1024 bytes.

[0239] The following section will introduce how to determine the value of the multiple X between the first length and the second length.

[0240] In one implementation, the value of the multiple X is related to the transmission bandwidth, service type, and response latency. These three factors will be introduced separately below.

[0241] The value of the multiple X is related to the transmission bandwidth.

[0242] X can be proportional to the bandwidth difference between the first bandwidth and the second bandwidth, where the first bandwidth is the transmission bandwidth between the first device and the gateway device, and the second bandwidth is the transmission bandwidth between the second device and the gateway device. In other words, the larger the difference between the transmission bandwidth between the first device and the gateway device and the transmission bandwidth between the second device and the gateway device, the larger the value of X will be.

[0243] It's understandable that the larger the bandwidth difference between the first and second bandwidths, the greater the difference between the MTU corresponding to the access types of the first and gateway devices and the MTU corresponding to the access types of the gateway and second devices. In other words, the MTU corresponding to the first and gateway devices is larger. Based on this, when performing packet fragmentation at the first device, a larger fragment length can be set, for example, to make the first packet segment longer, thus fully utilizing the first bandwidth.

[0244] Based on the above description, it can be determined that the length M of the second packet segment obtained after segmentation at the gateway device is... min The size of the first message segment can be predetermined, and there is a certain multiple relationship between the lengths of the first and second message segments. It can be understood that, given a fixed length for the second message segment and a multiple relationship of X between the two segments, the larger the value of X, the longer the length of the first message segment.

[0245] Based on the above analysis, the larger the difference between the first bandwidth and the second bandwidth, the larger the value of X can be set, so as to make the length of the first message segment longer, thereby improving the utilization rate of the first bandwidth.

[0246] Implementation 2: The value of the multiple X is related to the business type.

[0247] Furthermore, the value of X is related to the quality of service requirements of the service type carried by the first target message. For example, the service type carried by the first target message may have a first requirement regarding transmission rate, and a second requirement regarding reliability. Therefore, X may be directly proportional to the first requirement parameter, and / or inversely proportional to the second requirement parameter.

[0248] In other words, the higher the service type carried by the first target message has in terms of the first requirement for transmitting the first target message, the higher the bandwidth utilization required for transmitting the first target message, and the larger the value of X will be.

[0249] It is understandable that the greater the demand, the higher the efficiency requirement for the transmission of the first target message is for the service type carried by the first target message. Therefore, when performing message fragmentation at the first device, a larger fragment length can be set to make the length of the first message segment longer. This can make full use of the first bandwidth and thus improve the transmission efficiency of the first target message.

[0250] As can be understood from the above description, when the length of the second message segment is fixed and there is a multiple relationship of X between the second message segment and the second message segment, the larger the value of X, the longer the length of the corresponding first message segment.

[0251] Based on the above analysis, the larger the first demand, the larger the value of X can be set, so that the length of the first message segment is longer, thereby improving the utilization rate of the first bandwidth and thus improving the transmission efficiency of the first target message.

[0252] Furthermore, the higher the second requirement for the transmission of the first target message due to the service type carried by the first target message, the smaller the value of X. It can be understood that a higher second requirement means a higher demand for reliability in the transmission of the first target message due to the service type carried by the first target message. Therefore, when fragmenting the message at the first device, a smaller fragment length can be set to make the first message segment shorter. This reduces the number of fragments at the gateway device, thereby improving the reliability of the first target message transmission.

[0253] As can be understood from the above description, when the length of the second message segment is fixed and there is a multiple relationship of X between the second message segment and the second message segment, the smaller the value of X, the shorter the length of the corresponding first message segment.

[0254] Based on the above analysis, when the second demand is greater, the value of X can be set to be smaller, so that the length of the first message segment is shorter, reducing the number of fragmentation at the gateway device, thereby improving the reliability of the transmission of the first target message.

[0255] Thirdly, the value of the multiple X is related to the response delay.

[0256] In addition, the value of X is also related to the compensation function for the message response delay, that is, X is inversely proportional to the first delay, where the first delay is the message delay for the second device to respond after receiving the message. In other words, the greater the message delay for the second device to respond after receiving the message, the smaller the value of X.

[0257] It is understandable that the greater the initial latency, the longer it will take for the second device to respond after receiving the message. For example, this may cause message accumulation at the gateway. Therefore, when performing message fragmentation at the first device, a smaller fragment length can be set to make the first message segment shorter. This can reduce the number of fragmentation operations at the gateway device and reduce the impact of message accumulation at the gateway on message transmission efficiency.

[0258] As can be understood from the above description, when the length of the second message segment is fixed and there is a multiple relationship of X between the second message segment and the second message segment, the smaller the value of X, the shorter the length of the corresponding first message segment.

[0259] Based on the above analysis, when the first delay is greater, the value of X can be set to be smaller, so that the length of the first message segment is shorter, reducing the number of fragmentation at the gateway device, thereby improving the transmission efficiency of the first target message.

[0260] Based on the three implementations introduced above, the following section will explain the relevant content of determining the value of the multiple X using a specific implementation, in conjunction with Formula 2.

[0261] Formula 2

[0262] Among them, F n Let Q be a mapping function used to determine the number of slices based on weights, where Q 源设备 This represents the weight corresponding to the access type of the source device. The access type of the source device can be understood as the access type of the first device and the gateway device as described above. And Q 目标设备 This represents the weight corresponding to the access type of the target device. The access type of the target device can be understood as the access type between the second device and the gateway device as described above. And Q 请求服务 This represents the weight corresponding to the requested service, where the requested service is the service corresponding to the service type carried by the first target message.

[0263] And, R n T is the compensation function for the response delay of the message. 响应时延This refers to the response delay of the second device to the message, which is the first delay described above.

[0264] Based on Formula 2 and the implementation described above, for example, the weight Q described in Formula 2 can be determined based on the bandwidth difference between the first bandwidth and the second bandwidth. 源设备 With Q 目标设备 For example, the larger the bandwidth difference between the first bandwidth and the second bandwidth, the higher the corresponding weight Q. 源设备 With Q 目标设备 The larger the value, the better. The specific implementation of determining these two weights based on the bandwidth difference can be set according to actual needs, and this embodiment does not impose any restrictions on this.

[0265] Furthermore, for example, the weight Q described in Formula 2 above can be determined based on the requirement parameters corresponding to the service type carried by the first target message. 请求服务 For example, the greater the primary demand, the higher the corresponding weight Q. 请求服务 The larger the value of Q, the greater the weight Q becomes, for example, the greater the second requirement. 请求服务 The smaller the value of , the better. The specific implementation of determining these two weights based on the requirement parameters can be set according to actual needs; this embodiment does not impose any restrictions on this.

[0266] For example, a second mapping table can be pre-constructed, and the value of X can be determined based on the second mapping table, for example. The second mapping table can be used to indicate the mapping function of the sum of the access types of the source and target devices and the weights of the requested services. For example, the second mapping table can be understood with reference to Table 2 below.

[0267] Table 2

[0268]

[0269] Referring to Table 2, it can be understood that the weights in the second mapping table are the sum of the access types of the source device, the access types of the target device, and the weights of the requested services. The number of fragments contained in each group in the second mapping table is the multiple X between the first length and the second length.

[0270] Therefore, the second mapping table mentioned above can be understood as follows: without considering the response message latency, and with the sum of the source device type, target device type, and requested service weights ranging from 0 to 100, the multiple X between the first length and the second length is 1.

[0271] When the sum of the source device type, target device type, and requested service weight is between 100 and 200, the multiple X between the first length and the second length is 3.

[0272] When the sum of the source device type, target device type, and requested service weights is greater than or equal to 200, the multiple X between the first length and the second length is 5.

[0273] Furthermore, referring to Formula 2, when considering the response message delay, the value of X also needs to be multiplied by the compensation function related to the response message delay. It should be understood that the compensation function related to the response message delay can be set according to actual circumstances, and this embodiment does not impose any limitations.

[0274] Next, we will determine the length M of the first message segment. x The implementation of the size will be introduced.

[0275] In one implementation, the length M of the first message segment x Size and length M of the second message segment min The size is related to the length M of the first message segment. x It also depends on the value of the multiple X between the first length and the second length.

[0276] Because the length M of the second message segment min The size is equal to the sum of the second length and the message header L, and the length M of the second message segment. x The size is equal to the sum of the first length and the message header L, and the first length is X times the second length. Therefore, for example, the length M of the first message segment can be determined based on these relationships. x The size is calculated.

[0277] Furthermore, you can refer to Formula 3 for further understanding.

[0278] M x = X*M min -L*(X-1) Formula 3

[0279] Where X*M min This can be understood as the total length of X second message fragments, and each second message fragment contains a message header, i.e., X*M. min The length includes the length of X headers. It can be understood that in the process of fragmenting the first message segment, the message content of the first message segment is actually fragmented. Therefore, when calculating the length of the first message segment, the length of X headers should be subtracted. Furthermore, the total length of the first message segment is equal to the length of the message content plus the length of the headers. Therefore, it can be understood that for X*M... min Subtracting the length L of X-1 message headers will give you the length of the first message segment.

[0280] In the above embodiments, since the first length and the second length are integer multiples of each other, it can also be understood that the message content of the first message fragment and the second message fragment are integer multiples of each other. Therefore, each first message fragment received by the gateway device can be divided into M complete second message fragments. This avoids the latency caused by reassembly during continuous fragmentation and recalculation based on irregular lengths, as well as the latency caused by waiting for continuous fragmentation, significantly improving the efficiency of the gateway device in forwarding messages. Furthermore, by using a compensation function related to message latency, the overall message transmission and reception efficiency can be adjusted in real time.

[0281] Furthermore, each message segment described in the embodiments of this application contains a corresponding message header, and the contents contained in the message header of the message segment will be explained below.

[0282] The following can be combined Figure 13 To understand, Figure 13 This is a schematic diagram illustrating the content of the message header during message transmission, as provided in the embodiments of this application.

[0283] Reference Figure 13 In this embodiment, for example, the Mining Hong operating system can be deployed on the control center, gateway devices, and micro sensors, upgrading them into the Mining Hong control center, Mining Hong gateway, and Mining Hong micro sensors. Furthermore, an industrial control protocol can be deployed on the control center, gateway devices, and micro sensors. In one implementation, this protocol can be the Mine Device Transfer Protocol (MDTP).

[0284] In this implementation, based on an industrial control protocol, a fragmentation control field can be deployed in the headers of both request and response messages. For example, a fragmentation control field containing two bits (Bit5 and Bit6) can be set in the 13th byte of the header of both the request and response messages. The content and meaning of the fragmentation control field can be understood in conjunction with Table 3 below.

[0285] Table 3

[0286]

[0287] Specifically, for a complete, unfragmented message, Bits 5 and 6 in its header can be, for example, 1 and 1, which is represented as 11 bytes in binary. For example, in... Figure 13 In the header of the first target message 1300 shown, Bit5 and Bit6 can take values ​​of, for example, 1 and 1. Figure 13 The diagram also shows that the header of the first target message 1300 contains fragmentation mark 11B.

[0288] And for the first fragment of a message, the values ​​of Bits 5 and 6 in its header can be, for example, 1 and 0, which is 10 bytes in binary representation. For example, in... Figure 13 In the header of the first message segment 1310 and the header of the first message segment 1311 shown, Bit5 and Bit6 can have values ​​of 1 and 0, respectively. Figure 13 The diagram also illustrates that the header of the first first message segment 1310 and the header of the first second message segment 1311 contain fragmentation marker 10B.

[0289] And for intermediate fragments of a message, the values ​​of Bit5 and Bit6 in their header can be, for example, 0 and 0, which is represented as 00B in binary. For example, in... Figure 13 In the header of the first message segment 1320 shown, ..., in the headers of the second message segment 1312, the second message segment 1321, the second message segment 1322, ..., Bit5 and Bit6 can have values ​​of 0 and 0 respectively. Figure 13 The diagram also shows that portions of the headers of the first segment 1320, the second segment 1312, the second segment 1321, and the second segment 1322 contain the fragmentation marker 00B.

[0290] Furthermore, for the last fragment of a message, bits 5 and 6 in its header can be 0 and 1, respectively, which is represented as 01B in binary. For example, in... Figure 13 In the header of the third message segment 1330 shown, and in the header of the fourth message segment 1331, Bit5 and Bit6 can have values ​​of 0 and 1, respectively. Figure 13 The diagram also shows that the header of the third message segment 1330 and the header of the fourth message segment 1331 contain fragmentation marker 01B.

[0291] The above-described method of setting a fragmentation control field containing two bits (Bit5 and Bit6) in the 13th byte of the header of the request and response messages is only one possible implementation. In actual implementation, the position of the fragmentation control field in the header, as well as the position and number of bits occupied by the fragmentation control field, can be selected according to actual needs. This embodiment does not limit this.

[0292] In this way, the gateway device can quickly locate the first, middle, and last fragments of the target packet during packet fragmentation and the reassembly of received fragmented packets by the second device. This operation can effectively improve packet processing speed, reduce packet processing latency, and improve overall efficiency.

[0293] The above describes the downlink transmission process, which is the process by which the first device sends a request to the second device. The following section, in conjunction with the accompanying drawings, describes the process by which the second device sends a response to the first device.

[0294] Figure 14 Signaling interaction for the message transmission method provided in the embodiments of this application Figure 2 , Figure 15 A schematic diagram of the fragmentation method in the message transmission process provided in the embodiments of this application. Figure 4 , Figure 16 A schematic diagram of the fragmentation method in the message transmission process provided in the embodiments of this application. Figure 5 , Figure 17 A schematic diagram of the fragmentation method in the message transmission process provided in the embodiments of this application. Figure 6 . Reference Figure 14 The message transmission method provided in this application embodiment may include:

[0295] S1401, the second device segments the second target message to obtain at least one fifth message segment and one seventh message segment.

[0296] In one implementation, after receiving the first target message, the second device may, for example, respond to the request contained in the first target message, that is, the second device may, for example, respond to the request sent by the first device.

[0297] The second target message can be understood as a protocol response message. For example, after receiving the protocol request message (first target message) sent by the first device, the second device can send a protocol response message to the first device.

[0298] Alternatively, the second device can proactively send a second target message to the first device. The second target message may contain, for example, relevant data collected by the second device.

[0299] For example, the second target message may include a message header and a message body, whereby the message body may also be referred to as message content. The message header may include, for example, relevant configuration information and control information of the second target message, and the message content of the second target message may include, for example, the content of the second device's response to the request issued by the first device.

[0300] In one implementation, the second device may encapsulate the response content to be sent to the first device into a message body and assemble it with a message header to obtain the second target message.

[0301] It is understandable that, in order for the second device to send the second target message to the gateway device while meeting the MTU limit, the second device can, for example, segment the second target message to obtain multiple message fragments that meet the MTU limit.

[0302] For example, after the second device fragments the second target message, it can obtain at least one fifth message fragment and one seventh message fragment. In the fifth message fragment, the length of the message content can be, for example, the second length, and the length of the seventh message fragment can be, for example, less than or equal to the second length.

[0303] It is understood that the second target message also includes a message header and a message body. In the implementation of the second device segmenting the second target message, for example, the second device may segment the message body of the second target message to obtain multiple message fragments. In one implementation, for example, the second device may segment the message body of the second target message sequentially using a second length as the segmentation unit length, thereby obtaining the message body corresponding to at least one fifth message fragment.

[0304] Furthermore, it is understood that the length of the last remaining message segment after segmentation may be less than the second length. Therefore, in this embodiment of the application, in addition to at least one fifth message segment, a seventh message segment is also included in the multiple message fragments obtained by the second device segmenting the message body of the second target message. The seventh message segment can be understood as the last message segment obtained after segmentation.

[0305] For example, you can refer to Figure 15 To understand. For example Figure 15 As shown, the second target message can include a header and a body, where the header length can be, for example, L. During the segmentation of the second target message, the body can be segmented multiple times according to a second length. (Refer to...) Figure 15 After segmenting the message body of the second target message, for example, we can obtain... Figure 15 The shown segments are 1501, 1502, 1503, and 1504. The lengths of segments 1501 to 1503 can be, for example, a second length, and the length of the last remaining segment 1504 can be, for example, q, where q can be less than or equal to the second length.

[0306] like Figure 15As shown, these fragments can, for example, serve as the message bodies corresponding to multiple fifth message segments. Then, for example, corresponding message headers can be added to these message bodies to obtain... Figure 15 The fifth message segment D1, fifth message segment D2, ..., fifth message segment D3, and seventh message segment D4 are shown. Figure 15 In the example, the header length of each fifth and seventh message segment is L. The header added for the fifth message segment can be, for example, a copy of the header of the second target message.

[0307] S1402, the second device sends the fifth message fragment and the seventh message fragment to the gateway device, and the gateway device receives the fifth message fragment and the seventh message fragment accordingly.

[0308] For example, after segmenting the second target message, the second device may sequentially send at least one fifth message segment and one seventh message segment to the gateway device. For instance, the second device may send at least one fifth message segment and one seventh message segment to the gateway device via near-field communication or a fieldbus.

[0309] In this scenario, when the second device sends message segments to the gateway device, it can send each message segment sequentially, meaning it sends them in the order they appear. The specific method is similar to the one described above, where the first device sends the first message segment to the gateway device; it will not be repeated here.

[0310] It is understandable that after the seventh message segment is transmitted, the second device completes the operation of sending the second target message to the gateway device.

[0311] S1403, The gateway device reassembles the fifth and seventh message segments to obtain at least one sixth message segment and one eighth message segment.

[0312] In this embodiment, the gateway device needs to send the segmented fifth and seventh packet fragments to the first device. As explained above, the MTU limitation corresponding to the access method between the gateway device and the second device is typically smaller than the MTU limitation corresponding to the access method between the gateway device and the first device. Therefore, to enable the gateway device to send the fifth and seventh packet fragments to the first device while meeting the MTU limitation, and to fully utilize the bandwidth between the gateway device and the first device, the gateway device can, for example, reassemble the fifth and seventh packet fragments to obtain at least one packet fragment that both meets the MTU limitation and achieves a relatively long packet length.

[0313] In one implementation, the gateway device may, for example, reassemble multiple received fifth message fragments in chronological order to obtain at least one sixth message fragment, wherein the length of the message content in the sixth message fragment may, for example, be a first length.

[0314] Additionally, the gateway device will also receive a seventh message fragment. For example, the gateway device can concatenate several fifth message fragments that are ranked last among multiple fifth message fragments with the seventh message fragment to obtain an eighth message fragment. It can be understood that the eighth message fragment is the last message fragment after reassembly, and the length of its message content can be less than or equal to the first length.

[0315] It is understood that the fifth and seventh message segments also include a message header and a message body. In the implementation of the gateway device reassembling the fifth and seventh message segments, for example, the gateway device may reassemble the message bodies of the fifth and seventh message segments to obtain at least one message segment. In one implementation, for example, the gateway device may reassemble the message bodies of the fifth and seventh message segments sequentially, using a first length as the reassembly unit length, thereby obtaining the message bodies corresponding to at least one sixth message segment and the message body of an eighth message segment.

[0316] This can be understood as the first length being X times the second length, where X is an integer greater than or equal to 1. Therefore, using the first length as the unit length for reassembly, the message bodies of the fifth and seventh message segments are sequentially reassembled, which means reassembling every X received fifth message segments in order. This results in the message body corresponding to at least one sixth message segment and the message body of one eighth message segment.

[0317] The following is a combination of... Figure 16 Understanding the implementation of reassembling the fifth message segment to obtain at least one sixth message segment.

[0318] like Figure 16 As shown in the diagram, for example, the fifth message segment E1 can contain a message header and a message body 1601, the fifth message segment E2 can contain a message header and a message body 1602, and the fifth message segment E3 can contain a message header and a message body 1603. The length of the message body in the fifth message segment can be a second length, and the length of the message header can be, for example, L. After receiving X fifth message segments, the gateway device can reassemble them.

[0319] Reference Figure 16 After receiving X fifth message fragments, the gateway device can, for example, deseal them to obtain... Figure 16The fragments are 1601, 1602, ..., and 1603, where the length of fragments 1601-1603 can be, for example, a second length. The gateway device can then reassemble these fragments to obtain a message segment 1600 of a first length.

[0320] Because there is an integer multiple relationship of X between the first length and the second length as described here, the reassembly of the fifth message fragment only needs to be performed after X fifth message fragments have been received. This avoids the delay caused by insufficient total message length during reassembly as described above, requiring waiting for the next fragment to be received, splitting the next fragment, and then reassembling it into a complete message fragment. Therefore, the technical solution of this application embodiment can effectively reduce the waiting time required for message reassembly at the gateway device.

[0321] like Figure 16 As shown, a message segment of length 1600 can, for example, be used as the message body of the sixth message segment. Then, for example, a message header can be added to this message body to obtain... Figure 16 The sixth message fragment shown. Figure 16 In the example, the length of the header of each message segment is L. The header added to the message body can be, for example, a newly generated header based on the protocol between the gateway device and the first device, or the header added to the message body can be the header of the fifth message segment. This embodiment does not limit this.

[0322] It is understood that for every X fifth message fragments sent by the second device, the gateway device can reassemble them in the manner described here to obtain at least one sixth message fragment.

[0323] Next, let's combine... Figure 17 Understanding the implementation of reassembling the seventh and / or fifth message segments to obtain an eighth message segment.

[0324] As can be understood from the above description, after the second device fragments the second target message, in addition to obtaining at least one fifth message fragment with a message content length of the second length, it can also obtain, for example, a seventh message fragment with a message content length less than or equal to the second length. The seventh message fragment can be understood as the last message fragment after fragmenting the second target message.

[0325] Therefore, it can be understood that in the process of reassembling the fifth and seventh message segments, in addition to obtaining at least one sixth message segment, an eighth message segment will also be obtained. The eighth message segment can be understood as the last message segment obtained after reassembling the fifth and seventh message segments.

[0326] In one implementation, the number of fifth message fragments obtained by the second device after fragmenting the second target message is not an integer multiple of X. In this implementation, after reassembling every X fifth message fragments into a sixth message fragment, there may be at least one remaining fifth message fragment (less than X), and a final seventh message fragment remaining after fragmentation. These remaining at least one fifth message fragment and the seventh message fragment can then be reassembled in the manner described above.

[0327] For example Figure 17 The diagram illustrates the remaining fifth message segment, whose message body is the one indicated by 1701 in the diagram. It can be understood that there may be other remaining fifth message segments, which are not shown individually in the diagram. Subsequently, for example, the message body 1701 of the remaining fifth message segment and the message body 1702 of the seventh message segment can be reassembled to obtain a message segment 1700.

[0328] like Figure 17 As shown, message segment 1700 can, for example, be used as the message body of the eighth message segment. Then, for example, a message header can be added to this message body to obtain... Figure 17 The eighth message segment shown. Figure 17 In the example, the length of the header for each message segment is L. The header added to the message body can be referenced above and will not be repeated here.

[0329] In another implementation, the fifth packet fragment obtained by the second device after fragmenting the second target packet is an integer multiple of X. In this implementation, after reassembling every X fifth packet fragments into a sixth packet fragment, for example, only one seventh packet fragment remains. Therefore, the gateway does not need to reassemble this packet fragment; it only needs to perform protocol conversion. In other words, in this implementation, the seventh packet fragment is the eighth packet fragment.

[0330] The above description describes the implementation of reassembling the fifth and seventh message segments. It's understandable that, since the second device needs to send message segments to the gateway device in the correct order—for example, sending the second fifth message segment only after the first one has been transmitted—the gateway device can, for example, reassemble them after receiving X fifth message segments. In other words, the gateway device does not need to wait to receive all the fifth and seventh message segments before starting processing.

[0331] S1404, the gateway device sends the sixth message fragment and the eighth message fragment to the first device; correspondingly, the first device receives the sixth message fragment and the eighth message fragment.

[0332] For example, after reassembling the fifth and seventh packet fragments, the gateway device can sequentially send at least one sixth packet fragment and an eighth packet fragment to the first device. For instance, the gateway device can send at least one sixth packet fragment and an eighth packet fragment to the first device via an industrial ring network switch.

[0333] It's understandable that when the second device sends message segments to the gateway device, it needs to follow the order of the message segments; the second fifth message segment can only be sent after the first fifth message segment has been transmitted completely. Furthermore, the gateway device can reassemble X fifth message segments after receiving them, without waiting to receive all the fifth and seventh message segments before starting reassembly. Therefore, after reassembling a sixth message segment, the gateway device can send it to the first device without waiting for all message segments to be reassembled.

[0334] It can be understood that when the gateway device sends a message fragment to the first device, it can send the message fragments sequentially. That is, the message fragments are sent in the order they appear. For details, please refer to the method described above for the first device to send the first message fragment to the gateway device; it will not be repeated here.

[0335] Therefore, after the transmission of the eighth message segment is completed, the gateway device has completed the operation of sending the sixth and eighth message segments to the first device.

[0336] S1405, The first device reassembles the sixth and eighth message segments to obtain the second target message, and processes the second target message.

[0337] After receiving at least one sixth message fragment and one eighth message fragment forwarded by the gateway device, the first device may, for example, reassemble the at least one sixth message fragment and one eighth message fragment in sequence to obtain the second target message sent by the second device.

[0338] For example, the first device can also deseal the second target message according to the transmission protocol, that is, the protocol used for transmission between the gateway device and the first device. After desealing, the response content sent by the second device to the first device can be obtained, for example.

[0339] In this embodiment, by fragmenting and then reassembling the message, the message can be sent from the second device to the first device. Specifically, by dividing the second target message into relatively small segments between the second device and the gateway device, and then reassembling these relatively small segments into relatively large segments between the first device and the gateway device, the high bandwidth advantage of the Industrial Internet can be effectively utilized, improving bandwidth utilization. Furthermore, by setting the first length and the second length to a multiple relationship, the waiting time during message reassembly at the gateway device can be reduced. These two key operations effectively improve message transmission efficiency.

[0340] As can be understood from the above description, the length of the fifth message segment described in this application embodiment is the second length, and the length of the sixth message segment is the first length. The method for determining the first length and the second length can be understood with reference to the description in the above embodiments. That is, after determining the first length, the second length, and the value of X according to the method described in the above embodiments, the message is segmented and reassembled according to the lengths described above during both the uplink and downlink transmission processes. The specific implementation of determining the message length and multiples can be understood with reference to the above embodiments, and will not be repeated here.

[0341] By setting the first and second lengths as multiples of each other, the gateway device can reassemble every X fifth packet fragments received into a complete sixth packet fragment. This avoids the latency caused by recalculating fragments based on irregular lengths during continuous reassembly, as well as the latency incurred while waiting for continuous reassembly, significantly improving the efficiency of the gateway device in forwarding packets. Furthermore, by using a compensation function related to response packet latency, the overall packet transmission and reception efficiency can be adjusted in real time.

[0342] Furthermore, during the process of reassembling packet fragments, the gateway device or the first device can distinguish the first packet fragment, the intermediate packet fragments, and the last packet fragment based on the fragmentation marker in the packet header. The fragmentation marker in the packet header is similar to that described in the above embodiments, and will not be repeated here.

[0343] By setting a fragmentation control field in the packet header, the gateway device and the first device can quickly locate the first, middle, and last fragments of the received fragmented packets during the reassembly process. This operation can effectively improve packet transmission and processing speed, reduce packet latency, and improve overall efficiency.

[0344] The methods provided in the embodiments of this application have been described in detail above with reference to several accompanying drawings. The apparatus provided in the embodiments of this application will now be described with reference to the accompanying drawings.

[0345] It should be noted that the data involved in this application (including but not limited to data used for analysis, data stored, data displayed, etc.) are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation portals are provided for users to choose to authorize or refuse.

[0346] This application provides an electronic device, which includes a processor and a memory; the memory stores computer execution instructions; the processor executes the computer execution instructions stored in the memory, causing the electronic device to perform the above-described method.

[0347] This application provides a chip. The chip includes a processor, which is used to call a computer program in memory to execute the technical solutions in the above embodiments. Its implementation principle and technical effects are similar to those in the related embodiments described above, and will not be repeated here.

[0348] This application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program. When the computer program is executed by a processor, it implements the methods described above. The methods described in the above embodiments can be implemented wholly or partially by software, hardware, firmware, or any combination thereof. If implemented in software, the functionality can be stored as one or more instructions or code on or transmitted over the computer-readable medium. The computer-readable medium can include computer storage media and communication media, and can also include any medium that can transfer a computer program from one place to another. The storage medium can be any target medium accessible by a computer.

[0349] In one possible implementation, a computer-readable medium may include random access memory (RAM), read-only memory (ROM), compact disc read-only memory (CD-ROM) or other optical disc storage, magnetic disk storage or other magnetic storage devices, or any other medium intended to carry or store required program code in the form of instructions or data structures, and accessible by a computer. Furthermore, any connection is appropriately referred to as a computer-readable medium. For example, if software is transmitted from a website, server, or other remote source using coaxial cable, fiber optic cable, twisted pair, digital subscriber line (DSL), or wireless technologies such as infrared, radio, and microwave, then coaxial cable, fiber optic cable, twisted pair, DSL, or wireless technologies such as infrared, radio, and microwave are included in the definition of medium. As used herein, disks and optical discs include optical discs, laser discs, optical discs, digital versatile discs (DVDs), floppy disks, and Blu-ray discs, where disks typically reproduce data magnetically, while optical discs optically reproduce data using lasers. Combinations of the above should also be included within the scope of computer-readable media.

[0350] This application provides a computer program product, which includes a computer program that, when run, causes a computer to perform the above-described method.

[0351] It should be noted that the modules or components described in the above embodiments can be one or more integrated circuits configured to implement the above methods, such as one or more application-specific integrated circuits (ASICs), one or more digital signal processors (DSPs), or one or more field-programmable gate arrays (FPGAs), etc. Furthermore, when a module is implemented through processing element scheduler code, the processing element can be a general-purpose processor, such as a central processing unit (CPU) or other processors capable of calling program code, such as a controller. Additionally, these modules can be integrated together to implement a system-on-a-chip (SOC).

[0352] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the flow or function according to the embodiments of this application is generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., a solid-state disk (SSD)).

[0353] The term "multiple" in this document refers to two or more. The term "and / or" is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone. Furthermore, the character " / " in this document generally indicates an "or" relationship between the preceding and following related objects; in formulas, " / " indicates a "division" relationship. Additionally, it should be understood that in the description of this application, words such as "first" and "second" are used only for descriptive purposes and should not be construed as indicating or implying relative importance or order.

[0354] It is understood that the various numerical designations used in the embodiments of this application are merely for descriptive convenience and are not intended to limit the scope of the embodiments of this application.

[0355] It is understood that, in the embodiments of this application, the order of the above-mentioned process numbers does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of this application.

Claims

1. A method of processing a packet, the method comprising: The method is applied to a communication system, the system comprising a gateway device, a first device and a second device, the gateway device being configured to transmit data between the first device and the second device, the method comprising: The first device splits a first target packet to obtain at least one first packet segment, the length of the packet content in the first packet segment being a first length; The first device sends the at least one first packet segment to the gateway device; For any one of the at least one first packet segment, the gateway device splits the first packet segment to obtain X second packet segments, the length of the packet content in the second packet segment being a second length, the first length being X times the second length, X being an integer greater than or equal to 1; The gateway device sends the X second packet segments to the second device.

2. The method of claim 1, wherein, The number X is directly proportional to the bandwidth difference between a first bandwidth and a second bandwidth, the first bandwidth being the transmission bandwidth between the first device and the gateway device, the second bandwidth being the transmission bandwidth between the second device and the gateway device; The number X is inversely proportional to a first time delay, the first time delay being the time delay of the second device in responding to a packet after receiving the packet.

3. The method of claim 2, wherein, The number X is directly proportional to a first requirement parameter, the first requirement parameter being used to indicate the bandwidth utilization required for transmitting the first target packet; and / or, The number X is inversely proportional to a second requirement parameter, the second requirement parameter being used to indicate the reliability required for transmitting the first target packet.

4. The method according to any one of claims 1 to 3, characterized in that, The access type of the second device and the gateway device is a first type; wherein the total length of the second packet segment is less than or equal to the MTU corresponding to the first type, the total length of the second packet segment being equal to the second length of the packet content plus the third length of the packet header.

5. The method of claim 4, wherein, The total length of the second packet segment is determined based on a first mapping table, the first mapping table being used to indicate the total length of the packet segment corresponding to each of a plurality of access types.

6. The method of claim 4, wherein, The first device splits a first target packet to obtain at least one first packet segment, comprising: The first device splits the packet content in the first target packet according to the first length to obtain at least one split packet segment; A packet header is added to each of the at least one split packet segment to obtain the at least one first packet segment.

7. The method according to any one of claims 1 to 3, characterized in that, After the first device splits the first target packet, a third packet segment is also obtained, the third packet segment being the last packet segment split from the first target packet, the length of the third packet segment being less than or equal to the first length; The method further comprises: The first device sends the third packet segment to the gateway device; The gateway device splits the third packet segment to obtain at least one second packet segment and a fourth packet segment, the fourth packet segment being the last packet segment split from the third packet segment, the length of the fourth packet segment being less than or equal to the second length; The gateway device sends the at least one second packet segment and a fourth packet segment obtained by splitting the third packet segment to the second device.

8. The method of claim 7, wherein, A first identification is contained in a packet header of an initial first packet segment in the at least one first packet segment, and the first identification is used to indicate that the initial first packet segment is a first fragment. A second identification is contained in a packet header of a remaining first packet segment in the at least one first packet segment except the initial first packet segment, and the second identification is used to indicate that the remaining first packet segment is an intermediate fragment. A third identification is contained in a packet header of the third packet segment, and the third identification is used to indicate that the third packet segment is a last fragment.

9. The method of claim 7, wherein, A first identification is contained in a packet header of an initial second packet segment in the at least one second packet segment, and the first identification is used to indicate that the initial second packet segment is a first fragment. A second identification is contained in a packet header of a remaining second packet segment in the at least one second packet segment except the initial second packet segment, and the second identification is used to indicate that the remaining first packet segment is an intermediate fragment. A third identification is contained in a packet header of the fourth packet segment, and the third identification is used to indicate that the fourth packet segment is a last fragment.

10. A method of processing a packet, the method comprising: The method is applied to a communication system, and the system comprises a gateway device, a first device and a second device, the gateway device is used to transmit data between the first device and the second device, and the method comprises: The second device sends a plurality of fifth packet segments to the gateway device, and a length of packet content in the fifth packet segments is a second length. The gateway device sequentially splices every X fifth packet segments in the plurality of fifth packet segments to obtain at least one sixth packet segment, a length of packet content in the sixth packet segment is a first length, the first length is X times of the second length, and X is an integer greater than or equal to 1. The gateway device sends the at least one sixth packet segment to the first device. The first device splices the at least one sixth packet segment to obtain a second target packet.

11. The method of claim 10, wherein, A first identification is contained in a packet header of an initial fifth packet segment in the at least one fifth packet segment, and the first identification is used to indicate that the initial fifth packet segment is a first fragment. A second identification is contained in a packet header of a remaining fifth packet segment in the at least one fifth packet segment except the initial fifth packet segment and a tail fifth packet segment, and the second identification is used to indicate that the remaining fifth packet segment is an intermediate fragment. A third identification is contained in a packet header of the tail fifth packet segment in the at least one fifth packet segment, and the third identification is used to indicate that the tail fifth packet segment is a last fragment.

12. The method of claim 11, wherein, The gateway device sequentially splices every X fifth packet segments in the plurality of fifth packet segments to obtain at least one sixth packet segment, comprising: The gateway device sequentially splices every X fifth packet segment according to the identifier contained in the packet header of each of the plurality of fifth packet segments to obtain at least one sixth packet segment.

13. The method of claim 10, wherein, The packet header of an initial sixth packet segment in the at least one sixth packet segment contains a first identifier, the first identifier being used to indicate that the initial sixth packet segment is a first fragment. The packet header of a remaining sixth packet segment in the at least one sixth packet segment contains a second identifier, the second identifier being used to indicate that the remaining sixth packet segment is a middle fragment, except for the initial sixth packet segment and a tail sixth packet segment. The packet header of the tail sixth packet segment in the at least one sixth packet segment contains a third identifier, the third identifier being used to indicate that the tail sixth packet segment is a last fragment.

14. The method of claim 13, wherein, The first device splices the at least one sixth packet segment to obtain a second target packet, including: The first device splices the at least one sixth packet segment according to the identifier contained in the packet header of each of the at least one sixth packet segment to obtain a second target packet.

15. The method according to any one of claims 10 to 14, characterized in that, The number X is directly proportional to a bandwidth difference between a first bandwidth and a second bandwidth, the first bandwidth being a transmission bandwidth between the first device and the gateway device, and the second bandwidth being a transmission bandwidth between the second device and the gateway device. The number X is inversely proportional to a first time delay, the first time delay being a time delay of the second device in responding to a packet after receiving the packet.

16. The method of claim 15, wherein, The number X is directly proportional to a first requirement parameter, the first requirement parameter being used to indicate a bandwidth utilization required for transmitting the second target packet; and / or The number X is inversely proportional to a second requirement parameter, the second requirement parameter being used to indicate a reliability required for transmitting the second target packet.

17. The method according to any one of claims 10-14, characterized in that, An access type of the second device and the gateway device is a first type; wherein a total length of the sixth packet segment is less than or equal to an MTU corresponding to the first type, the total length of the sixth packet segment being equal to a second length of the packet content plus a third length of a packet header.

18. The method of claim 17, wherein, The total length of the sixth packet segment is determined based on a first mapping table, the first mapping table being used to indicate a total length of a packet segment corresponding to each of a plurality of access types.

19. An electronic device, comprising: The electronic device includes one or more processors and a memory; The memory is coupled to the one or more processors, and the memory is configured to store computer program codes, the computer program codes including computer instructions, and the one or more processors are configured to invoke the computer instructions to cause the electronic device to perform the method of any one of claims 1-18.

20. A computer-readable storage medium, characterized in that, The computer readable storage medium includes computer instructions, when the computer instructions are run on an electronic device, causing the electronic device to perform the method of any one of claims 1-18.

Citation Information

Patent Citations

  • Message fragmentation transmission method and apparatus

    CN106330788A

  • Internet of things data transmission method and system

    CN107528795A