Data transmission control method and device of vehicle-mounted Ethernet and vehicle

By controlling data aggregation and transmission according to VLAN priority in vehicle Ethernet, the problems of high CPU load and data packet processing delay caused by real-time transmission strategies are solved, efficient and flexible data transmission is achieved, and user experience is improved.

CN119922142APending Publication Date: 2025-05-02BEIJING CO WHEELS TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311423442.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-10-30
Publication Date
2025-05-02

AI Technical Summary

Technical Problem

In vehicle-mounted Ethernet, real-time transmission strategy causes the CPU load of the data receiver to be too high, especially in small packet transmission scenarios with high bandwidth; while traditional data aggregation transmission strategy cannot perform special processing of emergency data packets, resulting in response delays and affecting user experience.

Method used

By obtaining the data size and VLAN priority of the data packet to be transmitted, determining the appropriate cache queue and writing the data packet, configuring the maximum timeout according to the VLAN priority, controlling data aggregation and transmission, and ensuring that high-priority data packets are processed in a timely manner.

Benefits of technology

It effectively reduces CPU load, improves data processing efficiency, ensures that data packets with higher VLAN priority are processed in a timely manner, and improves the data transmission performance and user experience of on-board Ethernet.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119922142A_ABST
    Figure CN119922142A_ABST
Patent Text Reader

Abstract

The invention relates to a data transmission control method and device of a vehicle-mounted Ethernet and a vehicle, and the method comprises the steps: obtaining a to-be-transmitted data message in the vehicle-mounted Ethernet, and analyzing the to-be-transmitted data message to obtain a data size and a VLAN priority; querying a cache queue corresponding to the VLAN priority, and writing the to-be-transmitted data message into a target cache queue of which the size of a free area is not smaller than the data size; and aggregating and transmitting all the data messages in the target cache queue according to the maximum timeout time corresponding to the VLAN priority. An aggregation transmission strategy is adopted, the problems that the processing frequency is too high and the CPU load is relatively high when data packets with relatively high bandwidth are transmitted in real time in a vehicle-mounted Ethernet scene are solved, the maximum timeout time of aggregation transmission is configured according to different VLAN priorities, the flexibility of data transmission is improved, data messages with relatively high VLAN priorities are ensured to be processed in time, and the data transmission efficiency is improved. And the data processing efficiency of the vehicle-mounted Ethernet is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of vehicle communications, and in particular to a data transmission control method and device for vehicle-mounted Ethernet, and a vehicle. Background Art

[0002] With the development of automobile intelligence and networking, automotive Ethernet technology is widely used in vehicles to meet the increasingly high communication needs of vehicle networks.

[0003] In the current automotive Ethernet architecture, data transmission control is mainly implemented using a real-time transmission strategy. Specifically, the data sender sends a data message, and the data receiver immediately transmits the data message to the vehicle application module after receiving the data message. The real-time transmission strategy allows the data message to be received and processed by the receiver at the fastest speed; however, this method requires a high data processing capability of the data receiver, especially for small data packet transmission scenarios with high bandwidth. The number of packets increases exponentially compared to the number of large data packet transmission scenarios. If the receiver immediately transmits the data message to the upper layer protocol stack for processing after receiving it, the processing frequency of the receiver will be very high, which is a very heavy burden for the central processing unit (CPU).

[0004] In the related technology, an aggregation transmission strategy is also used to optimize the problems existing in the real-time transmission strategy, that is, the receiver writes the received data message into the cache queue first. When the free area of ​​the cache queue is insufficient or reaches the preset timeout time, the data in the cache queue is aggregated to form a large data message and transmitted to the upper-layer protocol stack, and then the upper-layer protocol stack distributes each data message in the large data message to the corresponding vehicle application module. The data aggregation transmission strategy solves the problem of high CPU load of high bandwidth and small data packets in the real-time transmission strategy. Multiple small data messages will be aggregated to form a large data message and transmitted to the protocol stack at one time. The processing frequency of the protocol stack and the operating system is significantly reduced. However, the traditional data aggregation transmission strategy has the same processing method for all data messages. There is no way to do special processing for some data messages that need to be responded to in time, resulting in some urgent data instructions cannot be received and processed in time by the upper-layer vehicle application module, and then the vehicle application module responds slowly, resulting in a poor user experience. Summary of the invention

[0005] In order to solve the above technical problems, the present disclosure provides a data transmission control method and device of an in-vehicle Ethernet and a vehicle.

[0006] In a first aspect, the present disclosure provides a data transmission control method for an in-vehicle Ethernet, comprising:

[0007] Acquire a data message to be transmitted in the vehicle Ethernet, and parse the data message to be transmitted to obtain the data size and virtual local area network VLAN priority of the data message to be transmitted;

[0008] Determine a cache queue whose idle area size is not less than the data size as a target cache queue, and write the data message to be transmitted into the idle area of ​​the target cache queue;

[0009] Querying a preset correspondence relationship to determine the maximum timeout time corresponding to the VLAN priority; the preset correspondence relationship includes a correspondence relationship between multiple groups of VLAN priorities and maximum timeout times; wherein, the higher the VLAN priority, the shorter the corresponding maximum timeout time;

[0010] All data packets in the target cache queue are aggregated and transmitted according to the maximum timeout time corresponding to the VLAN priority.

[0011] In some embodiments, before aggregating and transmitting all data packets in the target cache queue according to the maximum timeout time corresponding to the VLAN priority, the method further includes:

[0012] Determine whether the size of the free area in the target cache queue is smaller than a preset data size;

[0013] The step of aggregating and transmitting all data packets in the target cache queue according to the maximum timeout time corresponding to the VLAN priority includes:

[0014] If it is determined that the size of the free area in the target cache queue is greater than or equal to the preset data size, the timer corresponding to the target cache queue is monitored until the duration recorded by the timer exceeds the maximum timeout time, and all data packets in the target cache queue are aggregated and transmitted to the vehicle application module.

[0015] In some embodiments, the method further comprises:

[0016] In the process of monitoring the timer corresponding to the target cache queue, before the duration recorded by the timer does not exceed the maximum timeout period, receiving other to-be-transmitted data packets that are allowed to be written into the target cache queue;

[0017] Writing the other data packets to be transmitted into the target cache queue, and re-determining whether the size of the free area in the target cache queue is smaller than the preset data size;

[0018] If it is determined that after writing the other data packets to be transmitted, the size of the free area of ​​the target cache queue is greater than or equal to the preset data size, then when the next data packet to be transmitted that is allowed to be written into the target cache queue is received, the next data packet to be transmitted will be written into the target cache queue.

[0019] In some embodiments, the method further comprises:

[0020] If it is determined that the size of the free area in the target cache queue is smaller than the preset data size, all data messages in the target cache queue are aggregated and transmitted to the vehicle-mounted application module.

[0021] In some embodiments, the monitoring of the timer corresponding to the target cache queue until the duration recorded by the timer exceeds the maximum timeout time and before aggregating and transmitting all data packets in the target cache queue to the vehicle application module further includes:

[0022] Determining whether the target cache queue is empty before the data message to be transmitted is written;

[0023] If so, start the timer of the target cache queue to start timing.

[0024] In some embodiments, before determining that the cache queue whose free area size is not less than the data size is the target cache queue, the method further includes:

[0025] Parsing the field carrying the VLAN tag in the data message to be transmitted, and obtaining the VLAN identifier of the VLAN to which the data message to be transmitted belongs according to the identifier field in the field carrying the VLAN tag;

[0026] The step of determining that the cache queue whose free area size satisfies the data size is the target cache queue includes:

[0027] According to the VLAN ID, query multiple cache queues corresponding to the VLAN priority, and determine the cache queue consistent with the VLAN ID as a candidate cache queue;

[0028] A candidate cache queue whose free area size satisfies the data size is determined as the target cache queue.

[0029] In some embodiments, the parsing the data message to be transmitted to obtain the data size and VLAN priority of the data message to be transmitted includes:

[0030] The field carrying the VLAN tag in the data message to be transmitted is parsed, and the VLAN priority corresponding to the data message to be transmitted is obtained according to the VLAN priority field in the field carrying the VLAN tag.

[0031] In some embodiments, parsing the data message to be transmitted to obtain the VLAN priority of the data message to be transmitted includes:

[0032] The data message to be transmitted is parsed to obtain a source MAC address, and a preset MAC address and VLAN priority correspondence table is queried according to the source MAC address to obtain the VLAN priority corresponding to the data message to be transmitted.

[0033] In a second aspect, the present disclosure provides a data transmission control device for an in-vehicle Ethernet, comprising:

[0034] A data message acquisition module is used to acquire data messages to be transmitted in the vehicle Ethernet; and parse the data messages to be transmitted to obtain the data size and virtual local area network VLAN priority of the data messages to be transmitted;

[0035] A processing module, configured to determine a cache queue whose idle area is not less than the data size as a target cache queue, and write the data message to be transmitted into the idle area of ​​the target cache queue; and query a preset corresponding relationship to determine a maximum timeout time corresponding to the VLAN priority; the preset corresponding relationship includes a correspondence between multiple groups of VLAN priorities and maximum timeout times; wherein, the higher the VLAN priority, the shorter the corresponding maximum timeout time;

[0036] The transmission module is used to aggregate and transmit all data packets in the target cache queue according to the maximum timeout time corresponding to the VLAN priority.

[0037] In a third aspect, the present disclosure provides a vehicle-mounted terminal, including: a memory and a processor;

[0038] The memory is configured to store computer program instructions; the processor is configured to execute the computer program instructions, so that the vehicle-mounted terminal implements the data transmission control method of the vehicle-mounted Ethernet as described in the first aspect and any one of the first aspects.

[0039] In a fourth aspect, the present disclosure provides a readable storage medium, comprising: computer program instructions; at least one processor of a vehicle-mounted terminal executes the computer program instructions, so that the vehicle-mounted terminal implements the data transmission control method of the vehicle-mounted Ethernet as described in the first aspect and any one of the first aspects.

[0040] In a fifth aspect, the present disclosure provides a computer program product, and a vehicle-mounted terminal runs the computer program product, so that the vehicle-mounted terminal implements the data transmission control method of the vehicle-mounted Ethernet as described in the first aspect and any one of the first aspects.

[0041] The embodiment of the present disclosure provides a data transmission control method, device and vehicle of an in-vehicle Ethernet, wherein the method includes: obtaining a data message to be transmitted in the in-vehicle Ethernet, and parsing the data message to be transmitted to obtain the corresponding data size and VLAN priority; querying the cache queue corresponding to the VLAN priority, determining the cache queue whose idle area size is not less than the data size as the target cache queue, and writing the data message to be transmitted into the target cache queue; querying the preset corresponding relationship to determine the maximum timeout time corresponding to the VLAN priority; and controlling all data messages in the aggregate transmission target cache queue according to the maximum timeout time corresponding to the VLAN priority. The present disclosure adopts an aggregate transmission strategy to transmit data messages, thereby solving the problem of excessive processing frequency and high CPU load of the real-time transmission scheme in the in-vehicle Ethernet scenario under the condition of high bandwidth data packet transmission, and configuring the maximum timeout time of aggregate transmission according to different VLAN priorities, wherein the higher the VLAN priority, the shorter the maximum timeout time corresponding to the higher VLAN priority, increasing the flexibility of data transmission, and ensuring that the data messages with higher VLAN priority are processed in time, thereby improving the data processing efficiency of the in-vehicle Ethernet. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0043] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0044] Figure 1A A schematic diagram of a network architecture of an in-vehicle Ethernet provided by an embodiment of the present disclosure;

[0045] Figure 1B Processing flow chart for transmitting data for existing in-vehicle Ethernet;

[0046] Figure 2 A flowchart of a data transmission control method of an in-vehicle Ethernet provided by an embodiment of the present disclosure;

[0047] Figure 3A A schematic diagram of a data structure of a data message to be transmitted provided in an embodiment of the present disclosure;

[0048] Figure 3B A schematic diagram of the relationship between the pre-configured VLAN priority and the cache queue provided in an embodiment of the present disclosure;

[0049] Figure 4A flowchart of a data transmission control method of an in-vehicle Ethernet provided by another embodiment of the present disclosure;

[0050] Figure 5 A structural diagram of a data transmission control device for an in-vehicle Ethernet provided in one embodiment of the present disclosure;

[0051] Figure 6 A structural diagram of a vehicle-mounted terminal provided in one embodiment of the present disclosure. DETAILED DESCRIPTION

[0052] In order to make the purpose, implementation mode and advantages of the present application clearer, the exemplary implementation mode of the present application will be clearly and completely described below in conjunction with the drawings in the exemplary embodiments of the present application. Obviously, the described exemplary embodiments are only part of the embodiments of the present application, rather than all the embodiments.

[0053] Based on the exemplary embodiments described in this application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the claims attached to this application. In addition, although the disclosure in this application is introduced according to one or several exemplary examples, it should be understood that each aspect of these disclosures can also constitute a complete implementation method separately. It should be noted that the brief description of the terms in this application is only for the convenience of understanding the implementation methods described below, and is not intended to limit the implementation methods of this application. Unless otherwise specified, these terms should be understood according to their common and usual meanings.

[0054] Definition of professional terms:

[0055] 1. Ethernet card: It can be understood as the interface of Ethernet hardware. The upper-level network protocol stack can control the operation of Ethernet hardware through this interface.

[0056] 2. Network protocol stack: refers to the sum of all the protocols in the network, which vividly reflects the process of file transmission in a network: from the upper layer protocol to the lower layer protocol, and then from the lower layer protocol to the upper layer protocol. Among them, the most widely used is the Internet protocol stack.

[0057] 3. Virtual Local Area Network (VLAN) is a communication technology that logically divides a physical LAN into multiple broadcast domains. Hosts within a VLAN can communicate directly, but VLANs cannot communicate directly, thus limiting data packets to a VLAN. In the automotive Ethernet scenario, VLAN technology can provide a virtual network topology architecture that conforms to the business structure for vehicle-mounted services and sub-services, as well as between vehicle-mounted services, and implement access control functions, and can improve the security of vehicle-mounted network communications.

[0058] For example, refer to Figure 1A The network architecture of the in-vehicle Ethernet shown in the figure includes, in order from top to bottom: a protocol data unit (PDU) adaptation layer, a network protocol stack and an Ethernet card layer; wherein the PDU adaptation layer is deployed with an application module corresponding to the PDU; the network protocol stack includes, in order from top to bottom, a transmission control protocol (TCP) / user datagram protocol (UDP) module, an Internet protocol (IP) protocol module and an Ethernet protocol module; the Ethernet card layer is configured with a receiving buffer and a sending buffer, the Ethernet card layer receives the data message sent by the upper layer and writes it into the receiving buffer, and then transmits the data message to the sending buffer according to the transmission strategy, and the upper network protocol stack reads the data from the sending buffer and then transmits it to the upper PDU adaptation layer. It should be noted that the application layer in the embodiment of FIG. 1 is illustrated by taking the PDU adaptation layer as an example, and in actual applications, the application layer can include a variety of different application modules, not limited to the situation shown in FIG. 1.

[0059] At present, real-time transmission strategy and packet aggregation transmission strategy are often used to control data transmission in automotive Ethernet scenarios.

[0060] Among them, the real-time transmission strategy is easier to understand. Figure 1A As shown, the data sender sends a frame of Ethernet data. After receiving the data, the data receiver immediately transmits it to the upper protocol stack, that is, transmits it to the upper protocol stack in real time. The protocol stack then transmits it to the upper vehicle application module, such as the PDU adaptation layer.

[0061] This processing method has high real-time performance, and Ethernet data can be received and processed by the receiver at the fastest speed; however, this method requires high data processing capabilities of the data receiver, especially for small data packet transmission scenarios with high bandwidth. The number of data packets increases exponentially compared to large data packet transmission scenarios. If the data receiver transmits the received data to the upper-layer protocol stack for processing immediately, the processing frequency of the operating system and protocol stack will be very high, which is a very heavy burden on the CPU.

[0062] In view of the above problems existing in the real-time transmission strategy, the packet aggregation transmission strategy can be used for optimization. The specific process is as follows: Figure 1B As shown, the following steps may be included:

[0063] Step 1: After receiving the data packet, the network card determines that the length of the data packet is L0.

[0064] Step 2: Search the cache buffer queue and find the first free area of ​​cache item buffer0 whose size L1>L0, which means that this cache item buffer0 can store the data packet.

[0065] Step 3: Store the data in the free area of ​​buffer0 and update the size of the free area of ​​buffer0 to L1-L0.

[0066] Step 4: Determine whether the size of the free area L1-L0 is less than Lmin. If so, it means that the free area can no longer store new data packets. At this time, the data in buffer0 is transmitted to the protocol stack, and the data in buffer0 is cleared. If timer T0 exists in buffer0, timer T0 of buffer0 is turned off.

[0067] Step 5: If the size of the free area is greater than Lmin, it means that data can continue to be stored. At this time, it is determined whether buffer0 is empty before the data is written. If so, the timer T0 of buffer0 is started. When the timer expires, the data is transmitted to the protocol stack regardless of the length of the data in the buffer, and the data in buffer0 is cleared.

[0068] Step 6: If buffer0 is not empty before data is written, the process ends immediately and waits for the next data packet to arrive or the timer to expire.

[0069] The packet aggregation transmission strategy solves the problem of high bandwidth and high CPU load of small data packets in the real-time transmission strategy. Multiple small data packets are aggregated to form a large data packet and transmitted to the protocol stack at one time. The processing frequency of the protocol stack and the operating system is significantly reduced. However, this method processes all data packets in the same way and has the same timeout period. There is no way to perform special processing on some high-priority data packets, resulting in some urgent data instructions not being received by the upper layer in a timely manner.

[0070] In summary, in the prior art, the real-time transmission strategy has a high processing frequency of the operating system and protocol stack in the small data packet transmission scenario with high bandwidth, resulting in a high load on the central processing unit (CPU). In the data aggregation transmission scheme, the transmission timeout of all data packets is the same, and no data differentiation is performed, resulting in data instructions that need to be processed urgently not being processed in time.

[0071] In order to solve the problems existing in the data transmission control process of the above-mentioned in-vehicle Ethernet, the present disclosure provides a data transmission control method, device and vehicle of an in-vehicle Ethernet. The data transmission control method of the in-vehicle Ethernet provided by the present disclosure adopts a data aggregation transmission strategy to transmit data messages, thereby solving the problems of excessive processing frequency and high CPU load of the real-time transmission scheme in the case of high-bandwidth data packet transmission in the in-vehicle Ethernet scenario, and the maximum timeout time of the aggregated transmission is configured according to different VLAN priorities, wherein the higher the VLAN priority, the shorter the corresponding maximum timeout time, thereby increasing the flexibility of data transmission, and ensuring that the data messages with higher VLAN priorities are processed in time, thereby improving the data processing efficiency of the in-vehicle Ethernet.

[0072] The method provided by the present disclosure can be implemented by the data transmission control device of the vehicle Ethernet provided by the present disclosure, and the device can be implemented by any software and / or hardware, and the device can be configured in a vehicle, wherein the vehicle can be, but is not limited to, any of the following types: smart cars, new energy vehicles, ordinary passenger cars, convertible passenger cars, premium passenger cars, small passenger cars, convertibles, hatchback passenger cars, station wagons, multi-purpose passenger cars, short-head passenger cars, off-road passenger cars, special passenger cars, etc. For example, the data transmission control device of the vehicle Ethernet can be an Ethernet card.

[0073] Next, the data transmission control method of the vehicle Ethernet provided by the present disclosure is described in detail through several specific embodiments combined with the accompanying drawings and application scenarios. In the following embodiments, an Ethernet card is used as an example to illustrate the method of the present disclosure.

[0074] Figure 2 The following is a flow chart of a data transmission control method of an in-vehicle Ethernet according to an embodiment of the present disclosure. Figure 2 As shown, the method of this embodiment includes:

[0075] S201. Acquire a data message to be transmitted in the vehicle Ethernet, and parse the data message to be transmitted to obtain a data size and a VLAN priority of the data message to be transmitted.

[0076] The Ethernet card receives a data message to be transmitted sent by a data sender through the vehicle Ethernet, wherein the data sender can be any vehicle application module in the application layer of the architecture shown in FIG. 1 , that is, any vehicle application module in the PDU adaptation layer.

[0077] In some embodiments, the Ethernet card obtains the data size by parsing the field carrying the data size in the data message to be transmitted, and the Ethernet card parses the field carrying the VLAN tag to obtain the VLAN priority information. Exemplarily, as shown in FIG3 , the data format of the data message to be transmitted may include: a field carrying the VLAN tag, a field carrying the data size, a field carrying the data type, a field carrying the address information related to the data, and a field carrying the data, etc.

[0078] It should be noted that other data formats can also be used to transmit data in automotive Ethernet, not limited to Figure 3A The situation shown.

[0079] In other embodiments, the Ethernet card obtains the data size by parsing the field carrying the data size in the data message to be transmitted, and the Ethernet card parses the source MAC address corresponding to the sender of the data in the field carrying the MAC address, and then queries the preset MAC address and VLAN priority correspondence table based on the source MAC address to obtain the VLAN priority information of the data message to be transmitted.

[0080] In the automotive Ethernet, the MAC address of each node is fixed, and the priorities of different MAC addresses are divided in advance. For example, the data packets of some nodes are more important, such as the data packets sent by the vehicle control module, which need to be processed with the highest real-time performance. For some nodes, such as multimedia modules, the VLAN priority can be slightly lower. Based on this, a correspondence table between preset MAC addresses and VLAN priorities is established and stored in the Ethernet card so that the Ethernet card can determine the VLAN priority according to the MAC address carried in the data packet to be transmitted.

[0081] S202: Determine a cache queue whose idle area size is not less than the data size as a target cache queue, and write the to-be-transmitted data message into the idle area of ​​the target cache queue.

[0082] In order to ensure that the cache queue has sufficient size to write the data message to be transmitted, the storage situation of each cache queue can be determined to obtain the size of the spatial area of ​​each cache queue, and then the size of the free area of ​​each cache queue is compared with the data size of the data message to be transmitted. The cache queue whose free area size is not less than the data size of the data message to be transmitted is determined as the target cache queue, and the data message to be transmitted is written into the cache queue; if the size of the free area of ​​the cache queue is less than the data size of the data message to be transmitted, it means that the cache queue cannot store the data message to be transmitted.

[0083] In the embodiment of the present application, a VLAN priority can also pre-configure one or more candidate cache queues, wherein the number of candidate cache queues can be determined according to the communication requirements of the services provided by the vehicle application module deployed at the upper layer, the data processing capability of the Ethernet card, and other influencing factors. The higher the communication requirements corresponding to the VLAN priority, the higher the data processing capability of the Ethernet card, and the more candidate cache queues can be used, so as to better process the data of the VLAN priority. For example, in the vehicle Ethernet scenario, 4 VLAN priorities are pre-configured, and each VLAN priority is pre-configured with a candidate cache queue. The relationship between the candidate cache queue and the VLAN priority can be as follows: Figure 3B As shown. If the VLAN priority of the data message to be transmitted corresponds to multiple candidate cache queues and the multiple candidate cache queues are not distinguished, in a possible implementation, the storage conditions of the multiple candidate cache queues can be determined first to obtain the size of the free areas of the multiple candidate cache queues, and for each candidate cache queue, the size of the free area of ​​the candidate cache queue is compared with the data size of the data message to be transmitted. If the size of the free area of ​​the candidate cache queue is not less than the data size of the data message to be transmitted, it means that the candidate cache queue can store the data message to be transmitted. Therefore, the candidate cache queue can be determined as the target cache queue, and the data message to be transmitted can be written into the cache queue; if the size of the free area of ​​the candidate cache queue is less than the data size of the data message to be transmitted, it means that the candidate cache queue cannot store the data message to be transmitted. It should be noted that if there are multiple candidate cache queues whose free area sizes are not smaller than the data size of the data message to be transmitted, one candidate cache queue can be randomly selected as the target cache queue. It is also possible to determine the difference between the size of the free area of ​​each candidate cache queue and the data size of the data message to be transmitted, and determine the candidate cache queue corresponding to the minimum difference as the target cache queue.

[0084] In another possible implementation, the query may be performed in the order of the candidate cache queues. If a target cache queue that can store the data message to be transmitted is found, that is, a candidate cache queue whose free area size is not less than the data size of the data message to be transmitted is determined, the data message to be transmitted is written into the candidate cache queue. If no candidate cache queue that can store the data message to be transmitted is found, wait until any candidate cache queue is cleared and then use it as the target cache queue and write the data message to be transmitted into it.

[0085] Among them, one VLAN priority can correspond to multiple vehicle-mounted application modules. In order to improve the accuracy of data processing, multiple vehicle-mounted application modules can be divided into different VLANs, and multiple candidate cache queues corresponding to the VLAN priority are used to cache data of different VLANs. When this method is adopted, the Ethernet card can parse the field carrying the VLAN tag of the data message to be transmitted to obtain the VLAN identifier of the VLAN to which the data to be transmitted belongs, and then query the multiple candidate cache queues corresponding to the VLAN priority according to the VLAN identifier. If there are multiple candidate cache queues, the candidate cache queue whose free area size meets the data size of the data message to be transmitted is determined as the target cache queue. By distinguishing the cache queues of different VLANs under the same VLAN priority, the workload of the upper-layer network protocol stack can be reduced, and the probability of data transmission to the wrong vehicle-mounted application module can also be reduced, thereby improving the robustness of data processing.

[0086] S203, querying a preset corresponding relationship to determine the maximum timeout time corresponding to the VLAN priority; the preset corresponding relationship includes a correspondence between multiple groups of VLAN priorities and maximum timeout times; wherein, the higher the VLAN priority, the shorter the corresponding maximum timeout time.

[0087] The storage module of the Ethernet card can store preset correspondences in a data table or other data forms, and the preset correspondences include correspondences between multiple groups of VLAN priorities and maximum timeout times. The preset correspondences can be configured in the corresponding data transmission control device before using the on-board Ethernet for data transmission.

[0088] The preset corresponding relationship is exemplarily shown in the following Table 1:

[0089] Table 1

[0090] VLAN priority 0 1 2 3 Maximum timeout 1000 microseconds 500 microseconds 100 microseconds 0 microseconds

[0091] In Table 1, the higher the VLAN priority, the shorter the corresponding maximum timeout, that is, the higher the real-time transmission performance; where the maximum timeout is 0 microseconds, it means that the received data message to be transmitted needs to be transmitted to the vehicle application module in real time. It should be noted that the number of pre-divided VLAN priorities and the maximum timeout corresponding to each VLAN priority can be set according to demand and are not limited to the example in Table 1. The Ethernet card can obtain the maximum timeout corresponding to the data message to be transmitted by looking up the table.

[0092] It should also be noted that there is no particular order in which S202 and S203 are executed. They can be executed sequentially as shown above, or in parallel, or S203 can be executed first and then S202.

[0093] S204: Control the aggregation transmission of all data packets in the target cache queue according to the maximum timeout time corresponding to the VLAN priority.

[0094] In some embodiments, the Ethernet card can first determine whether the maximum timeout time corresponding to the current data message to be transmitted is 0; if it is 0, it means that real-time transmission is required, and the Ethernet card immediately transmits the data message to be transmitted to the upper layer network protocol stack, and transmits the data message to be transmitted to the correct vehicle application module through the network protocol stack; if it is not 0, the data aggregation transmission is controlled according to the maximum timeout time corresponding to the VLAN priority of the data message to be transmitted. Among them, the vehicle application module can include but is not limited to: entertainment application module, air conditioning application module, window application module, seat application module and any other type of application module, which is not limited in this disclosure.

[0095] The method of this embodiment adopts a data aggregation transmission strategy, and configures the maximum timeout time of the aggregate transmission according to different VLAN priorities, thereby increasing the flexibility of data transmission, thereby solving the problem of excessive processing frequency and high CPU load of the real-time transmission solution in the vehicle Ethernet scenario under the condition of high bandwidth data packet transmission. In addition, the present disclosure distinguishes data packets by configuring VLAN priorities, ensuring that data packets with higher VLAN priorities are processed in a timely manner, thereby improving the data processing efficiency of the vehicle Ethernet.

[0096] Figure 4 A flowchart of a data transmission control method for an in-vehicle Ethernet provided by another embodiment of the present disclosure. Figure 4 The embodiment shown mainly introduces in detail how to control data transmission when the maximum timeout period of the data message to be transmitted is not 0. Figure 4 As shown, the method of this embodiment includes:

[0097] S401: Determine whether the size of the free area in the target cache queue is smaller than a preset data size.

[0098] Among them, the preset data size can be the maximum data length of the data message allowed to be transmitted in the vehicle Ethernet. S401 is executed to determine whether the target cache queue can accommodate the next arriving data message; if the size of the free area in the target cache queue is smaller than the preset data size, step S402 is executed; if the size of the free area in the target cache queue is greater than or equal to the preset data size, S403 is executed.

[0099] When the target cache queue cannot accommodate new data packets, it is equivalent to meeting the conditions for aggregated data transmission. Specifically, if it has been determined that the target cache queue cannot accommodate new data packets but the waiting time recorded by the timer still exceeds the maximum timeout time, then all data packets in the target cache queue will be delayed in transmission. Therefore, when it is determined that the target cache queue cannot accommodate new data packets, even if the duration recorded by the timer has not reached the maximum timeout time, it is necessary to process it immediately. In this way, the data packets in the target cache queue can be transmitted in a timely manner, avoiding unnecessary waiting, thereby improving data processing efficiency.

[0100] It should be noted that the duration recorded by the timer represents the duration from the first data message (ie, the earliest written data message) in the target cache queue to the current time.

[0101] S402 , aggregate all data packets in the target cache queue for transmission to the vehicle-mounted application module.

[0102] S403: Monitor the timer corresponding to the target cache queue.

[0103] S404: When the duration recorded by the timer exceeds the maximum timeout period, all data packets in the target cache queue are aggregated and transmitted to the vehicle-mounted application module.

[0104] Among them, the purpose of monitoring the timer of the target cache queue is to monitor the duration recorded by the timer. The duration recorded by the timer is used to determine whether it exceeds the maximum timeout time, so as to determine whether the conditions for aggregate transmission are met. Then, when the duration recorded by the timer exceeds the maximum timeout time, it is determined that the conditions for aggregate transmission are met, and then all data packets in the target cache queue are aggregated and transmitted to the vehicle application module; when the duration recorded by the timer does not exceed the maximum timeout time, the data packets in the target cache queue are all in a state of waiting for aggregate transmission.

[0105] The method of this embodiment controls the data packets in the target cache queue to be aggregated and transmitted at the most appropriate time by comparing the size of the free area of ​​the target cache queue with the preset data size, monitoring whether the duration recorded by the timer exceeds the maximum timeout period, etc., thereby increasing the flexibility and timeliness of data packet transmission, thereby achieving better aggregation transmission effects and better meeting business needs.

[0106] exist Figure 4 Based on the embodiment shown, the following may also be included:

[0107] S405: Receive other data messages to be transmitted, and write the other data messages to be transmitted into a target cache queue.

[0108] Among them, other data packets to be transmitted refer to data packets received after the data packets to be transmitted received in S201, and the VLAN priority of other data packets to be transmitted is consistent with the VLAN priority of the target cache queue, and are data packets allowed to be written into the target cache queue.

[0109] Since it has been determined in advance in step S401 that the target cache queue can accommodate new data packets, after receiving other data packets to be transmitted, the other data packets to be transmitted can be directly written to the tail of the target cache queue. In order to determine whether the conditions for aggregate transmission are met after the other data packets to be transmitted are written into the target cache queue, it is necessary to re-determine whether the size of the free area of ​​the target cache queue is less than the preset data size. Figure 4 In the illustrated embodiment, corresponding to returning to execute S401, it should be understood that the size of the free area of ​​the target cache queue referred to when executing S401 again, that is, re-judgment is made by using the size of the free area updated after writing other data packets to be transmitted.

[0110] In addition, in the process of monitoring the timer, if the duration recorded by the timer does not exceed the maximum timeout time, if the target cache queue has sufficient space, multiple other data packets allowed to be written into the target cache queue can be received and written into the target cache queue. After each writing of the received data packet, it is necessary to return to execute S401 and re-determine whether the size of the free area of ​​the target cache queue is less than the preset data size, so that the timing of aggregate transmission can be accurately determined.

[0111] In addition, after all data messages in the target cache queue are packaged and aggregated for transmission, the target cache queue needs to be cleared so that new data messages can be written into the target cache queue next time, thereby improving cache resource utilization.

[0112] In some embodiments, Figure 4 Based on the embodiment shown, before S403, the following may also be included:

[0113] S403', determining whether the target cache queue is empty before the data message to be transmitted is written into the target cache queue.

[0114] S403', start the timer of the target cache queue to start timing.

[0115] The purpose of judging whether the target cache queue is empty before the data message to be transmitted is written into the target cache queue is to determine whether the timer has been started. If the target cache queue is empty before the data message to be transmitted is written, it indicates that the timer has not been started, and then step S403 needs to be executed. If the target cache queue is not empty before the data message to be transmitted is written, it indicates that the timer has been started, and then step S403 can be directly executed. Since the queue is not empty before the data is written, the timer of the target cache queue has been started when the first data message is written. Therefore, there is no need to restart the timer, and the action of monitoring the timer can be directly executed.

[0116] In this embodiment, by accurately judging whether the timer has been turned on, the timer is controlled to start timing if it is not turned on, and the timer is directly monitored if it is turned on, to ensure that the correct timing duration is compared with the maximum timeout time, thereby improving the accuracy of judging whether the conditions for aggregate transmission are met.

[0117] In addition, after all data messages in the target cache queue are packaged and aggregated for transmission, the target cache queue needs to be cleared so that new data messages can be written into the target cache queue next time, thereby improving cache resource utilization.

[0118] In summary, by comparing the size of the free area of ​​the target cache queue with the preset data size, monitoring whether the time recorded by the timer exceeds the maximum timeout time, and judging whether the timer is turned on, it is ensured that the data packets are aggregated and transmitted in a timely and efficient manner when the maximum timeout time is not 0.

[0119] Figure 5 This is a structural diagram of a data transmission control device for vehicle Ethernet provided by an embodiment of the present disclosure. Figure 5 As shown, the data transmission control device 500 of the vehicle Ethernet provided in this embodiment includes:

[0120] The data message acquisition module 501 acquires the data message to be transmitted in the vehicle Ethernet; and parses the data message to be transmitted to obtain the data size and virtual local area network VLAN priority of the data message to be transmitted.

[0121] The processing module 502 is used to determine that a cache queue whose free area size is not less than the data size is a target cache queue, and write the data message to be transmitted into the free area of ​​the target cache queue; and query a preset corresponding relationship to determine the maximum timeout time corresponding to the VLAN priority; the preset corresponding relationship includes a correspondence between multiple groups of VLAN priorities and maximum timeout times; wherein, the higher the VLAN priority, the shorter the corresponding maximum timeout time.

[0122] The transmission module 503 is used to control the aggregation transmission of all data packets in the target cache queue according to the maximum timeout time corresponding to the VLAN priority.

[0123] In some embodiments, the processing module 502 is specifically used to determine whether the maximum timeout is zero; if it is determined that the maximum timeout is zero, all data packets in the target cache queue are aggregated and transmitted to the vehicle application module; if it is determined that the maximum timeout is not zero, the timer corresponding to the target cache queue is monitored, and when the duration recorded by the timer exceeds the maximum timeout, all data packets in the target cache queue are aggregated and transmitted to the vehicle application module.

[0124] In some embodiments, before all data packets in the target cache queue are aggregated and transmitted according to the maximum timeout time corresponding to the VLAN priority, the processing module 502 is further used to determine whether the size of the free area in the target cache queue is less than a preset data size.

[0125] Correspondingly, the processing module 502 is specifically used to monitor the timer corresponding to the target cache queue if it is determined that the size of the free area in the target cache queue is greater than or equal to the preset data size, and aggregate and transmit all data packets in the target cache queue to the vehicle application module until the duration recorded by the timer exceeds the maximum timeout time.

[0126] In some embodiments, the processing module 502 is further configured to receive other to-be-transmitted data packets that are allowed to be written into the target cache queue before the duration recorded by the timer exceeds the maximum timeout period during the process of monitoring the timer corresponding to the target cache queue;

[0127] Writing the other data packets to be transmitted into the target cache queue, and re-determining whether the size of the free area in the target cache queue is smaller than the preset data size;

[0128] If it is determined that after writing the other data packets to be transmitted, the size of the free area of ​​the target cache queue is greater than or equal to the preset data size, then when the next data packet to be transmitted that is allowed to be written into the target cache queue is received, the next data packet to be transmitted will be written into the target cache queue.

[0129] In some embodiments, the processing module 502 is further configured to aggregate and transmit all data packets in the target cache queue to the vehicle-mounted application module if it is determined that the size of the free area in the target cache queue is smaller than the preset data size.

[0130] In some embodiments, the timer corresponding to the target cache queue is monitored until the duration recorded by the timer exceeds the maximum timeout time before all data packets in the target cache queue are aggregated and transmitted to the on-board application module. The processing module 502 is also used to determine whether the target cache queue is empty before the data packet to be transmitted is written; if so, the timer of the target cache queue is started for timing.

[0131] In some embodiments, before determining that a cache queue whose free area size is not less than the data size is the target cache queue, the processing module 502 is specifically used to parse the field carrying the VLAN tag in the data message to be transmitted, and obtain the VLAN identifier of the VLAN to which the data message to be transmitted belongs according to the identifier field in the field carrying the VLAN tag.

[0132] Accordingly, the processing module 502 is specifically used to query multiple cache queues corresponding to the VLAN priority according to the VLAN identifier, determine the cache queue consistent with the VLAN identifier as the candidate cache queue; and determine the candidate cache queue whose free area size meets the data size as the target cache queue.

[0133] In some embodiments, the processing module 502 is specifically configured to parse the field carrying the VLAN tag in the data message to be transmitted, and obtain the VLAN priority corresponding to the data message to be transmitted according to the VLAN priority field in the field carrying the VLAN tag.

[0134] In some embodiments, the processing module 502 is specifically used to parse the data message to be transmitted to obtain a source MAC address, query a preset MAC address and VLAN priority correspondence table according to the source MAC address, and obtain the VLAN priority corresponding to the data message to be transmitted.

[0135] The device provided in this embodiment can be used to implement the technical solution of any of the aforementioned method embodiments. Its implementation principle and technical effects are similar. Please refer to the detailed description of the aforementioned method embodiments. For the sake of brevity, they will not be repeated here.

[0136] Figure 6 This is a structural diagram of a vehicle-mounted terminal provided by an embodiment of the present disclosure. Figure 6 As shown, the vehicle-mounted terminal 600 provided in this embodiment includes: a memory 601 and a processor 602 .

[0137] The memory 601 may be an independent physical unit, and may be connected to the processor 602 via a bus 603. The memory 601 and the processor 602 may also be integrated together and implemented by hardware. The memory 601 is used to store program instructions, and the processor 602 calls the program instructions to execute the data transmission control method of the vehicle Ethernet provided by any of the above method embodiments.

[0138] Optionally, when part or all of the methods of the above embodiments are implemented by software, the vehicle-mounted terminal 600 may also include only a processor 602. The memory 601 for storing programs is located outside the vehicle-mounted terminal 600, and the processor 602 is connected to the memory through circuits / wires to read and execute the programs stored in the memory. The processor 602 may be a central processing unit (CPU), a network processor (NP) or a combination of a CPU and a NP. The processor 602 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD) or a combination thereof. The PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof.

[0139] The memory 601 may include a volatile memory, such as a random-access memory (RAM); the memory may also include a non-volatile memory, such as a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD); the memory may also include a combination of the above types of memory.

[0140] Exemplarily, the present disclosure provides a chip system, which is applied to a vehicle-mounted terminal including a memory and a sensor; the chip system includes: a processor; the processor is used to execute the data transmission control method of the vehicle-mounted Ethernet of the above embodiment.

[0141] Exemplarily, the present disclosure provides a computer-readable storage medium having a computer program stored thereon, and the computer program is executed by a processor of a vehicle-mounted terminal so that the vehicle-mounted terminal implements the data transmission control method of the vehicle-mounted Ethernet of the above embodiment when executing the computer program.

[0142] Exemplarily, the present disclosure provides a computer program product, which, when executed on a vehicle-mounted terminal, enables the vehicle-mounted terminal to execute the data transmission control method of the vehicle-mounted Ethernet of the above-mentioned embodiment.

[0143] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0144] The above description is only a specific embodiment of the present disclosure, so that those skilled in the art can understand or implement the present disclosure. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present disclosure. Therefore, the present disclosure will not be limited to the embodiments described herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.

Claims

1. A data transmission control method for vehicle-mounted Ethernet, characterized in that: include: Acquire a data message to be transmitted in the vehicle Ethernet, and parse the data message to be transmitted to obtain the data size and virtual local area network VLAN priority of the data message to be transmitted; Determine a cache queue whose idle area size is not less than the data size as a target cache queue, and write the data message to be transmitted into the idle area of ​​the target cache queue; Querying a preset correspondence relationship to determine the maximum timeout time corresponding to the VLAN priority; the preset correspondence relationship includes a correspondence relationship between multiple groups of VLAN priorities and maximum timeout times; wherein, the higher the VLAN priority, the shorter the corresponding maximum timeout time; All data packets in the target cache queue are aggregated and transmitted according to the maximum timeout time corresponding to the VLAN priority.

2. The method according to claim 1, characterized in that Before aggregating and transmitting all data packets in the target cache queue according to the maximum timeout time corresponding to the VLAN priority, the method further includes: Determine whether the size of the free area in the target cache queue is smaller than a preset data size; The step of aggregating and transmitting all data packets in the target cache queue according to the maximum timeout time corresponding to the VLAN priority includes: If it is determined that the size of the free area in the target cache queue is greater than or equal to the preset data size, the timer corresponding to the target cache queue is monitored until the duration recorded by the timer exceeds the maximum timeout time, and all data packets in the target cache queue are aggregated and transmitted to the vehicle application module.

3. The method according to claim 2, characterized in that The method further comprises: In the process of monitoring the timer corresponding to the target cache queue, before the duration recorded by the timer does not exceed the maximum timeout period, receiving other to-be-transmitted data packets that are allowed to be written into the target cache queue; Writing the other data packets to be transmitted into the target cache queue, and re-determining whether the size of the free area in the target cache queue is smaller than the preset data size; If it is determined that after writing the other data packets to be transmitted, the size of the free area of ​​the target cache queue is greater than or equal to the preset data size, then when the next data packet to be transmitted that is allowed to be written into the target cache queue is received, the next data packet to be transmitted will be written into the target cache queue.

4. The method according to claim 2, characterized in that: The method further comprises: If it is determined that the size of the free area in the target cache queue is smaller than the preset data size, all data messages in the target cache queue are aggregated and transmitted to the vehicle-mounted application module.

5. The method according to claim 2, characterized in that: The monitoring of the timer corresponding to the target cache queue until the duration recorded by the timer exceeds the maximum timeout time and before aggregating and transmitting all data packets in the target cache queue to the vehicle application module also includes: Determining whether the target cache queue is empty before the data message to be transmitted is written; If so, start the timer of the target cache queue to start timing.

6. The method according to claim 1, characterized in that Before determining that the cache queue whose free area size is not less than the data size is the target cache queue, the method further includes: Parsing the field carrying the VLAN tag in the data message to be transmitted, and obtaining the VLAN identifier of the VLAN to which the data message to be transmitted belongs according to the identifier field in the field carrying the VLAN tag; The step of determining that the cache queue whose free area size satisfies the data size is the target cache queue includes: According to the VLAN ID, query multiple cache queues corresponding to the VLAN priority, and determine the cache queue consistent with the VLAN ID as a candidate cache queue; A candidate cache queue whose free area size satisfies the data size is determined as the target cache queue.

7. The method according to claim 1, characterized in that The step of parsing the data message to be transmitted to obtain the data size and VLAN priority of the data message to be transmitted includes: The field carrying the VLAN tag in the data message to be transmitted is parsed, and the VLAN priority corresponding to the data message to be transmitted is obtained according to the VLAN priority field in the field carrying the VLAN tag.

8. The method according to claim 1, characterized in that: Parsing the data message to be transmitted to obtain the VLAN priority of the data message to be transmitted includes: The data message to be transmitted is parsed to obtain a source media access control MAC address, and a preset MAC address and VLAN priority correspondence table is queried according to the source MAC address to obtain the VLAN priority corresponding to the data message to be transmitted.

9. A data transmission control device for vehicle-mounted Ethernet, characterized in that: include: A data message acquisition module is used to acquire data messages to be transmitted in the vehicle Ethernet; and parsing the data message to be transmitted to obtain the data size and virtual local area network VLAN priority of the data message to be transmitted; A processing module, configured to determine a cache queue whose idle area is not smaller than the data size as a target cache queue, and write the to-be-transmitted data message into the idle area of ​​the target cache queue; And, querying a preset correspondence relationship to determine the maximum timeout time corresponding to the VLAN priority; the preset correspondence relationship includes a correspondence relationship between multiple groups of VLAN priorities and maximum timeout times; wherein, the higher the VLAN priority, the shorter the corresponding maximum timeout time; The transmission module is used to aggregate and transmit all data packets in the target cache queue according to the maximum timeout time corresponding to the VLAN priority.

10. A vehicle-mounted terminal, comprising: Memory and processor; The memory is configured to store computer program instructions; The processor is configured to execute the computer program instructions so that the vehicle-mounted terminal implements the data transmission control method of the vehicle-mounted Ethernet according to any one of claims 1 to 8.

11. A readable storage medium, characterized in that: include: Computer program instructions; The vehicle-mounted terminal executes the computer program instructions so that the vehicle-mounted terminal implements the data transmission control method of the vehicle-mounted Ethernet as described in any one of claims 1 to 8.

12. A vehicle, characterized in that: Include one or more of the following: The data transmission control device of the in-vehicle Ethernet as claimed in claim 9; The vehicle-mounted terminal as claimed in claim 10; The readable storage medium as claimed in claim 11.