Data transmission method and device, storage medium and computer device

By parsing and converting the frame identifier and priority fields of protocol messages, seamless integration and transmission of multiple industrial network protocols are achieved, solving the problem that existing equipment can only support a single protocol, and improving the compatibility and transmission efficiency of the network system.

CN119922252BActive Publication Date: 2026-06-30PENG CHENG LAB

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
PENG CHENG LAB
Filing Date
2025-04-07
Publication Date
2026-06-30

AI Technical Summary

Technical Problem

Existing protocol conversion equipment typically only supports a single industrial network protocol and cannot achieve compatibility with multiple industrial network protocols, resulting in devices with different protocols being unable to seamlessly integrate and transmit data on the same network in industrial scenarios.

Method used

By receiving protocol messages to be transmitted, parsing frame identifiers to identify message types, determining priority fields according to preset mapping relationships, converting message formats to specified formats, and directly scheduling them to the corresponding transmission queues, the system avoids dependence on dedicated protocol conversion equipment and achieves compatibility with multiple protocols.

Benefits of technology

It improves the compatibility and adaptability of different protocols in industrial networks, reduces the cost of system upgrades and transformations, and ensures the efficient transmission of critical data in complex network environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119922252B_ABST
    Figure CN119922252B_ABST
Patent Text Reader

Abstract

This application provides a data transmission method, apparatus, storage medium, and computer device, comprising: receiving a protocol message to be transmitted; parsing the protocol message to obtain a target frame identifier of the protocol message; determining a first message type corresponding to the target frame identifier based on a first preset mapping relationship between the frame identifier and the message type; determining a first priority field corresponding to the first message type according to a second preset mapping relationship between the message type and the priority field; converting the message format of the protocol message to a specified message format and writing the first priority field to obtain a target protocol message; and transmitting the target protocol message to a specified storage area so that a message scheduler schedules the target protocol message to a corresponding transmission queue according to the first priority field included in the target protocol message. The first message type of the protocol message is identified by the target frame identifier obtained by parsing the protocol message, eliminating the need for a protocol conversion device and improving compatibility.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of network technology, and in particular to a data transmission method, apparatus, storage medium, and computer equipment. Background Technology

[0002] With industrial development, smart factories are becoming increasingly integrated and intelligent, placing higher demands on the real-time and deterministic transmission of information. Intelligent industrial communication networks must encompass both deterministic, low-latency information and non-real-time control information transmission, employing both real-time Ethernet and standard Ethernet. Generally, real-time networks are used for machine and system control, while standard networks are used for management-level information transmission. As the underlying interoperability standards and specifications for industrial application networks continue to improve, the need to achieve the transmission of information technology (IT) and operational technology (OT) data within the same network and to prioritize different industrial protocols according to application scenarios is becoming increasingly urgent.

[0003] In related technologies, industrial scenarios typically integrate programmable logic controller (PLC) modules using different protocols, based on the application scenario and the characteristics of each equipment manufacturer. Multi-industry network protocol shared transmission systems include various industrial control devices and protocol switching modules. Existing protocol conversion equipment often uses dedicated hardware or a combination of hardware and software to achieve protocol conversion before shared network transmission. However, dedicated equipment only supports a single industrial network protocol and cannot achieve compatibility with multiple industrial network protocols. Therefore, there is an urgent need to propose a data transmission method to solve the above-mentioned technical problems. Summary of the Invention

[0004] The main objective of this application is to provide a data transmission method, apparatus, storage medium, and computer equipment that can effectively determine the quality score of each data source and classify the same data from different data sources, so as to evaluate the classified data based on the quality score of each data source and provide a data reliability assessment.

[0005] In a first aspect, embodiments of this application provide a data transmission method, including:

[0006] Receive the protocol message to be transmitted, parse the protocol message, and obtain the target frame identifier of the protocol message;

[0007] Based on the first preset mapping relationship between frame identifier and message type, the first message type corresponding to the target frame identifier is determined;

[0008] Based on the second preset mapping relationship between message type and priority field, determine the first priority field corresponding to the first message type;

[0009] The message format of the protocol message is converted into a specified message format, and the first priority field is written to obtain the target protocol message;

[0010] The target protocol message is transmitted to a designated storage area so that the message scheduler schedules the target protocol message to the corresponding transmission queue according to the first priority field included in the target protocol message.

[0011] Secondly, embodiments of this application provide a data transmission apparatus, including:

[0012] The parsing unit is used to receive the protocol message to be transmitted, parse the protocol message, and obtain the target frame identifier of the protocol message;

[0013] The first determining unit is used to determine the first message type corresponding to the target frame identifier based on a first preset mapping relationship between frame identifier and message type;

[0014] The second determining unit is used to determine the first priority field corresponding to the first message type according to the second preset mapping relationship between message type and priority field;

[0015] The writing unit is used to convert the message format of the protocol message into a specified message format and write the first priority field to obtain the target protocol message;

[0016] A transmission unit is used to transmit the target protocol message to a designated storage area so that the message scheduler schedules the target protocol message to the corresponding transmission queue according to the first priority field included in the target protocol message.

[0017] Thirdly, embodiments of this application provide a storage medium that stores multiple instructions adapted for loading by a processor to execute any of the above data transmission methods.

[0018] Fourthly, embodiments of this application provide a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the data transmission method as described above.

[0019] In this embodiment, a protocol message to be transmitted is received, parsed to obtain a target frame identifier; a first message type corresponding to the target frame identifier is determined based on a first preset mapping relationship between the frame identifier and the message type; a first priority field corresponding to the first message type is determined according to a second preset mapping relationship between the message type and the priority field; the message format of the protocol message is converted to a specified message format, and the first priority field is written to obtain a target protocol message; the target protocol message is transmitted to a specified storage area so that the message scheduler schedules the target protocol message to the corresponding transmission queue according to the first priority field included in the target protocol message. Compared with related technologies, where data of each industrial network protocol needs to be converted by a dedicated protocol conversion device before it can be transmitted, this embodiment identifies the first message type of the protocol message by parsing the target frame identifier from the protocol message. This allows the first message type corresponding to different protocol messages to be known, replacing the need for a protocol conversion device to identify the corresponding message type of the protocol message, thus improving compatibility.

[0020] Other features and advantages of this disclosure will be set forth in the following description and will be apparent in part from the description or may be learned by practicing the disclosure. The objectives and other advantages of this disclosure may be realized and obtained by means of the structures particularly pointed out in the description, claims and drawings. Attached Figure Description

[0021] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0022] Figure 1 This is a schematic diagram of a data transmission system provided in an embodiment of this application.

[0023] Figure 2 This is a flowchart illustrating the data transmission method provided in an embodiment of this application.

[0024] Figure 3 This is a schematic diagram of the domain segment structure of the open real-time Ethernet communication protocol provided in the embodiments of this application.

[0025] Figure 4 A schematic diagram of the industrial network co-network integration scheduling framework provided in the embodiments of this application.

[0026] Figure 5This is a schematic diagram of the structure of the data transmission device provided in the embodiments of this application.

[0027] Figure 6 A schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation

[0028] To enable those skilled in the art to better understand the solutions of this application, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0029] It should be noted that while some processes described in the specification, claims, and accompanying drawings contain multiple steps that appear in a specific order, it should be clearly understood that these steps may not be performed in the order they appear herein, or may be performed in parallel. The step numbers are merely used to distinguish different steps and do not represent any particular order of execution. Furthermore, descriptions such as "first," "second," or "objective" in this document are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence.

[0030] Before providing a further detailed description of the embodiments of this disclosure, the terms and concepts used in these embodiments are explained, and they are subject to the following interpretations:

[0031] Time-sensitive networking (TSN) is a series of Ethernet standard protocols developed by the IEEE 802.1 standards working group. It is used to address the shortcomings of traditional Ethernet in terms of real-time performance, determinism, and reliability, and to ensure that time-sensitive traffic is transmitted in the network with low latency and predictability. It is widely used in industrial automation, automotive, aerospace and other fields.

[0032] Its key technologies and mechanisms are:

[0033] 1. Time Synchronization: Through the Precision Time Protocol (PTP), devices in the network can synchronize their clocks to sub-microsecond accuracy. The master clock periodically broadcasts time information, and devices adjust their own time after receiving it from the clock, ensuring that all devices in the network have the same time, laying the foundation for real-time communication.

[0034] 2. Priority Scheduling: Utilizing Priority Code Points (PCPs) in Virtual Local Area Network (VLAN) tags, TSN can categorize traffic into eight priorities. Critical traffic is assigned high priority and transmitted through the network first, avoiding congestion by low-priority traffic and ensuring timely processing of important data.

[0035] 3. Traffic Shaping and Reservation: The Time-Aware Shaper (TAS) schedules traffic according to a preset time window, pre-plans bandwidth resources, prevents traffic conflicts, and ensures timely transmission of critical traffic. The Gated List (GCL) controls the opening and closing of ports according to a schedule, limiting traffic within specific time periods and improving network determinism.

[0036] 4. Frame preemption: Without discarding data, high-priority frames are allowed to interrupt the transmission of low-priority frames. After the high-priority frame is completed, the low-priority frame continues to be transmitted, reducing the waiting time of high-priority frames and improving the overall transmission efficiency.

[0037] A network protocol is a set of rules, standards, and conventions that must be followed when devices communicate with each other in a network. It specifies the data format, transmission order, error handling methods, and other aspects to ensure that different devices can exchange information accurately and efficiently.

[0038] A frame ID is a number or marker used in computer networks, communication protocols, and some data transmission or storage systems to identify a specific data frame. In TSN networks, each data frame also has a corresponding Frame ID to achieve accurate time synchronization and traffic scheduling. It can be used to classify and mark different data streams in the network. Combined with the time-aware scheduling mechanism of TSN, it ensures that critical data frames are transmitted accurately within a specified time, meeting the needs of time-sensitive applications such as industrial automation and automotive networks.

[0039] A Traffic Manager (TM), also known as a packet scheduler, is a key component in a network system or related equipment used to manage and control network traffic. The TM module can classify and label different types of traffic, providing them with different levels of Quality of Service (QoS) guarantees. It can allocate appropriate resources and priorities to traffic based on application needs, such as real-time requirements, bandwidth requirements, and latency tolerance.

[0040] For example, for applications with high real-time requirements such as voice and video calls, the TM module ensures that they receive sufficient bandwidth and low latency to guarantee call quality; while for applications with lower real-time requirements such as email and file transfer, the remaining bandwidth resources can be allocated reasonably while ensuring critical business operations.

[0041] In industrial settings, programmable logic controller (PLC) modules using different protocols are typically integrated, based on the application scenario and the characteristics of each equipment manufacturer. Multi-industry network protocol shared transmission systems include various industrial control devices and protocol switching modules. Existing protocol conversion equipment often uses dedicated hardware or a combination of hardware and software to achieve protocol conversion before shared network transmission. However, dedicated equipment only supports a single industrial network protocol and cannot achieve compatibility with multiple industrial network protocols.

[0042] For example, messages using the Profinet protocol (an open real-time Ethernet communication protocol used in industrial automation) can only be identified as Profinet by its dedicated protocol conversion equipment, and then converted accordingly. Similarly, messages using the EtherCAT protocol (EtherControl Automation Technology) can only be identified as Profinet by its dedicated protocol conversion equipment, and then converted accordingly. Protocol conversion equipment for EtherCAT messages cannot identify Profinet messages and therefore cannot perform protocol conversion. In other words, subsequent transmission processes can only proceed after the specific protocol type of the message can be identified.

[0043] To address the aforementioned problems, this application embodiment receives a protocol message to be transmitted, parses the protocol message to obtain a target frame identifier; determines a first message type corresponding to the target frame identifier based on a first preset mapping relationship between the frame identifier and message type; determines a first priority field corresponding to the first message type according to a second preset mapping relationship between the message type and a priority field; converts the message format of the protocol message to a specified message format and writes the first priority field to obtain a target protocol message; and transmits the target protocol message to a specified storage area so that the message scheduler schedules the target protocol message to the corresponding transmission queue according to the first priority field included in the target protocol message. Compared to related technologies, where data for each industrial network protocol requires dedicated protocol conversion equipment for conversion before transmission, this application embodiment identifies the first message type of the protocol message by parsing the target frame identifier from the protocol message. This allows for the identification of the first message type corresponding to different protocol messages, eliminating the need for protocol conversion equipment and improving compatibility. Please refer to the following specific embodiments for details.

[0044] Please see Figure 1 , Figure 1This is a schematic diagram of a data transmission system provided in an embodiment of this application. It includes a terminal 140, an internet connection 130, a switch 120, a control device 110, etc.

[0045] Terminal 140 includes, but is not limited to, pre-configured sensors or electronic devices with data reporting capabilities such as desktop computers. Furthermore, it can be a single device or a collection of multiple devices. Terminal 140 can communicate with the Internet 130 via wired or wireless means to exchange data.

[0046] Terminal 140 includes, but is not limited to, pre-configured industrial robotic arms, welding robots, sensors, etc.

[0047] A switch (120) is a network device used for forwarding electrical (optical) signals, playing a crucial role in network communication. A switch establishes and maintains a MAC address table by examining the source MAC address and receiving port in received data frames. For example, when computer A connects to a port on the switch and sends data, the switch records the mapping between computer A's MAC address and that port. When the switch receives a data frame, it checks the destination MAC address in the frame and searches for the corresponding port in the MAC address table. If a match is found, the data frame is forwarded from the corresponding port; otherwise, the switch typically broadcasts the data frame from all ports except the receiving port to locate the destination device. Messages sent from terminal 140 to control device 110 are transmitted to the corresponding control device 110 via switch 120. Messages sent from control device 110 to terminal 140 are also transmitted to the corresponding terminal 140 via switch 120.

[0048] The data transmission method of this embodiment can be implemented in switch 120.

[0049] It should be noted that, Figure 1 The schematic diagram of the data transmission system shown is merely an example. The data transmission system and scenario described in this application are intended to more clearly illustrate the technical solutions of this application and do not constitute a limitation on the technical solutions provided in this application. As those skilled in the art will know, with the evolution of image processing technology and the emergence of new business scenarios, the technical solutions provided in this application are also applicable to similar technical problems.

[0050] In this embodiment, the description will be from the perspective of a data transmission device, which can be integrated into a computer device that has a storage unit and a microprocessor and thus computing capabilities.

[0051] Please see Figure 2 , Figure 2 A flowchart illustrating a data transmission method provided in an embodiment of this application. The data transmission method includes:

[0052] In step 201, the protocol message to be transmitted is received, the protocol message is parsed, and the target frame identifier of the protocol message is obtained.

[0053] In network communication, a protocol message is a data unit encapsulated according to a specific network protocol format. It contains information the sender wants to transmit to the receiver, as well as control information for network transmission and processing, such as source address, destination address, and data content. Different network protocols have different message formats and contents. The destination frame identifier is a number or mark assigned to uniquely identify a protocol message. In network communication, this identifier allows for the differentiation of different messages, facilitating message management, tracking, and processing.

[0054] Specifically, the switch receives protocol messages from other devices through its network interface. Upon receiving a message, it parses the message according to the message format specification of the protocol and extracts the target frame identifier used to identify the message.

[0055] For example, in some industrial protocol messages, the target frame identifier may be located in a specific field in the message header, and the target frame identifier can be obtained by parsing this field.

[0056] By parsing and obtaining the target frame identifier, a basis is provided for subsequent determination of the message type, enabling the switch to identify and distinguish different messages, and facilitating targeted processing.

[0057] In some implementations, parsing the protocol message to obtain the target frame identifier of the protocol message includes:

[0058] (1) Obtain the multiple field segments included in the protocol message;

[0059] (2) Locate the protocol type domain segment from the multiple domain segments;

[0060] (3) Determine the next target domain segment that follows the domain segment of the protocol type among multiple domain segments;

[0061] (4) Parse the target field segment to obtain the target frame identifier of the protocol message.

[0062] The protocol message consists of multiple different domain segments, but the protocol messages corresponding to different protocol types all include a protocol type domain segment and an isochronous real-time (IRT-Data) domain segment following the protocol type domain segment. The IRT-Data domain segment includes the frame identifier, so the protocol type domain segment can be found from the multiple domain segments. The next domain segment after the protocol type domain segment is determined as the IRT-Data domain segment (i.e., the target domain segment). The target frame identifier of the protocol message can be obtained by parsing the target domain segment.

[0063] Therefore, protocol messages corresponding to different protocol types usually differ in specific format and content. However, this application embodiment utilizes the common feature that protocol messages of different protocol types all contain a protocol type field segment and a subsequent isochronous real-time data field segment (IRT-Data). By first searching for the protocol type field segment and then determining the IRT-Data field segment to obtain the target frame identifier, this parsing method does not depend on specific protocol details and can be widely applied to a variety of different protocol types, improving the system's compatibility and adaptability to different protocols.

[0064] In some implementations, parsing the target field segment to obtain the target frame identifier of the protocol message includes:

[0065] (1.1) Obtain the target data located in the pre-set storage space within the target domain segment;

[0066] (1.2) The target data is determined as the target frame identifier of the protocol message.

[0067] The target domain segment includes a specified storage space. The portion in the first preset storage space (e.g., the first 2 bytes) is used to fill in the target frame identifier, and the remaining storage space is used to fill in the user equipment or node participating in isochronous real-time (IRT-User) communication.

[0068] Based on this, the target data located in the pre-set storage space in the target domain segment can be obtained, and the target data can be identified as the target frame identifier of the protocol message.

[0069] Please see Figure 3 , Figure 3This diagram illustrates the domain segment structure of the Profinet protocol, an open real-time Ethernet communication protocol provided in this application. Taking the Profinet protocol as an example, it includes a preamble domain segment, a Start-of-Frame Delimiter (SFD) frame start domain segment, a destination MAC address domain segment, a protocol type domain segment, an Isochronous Real-Time (IRT-Data) domain segment, and a Frame Check Sequence (FCS) domain segment. The IRT-Data domain segment, which follows the protocol type domain segment, has a specified storage space size ranging from 40 to 1440 bytes. When the specified storage space size is 40 bytes, the first two bytes are used to store the destination frame identifier, so the remaining 38 bytes are used to store the IRT-User. When the specified storage space size is 1440 bytes, the first two bytes are used to store the destination frame identifier, so the remaining 1438 bytes are used to store the IRT-User.

[0070] Therefore, since the target frame identifier is explicitly stored in the pre-defined storage space of the target segment (e.g., the first two bytes), there is no need to perform a full scan and analysis of the entire target segment during parsing; only the data at that specific location needs to be retrieved directly. This greatly reduces the time and computational resources required for parsing, improves processing speed, and significantly enhances the overall performance of the system, especially when processing a large number of protocol messages.

[0071] In step 202, the first message type corresponding to the target frame identifier is determined based on the first preset mapping relationship between frame identifier and message type.

[0072] The first preset mapping relationship is a pre-defined correspondence table that records the correspondence between different frame identifiers and message types. Through this mapping relationship, the corresponding message type can be quickly determined based on the frame identifier of the protocol message.

[0073] Specifically, after obtaining the target frame identifier, the switch searches a pre-defined first mapping table. In this table, it finds the packet type corresponding to the target frame identifier and identifies it as the first packet type.

[0074] For example, if the target frame is identified as "0x88A4", and the message type corresponding to "0x88A4" in the mapping table is "EtherCAT protocol message", then the first message type is "EtherCAT protocol message".

[0075] This clarifies the specific type of the message. Different types of messages have different importance and processing methods in the network, and appropriate priorities can be assigned to them according to the message type.

[0076] In step 203, the first priority field corresponding to the first message type is determined according to the second preset mapping relationship between message type and priority field.

[0077] The second preset mapping relationship is also a pre-defined correspondence table that records the correspondence between different message types and priority fields. Through this mapping relationship, the priority of a message in network transmission can be determined based on its message type. The priority field uses specific encoded values ​​to represent different priorities; for example, in a TSN network, the PCP (Priority Code Point) value is a common priority field.

[0078] Specifically, after determining the first message type, the switch looks up a second preset mapping table. In this table, it finds the priority field value corresponding to the first message type and sets it as the first priority field. For example, if the first message type is "EtherCAT protocol message", and the PCP value corresponding to "EtherCAT protocol message" in the mapping table is "6", then the value of the first priority field is "6".

[0079] In this way, appropriate priority fields are assigned to messages, enabling switches to schedule messages according to priority fields during transmission, ensuring that time-sensitive protocol messages are transmitted first, and improving the quality of network service.

[0080] In step 204, the message format of the protocol message is converted into a specified message format, and the first priority field is written to obtain the target protocol message.

[0081] This process involves format conversion of the original protocol message according to the requirements of the specified message format. This includes reorganizing the message header structure and adding or deleting certain fields. After the format conversion is complete, the first priority field is written to the corresponding position in the specified message format. The specified message format can be the TSN message format.

[0082] For example, when converting a protocol message to a TSN message format, the first priority field (PCP value) is written to the PCP field position in the VLAN tag of the TSN message.

[0083] Specifically, message format conversion involves extracting key data from protocol messages, such as Frame IDs or other uniquely identifiable fields. EtherCAT messages typically have a specific frame structure, containing device information, control commands, and data. Switches identify and parse these specific fields to obtain key data for subsequent processing. The TSN protocol has its own header structure, containing specific fields such as timestamps, priority identifiers, and flow identifiers. After obtaining the key information from the EtherCAT message, the switch generates the corresponding TSN header based on this information.

[0084] For example, the priority field in the TSN header is set according to the device identifier and the urgency of the control commands in the EtherCAT message. Finally, the EtherCAT data is encapsulated, that is, the data portion of the parsed EtherCAT message is encapsulated into the data portion of the TSN message. In this way, the original EtherCAT data becomes the payload of the TSN message.

[0085] The TSN protocol provides a precise time synchronization mechanism, ensuring that the clock synchronization accuracy of various devices in the network reaches the sub-microsecond level. For equipment such as welding robots, which have extremely high requirements for time accuracy, converting to the TSN message format allows them to better utilize the time synchronization function of TSN, enabling precise coordinated actions between multiple robots and improving welding quality and efficiency.

[0086] The TSN protocol, through a series of scheduling mechanisms such as Time-Aware Shaper (TAS) and frame preemption, ensures low-latency and deterministic transmission of messages in the network. After converting EtherCAT messages to TSN message format, control commands for applications such as welding robots can be transmitted according to predetermined time windows, avoiding the latency and jitter that may occur in traditional networks and ensuring the real-time performance and stability of welding operations.

[0087] Therefore, in complex network environments such as industrial automation, devices using multiple different protocols may coexist, such as devices using the EtherCAT protocol and devices requiring TSN protocol support. By converting EtherCAT messages to TSN message format, communication barriers between different protocols can be broken down, enabling seamless integration of heterogeneous networks. This allows devices originally based on different protocols to work collaboratively within the same network, improving the integration and openness of the entire network system. For systems that have already deployed devices based on older protocols (such as EtherCAT), introducing new functions or technologies often involves high costs of equipment replacement or large-scale transformation. Converting existing protocol messages to TSN message format eliminates the need for large-scale replacement of existing equipment; message format conversion can be performed only at network nodes (such as switches), making older devices compatible with the new TSN network, significantly reducing the cost of system upgrades and transformations and improving compatibility.

[0088] In step 205, the target protocol message is transmitted to a designated storage area so that the message scheduler schedules the target protocol message to the corresponding transmission queue according to the first priority field included in the target protocol message.

[0089] Please refer to Figure 4 , Figure 4 This diagram illustrates the industrial network co-network converged scheduling framework provided in this application embodiment. Protocol messages of different protocol types, such as EtherCAT, Profinet, Ethernet Industrial Protocol (EtherNet / IP), and Mudbus, are input to the switch and placed into the corresponding input queue for each protocol type. The switch identifies the protocol messages in each input queue, converts them to a specified message format, and places them as data blocks into the switch's shared memory module, i.e., a designated storage area. This allows the P4 scheduling module, using the P4 high-level language, to manage the buffering, queuing, and scheduling of data packets, as they traverse from the ingress matching-action pipeline to the egress pipeline. A custom algorithm and requirements are used to establish a specific mapping relationship with the message scheduler (TM module), thereby further controlling the order of the egress queue.

[0090] In some implementations, after transmitting the target protocol message to the designated storage area, the method further includes:

[0091] (1) Obtain the first number of protocol messages to be transmitted in each transmission queue, and the second number of protocol messages to be transmitted in each transmission queue;

[0092] (2) Calculate the ratio of the number of first messages to the number of corresponding second messages in each transmission queue to obtain the percentage of messages in each transmission queue;

[0093] (3) When there is a first transmission queue in which the proportion of the number of messages exceeds the proportion of the first preset number of messages in multiple transmission queues, determine the second priority field corresponding to the first transmission queue;

[0094] (4) Determine the second message type corresponding to the second priority field according to the second preset mapping relationship between message type and priority field;

[0095] (5) Determine the third priority field from multiple priority fields that corresponds to the next priority after the second priority field;

[0096] (6) Change the mapping relationship between the second message type and the second priority field in the second preset mapping relationship to the mapping relationship between the second message type and the third priority field.

[0097] The transmission queue is a queue in the switch used to store protocol messages to be transmitted. Each queue corresponds to a different priority. The message scheduler places messages into the corresponding queue based on their priority field, waiting for transmission. Protocol messages to be transmitted are those that have been processed (e.g., format conversion, priority field writing) but have not yet been transmitted to the target device and are waiting in the transmission queue for transmission. The first message count is the actual number of protocol messages to be transmitted currently contained in each transmission queue. The second message count is the maximum number of protocol messages to be transmitted that each transmission queue can hold, i.e., the upper limit of the queue's capacity. The message count percentage is obtained by calculating the ratio of the first message count to the corresponding second message count for each transmission queue, reflecting the proportion of the number of messages currently stored in the queue relative to the queue's maximum capacity. The first preset message count percentage is a pre-set threshold used to determine whether the transmission queue is overloaded. When the message count percentage of a transmission queue exceeds this threshold, the transmission queue is determined to be overloaded and designated as the first transmission queue. The second priority field is the priority field corresponding to the first transmission queue, used to identify the priority of the messages in that queue. The second message type is the message type corresponding to the second priority field based on the second preset mapping relationship between message type and priority field. The third priority field is determined from multiple priority fields, and its corresponding priority is the next priority field after the second priority field.

[0098] Specifically, the switch iterates through each transmission queue, counts the actual number of protocol packets currently awaiting transmission in each queue, and obtains the first packet count. Simultaneously, it queries the configuration information of each transmission queue to obtain its maximum capacity, i.e., the second packet count. For each transmission queue, it divides its first packet count by the corresponding second packet count to obtain the packet count percentage for that queue.

[0099] For example, if the first message count of a transmission queue is 50 and the second message count is 100, then the message count ratio is 50 / 100 = 0.5 (i.e., 50%). By calculating the message count ratio, the load level of each transmission queue is quantified, which facilitates subsequent judgment on which queues may be at risk of overload and provides a basis for further priority adjustments.

[0100] The percentage of packets in each transmission queue is compared with a first preset percentage. If the percentage of packets in a transmission queue exceeds the preset value, it is identified as the first transmission queue. Then, the configuration information of that queue is queried to obtain its corresponding second priority field. The transmission queue in an overloaded state (the first transmission queue) is identified, and its current priority field (the second priority field) is determined so that the priority of packets in that queue can be adjusted to alleviate the queue overload.

[0101] In the second preset mapping table, the message type corresponding to the second priority field is found and identified as the second message type. For example, if the value of the second priority field is "6", and the message type corresponding to "6" in the mapping table is "EtherCAT protocol message", then the second message type is "EtherCAT protocol message". Clearly defining the type of the currently high-priority message in the first transmission queue provides information for subsequent priority adjustments of that type of message, allowing for more targeted priority adjustments.

[0102] Given the second priority field, among all priority fields, find the next priority field immediately following it in descending or ascending order (depending on the specific priority system) and designate it as the third priority field. For example, if the second priority field is "6", and the priority fields are in descending order of "7, 6, 5, 4...", then the third priority field is "5". This new priority field (third priority field) is used to reduce the priority of message types (second message types) that originally had a higher priority (second priority field) by one level, thereby alleviating the overload of the first transmission queue without affecting critical services.

[0103] In the second preset mapping table, the original correspondence between the second message type and the second priority field is modified to a correspondence between the second message type and the third priority field.

[0104] For example, the original "EtherCAT protocol message (second message type)" corresponded to "6 (second priority field)", which is now changed to "EtherCAT protocol message" corresponding to "5 (third priority field)". By changing the mapping relationship, subsequent protocol messages with the second message type will be assigned the priority corresponding to the third priority field when determining their priority, thereby reducing the priority of this type of message, reducing its number in the first transmission queue, and achieving the purpose of alleviating queue overload and optimizing network traffic.

[0105] In some embodiments, after changing the mapping relationship between the second message type and the second priority field in the second preset mapping relationship to the mapping relationship between the second message type and the third priority field, the method further includes:

[0106] When the proportion of the number of messages in the first transmission queue does not exceed the proportion of the number of messages in the first preset message queue, the mapping relationship between the second message type and the third priority field in the second preset mapping relationship is restored to the mapping relationship between the second message type and the second priority field.

[0107] The switch continuously monitors the percentage of packets in the first transmission queue, constantly obtaining the actual number of protocol packets to be transmitted in the first transmission queue (first packet count) and the maximum capacity of the queue (second packet count), and calculates their ratio to obtain the packet count percentage. The real-time calculated packet count percentage of the first transmission queue is compared with a first preset packet count percentage. If the packet count percentage does not exceed the first preset packet count percentage, it indicates that the overload of the first transmission queue has been alleviated and the load has returned to normal. Then, the second preset mapping relationship is modified. The previous mapping relationship, which was adjusted to the second packet type and the third priority field, is restored to the mapping relationship of the second packet type and the second priority field.

[0108] In this way, by continuously monitoring the load of the first transmission queue and dynamically adjusting the mapping relationship between message type and priority fields based on the load, flexible allocation of network resources is achieved. When the queue is overloaded, the priority of specific message types is reduced to alleviate the pressure on that queue; when the queue load returns to normal, the original priority of the messages is restored in a timely manner to ensure that critical business messages can continue to be transmitted with a higher priority, thus guaranteeing network service quality.

[0109] In some embodiments, the method further includes:

[0110] (1) When there is a second transmission queue in the plurality of transmission queues whose proportion of the number of messages does not exceed the proportion of the second preset number of messages, determine the fourth priority field corresponding to the second transmission queue, wherein the proportion of the second preset number of messages is lower than the proportion of the first preset number of messages;

[0111] (2) Determine the third message type corresponding to the fourth priority field according to the second preset mapping relationship between message type and priority field;

[0112] (3) Determine the fifth priority field from multiple priority fields that corresponds to the priority preceding the second priority field;

[0113] (4) Change the mapping relationship between the third message type and the fourth priority field in the second preset mapping relationship to the mapping relationship between the third message type and the fifth priority field.

[0114] The second preset message quantity percentage is a pre-set threshold used to determine whether the load on the transmission queue is low. This threshold is lower than the first preset message quantity percentage. When the message quantity percentage of a transmission queue does not exceed this threshold, the queue is considered to have a light load, and the second preset message quantity percentage is lower than the first preset message quantity percentage. The fourth priority field is the priority field corresponding to the second transmission queue, used to identify the priority of messages in that queue. The third message type is the message type corresponding to the fourth priority field according to the second preset mapping relationship. The fifth priority field is selected from multiple priority fields, and its corresponding priority is the one level higher than the second priority field.

[0115] Specifically, the switch iterates through all transmission queues, calculates the percentage of packets in each queue, and compares it with a second preset percentage of packets. If the percentage of packets in a queue does not exceed the second preset percentage, that queue is designated as the second transmission queue. Next, the switch retrieves the fourth priority field corresponding to the second transmission queue by querying the second preset mapping table. By identifying the lightly loaded transmission queue (the second transmission queue) and determining its current priority (the fourth priority field), preparation is made for subsequent adjustments to the priorities of related packet types.

[0116] The message type corresponding to the fourth priority field is found in the second preset mapping table and designated as the third message type. For example, if the fourth priority field is "3", and the message type corresponding to "3" in the mapping table is "Profinet protocol", then the third message type is "Profinet protocol". The message type corresponding to the current priority in the second transmission queue is then determined so that the priority of messages of that type can be adjusted.

[0117] Based on the existing multiple priority fields and their priority order, find the field that precedes the second priority field and determine it as the fifth priority field.

[0118] For example, if the priority fields are ranked from highest to lowest as "7, 6, 5, 4, 3...", and the second priority field is "3", then the fifth priority field is "4". A higher priority field (the fifth priority field) is determined to increase the priority of the third message type, thereby optimizing the allocation of network resources.

[0119] In the second preset mapping table, the original correspondence between the third message type and the fourth priority field is modified to a correspondence between the third message type and the fifth priority field.

[0120] For example, the original "Profinet protocol (third message type)" corresponded to "3 (fourth priority field)", but now it has been changed to "Profinet protocol" corresponding to "4 (fifth priority field)". By adjusting the mapping relationship, subsequent protocol messages belonging to the third message type are assigned a higher priority (the priority corresponding to the fifth priority field) when determining their priority, thereby increasing the transmission priority of this type of message in the network and making better use of network resources.

[0121] In this way, by prioritizing the message types corresponding to less loaded transmission queues, dynamic optimization of network resource allocation can be achieved. When certain queues are less loaded, the priority of message types originally in those queues is increased, enabling them to be transmitted faster and avoiding resource idleness. At the same time, it can also balance the load between different queues to a certain extent, improving the overall network operating efficiency and performance.

[0122] In some implementations, after changing the mapping relationship between the third message type and the fourth priority field in the second preset mapping relationship to the mapping relationship between the third message type and the fifth priority field, the method further includes:

[0123] When the proportion of the number of messages in the second transmission queue exceeds the proportion of the number of messages in the second preset message queue, the mapping relationship between the third message type and the fifth priority field in the second preset mapping relationship is restored to the mapping relationship between the third message type and the fourth priority field.

[0124] The switch continuously monitors the status of the second transmission queue and periodically calculates the percentage of packets in this queue. Specifically, it obtains the number of protocol packets currently awaiting transmission in the second transmission queue (first packet count) and the maximum capacity of the queue (second packet count), then calculates the ratio of these two to obtain the packet count percentage. This real-time calculated packet count percentage of the second transmission queue is compared with a second preset packet count percentage. If the packet count percentage exceeds the second preset percentage, it indicates that the load on the second transmission queue has changed and is no longer in a light load state. Once it is determined that the packet count percentage of the second transmission queue exceeds the second preset percentage, the network device modifies the second preset mapping relationship. The mapping relationship previously adjusted to the third packet type and the fifth priority field is restored to the mapping relationship of the third packet type and the fourth priority field.

[0125] In this way, by continuously monitoring the load of the second transmission queue and dynamically adjusting the mapping relationship between message type and priority fields according to load changes, flexible allocation of network resources is achieved. When the queue load is light, the priority of relevant message types is increased to make full use of network resources; when the queue load is no longer light, the original priority of messages is restored in a timely manner to avoid excessive resource consumption by the queue due to excessively high priority, which would affect the normal operation of other queues and services.

[0126] As described above, this embodiment of the application receives a protocol message to be transmitted, parses the protocol message to obtain the target frame identifier of the protocol message; determines the first message type corresponding to the target frame identifier based on a first preset mapping relationship between the frame identifier and the message type; determines the first priority field corresponding to the first message type according to a second preset mapping relationship between the message type and the priority field; converts the message format of the protocol message to a specified message format and writes the first priority field to obtain the target protocol message; and transmits the target protocol message to a specified storage area so that the message scheduler schedules the target protocol message to the corresponding transmission queue according to the first priority field included in the target protocol message. Compared with related technologies, where data of each industrial network protocol needs to be converted by a dedicated protocol conversion device before it can be transmitted, this embodiment of the application identifies the first message type of the protocol message by parsing the target frame identifier of the protocol message. In this way, the first message type corresponding to different protocol messages can be known, replacing the need for a protocol conversion device to identify the corresponding message type of the protocol message, thus improving compatibility.

[0127] For details on the implementation of each of the above steps, please refer to the previous examples, which will not be repeated here.

[0128] To facilitate better implementation of the data transmission method provided in the embodiments of this application, the embodiments of this application also provide an apparatus based on the above data transmission method. The meanings of the terms used are the same as in the above data transmission method, and specific implementation details can be found in the descriptions in the method embodiments.

[0129] Please see Figure 5 , Figure 5 This is a schematic diagram of the structure of a data transmission device provided in an embodiment of this application. The data transmission device is applied to a computer device. The data transmission device may include a parsing unit 601, a first determining unit 602, a second determining unit 603, a writing unit 604, and a transmission unit 605, etc.

[0130] The parsing unit 601 is used to receive the protocol message to be transmitted, parse the protocol message, and obtain the target frame identifier of the protocol message;

[0131] The first determining unit 602 is used to determine the first message type corresponding to the target frame identifier based on a first preset mapping relationship between frame identifier and message type;

[0132] The second determining unit 603 is used to determine the first priority field corresponding to the first message type according to the second preset mapping relationship between message type and priority field;

[0133] The writing unit 604 is used to convert the message format of the protocol message into a specified message format and write the first priority field to obtain the target protocol message;

[0134] The transmission unit 605 is used to transmit the target protocol message to a designated storage area so that the message scheduler schedules the target protocol message to the corresponding transmission queue according to the first priority field included in the target protocol message.

[0135] In some embodiments, the parsing unit 601 includes:

[0136] The acquisition subunit is used to acquire multiple field segments included in the protocol message;

[0137] A lookup subunit is used to find the protocol type domain segment from among the multiple domain segments;

[0138] A sub-unit is defined to determine the next target domain segment among multiple domain segments that follows the domain segment of the protocol type.

[0139] The parsing subunit is used to parse the target field segment to obtain the target frame identifier of the protocol message.

[0140] In some embodiments, the parsing subunit is used for:

[0141] Obtain the target data located in the pre-set storage space within the target domain segment;

[0142] The target data is determined as the target frame identifier of the protocol message.

[0143] In some embodiments, the apparatus further includes:

[0144] The acquisition unit is used to acquire the first number of protocol messages to be transmitted in each transmission queue, and the second number of protocol messages to be transmitted in each transmission queue.

[0145] The calculation unit is used to calculate the ratio of the number of first messages to the number of corresponding second messages in each transmission queue, so as to obtain the proportion of messages in each transmission queue.

[0146] The third determining unit is used to determine the second priority field corresponding to the first transmission queue when there is a first transmission queue in which the proportion of the number of messages exceeds the proportion of the first preset number of messages in the multiple transmission queues;

[0147] The fourth determining unit is used to determine the second message type corresponding to the second priority field according to the second preset mapping relationship between message type and priority field;

[0148] The fifth determining unit is used to determine, from multiple priority fields, the third priority field whose corresponding priority is the next priority after the second priority field;

[0149] The first modification unit is used to change the mapping relationship between the second message type and the second priority field in the second preset mapping relationship to the mapping relationship between the second message type and the third priority field.

[0150] In some embodiments, the apparatus further includes:

[0151] The first restoration unit is used to restore the mapping relationship between the second message type and the third priority field in the second preset mapping relationship to the mapping relationship between the second message type and the second priority field when the proportion of the number of messages in the first transmission queue does not exceed the proportion of the number of messages in the first preset mapping relationship.

[0152] In some embodiments, the apparatus further includes:

[0153] The sixth determining unit is used to determine the fourth priority field corresponding to the second transmission queue when there is a second transmission queue in the plurality of transmission queues whose proportion of the number of messages does not exceed the proportion of the second preset number of messages, wherein the proportion of the second preset number of messages is lower than the proportion of the first preset number of messages.

[0154] The seventh determining unit is used to determine the third message type corresponding to the fourth priority field according to the second preset mapping relationship between message type and priority field;

[0155] The eighth determining unit is used to determine, from multiple priority fields, the fifth priority field whose priority is the previous priority preceding the second priority field;

[0156] The second modification unit is used to change the mapping relationship between the third message type and the fourth priority field in the second preset mapping relationship to the mapping relationship between the third message type and the fifth priority field.

[0157] In some embodiments, the apparatus further includes:

[0158] The second restoration unit is used to restore the mapping relationship between the third message type and the fifth priority field in the second preset mapping relationship to the mapping relationship between the third message type and the fourth priority field when the proportion of the number of messages in the second transmission queue exceeds the proportion of the number of messages in the second preset mapping relationship.

[0159] The specific implementation of each of the above units can be found in the previous embodiments, and will not be repeated here.

[0160] As described above, in this embodiment of the application, the parsing unit 601 receives the protocol message to be transmitted, parses the protocol message, and obtains the target frame identifier of the protocol message; the first determining unit 602 determines the first message type corresponding to the target frame identifier based on the first preset mapping relationship between the frame identifier and the message type; the second determining unit 603 determines the first priority field corresponding to the first message type according to the second preset mapping relationship between the message type and the priority field; the writing unit 604 converts the message format of the protocol message into a specified message format and writes the first priority field to obtain the target protocol message; the transmission unit 605 transmits the target protocol message to a specified storage area so that the message scheduler schedules the target protocol message to the corresponding transmission queue according to the first priority field included in the target protocol message. Compared to related technologies where data for each industrial network protocol requires specialized protocol conversion equipment for conversion before transmission, this application embodiment identifies the first message type of a protocol message by parsing the target frame identifier from the protocol message. This allows the identification of the first message type corresponding to different protocol messages, eliminating the need for protocol conversion equipment to identify the corresponding message type and improving compatibility.

[0161] The specific implementation of each of the above units can be found in the previous embodiments, and will not be repeated here.

[0162] Reference Figure 6 , Figure 6 This is a partial structural block diagram of a computer device 1000 implementing embodiments of the present disclosure. The computer device 1000 can vary significantly due to different configurations or performance characteristics, and may include one or more central processing units (CPUs) 622 (e.g., one or more processors) and a memory 632, and one or more storage media 630 (e.g., one or more mass storage devices) storing application programs 642 or data 644. The memory 632 and storage media 630 may be temporary or persistent storage. The program stored in the storage media 630 may include one or more modules (not shown in the diagram), each module including a series of instruction operations on the server 600. Furthermore, the CPU 622 may be configured to communicate with the storage media 630 and execute the series of instruction operations in the storage media 630 on the server 600.

[0163] Computer device 1000 may also include one or more power supplies 626, one or more wired or wireless network interfaces 650, one or more input / output interfaces 658, and / or one or more operating systems 641, such as Windows Server™, Mac OS X™, Unix™, Linux™, FreeBSD™, etc.

[0164] The central processing unit 622 in the computer device 1000 can be used to execute the data transmission method of the embodiments of this disclosure, for example:

[0165] Receive the protocol message to be transmitted, parse the protocol message, and obtain the target frame identifier of the protocol message;

[0166] Based on the first preset mapping relationship between frame identifier and message type, the first message type corresponding to the target frame identifier is determined;

[0167] Based on the second preset mapping relationship between message type and priority field, determine the first priority field corresponding to the first message type;

[0168] The message format of the protocol message is converted into a specified message format, and the first priority field is written to obtain the target protocol message;

[0169] The target protocol message is transmitted to a designated storage area so that the message scheduler schedules the target protocol message to the corresponding transmission queue according to the first priority field included in the target protocol message.

[0170] This disclosure also provides a computer-readable storage medium for storing program code for executing the data transmission methods of the foregoing embodiments.

[0171] This disclosure also provides a computer program product comprising a computer program. A processor of a computer device reads and executes the computer program, causing the computer device to perform the data transmission method described above. For example:

[0172] Receive the protocol message to be transmitted, parse the protocol message, and obtain the target frame identifier of the protocol message;

[0173] Based on the first preset mapping relationship between frame identifier and message type, the first message type corresponding to the target frame identifier is determined;

[0174] Based on the second preset mapping relationship between message type and priority field, determine the first priority field corresponding to the first message type;

[0175] The message format of the protocol message is converted into a specified message format, and the first priority field is written to obtain the target protocol message;

[0176] The target protocol message is transmitted to a designated storage area so that the message scheduler schedules the target protocol message to the corresponding transmission queue according to the first priority field included in the target protocol message.

[0177] Furthermore, the terms “comprising” and “including”, and any variations thereof, are intended to cover non-exclusive inclusion, such that a process, method, system, product, or apparatus that includes a series of steps or units is not necessarily limited to those steps or units that are explicitly listed, but may include other steps or units that are not explicitly listed or that are inherent to such process, method, product, or apparatus.

[0178] It should be understood that in this application, "at least one (item)" means one or more, and "more than" means two or more. "And / or" is used to describe the relationship between related objects, indicating that three relationships can exist. For example, "A and / or B" can represent three cases: only A exists, only B exists, and both A and B exist simultaneously, where A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects are in an "or" relationship. "At least one (item) of the following" or similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one (item) of a, b, or c can represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, and c can be single or multiple.

[0179] It should be understood that in the description of the embodiments of this application, "multiple" means two or more, "greater than", "less than", "exceeding" etc. are understood to exclude the number itself, and "above", "below", "within" etc. are understood to include the number itself.

[0180] In the several embodiments provided in this application, it should be understood that the disclosed systems, apparatuses, and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces, or indirect coupling or communication connection between apparatuses or units, and may be electrical, mechanical, or other forms.

[0181] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0182] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.

[0183] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0184] It should also be understood that the various implementation methods provided in this application can be combined arbitrarily to achieve different technical effects.

[0185] In the embodiments of this application, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.

[0186] The above is a detailed description of the embodiments of this application. However, this application is not limited to the above embodiments. Those skilled in the art can make various equivalent modifications or substitutions without departing from the spirit of this application. All such equivalent modifications or substitutions are included within the scope defined by the claims of this application.

Claims

1. A data transmission method, characterized in that, include: Receive the protocol message to be transmitted and obtain the multiple field segments included in the protocol message; Locate the protocol type field segment from among the multiple field segments; Determine the next target domain segment among multiple domain segments that follows the domain segment of the protocol type; Obtain the target data located in the pre-set storage space within the target domain segment; The target data is determined as the target frame identifier of the protocol message; Based on the first preset mapping relationship between frame identifier and message type, the first message type corresponding to the target frame identifier is determined; Based on the second preset mapping relationship between message type and priority field, determine the first priority field corresponding to the first message type; The protocol message format is converted to a specified message format, and the first priority field is written to obtain the target protocol message; The target protocol message is transmitted to a designated storage area so that the message scheduler schedules the target protocol message to the corresponding transmission queue according to the first priority field included in the target protocol message; Get the first number of protocol messages to be transmitted in each transmission queue, and the second number of protocol messages to be transmitted in each transmission queue. Calculate the ratio of the number of first messages to the number of corresponding second messages in each transmission queue to obtain the percentage of messages in each transmission queue; When a first transmission queue exists in multiple transmission queues where the proportion of the number of messages exceeds the proportion of the first preset number of messages, the second priority field corresponding to the first transmission queue is determined. The second message type corresponding to the second priority field is determined based on the second preset mapping relationship between message type and priority field; From multiple priority fields, determine the third priority field, which is the next priority after the second priority field; Change the mapping relationship between the second message type and the second priority field in the second preset mapping relationship to the mapping relationship between the second message type and the third priority field.

2. The data transmission method according to claim 1, characterized in that, After changing the mapping relationship between the second message type and the second priority field in the second preset mapping relationship to the mapping relationship between the second message type and the third priority field, the method further includes: When the proportion of the number of messages in the first transmission queue does not exceed the proportion of the number of messages in the first preset message queue, the mapping relationship between the second message type and the third priority field in the second preset mapping relationship is restored to the mapping relationship between the second message type and the second priority field.

3. The data transmission method according to claim 1, characterized in that, The method further includes: When there is a second transmission queue in which the proportion of the number of messages does not exceed the proportion of the second preset number of messages, the fourth priority field corresponding to the second transmission queue is determined, and the proportion of the second preset number of messages is lower than the proportion of the first preset number of messages. The third message type corresponding to the fourth priority field is determined based on the second preset mapping relationship between message type and priority field; Determine the fifth priority field from multiple priority fields, which is the priority preceding the second priority field; The mapping relationship between the third message type and the fourth priority field in the second preset mapping relationship is changed to the mapping relationship between the third message type and the fifth priority field.

4. The data transmission method according to claim 3, characterized in that, After changing the mapping relationship between the third message type and the fourth priority field in the second preset mapping relationship to the mapping relationship between the third message type and the fifth priority field, the method further includes: When the proportion of the number of messages in the second transmission queue exceeds the proportion of the number of messages in the second preset message queue, the mapping relationship between the third message type and the fifth priority field in the second preset mapping relationship is restored to the mapping relationship between the third message type and the fourth priority field.

5. A data transmission device, characterized in that, include: The parsing unit, used to receive protocol messages to be transmitted, includes: The acquisition subunit is used to acquire multiple field segments included in the protocol message; A lookup subunit is used to find the protocol type domain segment from among the multiple domain segments; A sub-unit is defined to determine the next target domain segment among multiple domain segments that follows the domain segment of the protocol type. A parsing subunit is used to obtain target data located in the preset storage space of the target domain segment; The target data is determined as the target frame identifier of the protocol message; The first determining unit is used to determine the first message type corresponding to the target frame identifier based on a first preset mapping relationship between frame identifier and message type; The second determining unit is used to determine the first priority field corresponding to the first message type according to the second preset mapping relationship between message type and priority field; The writing unit is used to convert the message format of the protocol message into a specified message format and write the first priority field to obtain the target protocol message; A transmission unit is configured to transmit the target protocol message to a designated storage area, so that the message scheduler schedules the target protocol message to the corresponding transmission queue according to the first priority field included in the target protocol message; The acquisition unit is used to acquire the first number of protocol messages to be transmitted in each transmission queue, and the second number of protocol messages to be transmitted in each transmission queue. The calculation unit is used to calculate the ratio of the number of first messages to the number of corresponding second messages in each transmission queue, so as to obtain the proportion of messages in each transmission queue. The third determining unit is used to determine the second priority field corresponding to the first transmission queue when there is a first transmission queue in which the proportion of the number of messages exceeds the proportion of the first preset number of messages in the multiple transmission queues; The fourth determining unit is used to determine the second message type corresponding to the second priority field according to the second preset mapping relationship between message type and priority field; The fifth determining unit is used to determine, from multiple priority fields, the third priority field whose corresponding priority is the next priority after the second priority field; The first modification unit is used to change the mapping relationship between the second message type and the second priority field in the second preset mapping relationship to the mapping relationship between the second message type and the third priority field.

6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a plurality of instructions adapted for loading by a processor to execute the data transmission method according to any one of claims 1 to 4.

7. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the data transmission method according to any one of claims 1 to 4.