Vehicle gateway control method and device, gateway, vehicle, medium and product

By controlling message data processing based on the cache space and communication link data of the vehicle gateway, the problem of reduced vehicle gateway processing efficiency and cache overflow is solved, and more efficient message data processing and more stable vehicle network performance are achieved.

CN119814873APending Publication Date: 2025-04-11BYD CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411780283.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-05
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

As the number of nodes in the vehicle network increases, the load and efficiency of the message data processing of the vehicle gateway decreases, resulting in cache space overflow and message data loss, and processing delays increase, affecting the performance and service quality of the vehicle network.

Method used

By controlling the message data processing of the cache space of the vehicle gateway according to the cache space and communication link data of the vehicle gateway, the message data processing of the cache space includes determining the saturation time and waiting time, and reasonably arranging the message data processing to avoid cache overflow and delay.

Benefits of technology

It effectively avoids cache space overflow and packet data loss, reduces the delay in message data processing by vehicle gateways, improves message data processing efficiency in vehicle networks, and ensures the performance and service quality of the vehicle network.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119814873A_ABST
    Figure CN119814873A_ABST
Patent Text Reader

Abstract

The invention discloses a vehicle gateway control method, an electronic device, a vehicle gateway, a vehicle, a computer readable storage medium and a computer program product, and the control method comprises the steps: controlling the vehicle gateway to process message data of a cache space according to the cache space of the vehicle gateway and communication link data. Thus, according to the cache space of the vehicle gateway and the communication link data, the vehicle gateway can be controlled to process the message data in the cache space, so that the situation that the message data is lost due to overflow of the cache space can be avoided to a certain extent, and the user experience is improved. And the processing delay of the vehicle gateway to the message data can be reduced to a certain extent, the message data processing efficiency in the vehicle network is improved, and the performance and service quality of the vehicle network are guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of gateway technology, and in particular to a control method for a vehicle gateway, an electronic device, a vehicle gateway, a vehicle, a computer-readable storage medium, and a computer program product. Background Art

[0002] With the development of vehicle intelligence and networking, a large number of cameras, millimeter-wave radars, lidars, audio and video nodes have appeared in the vehicle network to assist the operation of ADAS (Advanced Driving Assistance System) and in-vehicle entertainment systems. However, as the number of nodes in the vehicle network increases, the message data processing load and processing efficiency of the vehicle gateway are reduced. Summary of the invention

[0003] The present application provides a control method for a vehicle gateway, an electronic device, a vehicle gateway, a vehicle, a computer-readable storage medium, and a computer program product.

[0004] The present application provides a method for controlling a vehicle gateway, including:

[0005] According to the cache space and communication link data of the vehicle gateway, the vehicle gateway is controlled to process the message data in the cache space.

[0006] In this way, in the implementation mode of the present application, the vehicle gateway can be controlled to process the message data in the cache space according to the cache space of the vehicle gateway and the communication link data, thereby avoiding the overflow of the cache space to a certain extent, thereby causing the loss of message data, and reducing the processing delay of the vehicle gateway for the message data to a certain extent, the message data processing efficiency in the vehicle network can be improved, and the performance and service quality of the vehicle network can be guaranteed.

[0007] In certain embodiments of the present application, controlling the vehicle gateway to process message data in the cache space according to the cache space and communication link data of the vehicle gateway includes:

[0008] Determining a saturation time of the vehicle gateway according to the cache space and the communication link data;

[0009] The vehicle gateway is controlled to process the message data in the cache space according to the saturation time and the waiting time, wherein the waiting time is used to indicate the time since the last time the vehicle gateway processed the message data in the cache space.

[0010] In this way, in the implementation mode of the present application, the saturation time of the vehicle gateway can be determined according to the cache space and the communication link data, and the vehicle gateway can be controlled to process the message data in the cache space according to the saturation time and the waiting time, so that the vehicle gateway can be controlled to process the message data in the cache space by time, which ensures the stable operation of the vehicle gateway to a certain extent and can effectively avoid the overflow of message data in the cache space.

[0011] In certain embodiments of the present application, determining the saturation time of the vehicle gateway according to the cache space and the communication link data includes:

[0012] Determining the communication link data according to the communication link type and the number of communication links of the vehicle gateway;

[0013] The saturation time is determined according to the cache space and the communication link data.

[0014] In this way, in the implementation mode of the present application, the communication link data can be determined according to the communication link type and the number of communication links of the vehicle gateway, and the saturation time can be determined according to the cache space and the communication link data, so that the saturation time can be related to the communication link of the vehicle gateway, and then matched with the vehicle gateway to a certain extent, thereby ensuring the effectiveness and reliability of the saturation time.

[0015] In certain embodiments of the present application, determining the communication link data according to the communication link type and the number of communication links of the vehicle gateway includes:

[0016] Determine, according to the communication link type, the maximum number of transmission messages corresponding to the communication link type;

[0017] The communication link data is determined according to the maximum number of transmission messages and the number of communication links.

[0018] In this way, in the implementation mode of the present application, the maximum number of transmission messages corresponding to the communication link type can be determined according to the communication link type, and the communication link data can be determined according to the maximum number of transmission messages and the number of communication links, so that the communication link data can reliably reflect the ability of the vehicle gateway to receive message data, thereby ensuring the validity of the communication link data, and the reliability of the saturation time determined by the communication link data can also be improved.

[0019] In certain embodiments of the present application, determining, according to the communication link type, the maximum number of transmission messages corresponding to the communication link type includes:

[0020] Determining, according to the communication link type, a communication link bandwidth and a target message corresponding to the communication link type;

[0021] The maximum number of transmission messages is determined according to the communication link bandwidth and the target message.

[0022] Thus, in the implementation mode of the present application, the communication link bandwidth and target message corresponding to the communication link type can be determined according to the communication link type, and the maximum number of transmitted messages corresponding to the communication link type can be determined according to the communication link bandwidth and the target message, so that the ability of the gateway communication link to receive message data can be described by the maximum transmission number, and then the communication link data can be determined by the maximum transmission number, so that the communication link data can more accurately reflect the ability of the vehicle gateway to receive message data, so that the reliability of the communication link data can be further improved, and the reliability of the saturation time determined by the communication link data can also be further improved.

[0023] In certain embodiments of the present application, the number of communication links includes the number of communication link sub-numbers corresponding to each type of the communication link, and the determining the communication link data according to the maximum number of transmission messages and the number of communication links includes:

[0024] The communication link data is determined according to the number of communication link sub-units corresponding to each type of the communication link and the maximum number of transmission messages corresponding to the type of the communication link.

[0025] Thus, in the implementation mode of the present application, the communication link data can be determined according to the number of communication link sub-groups corresponding to each communication link type and the maximum number of transmission messages corresponding to the communication link type, so that the communication link data can accurately reflect the message data receiving capacity of each communication link of the vehicle gateway, and the reliability of the communication link data can be further improved, and the reliability of the saturation time determined by the communication link data can also be further improved.

[0026] In certain embodiments of the present application, controlling the vehicle gateway to process the message data in the cache space according to the saturation time and the waiting time includes:

[0027] When the waiting time is greater than or equal to the saturation time, the vehicle gateway is controlled to process the message data in the cache space and the waiting time is set to zero.

[0028] In this way, in the implementation mode of the present application, the vehicle gateway can be controlled to process the message data in the cache space when the waiting time is greater than or equal to the saturation time, and the waiting time can be set to zero, so that the next round of message data processing can be performed with the waiting time set to zero, thereby ensuring the stable progress of the message data processing to a certain extent.

[0029] In certain embodiments of the present application, when the waiting time is greater than or equal to the saturation time, controlling the vehicle gateway to process the message data in the cache space and setting the waiting time to zero includes:

[0030] When the waiting time is greater than or equal to the saturation time, interrupting the execution of the current task by the vehicle gateway;

[0031] Controlling the vehicle gateway to process the message data in the cache space;

[0032] When the processing is completed, the vehicle gateway resumes execution of the current task and sets the waiting time to zero.

[0033] Thus, in the implementation mode of the present application, when the waiting time is greater than or equal to the saturation time, the vehicle gateway is interrupted from executing the current task, and the vehicle gateway is controlled to process the message data in the cache space, and when the processing is completed, the vehicle gateway is restored from executing the current task and the waiting time is set to zero, so that the vehicle gateway can process each message data in the cache space based on the interrupt mechanism, thereby ensuring the robustness of the vehicle gateway in processing message data and further reducing the risk of cache overflow.

[0034] In certain embodiments of the present application, controlling the vehicle gateway to process the message data in the cache space according to the saturation time and the waiting time includes:

[0035] When the waiting time is less than the saturation time, the waiting time continues to be accumulated.

[0036] Thus, in the implementation mode of the present application, the waiting time can be continuously accumulated when the waiting time is less than the saturation time, so that the waiting time gradually approaches the saturation time, thereby ensuring the effectiveness of controlling the vehicle gateway through the waiting time and the saturation time.

[0037] In certain embodiments of the present application, controlling the vehicle gateway to process message data in the cache space according to the cache space and communication link data of the vehicle gateway includes:

[0038] According to the cache space and the communication link data, the vehicle gateway is controlled to forward the message data in the cache space so as to forward the message data to a corresponding receiving object.

[0039] In this way, in the implementation mode of the present application, the waiting time vehicle gateway can be controlled to forward the message data in the waiting time cache space according to the waiting time cache space and the waiting time communication link data, so as to forward the message data in the cache space to the corresponding receiving objects respectively, thereby realizing the effective processing of the message data in the cache space to a certain extent.

[0040] In certain embodiments of the present application, the vehicle gateway stores the message data in the cache space when acquiring the message data.

[0041] An embodiment of the present application provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and when the computer program is executed by the processor, the above-mentioned vehicle gateway control method is implemented.

[0042] An embodiment of the present application provides a vehicle gateway, comprising the above-mentioned electronic device.

[0043] An embodiment of the present application provides a vehicle, including the above-mentioned electronic device, or including the above-mentioned vehicle gateway.

[0044] An embodiment of the present application provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by one or more processors, the above-mentioned vehicle gateway control method is implemented.

[0045] An embodiment of the present application provides a computer program product, including a computer program / instruction, which implements the above-mentioned vehicle gateway control method when executed by a processor.

[0046] The electronic device, vehicle gateway, vehicle, computer-readable storage medium, and computer program product provided in the embodiments of the present application can control the vehicle gateway to process the message data in the cache space according to the cache space and communication link data of the vehicle gateway, thereby avoiding cache space overflow to a certain extent, thereby causing message data loss, and can reduce the processing delay of the vehicle gateway for message data to a certain extent, thereby improving the message data processing efficiency in the vehicle network, and ensuring the performance and service quality of the vehicle network.

[0047] Additional aspects and advantages of the embodiments of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the embodiments of the present application. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:

[0049] Figure 1 A flowchart of a method for controlling a vehicle gateway in certain embodiments of the present application;

[0050] Figure 2 A flowchart of a method for controlling a vehicle gateway in certain embodiments of the present application;

[0051] Figure 3 A flowchart of a method for controlling a vehicle gateway in certain embodiments of the present application;

[0052] Figure 4 A flowchart of a method for controlling a vehicle gateway in certain embodiments of the present application;

[0053] Figure 5 A flowchart of a method for controlling a vehicle gateway in certain embodiments of the present application;

[0054] Figure 6 A flowchart of a method for controlling a vehicle gateway in certain embodiments of the present application;

[0055] Figure 7 A flowchart of a method for controlling a vehicle gateway in certain embodiments of the present application;

[0056] Figure 8 A schematic diagram of a vehicle gateway in certain embodiments of the present application;

[0057] Fig. 9 A schematic diagram of an application scenario in certain embodiments of the present application. DETAILED DESCRIPTION

[0058] The embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals represent the same or similar elements or elements having the same or similar functions from beginning to end. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the embodiments of the present application, and cannot be understood as limiting the embodiments of the present application.

[0059] In the related art, the vehicle network system is a highly complex network system. At the same time, due to the bandwidth bottleneck of a single CAN (Controller Area Network), there are often multiple CAN segments in the vehicle network system, such as cockpit CAN segment, intelligent assisted driving CAN segment, chassis and body CAN segment, etc., so that different vehicle domains (such as cockpit domain, intelligent assisted driving domain, chassis and body domain, etc.) can be connected to different CAN segments to achieve intra-domain communication.

[0060] It is understandable that there may be a large amount of data exchange needs between different domains connected to different network segments. Therefore, for inter-domain communication, related technologies usually implement cross-segment data forwarding based on gateways, that is, forwarding message data from different CAN network segments through the domain control gateways of each domain.

[0061] In the related art, the domain control gateway adopts the following process to forward the data message of the CAN bus: (1) Receive the message data. (2) Store the message data in the cache area of ​​the domain control gateway chip. (3) At a certain period T, the gateway CPU traverses the cache area to retrieve the message. (4) The gateway CPU continuously processes each message data and forwards it; (5) Clear the cache area space.

[0062] However, with the development of vehicle intelligence and networking, and to assist the operation of ADAS (Advanced Driving Assistance System) and on-board entertainment functions, a large number of cameras, millimeter-wave radars, lidars, audio and video nodes have appeared in the vehicle network, which has led to a surge in the number and types of tasks of the domain control gateway, and the gateway CPU (Central Processing Unit) and cache loads have become increasingly heavy. Correspondingly, according to actual vehicle network monitoring data, the average load of the CAN bus and the domain control gateway CPU is generally close to saturation.

[0063] Furthermore, due to the surge in the number of tasks and types of tasks, as well as the increasing load on the gateway CPU and cache, the domain control gateway has two negative impacts. First, the amount of data that the gateway needs to forward has increased significantly, increasing the pressure on the gateway cache. Second, the gateway can no longer guarantee a stable cycle when processing cache tasks, and may experience delays that are dozens of times greater than the cycle T.

[0064] Furthermore, due to the emergence of the above two negative effects, the risk of gateway cache overflow and frame loss is getting higher and higher, but the data in the vehicle network is usually directly related to the power, steering, safety and other functions of the vehicle during driving. Once frame loss occurs, it may directly affect the vehicle driving and even cause traffic accidents.

[0065] To avoid frame loss, one solution in the related art is to increase the size of the cache space. However, since the cycle delay of the gateway CPU may have no upper limit, simply increasing the cache space cannot completely guarantee that frame loss will not occur. At the same time, the cache of the automotive CAN bus domain control gateway chip is a highly limited resource, and the cache space cannot be increased indefinitely. In addition, an overly large gateway cache will occupy RAM space and affect the performance of the CPU, while increasing the RAM space will bring higher costs. In addition, in the related art, in order to prevent the automotive gateway from cache overflow and frame loss, the automotive gateway has adopted a cache space redundancy that is far greater than that required for the normal cycle. In other words, there is a large waste of resources.

[0066] Other mainstream solutions to buffer overflow frame loss in related technologies include buffer overflow frame loss solution based on buffer queue length management technology, buffer overflow frame loss solution based on random early detection technology, etc. These solutions are to appropriately discard some old message data to accommodate new message data when the buffer is full. It can be understood that these solutions still have buffer overflow frame loss, and these solutions are mainly applicable to audio and video streams. However, for the in-vehicle network environment, the consequences of data loss may be extremely serious, and the above method of discarding old data to avoid overflow is not suitable.

[0067] Based on the above problems you may encounter, please refer to Figure 1 , the embodiment of the present application provides a control method for a vehicle gateway, including:

[0068] 01: According to the cache space of the vehicle gateway and the communication link data, control the vehicle gateway to process the message data in the cache space.

[0069] The embodiment of the present application also provides an electronic device, which includes a memory and a processor. The control method of the vehicle gateway of the embodiment of the present application can be implemented by the electronic device of the embodiment of the present application. Specifically, a computer program is stored in the memory, and the processor is used to control the vehicle gateway to process the message data in the cache space according to the cache space of the vehicle gateway and the communication link data.

[0070] Specifically, in order to prevent the vehicle gateway from cache overflow and frame loss, and to save the cost caused by redundant gateway cache space, in the implementation mode of the present application, the vehicle (or the control device in the vehicle, or the electronic device in the vehicle) can determine whether the message data in the cache space will overflow based on the cache space of the vehicle gateway and the communication link data, thereby controlling the vehicle gateway to process the message data in the cache space.

[0071] In one example, the vehicle gateway stores the message data in a cache space when the message data is acquired.

[0072] Furthermore, when the communication link data is used to indicate the number of message data received by the vehicle gateway per unit time, the time T1 occupied by the current remaining capacity of the cache space by the message data received in real time can be determined based on the current remaining capacity of the cache space and the communication link data. Then, the vehicle gateway can start timing from the current moment until a time less than or equal to T1 is reached, and then process one or more message data in the cache space.

[0073] Furthermore, when the communication link data is used to indicate the amount of message data received by the vehicle gateway per unit time, the time T2 required for the cache space to be loaded from empty to full with message data can be determined based on the maximum remaining capacity of the cache space and the communication link data. Then, the vehicle gateway can start timing from the current moment until a time less than or equal to T2 is reached, and then process all the message data in the cache space.

[0074] In addition, it is understandable that the number of message data received by the vehicle gateway at different time points during actual operation is not a constant, or in other words, the number of message data received by the vehicle gateway at different time points is different. Therefore, when the above T1 and T2 are determined by the communication link data, if the communication link data is predetermined and used to reflect the "minimum number of message data received by the vehicle gateway per unit time", then the above T1 and T2 determined by the communication link data can be understood as the remaining time of cache full load (or cache overflow remaining time) without redundancy. Then, the vehicle gateway starts timing from the current moment, and can process one or more message data in the cache space when the timing reaches a time less than or equal to T1 (or T2), thereby avoiding cache overflow.

[0075] In contrast, if the communication link data is predetermined and used to reflect the "maximum number of message data received by the vehicle gateway within a unit time", then the above T1 and T2 determined by the communication link data can be understood as redundant cache full load remaining time (or cache overflow remaining time). Furthermore, the vehicle gateway starts timing from the current moment and can process one or more message data in the cache space when the timing reaches a time greater than or equal to T1 (or T2), thereby avoiding cache overflow.

[0076] In addition, it can also be understood that the communication link data can also reflect the average of the "maximum number" and "minimum number" of message data received by the vehicle gateway in a unit time, or other statistical values ​​or characteristic values, which can be set according to actual conditions.

[0077] In addition, in order to avoid confusion and clearly illustrate the implementation methods of the present application, the definition of "the 'maximum number' of message data received by the vehicle gateway within a unit time" will be used as an example to illustrate the communication link data and its related contents.

[0078] In this way, in the implementation mode of the present application, the vehicle gateway can be controlled to process the message data in the cache space according to the cache space of the vehicle gateway and the communication link data, thereby avoiding the overflow of the cache space to a certain extent, thereby causing the loss of message data, and can reduce the processing delay of the vehicle gateway for the message data to a certain extent, the message data processing efficiency in the vehicle network can be improved, and the performance and service quality of the vehicle network can be guaranteed.

[0079] In one example, the vehicle gateway is the above-mentioned domain control gateway, that is, a gateway device that can forward message data between two different vehicle domains (such as a cockpit domain, an intelligent assisted driving domain, a chassis and body domain, etc.) in the vehicle.

[0080] In one example, the message data includes at least one of a CAN message constructed based on the CAN (Controller Area Network) protocol, a CAN-FD message constructed based on the CAN-FD (Controller Area Network with Flexible Data-Rate) protocol, an Ethernet message constructed based on the Ethernet protocol, etc. In other words, in the implementation of the present application, the vehicle gateway may be responsible for at least one of the CAN messages, CAN-FD messages, Ethernet messages, etc.

[0081] See also Figure 2 In certain embodiments of the present application, step 01 includes:

[0082] 010: Determine the saturation time of the vehicle gateway based on the cache space and communication link data;

[0083] 011: Control the vehicle gateway to process the message data in the cache space according to the saturation time and the waiting time, wherein the waiting time is used to indicate the time since the last time the vehicle gateway processed the message data in the cache space.

[0084] The processor of the implementation mode of the present application is also used to determine the saturation time of the vehicle gateway based on the cache space and the communication link data, and to control the vehicle gateway to process the message data in the cache space based on the saturation time and the waiting time, and the waiting time is used to indicate the time since the last time the vehicle gateway processed the message data in the cache space.

[0085] Specifically, in the implementation mode of the present application, the vehicle gateway can first determine the saturation time of the vehicle gateway through the cache space and the communication link data, that is, the time value required for the cache space to be fully loaded with message data. Then, the vehicle gateway can determine the waiting time by accumulating timing, starting the timing every time the vehicle gateway completes the processing of the message data in the cache space, so as to control the vehicle gateway to process the message data in the cache space through the waiting time and the saturation time.

[0086] For example, when the communication link data is used to indicate the number N of message data received by the vehicle gateway per unit time, the shortest time T3 (i.e., saturation time) occupied by the current remaining capacity C1 of the cache space received in real time can be determined based on the remaining capacity C1 of the cache space at the current time t0 and N indicated by the communication link data, i.e., T3=C1 / (N*B), where B is the size of the message data.

[0087] Furthermore, the vehicle gateway can start timing from t0 to obtain Tw (i.e., waiting time), and when Tw is greater than or equal to T3, process M (M≤C1 / B) message data in the cache space, and restart the timing of Tw at time t1 when the vehicle completes the processing of these M message data, and recalculate T3 based on N and the remaining capacity C1 of the cache space at time t1, and execute the next round of message data processing based on the new T3 and the re-timed Tw, and repeat this process.

[0088] For example, when the communication link data is used to indicate the number N of message data received by the vehicle gateway per unit time, the shortest time T4 (i.e., saturation time) required for the cache space to be loaded from empty to full with message data can be determined based on the maximum remaining capacity Cmax of the cache space and N indicated by the communication link data, i.e., T4=Cmax / (N*B), where B is the size of the message data.

[0089] At time t2 when the cache space is empty, the vehicle gateway can start timing from t2 to obtain Tw (i.e., waiting time), and when Tw is greater than or equal to T4, process all message data in the cache space, and at time t3 when the vehicle completes the processing of all message data in the cache space, restart the timing of Tw, and perform the next round of message data processing based on T4 and the re-timed Tw, and repeat this process.

[0090] In this way, in the implementation mode of the present application, the saturation time of the vehicle gateway can be determined according to the cache space and the communication link data, and the vehicle gateway can be controlled to process the message data in the cache space according to the saturation time and the waiting time, so that the vehicle gateway can be controlled to process the message data in the cache space by time, which ensures the stable operation of the vehicle gateway to a certain extent and can effectively avoid the overflow of message data in the cache space.

[0091] In one example, the size of T4 is 3 ms (milliseconds).

[0092] In an example, the value range of T4 is [3,8], and the unit is ms (milliseconds), such as 3ms, 4ms, 5ms, 6ms, 7ms and 8ms.

[0093] See also Figure 3 In some implementations of the present application, step 010 includes:

[0094] 0100: Determine the communication link data according to the communication link type and the number of communication links of the vehicle gateway;

[0095] 0101: Determine the saturation time based on the cache space and communication link data.

[0096] The processor of the embodiment of the present application is also used to determine the communication link data according to the communication link type and the number of communication links of the vehicle gateway, and determine the saturation time according to the cache space and the communication link data.

[0097] Specifically, in the implementation mode of the present application, the vehicle gateway can determine the number of message data that the vehicle gateway can receive per unit time, that is, the communication link data, according to the type of each communication link supported by the vehicle gateway and the number of each communication link supported by the vehicle gateway. Then, the vehicle gateway can determine the time required for the cache space to meet the message data, that is, the saturation time, according to the size of the cache space and the communication link data.

[0098] It is understandable that for two communication links of different types, the sizes of message data that can be transmitted by the two communication links may be different, and the data transmission rates (i.e., bandwidths) of the two communication links may also be different. Therefore, the amount of message data that can be transmitted per unit time by different types of communication links may be different.

[0099] It can also be understood that the more communication links the vehicle gateway uses, the more message data the vehicle gateway can receive per unit time.

[0100] In this way, in the implementation mode of the present application, the communication link data can be determined according to the communication link type and the number of communication links of the vehicle gateway, and the saturation time can be determined according to the cache space and the communication link data, so that the saturation time can be related to the communication link of the vehicle gateway, and then matched with the vehicle gateway to a certain extent, thereby ensuring the effectiveness and reliability of the saturation time.

[0101] See also Figure 4 In some embodiments of the present application, step 0100 includes:

[0102] 01000: Determine the maximum number of transmission messages corresponding to the communication link type according to the communication link type;

[0103] 01001: Determine the communication link data based on the maximum number of transmission messages and the number of communication links.

[0104] The processor of the embodiment of the present application is also used to determine the maximum number of transmission messages corresponding to the communication link type according to the communication link type, and to determine the communication link data according to the maximum number of transmission messages and the number of communication links.

[0105] Specifically, in the implementation mode of the present application, the vehicle gateway can determine the maximum number of messages transmitted by the gateway communication link per unit time, that is, the maximum number of transmitted messages, based on the type of each communication link supported by the vehicle gateway. Then, based on the number of each communication link supported by the vehicle gateway and the maximum number of messages transmitted by each communication link per unit time, the maximum number of message data received by the vehicle gateway per unit time, that is, the communication link data, is determined.

[0106] In one example, the vehicle gateway may determine the maximum number of transmission messages corresponding to the communication links it supports based on a pre-calibrated maximum number of transmission messages corresponding to each type of communication link.

[0107] In this way, in the implementation mode of the present application, the maximum number of transmission messages corresponding to the communication link type can be determined according to the communication link type, and the communication link data can be determined according to the maximum number of transmission messages and the number of communication links, so that the communication link data can reliably reflect the ability of the vehicle gateway to receive message data, thereby ensuring the validity of the communication link data, and the reliability of the saturation time determined by the communication link data can also be improved.

[0108] See also Figure 5 In some embodiments of the present application, step 01000 includes:

[0109] 010000: Determine the communication link bandwidth and target message corresponding to the communication link type according to the communication link type;

[0110] 010001: Determine the maximum number of transmission messages based on the communication link bandwidth and target message.

[0111] The processor of the embodiment of the present application is also used to determine the communication link bandwidth and target message corresponding to the communication link type according to the communication link type, and to determine the maximum number of transmission messages according to the communication link bandwidth and the target message.

[0112] Specifically, in the implementation mode of the present application, the vehicle network can determine the bandwidth of each communication link and the messages supported for transmission, that is, the communication link bandwidth and the target message, according to the type of each communication link supported by itself. Then, the vehicle gateway can determine the maximum number of messages that can be transmitted per unit time for each communication link according to the bandwidth of each communication link and the data volume of the messages supported for transmission by each communication link.

[0113] For example, assume that the vehicle gateway can connect to four types of CAN buses, namely, a CAN bus with a bandwidth of 250Kbps, a CAN bus with a bandwidth of 500Kbps, a CAN-FD bus with a bandwidth of 1000Kbps, and a CAN-FD bus with a bandwidth of 2000Kbps. Let the bandwidth rates of these four CAN buses be R 1 , R 2 , R 3 and R 4 , and the number of each CAN bus connected to the vehicle gateway is N 1 、N 2 、N 3 and N 4 And, the size of the CAN bus message (target message) in the vehicle network is usually 8 bytes, that is, 64 bits. Therefore, for the above four types of CAN buses, the number of message data that can be transmitted per unit time by the i-th CAN bus is i It can be expressed by the following formula:

[0114]

[0115] In the formula, λ i represents the number of message transmissions of the i-th CAN bus, R i Represents the bandwidth rate of the i-th CAN bus.

[0116] In addition, it can be understood that when transmitting messages based on different communication protocols, it is usually necessary to add additional data to the header and tail of the message, that is, the header, tail and other data. Therefore, in addition to considering the amount of data of the message to be transmitted, the additional overhead when transmitting messages under different communication protocols can also be considered. Therefore, in one example, the number of messages to be transmitted λ i The above formula can be transformed into the following form:

[0117]

[0118] In the formula, e iIt represents the CAN protocol reimbursement of the i-th CAN bus, that is, when the message data is transmitted using the CAN protocol supported by the i-th CAN bus, the total size of the header data (i.e., header) and the tail data (i.e., message) encapsulated for the message data. It can be understood that e i Determined according to the communication protocol.

[0119] It can be understood that the header data (ie, the header) can indicate the recipient of the message data, the segment number of the message data, etc.

[0120] It can also be understood that the tail data is usually used to transmit message data in a fixed size during transmission. For example, when transmitting 64 bits of message data, the 64 bits are encapsulated with frame header data to determine the recipient of the message data, and then the tail data is encapsulated so that the size of the overall data consisting of the message data, frame header data and tail data is 128 bits.

[0121] Thus, in the implementation mode of the present application, the communication link bandwidth and target message corresponding to the communication link type can be determined according to the communication link type, and the maximum number of transmitted messages corresponding to the communication link type can be determined according to the communication link bandwidth and the target message, so that the ability of the gateway communication link to receive message data can be described by the maximum transmission number, and then the communication link data can be determined by the maximum transmission number, so that the communication link data can more accurately reflect the ability of the vehicle gateway to receive message data, so that the reliability of the communication link data can be further improved, and the reliability of the saturation time determined by the communication link data can also be further improved.

[0122] To a certain extent, the reliability and effectiveness of the maximum number of transmitted messages are guaranteed.

[0123] In some embodiments of the present application, the number of communication links includes the number of communication link sub-numbers corresponding to each communication link type, and step 01001 includes:

[0124] The communication link data is determined according to the number of communication link sub-units corresponding to each communication link type and the maximum number of transmission messages corresponding to the communication link type.

[0125] The processor of the embodiment of the present application is also used to determine the communication link data according to the number of communication link sub-units corresponding to each communication link type and the maximum number of transmission messages corresponding to the communication link type.

[0126] Specifically, in the implementation mode of the present application, the vehicle gateway can determine the maximum number of message data received by the vehicle gateway per unit time, that is, the communication link data, based on the maximum value of the message data that can be transmitted per unit time by each communication link supported by the vehicle gateway (that is, the maximum number of transmitted messages) and the number of each communication link supported by the vehicle gateway (that is, the number of communication link sub-links), and then determine the above-mentioned saturation time through the size of the communication link data and the cache space.

[0127] Thus, in the implementation mode of the present application, the communication link data can be determined according to the number of communication link sub-groups corresponding to each communication link type and the maximum number of transmission messages corresponding to the communication link type, so that the communication link data can accurately reflect the message data receiving capacity of each communication link of the vehicle gateway, and the reliability of the communication link data can be further improved, and the reliability of the saturation time determined by the communication link data can also be further improved.

[0128] To more clearly illustrate the process of determining the saturation time in the implementation manner of the present application, please refer to the following example, namely:

[0129] First, let the total number of CAN buses connected to a vehicle gateway be M. The gateway can connect to four types of CAN buses, namely, CAN bus with a bandwidth of 250Kbps, CAN bus with a bandwidth of 500Kbps, CAN-FD bus with a bandwidth of 1000Kbps, and CAN-FD bus with a bandwidth of 2000Kbps. Let the bandwidth rates of these four CAN buses be R 1 , R 2 , R 3 and R 4 , and the number of each CAN bus connected to the vehicle gateway is N 1 、N 2 、N 3 and N 4 , then:

[0130] M=N 1 +N 2 +N 3 +N 4 (1)

[0131] Furthermore, in the related art, the message size of the CAN bus in the vehicle network is usually 8 bytes, that is, 64 bits. For the above four types of CAN buses, the number of message data that can be transmitted per unit time by the i-th CAN bus is λ i It can be expressed by formula (2), namely:

[0132]

[0133] Furthermore, based on the λ calculated by formula (2) i , then the lower limit time value T required for the cache space of the vehicle gateway to overflow from empty can be determined max , T max It can be obtained by formula (2), that is:

[0134]

[0135] In formula (3), K represents the maximum number of message data that can be stored when the cache space is empty, or represents the maximum number of message data that can be stored in the remaining space of the cache space at the current moment.

[0136] Finally, based on T max Determine the saturation time of the vehicle gateway. For example, T max As the saturation time of the vehicle gateway, for example, T max Determine the saturation time as T above max K times, the value range of K is [1,3], that is, the saturation time is T max , 2T max And 3T max One of them.

[0137] It can be understood that the communication link data in the implementation manner of the present application can be understood as

[0138] It can also be understood that based on the mathematical model shown in the above formulas (1)-(3), the embodiment of the present application can calculate the lower limit of the time required for the cache space of the vehicle gateway to overflow from empty, that is, T max Furthermore, it can be understood that the mathematical model shown in the above formulas (1)-(3) is applicable to the lossless competition mechanism of the automotive CAN bus, and T can be obtained by using multiple CAN bus transmission bandwidth upper limits. max , thus ensuring T max effectiveness and reliability.

[0139] See also Figure 6 In some implementations of the present application, step 011 includes:

[0140] 0110: When the waiting time is greater than or equal to the saturation time, the vehicle gateway is controlled to process the message data in the cache space and the waiting time is set to zero.

[0141] The processor of the implementation mode of the present application is also used to control the vehicle gateway to process the message data in the cache space and set the waiting time to zero when the waiting time is greater than or equal to the saturation time.

[0142] Specifically, in an embodiment of the present application, the vehicle gateway may process the message data in the cache space and set the waiting time to zero whenever the waiting time is greater than or equal to the saturation time, so that the next round of message data processing may be performed based on the zeroed waiting time.

[0143] For example, when the communication link data is used to indicate the number N of message data received by the vehicle gateway in a unit time, the shortest time T5 (i.e., saturation time) occupied by the current remaining capacity C2 of the cache space by the message data received in real time can be determined based on the remaining capacity C2 of the cache space at the current time t3 and the N indicated by the communication link data, i.e., T5=C2 / (N*B), where B is the size of the message data. Furthermore, the vehicle gateway can process M (M≤C2 / B) message data in the cache space when Tw is counted from 0 to a value greater than or equal to T5 (i.e., when Tw≥T5), and restart the timing of Tw at the time t4 when the vehicle completes the processing of these M message data, and recalculate T3 based on N and the remaining capacity C1 of the cache space at the time t4, and perform the next round of message data processing with the new T3 and the re-timed Tw, and repeat this process.

[0144] For another example, when the communication link data is used to indicate the number N of message data received by the vehicle gateway in a unit time, the shortest time T6 (i.e., saturation time) required for the cache space to be loaded with message data from empty to full can be determined based on the maximum remaining capacity Cmax of the cache space and the N indicated by the communication link data, i.e., T6 = Cmax / (N*B), where B is the size of the message data. Furthermore, at time t5 when the cache space is empty, the vehicle gateway can start timing from t5 to obtain Tw (i.e., waiting time), and when Tw is timed to a value greater than or equal to T6 (i.e., when Tw ≥ T6), all message data in the cache space are processed, and at time t6 when the vehicle completes the processing of all message data in the cache space, the timing of Tw is restarted, and the next round of message data processing is performed according to T6 and the restarted Tw, and so on.

[0145] In this way, in the implementation mode of the present application, the vehicle gateway can be controlled to process the message data in the cache space when the waiting time is greater than or equal to the saturation time, and the waiting time can be set to zero, so that the next round of message data processing can be performed with the waiting time set to zero, thereby ensuring the stable progress of the message data processing to a certain extent.

[0146] See also Figure 7 In some implementations of the present application, step 0110 includes:

[0147] 01100: When the waiting time is greater than or equal to the saturation time, the vehicle gateway interrupts the execution of the current task;

[0148] 01101: Control the vehicle gateway to process the message data in the cache space;

[0149] 01102: When the processing is completed, the vehicle gateway resumes the execution of the current task and sets the waiting time to zero.

[0150] The processor of the implementation mode of the present application is also used to interrupt the vehicle gateway's execution of the current task when the waiting time is greater than or equal to the saturation time, and control the vehicle gateway to process the message data in the cache space, and when the processing is completed, resume the vehicle gateway's execution of the current task and set the waiting time to zero.

[0151] Specifically, if cache overflow is avoided through simple periodic scheduling, or in other words, cache overflow is avoided by making the vehicle gateway process the message data in the cache once at a certain interval, the task execution of the vehicle gateway may be affected by the processing time of the previous task, resulting in a significant increase in the time for the vehicle gateway to process all the message data in the cache next time, ultimately causing the cache overflow to occur again. Therefore, in the implementation mode of the present application, the message processing task in the cache space can be implemented based on the interrupt mechanism.

[0152] For example, when the target time reaches the saturation time, the vehicle gateway can interrupt the current task when receiving the interrupt instruction. now and set an interruption point.

[0153] Next, the vehicle gateway processes the message data in the cache space, such as traversing one or more messages in the cache space, and forwarding the traversed messages to the corresponding receiving object.

[0154] Finally, when all the traversed messages are forwarded to the corresponding receiving objects, the task Task is continued based on the previously set breakpoint. now , and reset the waiting time to zero to restart the waiting time.

[0155] In one example, the processor in the vehicle gateway may time the waiting time through an internal timer, and generate an interrupt instruction when the waiting time is greater than or equal to the saturation time.

[0156] In one example, a timer corresponding to the vehicle gateway may count the waiting time, and generate an interrupt instruction when the waiting time is greater than or equal to the saturation time, and send the interrupt instruction to the vehicle gateway.

[0157] Thus, in the implementation mode of the present application, when the waiting time is greater than or equal to the saturation time, the vehicle gateway is interrupted from executing the current task, and the vehicle gateway is controlled to process the message data in the cache space, and when the processing is completed, the vehicle gateway is restored from executing the current task and the waiting time is set to zero, so that the vehicle gateway can process each message data in the cache space based on the interrupt mechanism, thereby ensuring the robustness of the vehicle gateway in processing message data and further reducing the risk of cache overflow.

[0158] In some implementations of the present application, step 011 includes:

[0159] When the waiting time is less than the saturation time, the waiting time continues to be accumulated.

[0160] The processor of the embodiment of the present application is also used to continuously accumulate the waiting time when the waiting time is less than the saturation time.

[0161] Specifically, in the implementation manner of the present application, the vehicle gateway may continue to count the waiting time when the waiting time is less than the saturation time.

[0162] For example, when the communication link data is used to indicate the number N of message data received by the vehicle gateway in a unit time, the shortest time T7 (i.e., saturation time) occupied by the current remaining capacity C3 of the cache space received in real time can be determined based on the remaining capacity C3 of the cache space at the current time t7 and the N indicated by the communication link data, i.e., T7 = C3 / (N*B), where B is the size of the message data. Furthermore, the vehicle gateway can continue to execute the timing of T7 when Tw is less than T7 until Tw is greater than or equal to T7.

[0163] Thus, in the implementation mode of the present application, the waiting time can be continuously accumulated when the waiting time is less than the saturation time, so that the waiting time gradually approaches the saturation time, thereby ensuring the effectiveness of controlling the vehicle gateway through the waiting time and the saturation time.

[0164] In certain embodiments of the present application, step 03 includes:

[0165] According to the cache space and the communication link data, the vehicle gateway is controlled to forward the message data in the cache space so as to forward the message data to the corresponding receiving object.

[0166] The processor of the implementation mode of the present application is also used to control the vehicle gateway to forward the message data in the cache space according to the cache space and the communication link data, so as to forward the message data to the corresponding receiving object.

[0167] Specifically, in an embodiment of the present application, the vehicle gateway can forward one or more message data in the exchange to the corresponding receiving object according to the cache space and communication link data, so that one or more message data stored in the cache space are taken out from the cache space, thereby avoiding cache overflow.

[0168] In one example, the receiving object includes a target network segment, such as at least one of a cockpit CAN network segment, an intelligent assisted driving CAN network segment, a chassis and body CAN network segment, etc.

[0169] In one example, the receiving object includes a target vehicle terminal device, such as a camera, a central control display screen, etc.

[0170] In this way, in the implementation mode of the present application, the waiting time vehicle gateway can be controlled to forward the message data in the waiting time cache space according to the waiting time cache space and the waiting time communication link data, so as to forward the message data in the cache space to the corresponding receiving objects respectively, thereby realizing the effective processing of the message data in the cache space to a certain extent.

[0171] See also Figure 8 Corresponding to the control method of the vehicle gateway 200 described above, the embodiment of the present application further provides a vehicle gateway 200, including a processor 210 and a preset device 220, wherein the preset device 220 includes an instruction device 221, a judgement device 222 and a timer 223. It can be understood that the control method of the vehicle gateway provided in the embodiment of the present application can be Figure 7 The vehicle gateway 200 is shown implemented.

[0172] To more clearly illustrate the working principle of the vehicle gateway 200 in the embodiment of the present application, please refer to Fig. 9 , Fig. 9 A schematic diagram of an application scenario in certain embodiments of the present application.

[0173] Specifically, if Fig. 9 As shown in step 31 , when the message data reaches the vehicle gateway, the CPU (ie, the processor 210 ) may store the message data in the cache space.

[0174] like Fig. 9 As shown in step 32 and step 33, the CPU can take at least one message data from the cache space according to the preset interval period T, and forward the read message data to the target network segment. And, if the CPU normally takes at least one message data from the cache space, the CPU can take at least one message data from the cache space again when the next interval period T arrives, and forward the read message data to the target network segment.

[0175] like Fig. 9As shown in step 34, regardless of whether the CPU normally takes at least one message data from the cache space, the timer 223 will continue to record the waiting time, that is, the time interval from the last time the CPU emptied the cache space to the present. At the same time, the judge 222 can determine whether the waiting time has reached T max If not, continue to wait and stay in this step until T = T max If the waiting time reaches T max , then execute step 35.

[0176] It is worth noting that in most cases T< <T max , and the CPU should have executed the cache processing task after the interval period T, so step 35 and subsequent steps can be understood as steps set to take into account the situation that the CPU may be occupied by other tasks and fail to process the cache message according to the normal interval period T.

[0177] like Fig. 9 As shown in step 35, the instruction unit 221 sends a system interrupt instruction to the CPU.

[0178] like Fig. 9 As shown in step 36, after receiving the instruction, the CPU interrupts the execution of the current task and establishes a task interruption point.

[0179] like Fig. 9 As shown in step 37, the CPU traverses the gateway cache and processes the message data. The message is forwarded by the CPU to the target network segment and the gateway cache is cleared. It can be understood that after step 37 is executed, the message data newly arrived at the vehicle gateway can be stored in the gateway cache normally, and will not be affected by the cache overflow and will not cause the cache overflow. These messages can be left to wait for the next CPU to traverse the cache area for processing.

[0180] like Fig. 9 As shown in step 38, the CPU returns to the task interruption point to continue executing the original task, and at the same time, the timer 223 resets the waiting time and starts a new round of waiting time timing.

[0181] The present application also provides a vehicle in an embodiment, comprising the above-mentioned vehicle gateway, or comprising the above-mentioned electronic device, or comprising the above-mentioned control device.

[0182] The embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by one or more processors, the control method of the vehicle gateway is implemented.

[0183] The embodiment of the present application also provides a computer program product, including a computer program / instruction, which implements the control method of the vehicle gateway when executed by a processor.

[0184] In the description of this specification, the descriptions with reference to the terms "specifically", "further", "particularly", "understandably", etc. are intended to mean that the specific features, structures, materials or characteristics described in conjunction with the embodiments or examples are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms are not intended to refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, unless they are contradictory.

[0185] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.

[0186] Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limitations on the present application. Ordinary technicians in this field can change, modify, replace and modify the above embodiments within the scope of the present application.

Claims

1. A control method for a vehicle gateway, characterized in that: include: According to the cache space and communication link data of the vehicle gateway, the vehicle gateway is controlled to process the message data in the cache space.

2. The method according to claim 1, characterized in that The controlling the vehicle gateway to process the message data in the cache space according to the cache space and the communication link data of the vehicle gateway includes: Determining a saturation time of the vehicle gateway according to the cache space and the communication link data; The vehicle gateway is controlled to process the message data in the cache space according to the saturation time and the waiting time, wherein the waiting time is used to indicate the time since the last time the vehicle gateway processed the message data in the cache space.

3. The method according to claim 2, characterized in that The determining, according to the cache space and the communication link data, the saturation time of the vehicle gateway comprises: Determining the communication link data according to the communication link type and the number of communication links of the vehicle gateway; The saturation time is determined according to the cache space and the communication link data.

4. The method according to claim 3, characterized in that The determining the communication link data according to the communication link type and the number of communication links of the vehicle gateway includes: Determine, according to the communication link type, the maximum number of transmission messages corresponding to the communication link type; The communication link data is determined according to the maximum number of transmission messages and the number of communication links.

5. The method according to claim 4, characterized in that The determining, according to the communication link type, a maximum number of transmission messages corresponding to the communication link type includes: Determining, according to the communication link type, a communication link bandwidth and a target message corresponding to the communication link type; The maximum number of transmission messages is determined according to the communication link bandwidth and the target message.

6. The method according to claim 4, characterized in that The number of communication links includes the number of communication link sub-numbers corresponding to each type of the communication link, and the determining the communication link data according to the maximum number of transmission messages and the number of communication links includes: The communication link data is determined according to the number of communication link sub-units corresponding to each type of the communication link and the maximum number of transmission messages corresponding to the type of the communication link.

7. The method according to claim 2, characterized in that The controlling the vehicle gateway to process the message data in the cache space according to the saturation time and the waiting time includes: When the waiting time is greater than or equal to the saturation time, the vehicle gateway is controlled to process the message data in the cache space and the waiting time is set to zero.

8. The method according to claim 7, characterized in that When the waiting time is greater than or equal to the saturation time, controlling the vehicle gateway to process the message data in the cache space and setting the waiting time to zero includes: When the waiting time is greater than or equal to the saturation time, interrupting the execution of the current task by the vehicle gateway; Controlling the vehicle gateway to process the message data in the cache space; When the processing is completed, the vehicle gateway resumes execution of the current task and sets the waiting time to zero.

9. The method according to claim 2, characterized in that: The controlling the vehicle gateway to process the message data in the cache space according to the saturation time and the waiting time includes: When the waiting time is less than the saturation time, the waiting time continues to be accumulated.

10. The method according to any one of claims 1 to 9, characterized in that: The controlling the vehicle gateway to process the message data in the cache space according to the cache space and the communication link data of the vehicle gateway includes: According to the cache space and the communication link data, the vehicle gateway is controlled to forward the message data in the cache space so as to forward the message data to a corresponding receiving object.

11. The method according to any one of claims 1 to 9, characterized in that: The vehicle gateway stores the message data in the cache space when acquiring the message data.

12. An electronic device, characterized in that: The method comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the method according to any one of claims 1 to 11 is implemented.

13. A vehicle gateway, characterized in that: The electronic device comprises the electronic device as claimed in claim 12.

14. A vehicle, characterized in that: Includes the electronic device as claimed in claim 12, or includes the vehicle gateway as claimed in claim 13.

15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by one or more processors, the method according to any one of claims 1 to 11 is implemented.

16. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the method according to any one of claims 1 to 11 is implemented.