Queue depth adjusting method and device, storage medium and electronic device

By dynamically adjusting the queue depth of the vehicle gateway, combined with period and delay parameters, the signal forwarding delay and frame loss problems caused by fixed queue depth are solved, improving the real-time performance and reliability of vehicle signal interaction.

CN121728044APending Publication Date: 2026-03-24SAIC MOTOR
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-24
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

In existing technologies, improper setting of the fixed queue depth of vehicle gateways frequently leads to signal forwarding delays or frame drops, and there is a lack of effective solutions.

Method used

By determining the periodic and delay parameters of the forwarding queue, the queue depth is dynamically adjusted. Combined with the delay of the function and the signal transmission period, an adaptive queue depth adjustment method is adopted to avoid signal forwarding delay or frame loss problems caused by a fixed queue depth.

Benefits of technology

This improved the real-time performance and reliability of signal forwarding, reduced latency and frame drops caused by improper queue depth settings, and enhanced the timeliness of vehicle function response.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121728044A_ABST
    Figure CN121728044A_ABST
Patent Text Reader

Abstract

The invention discloses a queue depth adjusting method and device, a storage medium and an electronic device, and relates to the field of vehicles. The queue depth adjusting method comprises the steps that under the condition that activated vehicle-mounted signals exist in a forwarding queue, the period parameter of the forwarding queue is determined, the delay parameter of the activated vehicle-mounted signals is determined, the forwarding queue is used for storing the vehicle-mounted signals sent by a vehicle, and the vehicle-mounted signals sent by the vehicle are sent to the vehicle. The delay parameter is used for indicating a delay condition of a function associated with the vehicle-mounted signal; determining a target queue depth of the forwarding queue based on the period parameter and the delay parameter; and adjusting the current queue depth of the forwarding queue based on the target queue depth. By adopting the technical scheme, the situation of signal forwarding delay or frame loss caused by improper setting of the depth of the fixed queue is avoided, and the functional response timeliness performance of the vehicle can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of vehicles, in particular, to a queue depth adjustment method and device, a storage medium, and an electronic device. BACKGROUND

[0002] The vehicle gateway, a key part in the automotive electronic and electrical architecture, plays a role in routing and forwarding message signals. With the rapid development of vehicle intelligence, networking, and autonomous driving, the number of controllers on vehicles is increasing, and the number of signal interactions between controllers is also increasing, with higher real-time requirements. As a physical isolation between different network segments and a translation between different protocols, the vehicle gateway plays an increasingly important role in low-latency signal forwarding and fast data sharing.

[0003] When forwarding signals between different network segments, the vehicle gateway sets a signal forwarding queue to avoid signal loss due to non-idle bus during transmission. For AUTOSAR (Automotive Open System Architecture) software architecture forwarding, the vehicle gateway stores signals in the forwarding queue if the bus is not idle at the moment of sending to the target network segment, and waits for the bus to be idle to send the signals to the target network segment according to the FIFO (Fist Input First Output) principle.

[0004] However, the forwarding queue is usually fixed, and the queue depth of the forwarding queue determines the number of signals cached in the queue. If the queue depth value is set too large, the maximum delay when the tail signal is sent to the target network segment is the product of the queue depth and the signal period. If the queue depth is set too small and the bus is always non-idle, the signals in the queue cannot be sent in time, and when the queue is full, the signals stored in the queue will be cleared, which may cause frame loss, and the maximum number of frame loss is the queue depth.

[0005] Currently, there is no effective solution to the signal forwarding delay or frame loss caused by improper fixed queue depth setting in related technologies. SUMMARY

[0006] The embodiments of the present application provide a queue depth adjustment method and device, a storage medium, and an electronic device to at least solve the problem of signal forwarding delay or frame loss caused by improper fixed queue depth setting in related technologies.

[0007] According to one aspect of the embodiments of this application, a method for adjusting queue depth is provided, comprising: determining a period parameter of the forwarding queue and a delay parameter of the activated vehicle signal when it is determined that an active vehicle signal exists in the forwarding queue, wherein the forwarding queue is used to store the vehicle signal sent by a vehicle, and the delay parameter is used to indicate the delay status of the function associated with the vehicle signal; determining a target queue depth of the forwarding queue based on the period parameter and the delay parameter; and adjusting the current queue depth of the forwarding queue based on the target queue depth.

[0008] In an exemplary embodiment, determining whether an active vehicle signal exists in the current forwarding queue includes: reading the activation flag bit of the vehicle signal in the forwarding queue; and if it is determined that the activation flag bit of the vehicle signal is a target identifier, identifying the vehicle signal as the active vehicle signal.

[0009] In an exemplary embodiment, determining the target queue depth of the forwarding queue based on the period parameter and the delay parameter includes: when there is one activated vehicle signal in the forwarding queue, determining the quotient of the period parameter and the delay parameter as the target queue depth of the forwarding queue; when there are multiple simultaneously activated vehicle signals in the forwarding queue, obtaining multiple quotients based on the period parameter and multiple delay parameters, and determining the quotient with the largest value among the multiple quotients as the target queue depth of the forwarding queue.

[0010] In an exemplary embodiment, determining the delay parameter of the activated vehicle signal includes: obtaining a pre-set function delay table, wherein the function delay table includes multiple function categories, functions under the function categories, and delay parameters associated with the functions; based on the function category to which the function associated with the activated vehicle signal belongs, determining a target function category matching the function category in the function delay table; under the target function category, searching for a target function matching the function associated with the activated vehicle signal, and determining the delay parameter associated with the target function as the delay parameter of the activated vehicle signal.

[0011] In one exemplary embodiment, the method further includes:

[0012] When there are active vehicle signals in multiple forwarding queues, the active vehicle signals are selected alternately from the multiple forwarding queues according to the queue alternation order and placed into the transmission queue. The active vehicle signals are then transmitted to the target device through the transmission queue.

[0013] In an exemplary embodiment, the step of alternately selecting the active vehicle signal from the plurality of forwarding queues and placing it into the transmission queue according to the queue alternation order includes: when the plurality of forwarding queues include a first forwarding queue and a second forwarding queue, the following steps are executed cyclically: a first placement step: determining the active vehicle signal extracted from the first forwarding queue as a first vehicle signal and placing the first vehicle signal into the transmission queue; a second placement step: determining the active vehicle signal extracted from the second forwarding queue as a second vehicle signal and placing the second vehicle signal into the transmission queue where the first vehicle signal has been placed; the first placement step and the second placement step are executed cyclically until the active vehicle signals in both the first forwarding queue and the second forwarding queue have been placed into the transmission queue; wherein, for the same forwarding queue, the active vehicle signal placed into the transmission queue each time is different from the active vehicle signal previously placed into the transmission queue.

[0014] In an exemplary embodiment, adjusting the current queue depth of the forwarding queue based on the target queue depth includes:

[0015] If the current queue depth is less than the target queue depth, the current queue depth of the forwarding queue is increased.

[0016] If the current queue depth is greater than the target queue depth, the current queue depth of the forwarding queue is reduced.

[0017] According to another aspect of the embodiments of this application, a queue depth adjustment device is also provided, comprising: a parameter determination module, configured to determine a period parameter of the forwarding queue and a delay parameter of the activated vehicle signal when it is determined that an active vehicle signal exists in the forwarding queue, wherein the forwarding queue is used to store the vehicle signal sent by a vehicle, and the delay parameter is used to indicate the delay status of a function associated with the vehicle signal; a depth determination module, configured to determine a target queue depth of the forwarding queue based on the period parameter and the delay parameter; and an adjustment module, configured to adjust the current queue depth of the forwarding queue based on the target queue depth.

[0018] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, wherein a computer program is stored in the computer-readable storage medium, and the computer program is configured to execute the above-described queue depth adjustment method at runtime.

[0019] According to another aspect of the embodiments of this application, an electronic device is also provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the queue depth adjustment method described above through the computer program.

[0020] According to another aspect of the embodiments of this application, a computer program product is also provided, including a computer program that, when executed by a processor, implements the steps of the methods described in various embodiments of this application.

[0021] In this embodiment, when it is determined that an active vehicle signal exists in the forwarding queue, the period parameter of the forwarding queue and the delay parameter of the active vehicle signal are determined. The forwarding queue is used to store the vehicle signal sent by the vehicle, and the delay parameter is used to indicate the delay of the function associated with the vehicle signal. Then, based on the period parameter and the delay parameter, i.e., combining the delay of the function and the period parameter of the forwarding queue, the target queue depth of the forwarding queue is determined. Thus, the current queue depth of the forwarding queue can be adaptively adjusted based on the determined target queue depth, avoiding signal forwarding delay or frame loss caused by improper fixed queue depth settings, and improving the functional response timeliness of the vehicle. Attached Figure Description

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

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

[0024] Figure 1 This is a hardware structure block diagram of the vehicle terminal of the queue depth adjustment method according to an embodiment of this application;

[0025] Figure 2 This is a flowchart of an optional queue depth adjustment method according to an embodiment of this application;

[0026] Figure 3 This is a schematic diagram of the process for sending vehicle signals in related technologies;

[0027] Figure 4 This is a structural block diagram of an in-vehicle gateway according to an embodiment of this application;

[0028] Figure 5This is a schematic diagram of the functional delay list according to an embodiment of this application;

[0029] Figure 6 This is a structural block diagram of an optional queue depth adjustment device according to an embodiment of this application. Detailed Implementation

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

[0031] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data used in this way can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0032] The methods and embodiments provided in this application can be executed in an in-vehicle terminal or a similar computing device. Taking running on an in-vehicle terminal as an example, Figure 1 This is a hardware structure block diagram of the vehicle terminal for the queue depth adjustment method according to an embodiment of this application. For example... Figure 1 As shown, the vehicle-mounted terminal may include one or more ( Figure 1 Only one is shown in the diagram. A processor 102 (which may include, but is not limited to, a microprocessor (MPU) or a programmable logic device (PLD)) and a memory 104 for storing data are also shown. In one exemplary embodiment, the vehicle-mounted terminal may further include a transmission device 106 for communication functions and an input / output device 108. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned vehicle-mounted terminal. For example, the vehicle-mounted terminal may also include components that are more... Figure 1 The more or fewer components shown, or having the sameFigure 1 Equivalent functions or ratios shown Figure 1 The functions shown have more different configurations.

[0033] The memory 104 can be used to store computer programs, such as application software programs and modules, like the computer program corresponding to the queue depth adjustment method in this embodiment. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, thus implementing the above-described method. The memory 104 may include high-speed random access memory and non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the vehicle terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0034] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of the vehicle terminal. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module used for wireless communication with the Internet.

[0035] To address the aforementioned issues, this embodiment provides a method for adjusting queue depth, applied to an in-vehicle terminal, specifically to the in-vehicle gateway included in the in-vehicle terminal. (See reference...) Figure 2 The diagram shows a flowchart of a method for adjusting queue depth, which includes the following steps S202-S206:

[0036] Step S202: If it is determined that there is an active vehicle signal in the forwarding queue, determine the period parameter of the forwarding queue and the delay parameter of the active vehicle signal, wherein the forwarding queue is used to store the vehicle signal sent by the vehicle, and the delay parameter is used to indicate the delay status of the function associated with the vehicle signal.

[0037] The forwarding queue is a queue used by the vehicle gateway to store vehicle signals. Vehicle signals sent by the vehicle's signal transmitter can be temporarily stored in the forwarding queue, waiting for the vehicle signal to be activated before being sent to the signal receiver.

[0038] It should be noted that a vehicle gateway can be configured with multiple forwarding queues, each with a different period parameter. The period parameter characterizes the transmission interval of each vehicle signal in the forwarding queue. For example, forwarding queue A has a period parameter of 10ms (milliseconds), while forwarding queue B has a period parameter of 20ms. Vehicle signals stored in forwarding queue A are transmitted at 10ms intervals, while vehicle signals stored in forwarding queue B are transmitted at 20ms intervals.

[0039] The delay parameter indicates the delay of the function associated with the vehicle signal. Each vehicle signal is associated with a corresponding function. For example, vehicle signal 1 can be associated with the steering function, and vehicle signal 2 can be associated with the braking function. Optionally, the delay parameter can be the maximum delay of each function. For the steering function, the maximum delay can be 100ms, and for the vision function, the maximum delay can be 500ms.

[0040] Optionally, vehicle signals in different forwarding queues can be transmitted in parallel. That is, as long as the signal transmission conditions are met, such as when a vehicle signal in the forwarding queue is activated, the vehicle signal can be transmitted; or when the signal transmission cycle of the vehicle signal in the forwarding queue is reached, etc.

[0041] In an optional embodiment, the forwarding queue is classified according to the signal cycle types of all vehicle signals. The signal cycles of all vehicle signals that need to be forwarded by the vehicle gateway are enumerated, such as 10ms, 20ms, 50ms, 100ms, 200ms, etc. A forwarding queue is set for each cycle type, and each forwarding queue can be set with an initial queue depth. The queue depth determines the number of vehicle signals buffered in the forwarding queue. For example, the initial queue depth can be set to 2, 3, and other values. The specific values ​​can be adaptively adjusted according to the type and number of vehicle signals. This embodiment of the application does not impose any limitations on this.

[0042] In one exemplary embodiment, determining whether an active vehicle signal exists in the current forwarding queue includes: reading the activation flag bit of the vehicle signal in the forwarding queue; and if it is determined that the activation flag bit of the vehicle signal is a target identifier, identifying the vehicle signal as the active vehicle signal.

[0043] Specifically, the activation flag is used to record changes in the signal. Each vehicle signal in the forwarding queue has a corresponding activation flag. When a vehicle signal is activated, it also indicates that the function associated with that signal is activated, i.e., a function is started or turned on. By reading the identifier recorded in the activation flag corresponding to the vehicle signal, it is determined whether the identifier is a target identifier; if it is a target identifier, the vehicle signal is determined to be an activated vehicle signal.

[0044] In some embodiments, the initial identifier of the activation flag can be set using numbers, letters, or feature codes. For example, a number can be used to set the initial identifier of the activation flag, with the initial identifier being 0 and the target identifier being 1. When the activation flag of the read vehicle signal is 1, it indicates that the vehicle signal is activated.

[0045] In the above embodiments, by setting an activation flag and reading the flag recorded by the set activation flag, it is possible to accurately and quickly determine whether the vehicle signal is activated.

[0046] Step S204: Determine the target queue depth of the forwarding queue based on the period parameter and the delay parameter.

[0047] It should be noted that the target queue depth is the new queue depth of the determined forwarding queue. The target queue depth is related to the delay of the function associated with the vehicle signal and the signal transmission period of the vehicle signal. By comprehensively considering the delay and the signal transmission period, the target queue depth is determined so that the current queue depth of the forwarding queue can be adjusted. This can avoid signal forwarding delay or frame loss caused by improper fixed queue depth settings and can improve the timeliness of function response.

[0048] In an exemplary embodiment, determining the target queue depth of the forwarding queue based on the period parameter and the delay parameter includes: when there is one activated vehicle signal in the forwarding queue, determining the quotient of the period parameter and the delay parameter as the target queue depth of the forwarding queue; when there are multiple simultaneously activated vehicle signals in the forwarding queue, obtaining multiple quotients based on the period parameter and multiple delay parameters, and determining the quotient with the largest value among the multiple quotients as the target queue depth of the forwarding queue.

[0049] It should be noted that in actual signal interaction, only one vehicle signal in the forwarding queue can be activated, multiple vehicle signals in the same forwarding queue can be activated simultaneously, or vehicle signals in multiple forwarding queues can be activated simultaneously. The calculation of the target queue depth of the forwarding queue is related to the vehicle signals stored within it.

[0050] Specifically, for any given forwarding queue, when one of the vehicle signals stored in it is activated, the target queue depth is determined by calculating the quotient of the period parameter and the delay parameter. When multiple vehicle signals are activated simultaneously in the forwarding queue, a corresponding quotient is calculated based on the period parameter and each delay parameter, and the quotient with the largest value among these quotients is determined as the target queue depth.

[0051] In the above embodiments, the target queue depth is determined by calculating the quotient of the delay parameter and the period parameter.

[0052] Step S206: Adjust the current queue depth of the forwarding queue based on the target queue depth.

[0053] Specifically, in the process of adjusting the current queue depth through the target queue, the current queue depth can be increased or decreased to obtain a forwarding queue with an adjusted depth. When a vehicle signal is received again, the received vehicle signal can be stored in the forwarding queue with the adjusted depth. Increasing the current queue depth allows the forwarding queue with the adjusted depth to store more vehicle signals, thereby reducing the possibility of frame loss; decreasing the current queue depth allows the forwarding queue with the adjusted depth to store less vehicle signals, thereby reducing the possibility of frame loss. This adaptive adjustment of the queue depth is based on the attributes of the vehicle signal, such as the signal transmission period and maximum delay, thus enabling accurate adjustment of the queue depth.

[0054] In an exemplary embodiment, adjusting the current queue depth of the forwarding queue based on the target queue depth includes: increasing the current queue depth of the forwarding queue when the current queue depth is less than the target queue depth; and decreasing the current queue depth of the forwarding queue when the current queue depth is greater than the target queue depth.

[0055] Understandably, when the current queue depth is less than the target queue depth, the forwarding queue's current depth is increased—either to the target queue depth or close to it—to obtain the adjusted forwarding queue depth. Conversely, when the current queue depth is greater than the target queue depth, the forwarding queue's current depth is decreased—either to the target queue depth or close to it—to obtain the adjusted forwarding queue depth.

[0056] Through the above steps S202-S206, when it is determined that there is an active vehicle signal in the forwarding queue, the period parameter of the forwarding queue and the delay parameter of the active vehicle signal are determined. The forwarding queue is used to store the vehicle signal sent by the vehicle, and the delay parameter is used to indicate the delay of the function associated with the vehicle signal. Then, based on the period parameter and the delay parameter, that is, combining the delay of the function and the period parameter of the forwarding queue, the target queue depth of the forwarding queue can be determined. Thus, the current queue depth of the forwarding queue can be adaptively adjusted based on the determined target queue depth, avoiding signal forwarding delay or frame loss caused by improper fixed queue depth settings, and improving the functional response timeliness of the vehicle.

[0057] In an exemplary embodiment, determining the delay parameter of the activated vehicle signal includes: obtaining a pre-set function delay table, wherein the function delay table includes multiple function categories, functions under the function categories, and delay parameters associated with the functions; based on the function category to which the function associated with the activated vehicle signal belongs, determining a target function category matching the function category in the function delay table; under the target function category, searching for a target function matching the function associated with the activated vehicle signal, and determining the delay parameter associated with the target function as the delay parameter of the activated vehicle signal.

[0058] It is understandable that the delay parameters of the vehicle signal can be determined based on the functional delay table when the vehicle signal is stored in the forwarding queue. The determined delay parameters can be pre-stored in the storage structure, and when the vehicle signal is activated, it only needs to be retrieved from the storage structure. Alternatively, the delay parameters can be determined based on the functional delay table when the stored signal in the forwarding queue is activated.

[0059] In some embodiments, the function delay table includes multiple function categories, specifically including three categories: human-machine control, human-machine display, and non-human-machine control. Each function category may also correspond to multiple functions. For example, human-machine control corresponds to visual and visual + auditory functions, while human-machine display corresponds to functions such as rapid changes and passive safety normal states. Each function corresponds to a delay parameter (maximum delay), and typical delay values ​​are shown in Table 1, which is the function delay table:

[0060]

[0061]

[0062] In the above embodiments, the delay parameters of the vehicle signal can be quickly and accurately determined by looking up a table, which effectively improves the accuracy of queue depth adjustment.

[0063] In an exemplary embodiment, the method further includes: when there are active vehicle signals in multiple forwarding queues, selecting the active vehicle signals from the multiple forwarding queues alternately according to the queue alternation order and placing them into a transmission queue, and transmitting the active vehicle signals to the target device through the transmission queue.

[0064] Specifically, when there are active vehicle signals in multiple forwarding queues, the active vehicle signals can be selected from multiple forwarding queues and sent according to the alternation order of the queues. This avoids the situation where the active vehicle signals in one or several forwarding queues are sent first, and then the active vehicle signals in the remaining forwarding queues are sent, thereby achieving rapid function response.

[0065] In an exemplary embodiment, the step of alternately selecting the active vehicle signal from the plurality of forwarding queues and placing it into the transmission queue according to the queue alternation order includes: when the plurality of forwarding queues include a first forwarding queue and a second forwarding queue, the following steps are executed cyclically: a first placement step: determining the active vehicle signal extracted from the first forwarding queue as a first vehicle signal and placing the first vehicle signal into the transmission queue; a second placement step: determining the active vehicle signal extracted from the second forwarding queue as a second vehicle signal and placing the second vehicle signal into the transmission queue where the first vehicle signal has been placed; the first placement step and the second placement step are executed cyclically until the active vehicle signals in both the first forwarding queue and the second forwarding queue have been placed into the transmission queue; wherein, for the same forwarding queue, the active vehicle signal placed into the transmission queue each time is different from the active vehicle signal previously placed into the transmission queue.

[0066] Understandably, when multiple forwarding queues, including a first forwarding queue and a second forwarding queue, are involved, the process of extracting active vehicle signals from the forwarding queues into the transmission queue in an alternating order can involve cyclically executing two insertion steps: a first insertion step and a second insertion step. This allows the active vehicle signals from the first and second forwarding queues to be inserted into the transmission queue. For example, active vehicle signals in forwarding queue A include S11, S12, S13, etc., and active vehicle signals in forwarding queue B include S21, S22, S23, etc. When extracting active vehicle signals from forwarding queues A and B into the transmission queue, S11 can be extracted from forwarding queue A and identified as the first vehicle signal, then S21 can be extracted from forwarding queue B and identified as the second vehicle signal, and this process can be repeated cyclically. The final transmission queue will contain S11, S21, S12, S22, S13, S23, etc. For forwarding queue A, the active vehicle signal added to the transmission queue each time is different from the one added previously. Similarly, for forwarding queue B, the active vehicle signal added to the transmission queue each time is different from the one added previously. This method of alternately selecting active vehicle signals ensures that, during subsequent signal transmission, vehicle signals with various functions are sent to the signal receiver as promptly as possible, enabling rapid functional response.

[0067] Obviously, the embodiments described above are only some embodiments of this application, and not all embodiments. To better understand the above method and the above queue depth adjustment scheme, in an optional embodiment, a scheme is also provided for explaining and illustrating the above scheme.

[0068] In automotive electronic and electrical architecture, the onboard gateway, a key component, plays a crucial role in routing and forwarding message signals. With the rapid development of vehicle intelligence, connectivity, and autonomous driving, the number of controllers in vehicles is increasing, leading to a greater volume of signal interactions and higher real-time requirements for these interactions. As a physical isolation point between controllers on different network segments and a translator between different protocols, the onboard gateway's low-latency signal forwarding and rapid data sharing capabilities are becoming increasingly important. To prevent signal loss due to bus idleness when forwarding signals between different network segments, the onboard gateway uses a signal forwarding queue. For AUTOSAR (Automotive Open System Architecture) software architecture based on Container PDUs (Container Distribution Units), if the bus is not idle at the moment of transmission to the target network segment, the onboard gateway stores the signal in the PDUR queue (forwarding queue) and waits for the bus to become idle before sending the signal to the target network segment, following a FIFO (First Input First Output) principle. Figure 3 The diagram shows the flowchart of a vehicle gateway sending vehicle signals in a conventional manner. After receiving the vehicle signal, the vehicle gateway stores it in a forwarding queue and, when the bus is idle, schedules it according to a scheduling strategy before sending it to the target network segment. The gateway queue depth is usually a fixed value, which determines the number of signals buffered in the queue. If the queue depth is set too high, the maximum delay when the tail signal is sent to the target network segment is the queue depth multiplied by the signal period. If the queue depth is set too low and the bus is constantly busy, the signals in the queue cannot be sent in time. When the queue is full, the temporarily stored signals in the queue will be cleared, resulting in frame drops. The maximum number of dropped frames is equal to the queue depth. The setting of the vehicle gateway signal forwarding queue depth affects the signal forwarding delay and frame drop status. The current common practice is to set the signal forwarding queue depth value based on test data and the acceptable frame drop status of the signal receiver.

[0069] To solve the above problems, refer to Figure 4 As shown, this application proposes a signal processing system for an on-board gateway, specifically including a monitoring module, an adjustment module, and a scheduling module. First, all signal cycles that need to be forwarded by the on-board gateway in the vehicle are enumerated, and forwarding queues are divided according to different cycles. When the on-board gateway receives a signal, during the waiting time for the bus to idle, the signal is buffered in the corresponding forwarding queue according to the corresponding signal cycle. For example, a 10ms signal S11 is buffered in the 10ms queue. The scheduling module schedules the signal according to a normal scheduling strategy (such as round-robin scheduling with a 5ms cycle) and places it in the transmission queue, which then sends it to the target network segment.

[0070] The vehicle's periodic signals are categorized according to their functions, and these functions are further classified into three categories: human-machine control, human-machine display, and non-human-machine control. Maximum delay represents the time from function triggering to being detected. By statistically analyzing the maximum delay of each function, a maximum delay Xn+1 is obtained for each function, ultimately forming a list of maximum delays for each function, which is integrated into the monitoring module. Figure 5 The following is a list of maximum delays for each function.

[0071] When a vehicle signal is input, the vehicle gateway receives the signal from the signal source network segment and forwards it to the target network segment. This is mainly for vehicle gateways developed based on the AUTOSAR software architecture, and belongs to the signal forwarding based on Container PDU and Signal Group. The signal input can include signals from sources such as CAN (Controller Area Network, serial bus communication protocol), CANFD (Controller Area Network Flexible Data Rate, a new generation of CAN bus communication protocol), and Ethernet (a communication technology for transmitting data), which need to be filtered and converted into protocols before being placed in the forwarding queue.

[0072] The queues are categorized according to all signal cycle types in the vehicle, exhaustively listing all signal cycles that need to be forwarded by the vehicle gateway, such as 10ms, 20ms, 50ms, 100ms, 200ms, etc. Each cycle type has its own forwarding queue, with an initial queue depth of 2. This default value of 2 is maintained during vehicle gateway initialization or when the function delay list becomes invalid. The monitoring module monitors each forwarding queue. When signal S11 is added to the forwarding queue, it queries the internal storage list for the corresponding function and its maximum delay X1. When the function is activated (i.e., the function signal value changes), the queue depth is calculated based on the maximum delay X1 of the corresponding function. The calculated value of X1 / X is then passed to the adjustment module as the queue depth value, where X represents the signal cycle of the forwarding queue. Upon receiving this value, the adjustment module adjusts the queue depth of the corresponding forwarding queue. If multiple function signals are buffered in the forwarding queue and activated simultaneously, the queue depth is set according to the maximum value calculated by X1 / X.

[0073] Simultaneously, the adjustment module inputs the queue depth adjustment information to the scheduling module. The scheduling module needs to prioritize scheduling the queue containing the function activation signal, such as... Figure 4As shown, S11 and S22 are signals corresponding to the same function 1, and S12 and S24 are signals corresponding to the same function 2. When the two functions are activated at a certain moment, the scheduling module needs to schedule the queue where S11 is located and the queue where S12 is located first, and then schedule them in the alternating order of queues S11, S21, S12, S22, S23, and S24 to achieve rapid function response.

[0074] Based on this application, frame loss and latency in vehicle gateway signal forwarding can be reduced or decreased, and the forwarding queue depth can be adaptively set according to specific functional requirements. This avoids signal forwarding latency or frame loss caused by improper fixed queue depth settings, thereby improving the timeliness of functional response.

[0075] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods of the various embodiments of this application.

[0076] This embodiment also provides a queue depth adjustment device, which is used to implement the above embodiments and preferred embodiments, and will not be repeated as already described. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the apparatus described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.

[0077] Figure 6 This is a structural block diagram of a queue depth adjustment device according to an embodiment of this application; as shown below. Figure 6 As shown, it includes:

[0078] The parameter determination module 62 is used to determine the period parameter of the forwarding queue and the delay parameter of the activated vehicle signal when it is determined that there is an active vehicle signal in the forwarding queue. The forwarding queue is used to store the vehicle signal sent by the vehicle, and the delay parameter is used to indicate the delay of the function associated with the vehicle signal.

[0079] The depth determination module 64 is used to determine the target queue depth of the forwarding queue based on the period parameter and the delay parameter;

[0080] The adjustment module 66 is used to adjust the current queue depth of the forwarding queue based on the target queue depth.

[0081] Using the aforementioned device, when it is determined that an active vehicle signal exists in the forwarding queue, the period parameter of the forwarding queue and the delay parameter of the activated vehicle signal are determined. The forwarding queue is used to store the vehicle signal sent by the vehicle, and the delay parameter is used to indicate the delay of the function associated with the vehicle signal. Then, based on the period parameter and the delay parameter, i.e., combining the delay of the function and the period parameter of the forwarding queue, the target queue depth of the forwarding queue can be determined. Thus, the current queue depth of the forwarding queue can be adaptively adjusted based on the determined target queue depth, avoiding signal forwarding delays or frame drops caused by improper fixed queue depth settings, thereby improving the functional response timeliness of the vehicle.

[0082] In an exemplary embodiment, the parameter determination module 62 is further configured to read the activation flag bit of the vehicle signal in the forwarding queue; and if it is determined that the activation flag bit of the vehicle signal is a target identifier, the vehicle signal is determined to be the activated vehicle signal.

[0083] In an exemplary embodiment, the depth determination module 64 is further configured to, when there is an activated vehicle signal in the forwarding queue, determine the quotient of the period parameter and the delay parameter as the target queue depth of the forwarding queue; and when there are multiple simultaneously activated vehicle signals in the forwarding queue, obtain multiple quotients based on the period parameter and multiple delay parameters, and determine the quotient with the largest value among the multiple quotients as the target queue depth of the forwarding queue.

[0084] In an exemplary embodiment, the parameter determination module 62 is further configured to obtain a pre-set function delay table, wherein the function delay table includes multiple function categories, functions under the function categories, and delay parameters associated with the functions; based on the function category to which the function associated with the activated vehicle signal belongs, a target function category matching the function category is determined in the function delay table; under the target function category, a target function matching the function associated with the activated vehicle signal is searched, and the delay parameter associated with the target function is determined as the delay parameter of the activated vehicle signal.

[0085] In an exemplary embodiment, the device further includes a signal transmission module; the signal transmission module is configured to, when there are active vehicle signals in multiple forwarding queues, alternately select the active vehicle signals from the multiple forwarding queues according to the queue alternation order and place them into a transmission queue, and transmit the active vehicle signals to the target device through the transmission queue.

[0086] In an exemplary embodiment, the signal transmitting module is further configured to determine any one of the plurality of forwarding queues as the target forwarding queue; firstly, extract the active vehicle signal from the target forwarding queue and place it into the transmitting queue; then, sequentially extract the active vehicle signal from the other forwarding queues (excluding the target forwarding queue) and place it into the transmitting queue, until the active signals in the other forwarding queues have been placed into the transmitting queue, and then return to the step of extracting the active vehicle signal from the target forwarding queue and placing it into the transmitting queue.

[0087] In an exemplary embodiment, the adjustment module 66 is configured to increase the current queue depth of the forwarding queue when the current queue depth is less than the target queue depth, and decrease the current queue depth of the forwarding queue when the current queue depth is greater than the target queue depth.

[0088] Embodiments of this application also provide a storage medium including a stored program, wherein the program executes any of the methods described above when it is run.

[0089] Optionally, in this embodiment, the storage medium may be configured to store program code for performing the following steps:

[0090] S1, if it is determined that there is an active vehicle signal in the forwarding queue, determine the period parameter of the forwarding queue and the delay parameter of the active vehicle signal, wherein the forwarding queue is used to store the vehicle signal sent by the vehicle, and the delay parameter is used to indicate the delay status of the function associated with the vehicle signal.

[0091] S2, Based on the period parameter and the delay parameter, determine the target queue depth of the forwarding queue;

[0092] S3, adjust the current queue depth of the forwarding queue based on the target queue depth.

[0093] Embodiments of this application also provide an electronic device including a memory and a processor, wherein the memory stores a computer program and the processor is configured to run the computer program to perform the steps in any of the above method embodiments.

[0094] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor and the input / output device is connected to the processor.

[0095] Optionally, in this embodiment, the processor can be configured to perform the following steps via a computer program:

[0096] S1, if it is determined that there is an active vehicle signal in the forwarding queue, determine the period parameter of the forwarding queue and the delay parameter of the active vehicle signal, wherein the forwarding queue is used to store the vehicle signal sent by the vehicle, and the delay parameter is used to indicate the delay status of the function associated with the vehicle signal.

[0097] S2, Based on the period parameter and the delay parameter, determine the target queue depth of the forwarding queue;

[0098] S3, adjust the current queue depth of the forwarding queue based on the target queue depth.

[0099] Optionally, in this embodiment, the storage medium may include, but is not limited to, various media capable of storing program code, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0100] Embodiments of this application also provide a computer program product, including a non-volatile computer-readable storage medium storing the computer program product, wherein the computer program, when executed by a processor, implements the steps of the methods described in various embodiments of this application.

[0101] Optionally, in this embodiment, the computer program described above can be configured to perform the following steps when executed by a processor:

[0102] S1, if it is determined that there is an active vehicle signal in the forwarding queue, determine the period parameter of the forwarding queue and the delay parameter of the active vehicle signal, wherein the forwarding queue is used to store the vehicle signal sent by the vehicle, and the delay parameter is used to indicate the delay status of the function associated with the vehicle signal.

[0103] S2, Based on the period parameter and the delay parameter, determine the target queue depth of the forwarding queue;

[0104] S3, adjust the current queue depth of the forwarding queue based on the target queue depth.

[0105] Optionally, specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementations, and will not be repeated here.

[0106] Obviously, those skilled in the art should understand that the modules or steps of this application described above can be implemented using general-purpose computing devices. They can be centralized on a single computing device or distributed across a network of multiple computing devices. Optionally, they can be implemented using computer-executable program code, thereby storing them in a storage device for execution by a computing device. In some cases, the steps shown or described can be performed in a different order than those presented here, or they can be fabricated as separate integrated circuit modules, or multiple modules or steps can be fabricated as a single integrated circuit module. Thus, this application is not limited to any particular combination of hardware and software.

[0107] The above description is merely a preferred embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the principles of this application should be included within the protection scope of this application.

Claims

1. A method for adjusting queue depth, characterized in that, include: If it is determined that there is an active vehicle signal in the forwarding queue, the period parameter of the forwarding queue and the delay parameter of the active vehicle signal are determined, wherein the forwarding queue is used to store the vehicle signal sent by the vehicle, and the delay parameter is used to indicate the delay status of the function associated with the vehicle signal. The target queue depth of the forwarding queue is determined based on the period parameter and the delay parameter. The current queue depth of the forwarding queue is adjusted based on the target queue depth.

2. The method according to claim 1, characterized in that, Determining whether an active vehicle signal exists in the current forwarding queue includes: Read the activation flag bit of the vehicle signal in the forwarding queue; If it is determined that the activation flag of the vehicle signal is a target identifier, the vehicle signal is identified as the activated vehicle signal.

3. The method according to claim 1, characterized in that, Determining the target queue depth of the forwarding queue based on the period parameter and the delay parameter includes: When there is an active vehicle signal in the forwarding queue, the quotient of the period parameter and the delay parameter is determined as the target queue depth of the forwarding queue. When multiple vehicle signals are activated simultaneously in the forwarding queue, multiple quotients are obtained based on the period parameter and multiple delay parameters, and the quotient with the largest value among the multiple quotients is determined as the target queue depth of the forwarding queue.

4. The method according to claim 1, characterized in that, Determining the delay parameters of the activated vehicle signal includes: Obtain a pre-set function delay table, wherein the function delay table includes multiple function categories, functions under the function categories, and delay parameters associated with the functions; Based on the function category to which the activated vehicle signal associated function belongs, a target function category matching the function category is determined in the function delay table; Under the target function category, find the target function that matches the function associated with the activated vehicle signal, and determine the delay parameter associated with the target function as the delay parameter of the activated vehicle signal.

5. The method according to claim 1, characterized in that, The method further includes: When there are active vehicle signals in multiple forwarding queues, the active vehicle signals are selected alternately from the multiple forwarding queues according to the queue alternation order and placed into the transmission queue. The active vehicle signals are then transmitted to the target device through the transmission queue.

6. The method according to claim 5, characterized in that, The step of alternately selecting the activated vehicle signal from the plurality of forwarding queues and placing it into the transmission queue according to the queue alternation order includes: In the case that the plurality of forwarding queues includes a first forwarding queue and a second forwarding queue, the following steps are executed cyclically: First placement step: The activated vehicle signal extracted from the first forwarding queue is identified as the first vehicle signal, and the first vehicle signal is placed into the transmission queue; The second placement step is to determine the activated vehicle signal extracted from the second forwarding queue as the second vehicle signal and place the second vehicle signal into the transmission queue that has been placed into the first vehicle signal. The first placement step and the second placement step are executed repeatedly until all active vehicle signals in the first forwarding queue and the second forwarding queue have been placed into the transmission queue; wherein, For the same forwarding queue, each time an active vehicle signal is placed into the sending queue, it is different from the active vehicle signal previously placed into the sending queue.

7. The method according to claim 1, characterized in that, The adjustment of the current queue depth of the forwarding queue based on the target queue depth includes: If the current queue depth is less than the target queue depth, the current queue depth of the forwarding queue is increased. If the current queue depth is greater than the target queue depth, the current queue depth of the forwarding queue is reduced.

8. A queue depth adjustment device, characterized in that, The device includes: The parameter determination module is used to determine the period parameter of the forwarding queue and the delay parameter of the activated vehicle signal when it is determined that there is an active vehicle signal in the forwarding queue. The forwarding queue is used to store the vehicle signal sent by the vehicle, and the delay parameter is used to indicate the delay status of the function associated with the vehicle signal. A depth determination module is used to determine the target queue depth of the forwarding queue based on the period parameter and the delay parameter; The adjustment module is used to adjust the current queue depth of the forwarding queue based on the target queue depth.

9. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored program, wherein the program, when executed, performs the method described in any one of claims 1 to 7.

10. An electronic device comprising a memory and a processor, characterized in that, The memory stores a computer program, and the processor is configured to execute the method described in any one of claims 1 to 7 through the computer program.

11. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the method described in any one of claims 1 to 7.