Terminal ethernet scheduling method, system, storage medium and computer
By employing a time-triggered terminal Ethernet scheduling method in vehicle Ethernet, combined with switch signal and embedded operating system management, the problems of high real-time performance and large data volume transmission in vehicle Ethernet are solved, achieving efficient data transmission and low latency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NANCHANG AUTOMOTIVE INST OF INTELLIGENCE & NEW ENERGY
- Filing Date
- 2023-05-17
- Publication Date
- 2026-07-07
AI Technical Summary
Existing technologies struggle to achieve high real-time data transmission in automotive Ethernet. Traditional Ethernet protocols suffer from latency and jitter issues, and the time-triggered scheduling method of the TSN protocol cannot meet the demands of high-speed transmission of large data volumes, requiring modifications to the Ethernet controller's operating mode.
A time-triggered terminal Ethernet scheduling method is adopted. Through encapsulation operations, buffer queue management and priority transmission, combined with switch signal triggering, the priority order of packet transmission is realized. The queue is managed by an embedded operating system to avoid task preemption.
It improves the real-time performance and network efficiency of automotive Ethernet, avoids low-priority packet blocking, reduces the latency of traditional Ethernet protocol stack layered processing, and supports high-bandwidth, high-real-time data transmission.
Smart Images

Figure CN116545953B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of vehicle communication technology, and in particular to a terminal Ethernet scheduling method, system, storage medium, and computer. Background Technology
[0002] With the rapid increase in the use of electronic products in automobiles, the scale and complexity of in-vehicle systems are growing, leading to higher demands for vehicle safety, energy efficiency, emission reduction, and comfort. More and more cars are equipped with Advanced Driver Assistance Systems (ADAS), such as lane departure warning systems, rear-view cameras, and active collision avoidance systems. In particular, intelligentization is becoming the future direction of the automotive industry, with cameras, radars, sensors, and automatic control devices accounting for an increasingly larger proportion of electronic equipment in vehicles. Under this development trend, the bandwidth requirements of in-vehicle networks are also constantly increasing, which is why the importance of automotive Ethernet is becoming increasingly prominent.
[0003] Generally, Ethernet transmission implies large data volumes and high speeds. Therefore, the controller must process large amounts of data, and Ethernet message scheduling must better manage the operational resources used by the controller. To achieve real-time scheduling, restrictions were placed on the sending behavior of driver messages. We combined Ethernet message scheduling with time synchronization, making Ethernet message scheduling time-triggered rather than the traditional event-triggered approach of Ethernet.
[0004] In certain scenarios, real-time data transmission is crucial, especially in the context of high-volume, high-speed Ethernet transmission. Controllable delay transmission of critical packets is particularly critical, and this requires the support of network scheduling mechanisms. Under current technological conditions, the following solutions exist:
[0005] 1. In the context of traditional Ethernet, message real-time performance can be guaranteed through the Real-Time Transport Protocol (RTP). RTP provides jitter compensation and out-of-order data arrival detection mechanisms, offering end-to-end delivery services with real-time characteristics, such as interactive video and audio or analog data in multicast or unicast network services. Due to the transmission characteristics of IP networks, out-of-order data arrival is common. RTP allows data to be transmitted to multiple destinations via IP multicast.
[0006] 2. In traditional bus communication, such as the CAN bus, there is a time-triggered scheduling method based on TTCAN technology. TTCAN is driven by a time process, and its time-triggered scheduling consists of time windows with a fixed sequence. A time window is a time segment used for exchanging messages, and there are typically three types of time windows: dedicated time windows (for specific periodic messages), arbitration time windows (for messages accessing the bus through arbitration), and idle time windows (reserved for bus expansion).
[0007] 3. In vehicular Ethernet, the IEEE 802.1Qbv standard in the TSN protocol provides time-division scheduling functionality. This mechanism is implemented by different message queues, message transmission algorithms, gate opening and closing mechanisms, and gate control lists. Messages received from the port are placed into different transmission queues based on their VLAN (Virtual Local Area Network) priorities. Then, in queues with open gate control lists, the appropriate message is selected for transmission from the message transmission port based on the corresponding message selection algorithm (e.g., message selection based on traditional priority or message selection based on credit value shaping).
[0008] However, the aforementioned existing technologies still have the following drawbacks that cannot be ignored:
[0009] 1. In traditional Ethernet, although RTP (Realtime Transport Protocol) can guarantee the transmission of real-time data to a certain extent, it cannot provide a reliable transmission mechanism for transmitting data packets in order. Therefore, to order all data packets, data buffering is indispensable. However, once a buffering mechanism is adopted, it will bring new problems—significant latency. On the other hand, the transmission latency and jitter generated by traditional Ethernet, which is based on event triggering, will accumulate, affecting real-time requirements and making it unsuitable for terminal Ethernet with high real-time requirements.
[0010] 2. The time-triggered scheduling method based on TTCAN technology ensures the transmission of critical periodic messages by defining time windows. However, this fixed time window scheduling mode is not suitable for Ethernet with high data volume and high speed transmission. It will reduce the efficiency of network utilization and fail to take full advantage of the high speed and high bandwidth characteristics of Ethernet.
[0011] 3. The time-sharing scheduling mechanism in the TSN protocol, as defined in IEEE 802.1Qbv, is primarily implemented by the switch. However, the functionality of a node requires both a switch and a controller. To support the real-time scheduling function of TSN, in addition to the corresponding configuration in the switch, the operating mode of the Ethernet controller must also be changed; therefore, a terminal Ethernet scheduling mechanism is needed. Summary of the Invention
[0012] Based on this, the purpose of the present invention is to provide a terminal Ethernet scheduling method, system, storage medium, and computer to at least address the shortcomings of the aforementioned related technologies.
[0013] This invention proposes a terminal Ethernet scheduling method, comprising:
[0014] When a message sending task is obtained, the message data in the message sending task is encapsulated to obtain the corresponding encapsulated message;
[0015] The encapsulated message is sent to the buffer queue, and the encapsulated messages in the buffer queue are sent according to their priority based on the switch's trigger signal.
[0016] When a message event is received, the current operation mode is determined, including the interrupt receiving mode.
[0017] If the current operating mode is interrupt reception mode, the message data corresponding to the message event is broadcast to all listening tasks through the message mailbox, and each listening task processes the message in order of its priority.
[0018] Furthermore, the steps for encapsulating the message data in the message sending task to obtain the corresponding encapsulated message include:
[0019] Create a memory pool, wherein the memory pool contains several memory blocks of the same size;
[0020] Lock the data memory occupied by the message data in the message sending task, and obtain the locking status of each memory block through a callback function model;
[0021] The message data in the message sending task is encapsulated using the MAC address and VLAN-tag field in the unlocked memory block to obtain the corresponding encapsulated message.
[0022] Furthermore, the step of sending the encapsulated packets in the buffer queue according to their priority based on the switch's trigger signal includes:
[0023] Within the loop cycle, determine whether an I / O signal sent by the switch has been received;
[0024] If the IO signal is received within the loop cycle, the encapsulated messages in the buffer queue are sent in priority order until all messages are sent.
[0025] Furthermore, the operation mode also includes a polling receiving mode. After the step of determining the current operation mode when a message event is received, the method further includes:
[0026] If the current operating mode is polling reception mode, the register is checked for message reception at a fixed period, and the message data received by the register is passed to the registration function. The registration function is then polled until the message data received by the register is processed.
[0027] The present invention also proposes a terminal Ethernet scheduling system, comprising:
[0028] The encapsulation operation module is used to encapsulate the message data in the message sending task when a message sending task is obtained, so as to obtain the corresponding encapsulated message.
[0029] The message sending module is used to send the encapsulated message to the buffer queue, and send the encapsulated message in the buffer queue according to its priority based on the trigger signal of the switch;
[0030] The mode determination module is used to determine the current operation mode when a message event is received. The operation mode includes the interrupt receiving mode.
[0031] The first processing module is used to broadcast the message data corresponding to the message event to all listening tasks through the message mailbox if the current operation mode is interrupt receiving mode, and to process the message in order of priority of each listening task.
[0032] Furthermore, the packaging operation module includes:
[0033] A memory pool creation unit is used to create a memory pool, wherein the memory pool contains several memory blocks of the same size;
[0034] The status acquisition unit is used to lock the data memory occupied by the message data in the message sending task, and to obtain the locking status of each memory block through a callback function model.
[0035] The message encapsulation unit is used to encapsulate the message data in the message sending task using the MAC address and VLAN-tag field in the unlocked memory block to obtain the corresponding encapsulated message.
[0036] Furthermore, the message sending module includes:
[0037] The signal determination unit is used to determine whether an I / O signal sent by the switch has been received within the cycle.
[0038] The message sending unit is used to send the encapsulated messages in the buffer queue in priority order if the IO signal is received within the cycle period, until all messages are sent.
[0039] Furthermore, the operating mode also includes a polling receiving mode, and the system further includes:
[0040] The second processing module is used to check the message reception of the register at a fixed period if the current operation mode is polling reception mode, and to pass the message data received by the register to the registration function, and to poll the registration function until the message data received by the register is processed.
[0041] The present invention also proposes a storage medium on which a computer program is stored, which, when executed by a processor, implements the aforementioned terminal Ethernet scheduling method.
[0042] The present invention also proposes a computer, 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 aforementioned terminal Ethernet scheduling method.
[0043] Compared with existing technologies, the advantages of this invention are: it combines terminal Ethernet controller message scheduling with time synchronization, adopting a time-triggered approach. When a module requests to send, the message descriptor pointer is stored in a buffer queue, and message scheduling only performs the actual sending operation when each scheduling window is triggered. During message sending, messages are sent in priority order to avoid low-priority blocking. Simultaneously, the embedded operating system provides management support for the waiting queue to prevent queue management problems caused by task preemption. The improvement in data storage management mainly lies in supporting segmented data descriptors, which allows different contents of Ethernet packets (such as application layer parts, function IDs, MAC addresses, etc.) to be placed in different memories. Furthermore, when sending messages, the relevant memory is locked, and messages are dynamically allocated and assembled through memory during operation, avoiding the delays caused by duplicate data copying in traditional Ethernet protocol stack layered processing. Attached Figure Description
[0044] Figure 1 This is a flowchart of the terminal Ethernet scheduling method in the first embodiment of the present invention;
[0045] Figure 2 for Figure 1 Detailed flowchart of step S101;
[0046] Figure 3 This is a schematic diagram illustrating accidental modification of memory data during message transmission in the first embodiment of the present invention;
[0047] Figure 4 This is a schematic diagram illustrating Ethernet packet assembly, transmission, and memory recovery in the first embodiment of the present invention;
[0048] Figure 5 for Figure 1 Detailed flowchart of step S102;
[0049] Figure 6 This is a schematic diagram illustrating the real-time issues caused by Ethernet packets without queue management in the first embodiment of the present invention;
[0050] Figure 7 This is a schematic diagram of Ethernet transmission information queue management in the first embodiment of the present invention;
[0051] Figure 8 This is a schematic diagram illustrating the interruption and message mailbox processing in the first embodiment of the present invention;
[0052] Figure 9 This is a schematic diagram illustrating the polling and callback function processing in the first embodiment of the present invention;
[0053] Figure 10 This is a structural block diagram of the terminal Ethernet scheduling system in the second embodiment of the present invention;
[0054] Figure 11 This is a structural block diagram of the computer in the third embodiment of the present invention.
[0055] The following detailed description, in conjunction with the accompanying drawings, will further illustrate the present invention. Detailed Implementation
[0056] To facilitate understanding of the present invention, a more complete description will be given below with reference to the accompanying drawings. Several embodiments of the invention are illustrated in the drawings. However, the invention can be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete.
[0057] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein in the description of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.
[0058] Example 1
[0059] Please see Figure 1 The figure shows a terminal Ethernet scheduling method in the first embodiment of the present invention, the method specifically including steps S101 to S104:
[0060] S101, When a message sending task is obtained, the message data in the message sending task is encapsulated to obtain the corresponding encapsulated message;
[0061] For further details, please refer to Figure 2 Step S101 specifically includes steps S1011 to S1013:
[0062] S1011, Create a memory pool, wherein the memory pool contains several memory blocks of the same size;
[0063] S1012, lock the data memory occupied by the message data in the message sending task, and obtain the locking status of each memory block through the callback function model;
[0064] S1013, the message data in the message sending task is encapsulated using the MAC address and VLAN-tag field in the unlocked memory block to obtain the corresponding encapsulated message.
[0065] In practical implementation, the terminal Ethernet scheduling method in this embodiment mainly proposes new methods for data management and transmission queue management of terminal Ethernet packet scheduling, and provides two different options for Ethernet packet reception mode. The specific steps are as follows:
[0066] like Figure 3 As shown, in practical implementation, when the driver sends a message, the application layer modifies the data in the memory space where the message resides, causing data transmission errors. This embodiment requires the application layer to lock the relevant memory when sending a message, obtain the message sending status through message scheduling, and use a mechanism similar to a callback function for message sending completion to contact the locked memory, thereby avoiding data modification at runtime. Simultaneously, this embodiment uses segmented data descriptors to place different contents of the Ethernet data packet (such as the application layer portion, function ID, MAC address, etc.) in different memories, avoiding the latency caused by multiple data copying in the traditional Ethernet protocol stack's layered processing.
[0067] like Figure 4 As shown, each frame involves a MAC address, VLAN tag, and length data segment. This memory is shared by each module to improve utilization. To facilitate memory reuse among modules, this embodiment uses the memory management function provided by the embedded operating system to create a memory pool during initialization, containing a certain number of memory blocks of the same size. Each time memory is requested, a memory block is used as the unit. When a memory block is released, it is returned to the corresponding memory partition. Therefore, each task can dynamically allocate and assemble messages through memory during operation, avoiding the latency caused by duplicate data copying in the traditional Ethernet protocol stack layered processing. After transmission is completed, the requested memory is returned by sending a completion callback function. The operating system ensures that other tasks can successfully send Ethernet packets.
[0068] Understandably, during packet transmission, a memory pool is first created, containing data blocks of equal size, each storing relevant frame header information (MAC address, VLAN tag, etc.). Next, the application layer needs to transmit the data to be sent (the packet's payload field) to the lower layer for encapsulation (adding the MAC address and VLAN tag fields to the frame header). However, after the data segment is transmitted to the lower layer for encapsulation, it may still be affected by other operations at the application layer, so the memory occupied by the data needs to be locked before transmission. Furthermore, the application layer can also retrieve the locked state through relevant callback functions. During encapsulation, to avoid delays caused by multiple data copies in traditional Ethernet protocol stack layering, the information already stored in the memory blocks is used directly to encapsulate the data. After encapsulation, the memory is released to the appropriate area, and the packet is stored in a buffer queue awaiting transmission.
[0069] S102, the encapsulated message is sent to the buffer queue, and the encapsulated messages in the buffer queue are sent according to their priority based on the trigger signal of the switch;
[0070] For further details, please refer to Figure 5 Step S102 specifically includes steps S1021 to S1022:
[0071] S1021, within the cycle, determines whether an I / O signal sent by the switch has been received;
[0072] S1022, if the IO signal is received within the cycle, the encapsulated messages in the buffer queue are sent in priority order until all are sent.
[0073] In practical implementation, after the message encapsulation process (1. Data storage management) is completed, the messages need to be sent based on a time window. The sending period is determined by the switch configuration. At the beginning of the cycle, the switch sends an I / O signal to the terminal station to trigger the message sending process. When the terminal station receives the trigger signal, it sends the messages in the queue in priority order until all messages are sent, and then waits for the next trigger from the switch, thus completing the message sending process.
[0074] like Figure 6 As shown, when the switch triggers the sending of a control message via I / O, image acquisition or other modules may be sending messages. Because traditional MAC controllers do not support message preemption, control messages must wait for other messages to be sent, causing additional transmission delays on the controller side.
[0075] like Figure 7As shown, when a module requests to send a message, the message descriptor pointer is stored in a buffer queue. Message scheduling only performs the actual sending operation when each scheduling window is triggered. During message sending, messages are sent in priority order to avoid blocking low-priority messages. The embedded operating system provides management support for the waiting queue to prevent queue management problems caused by task preemption. Each Ethernet transmission is triggered by the switch's synchronous clock I / O, so the triggering period is critical. If the period is too long, the controller will buffer a large number of messages, posing a risk of overflow. If the period is too short, the sending task will be repeatedly scheduled, increasing the controller's runtime. Therefore, the synchronization period also needs to be designed according to different systems to obtain an appropriate value.
[0076] S103, when a message event is received, the current operation mode is determined, wherein the operation mode includes interrupt receiving mode;
[0077] S104, if the current operation mode is interrupt receiving mode, the message data corresponding to the message event is broadcast to all listening tasks through the message mailbox, and each listening task processes the message according to its priority order.
[0078] In specific implementation, such as Figure 8 As shown, when handling message sending and receiving events using interrupt mode, Ethernet message scheduling communicates with other tasks via message mailboxes. When an interrupt occurs, the message receiving interrupt function checks relevant registers to determine the message receiving and sending status. After the determination, the message to be processed is broadcast to all tasks listening to the message mailbox via the message mailbox. Each task processes messages in priority order. If the message is relevant to a task, it is processed according to predefined logic; otherwise, the message is discarded and awaits the next wake-up event. In interrupt mode, message reception triggers a corresponding interrupt operation. During interrupt execution, the terminal station broadcasts the message to all tasks listening for that message via the message mailbox, and the various tasks in the terminal station process the message in priority order.
[0079] In some alternative embodiments, after step S103, the method further includes the following steps:
[0080] If the current operating mode is polling reception mode, the register is checked for message reception at a fixed period, and the message data received by the register is passed to the registration function. The registration function is then polled until the message data received by the register is processed.
[0081] In specific implementation, such as Figure 9As shown, in the polling mode, the driver checks for completion of sending and receiving. At startup, all tasks related to message sending and receiving completion events pass a pointer to the address of a message processing function through the driver interface. During normal operation, the Ethernet driver disables interrupt functionality and checks the status register at a fixed interval. First, all received packets are processed. If a packet is received, it is sequentially passed to the registered processing function. If the message is being processed by a registered function, the processing flow for the next message is executed directly. Otherwise, the next processing function is called until it is confirmed that no function will process the message, and the message is discarded. The message sending completion event checking logic is consistent with the receiving check logic, ensuring that the data memory management module can restore resources in a timely manner. Compared to the previous mode, the polling mode eliminates the time consumption of repeatedly entering interrupts, while the callback function eliminates the problems existing in task scheduling. In polling mode, the end station periodically checks the packet receiving status register. If a packet has already been received, it is passed to the corresponding registered function. The process of repeatedly accessing registered functions continues until a packet is processed by a registered function, and then the above operation is repeated for the next packet.
[0082] In summary, the terminal Ethernet scheduling method in the above embodiments of the present invention combines terminal Ethernet controller message scheduling with time synchronization, adopting a time-triggered approach. When a module requests to send, the message descriptor pointer is stored in a buffer queue, and message scheduling only performs the actual sending operation when each scheduling window is triggered. During message sending, messages are sent in priority order to avoid low-priority blocking. Simultaneously, the embedded operating system provides management support for the waiting queue to prevent queue management problems caused by task preemption. The improvement in data storage management mainly lies in supporting segmented data descriptors, which allows different contents of Ethernet packets (such as application layer parts, function IDs, MAC addresses, etc.) to be placed in different memories. Furthermore, when sending messages, the relevant memory is locked, and messages are dynamically allocated and assembled through memory during operation, avoiding the delays caused by duplicate data copying in traditional Ethernet protocol stack layered processing.
[0083] Example 2
[0084] In another aspect, this invention also proposes a terminal Ethernet scheduling system; please refer to [link to relevant documentation]. Figure 10 The figure shows a terminal Ethernet scheduling system according to a second embodiment of the present invention, comprising:
[0085] The encapsulation operation module 11 is used to encapsulate the message data in the message sending task when a message sending task is obtained, so as to obtain the corresponding encapsulated message.
[0086] Furthermore, the packaging operation module 11 includes:
[0087] A memory pool creation unit is used to create a memory pool, wherein the memory pool contains several memory blocks of the same size;
[0088] The status acquisition unit is used to lock the data memory occupied by the message data in the message sending task, and to obtain the locking status of each memory block through a callback function model.
[0089] The message encapsulation unit is used to encapsulate the message data in the message sending task using the MAC address and VLAN-tag field in the unlocked memory block to obtain the corresponding encapsulated message.
[0090] The message sending module 12 is used to send the encapsulated message to the buffer queue, and send the encapsulated message in the buffer queue according to its priority based on the trigger signal of the switch.
[0091] Furthermore, the message sending module 12 includes:
[0092] The signal determination unit is used to determine whether an I / O signal sent by the switch has been received within the cycle.
[0093] The message sending unit is used to send the encapsulated messages in the buffer queue in priority order if the IO signal is received within the cycle period, until all messages are sent.
[0094] The mode determination module 13 is used to determine the current operation mode when a message event is received, wherein the operation mode includes the interrupt receiving mode;
[0095] The first processing module 14 is used to broadcast the message data corresponding to the message event to all listening tasks through the message mailbox if the current operation mode is interrupt receiving mode, and to process the message in order of priority of each listening task.
[0096] In some alternative embodiments, the operating mode further includes a polling receiving mode, and the system further includes:
[0097] The second processing module is used to check the message reception of the register at a fixed period if the current operation mode is polling reception mode, and to pass the message data received by the register to the registration function, and to poll the registration function until the message data received by the register is processed.
[0098] The functions or operation steps implemented by the above modules and units are largely the same as those in the above method embodiments, and will not be repeated here.
[0099] The terminal Ethernet scheduling system provided in this embodiment of the invention has the same implementation principle and technical effects as the aforementioned method embodiment. For the sake of brevity, any parts not mentioned in the system embodiment can be referred to the corresponding content in the aforementioned method embodiment.
[0100] Example 3
[0101] This invention also proposes a computer, please refer to [link / reference]. Figure 11 The computer shown in the third embodiment of the present invention includes a memory 10, a processor 20, and a computer program 30 stored in the memory 10 and executable on the processor 20. When the processor 20 executes the computer program 30, it implements the above-described terminal Ethernet scheduling method.
[0102] The memory 10 includes at least one type of storage medium, such as flash memory, hard disk, multimedia card, card-type memory (e.g., SD or DX memory), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 10 can be an internal storage unit of a computer, such as the computer's hard disk. In other embodiments, the memory 10 can be an external storage device, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. Furthermore, the memory 10 can include both internal and external storage units of the computer. The memory 10 can be used not only to store application software and various types of data installed on the computer, but also to temporarily store data that has been output or will be output.
[0103] In some embodiments, the processor 20 may be an electronic control unit (ECU, also known as a vehicle computer), a central processing unit (CPU), a controller, a microcontroller, a microprocessor, or other data processing chip, used to run program code stored in the memory 10 or process data, such as executing access restriction programs.
[0104] It should be pointed out that, Figure 11 The structure shown does not constitute a limitation on the computer. In other embodiments, the computer may include fewer or more components than shown, or combine certain components, or have different component arrangements.
[0105] This invention also proposes a storage medium storing a computer program that, when executed by a processor, implements the terminal Ethernet scheduling method described above.
[0106] Those skilled in the art will understand that the logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer storage medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer storage medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device.
[0107] More specific examples of computer storage media (a non-exhaustive list) include: electrical connections (electronic devices) with one or more wires, portable computer disk drives (magnetic devices), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, computer storage media can even be paper or other suitable storage media on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other storage medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in computer memory.
[0108] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0109] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0110] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the invention patent. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this patent application should be determined by the appended claims.
Claims
1. A terminal Ethernet scheduling method, characterized in that, include: When a message sending task is obtained, the message data in the message sending task is encapsulated to obtain the corresponding encapsulated message; The encapsulated message is sent to the buffer queue, and the encapsulated messages in the buffer queue are sent according to their priority based on the switch's trigger signal. When a message event is received, the current operation mode is determined, including the interrupt receiving mode. If the current operating mode is interrupt receiving mode, the message data corresponding to the message event is broadcast to all listening tasks through the message mailbox, and each listening task processes the message according to its priority order. The steps involved in encapsulating the message data in the message sending task to obtain the corresponding encapsulated message include: Create a memory pool, wherein the memory pool contains several memory blocks of the same size; Lock the data memory occupied by the message data in the message sending task, and obtain the locking status of each memory block through a callback function model; The message data in the message sending task is encapsulated using the MAC address and VLAN-tag field in the unlocked memory block to obtain the corresponding encapsulated message.
2. The terminal Ethernet scheduling method according to claim 1, characterized in that, The steps of sending encapsulated packets in the buffer queue according to their priority based on the switch's trigger signal include: Within the loop cycle, determine whether an I / O signal sent by the switch has been received; If the IO signal is received within the loop cycle, the encapsulated messages in the buffer queue are sent in priority order until all messages are sent.
3. The terminal Ethernet scheduling method according to claim 1, characterized in that, The operation mode also includes a polling receiving mode. After the step of determining the current operation mode when a message event is received, the method further includes: If the current operating mode is polling reception mode, the register is checked for message reception at a fixed period, and the message data received by the register is passed to the registration function. The registration function is then polled until the message data received by the register is processed.
4. A terminal Ethernet scheduling system, characterized in that, include: The encapsulation operation module is used to encapsulate the message data in a message sending task when a message sending task is obtained, so as to obtain the corresponding encapsulated message. The message sending module is used to send the encapsulated message to the buffer queue, and send the encapsulated message in the buffer queue according to its priority based on the trigger signal of the switch; The mode determination module is used to determine the current operation mode when a message event is received. The operation mode includes the interrupt receiving mode. The first processing module is used to broadcast the message data corresponding to the message event to all listening tasks through the message mailbox if the current operation mode is interrupt receiving mode, and to process the message in order of priority of each listening task. The encapsulation operation module includes: A memory pool creation unit is used to create a memory pool, wherein the memory pool contains several memory blocks of the same size; The status acquisition unit is used to lock the data memory occupied by the message data in the message sending task, and to obtain the locking status of each memory block through a callback function model. The message encapsulation unit is used to encapsulate the message data in the message sending task using the MAC address and VLAN-tag field in the unlocked memory block to obtain the corresponding encapsulated message.
5. The terminal Ethernet scheduling system according to claim 4, characterized in that, The message sending module includes: The signal determination unit is used to determine whether an I / O signal sent by the switch has been received within the cycle. The message sending unit is used to send the encapsulated messages in the buffer queue in priority order if the IO signal is received within the cycle period, until all messages are sent.
6. The terminal Ethernet scheduling system according to claim 4, characterized in that, The operating mode also includes a polling reception mode, and the system further includes: The second processing module is used to check the message reception of the register at a fixed period if the current operation mode is polling reception mode, and to pass the message data received by the register to the registration function, and to poll the registration function until the message data received by the register is processed.
7. A storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the terminal Ethernet scheduling method as described in any one of claims 1 to 3.
8. A computer 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 terminal Ethernet scheduling method as described in any one of claims 1 to 3.