A queue management method, system, electronic device, storage medium, and vehicle.

By setting virtual threshold values ​​and priority discarding policies, the cache space of the vehicle's Ethernet modules is reasonably allocated, solving the problem of uneven cache resource utilization and achieving maximum utilization of cache space and fairness of bandwidth service.

CN117938786BActive Publication Date: 2026-06-30CHINA FAW CO LTD +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA FAW CO LTD
Filing Date
2023-12-18
Publication Date
2026-06-30

Smart Images

  • Figure CN117938786B_ABST
    Figure CN117938786B_ABST
Patent Text Reader

Abstract

This invention discloses a queue management method, system, electronic device, storage medium, and vehicle. The method includes: in response to an Ethernet connection signal, acquiring the bandwidth values ​​of each module selected by the user to connect to the Ethernet; setting corresponding virtual threshold values ​​based on the bandwidth values ​​of each module; dividing the total buffer space into corresponding virtual buffer spaces based on the ratio of the bandwidth values ​​of each module to the total bandwidth value; and in response to a data frame arrival signal, allocating the data frames to each queue based on the virtual threshold values ​​using the virtual buffer spaces. This method maximizes the utilization of buffer space and allows for reasonable allocation of buffer space to each queue when buffer resources are scarce.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of vehicle technology, and in particular to a queue management method, system, electronic device, storage medium, and vehicle. Background Technology

[0002] The development of automotive intelligence and connectivity is accelerating, transforming cars from traditional transportation terminals into intelligent terminals. Traditional automotive electronic communication buses primarily use the CAN bus, with communication speeds below 1 Mbps, which is sufficient for most needs. However, with the upgrading of automotive EE architectures, the communication speed and bandwidth of the CAN bus are no longer adequate. This is especially true in the field of autonomous driving, where the structure of sensors + autonomous driving domain controller + execution unit results in a massive amount of data being sensed by the sensors. This has led to the increasing adoption of Ethernet in vehicles.

[0003] Patent document CN111400206A discloses a cache management method based on dynamic virtual thresholds, mainly addressing the problem that existing technologies cannot guarantee fair threshold settings for each queue under high cache utilization. The implementation scheme is as follows: 1) Initialize cache management parameters for each queue; 2) Determine if the current data frame can enter the cache space and whether the cache manager needs to discard the data frame; the cache management operation ends when no data frame arrives at the cache space; 3) Enter the cache space for data frames that have not been discarded; 4) Modify the virtual threshold value of each queue every time interval T; 5) The dequeue scheduler retrieves data frames from the cache in each cycle and returns to step 2). This invention only discards data frames when the cache is full and sets dynamic virtual threshold caches for each queue, offering advantages such as high cache space utilization and good fairness among queues, making it suitable for network switching equipment.

[0004] In the aforementioned patent documents and existing technologies, the cache threshold cannot accurately match the actual business volume requirements. In the queue manager, there are still some idle cache spaces, while some data frames are discarded due to lack of cache space.

[0005] Therefore, this application provides a queue management method to solve the above-mentioned technical problems. Summary of the Invention

[0006] The purpose of this invention is to provide a queue management method, system, electronic device, storage medium, and vehicle that can solve at least one of the aforementioned technical problems.

[0007] To address the aforementioned technical problems, this invention provides a queue management method, comprising:

[0008] In response to the Ethernet connection signal, the bandwidth values ​​of each module selected by the user to connect to the Ethernet are obtained;

[0009] Based on the bandwidth values ​​of each module, set corresponding virtual threshold values;

[0010] Based on the ratio of the bandwidth values ​​of each module to the total bandwidth value, the total cache space is divided into corresponding virtual cache spaces;

[0011] In response to the arrival signal of a data frame, the virtual buffer space is invoked based on the virtual threshold value to allocate the data frame to each queue.

[0012] In some specific embodiments, based on the bandwidth values ​​of each module, corresponding virtual threshold values ​​are set, specifically including:

[0013] Through the formula:

[0014] Obtain the bandwidth values ​​of each module, where,

[0015] The bandwidth value of each module selected by the user to connect to the Ethernet is B. n ;

[0016] The total bandwidth value is B;

[0017] The total cache space is M;

[0018] The virtual threshold value is M n .

[0019] In some specific embodiments, in response to a data frame arrival signal, based on the virtual threshold value, the virtual buffer space is invoked to allocate the data frames to each queue, specifically including:

[0020] In response to a data frame arrival signal, the virtual buffer space is initialized;

[0021] Determine whether the total cache space is full;

[0022] When the total cache space is full, determine whether the virtual threshold value of the corresponding module has been exceeded;

[0023] When the virtual threshold value is exceeded, it is determined whether the arriving data frame is a low-priority data frame;

[0024] When it is a low-priority data frame, the arriving data frame is discarded;

[0025] Determine whether any more data frames are expected to arrive;

[0026] When no data frame arrives, the data frame allocation is complete;

[0027] When a data frame arrives, it is further determined whether the total buffer space is full.

[0028] In some specific embodiments, when the total cache space is not full, the data frame is allocated into the corresponding queue.

[0029] In some specific embodiments, when the virtual threshold value is not exceeded, the module with the most low-priority data frames is searched.

[0030] Determine whether the number of low-priority data frames in the module is greater than a preset first discard value;

[0031] When the value is greater than the first discard value, the module discards one of the low-priority data frames and allocates the data frame into the corresponding queue.

[0032] When the number of medium-priority data frames in the module is less than the first discard value, it is determined whether the number of medium-priority data frames in the module is greater than the preset second discard value.

[0033] When the value is greater than the second discard value, the module discards one of the medium-priority data frames and allocates the data frame into the corresponding queue.

[0034] When the value is less than the second discard value, the module discards a high-priority data frame and allocates the data frame to the corresponding queue.

[0035] In some specific embodiments, when it is not a low-priority data frame, it is determined whether it is a medium-priority data frame;

[0036] When it is a medium-priority data frame, determine whether the module to which the medium-priority data frame belongs contains the low-priority data frame;

[0037] When the module contains the low-priority data frame, one of the low-priority data frames in the module is discarded, and the data frame is allocated into the corresponding queue.

[0038] When it is not the medium-priority data frame, determine whether the low-priority data frame in the module to which the arriving data frame belongs is greater than the first discard value;

[0039] When the value is greater than the first discard value, one of the low-priority data frames in the module is discarded, and the data frame is allocated into the corresponding queue.

[0040] When the number of medium-priority data frames is less than the first discard value, it is determined whether the number of medium-priority data frames in the module is greater than the second discard value.

[0041] When the value is greater than the second discard value, one of the medium-priority data frames in the module is discarded, and the data frame is allocated to the corresponding queue.

[0042] When the value is less than the second discard value, the arriving data frame is discarded.

[0043] Based on the same concept, the present invention also provides an electronic device, including: a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the steps of a queue management method.

[0044] Based on the same concept, the present invention also provides a computer-readable storage medium storing a computer program executable by an electronic device, which, when run on the electronic device, causes the electronic device to perform the steps of a queue management method.

[0045] Based on the same concept, the present invention also provides a vehicle equipped with a queue management system as described above.

[0046] Compared with existing technologies, its advantages are as follows:

[0047] This invention discloses a queue management method, system, electronic device, storage medium, and vehicle, which can maximize the use of cache space and rationally allocate cache space for each queue when cache resources are scarce. Attached Figure Description

[0048] Figure 1 This is a flowchart illustrating some specific embodiments of the queue management method of the present invention;

[0049] Figure 2 This is a schematic diagram of the Ethernet packet sending process in some applications of the queue management method of the present invention;

[0050] Figure 3 This is a schematic diagram of the queue cache structure in some applications of the queue management method of the present invention;

[0051] Figure 4 This is a schematic diagram of cache allocation in some applications of the queue management method of the present invention;

[0052] Figure 5 This is a schematic diagram of the management process of the queue management method of the present invention in some applications;

[0053] Figure 6 This is a schematic diagram of the structure of a queue management system according to some specific embodiments of the present invention;

[0054] Figure 7 This is a schematic diagram of the structure of an electronic device according to some specific embodiments of the present invention. Detailed Implementation

[0055] To make the objectives, technical solutions, and advantages of this application clearer, the application will be further described in detail below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0056] The terminology used in the embodiments of this application is for the purpose of describing particular embodiments only and is not intended to limit the application. The singular forms “a,” “said,” and “the” used in the embodiments of this application and the appended claims are also intended to include the plural forms, and “multiple” generally includes at least two unless the context clearly indicates otherwise.

[0057] It should be understood that the term "and / or" used in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.

[0058] It should be understood that although the terms first, second, third, etc., may be used in the embodiments of this application, these descriptions should not be limited to these terms. These terms are only used to distinguish the descriptions. For example, first may also be referred to as second without departing from the scope of the embodiments of this application, and similarly, second may also be referred to as first.

[0059] Depending on the context, the words “if” or “suppose” as used here can be interpreted as “when” or “in response to determination” or “in response to detection.” Similarly, depending on the context, the phrases “if determination” or “if detection (of the stated condition or event)” can be interpreted as “when determination” or “in response to determination” or “when detection (of the stated condition or event)” or “in response to detection (of the stated condition or event).”

[0060] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that an article or device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such an article or device. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the article or device that includes said element.

[0061] It should be noted that any symbols and / or numbers present in the specification that are not marked in the accompanying drawings are not reference numerals.

[0062] Reference Figure 1 A queue management method, comprising:

[0063] S101, in response to the Ethernet connection signal, obtains the bandwidth values ​​of each module selected by the user to connect to the Ethernet;

[0064] Specifically, in this step, the bandwidth values ​​of each module selected by the user to connect to the Ethernet are obtained based on the Ethernet connection signal.

[0065] It is understandable that, for example, when a user operates the vehicle terminal, the vehicle terminal connects to the Ethernet and obtains the bandwidth values ​​of each module selected by the user on the vehicle terminal.

[0066] S102, Based on the bandwidth values ​​of each module, set the corresponding virtual threshold value;

[0067] In some applications, the formula is used:

[0068]

[0069] Obtain the bandwidth values ​​of each module, wherein the bandwidth value of each module selected by the user to connect to the Ethernet is B. n The total bandwidth is B; the total cache space is M; the virtual threshold value is M. n ;

[0070] Understandably, for example, in an in-vehicle Ethernet switch system, the maximum switch capacity is assumed to be 10Gb / s. Therefore, the total bandwidth selected by users for all connection modules in the entire switch system will not exceed 10Gb / s. Let's assume a user selects a module bandwidth of B. n The corresponding virtual threshold value can be determined according to the above formula. The queue manager sets a larger virtual threshold value for modules that select larger bandwidth and a smaller virtual threshold value for modules that select smaller bandwidth.

[0071] S103, based on the ratio of the bandwidth values ​​of each module to the total bandwidth value, the total cache space is divided into corresponding virtual cache spaces;

[0072] Understandably, once the bandwidth values ​​of each module are obtained, the proportion of each module in the total bandwidth can be determined, and the corresponding virtual cache space can be allocated according to the proportion.

[0073] S104, in response to the arrival signal of a data frame, based on the virtual threshold value, the virtual buffer space is invoked to allocate the data frames to each queue.

[0074] In some applications, in response to a data frame arrival signal, a virtual buffer space is invoked based on a virtual threshold value to allocate the data frames to each queue. Specifically, this includes: in response to a data frame arrival signal, initializing the virtual buffer space; determining whether the total buffer space is full; when the total buffer space is full, determining whether the virtual threshold value of the corresponding module has been exceeded; when the virtual threshold value has been exceeded, determining whether the arriving data frame is a low-priority data frame; when it is a low-priority data frame, discarding the arriving data frame; determining whether there are any more arriving data frames; when no more data frames have arrived, the data frame allocation is complete; when more data frames have arrived, continuing to determine whether the total buffer space is full.

[0075] Understandably, this application demonstrates one type of queue management step, whereby, when a data frame arrives, appropriate management and allocation are performed based on whether the total buffer space is full.

[0076] Furthermore, in this application, when the total cache space is not full, data frames are allocated into the corresponding queue.

[0077] Understandably, in this application, when the total cache space is not full, it can be allocated directly.

[0078] Furthermore, in this application, when the virtual threshold is not exceeded, the module with the most low-priority data frames is searched; it is determined whether the number of low-priority data frames in the module is greater than a preset first discard value; when it is greater than the first discard value, the module discards one low-priority data frame and allocates a data frame into the corresponding queue; when it is less than the first discard value, it is determined whether the number of medium-priority data frames in the module is greater than a preset second discard value; when it is greater than the second discard value, the module discards one of the medium-priority data frames and allocates a data frame into the corresponding queue; when it is less than the second discard value, the module discards one high-priority data frame and allocates a data frame into the corresponding queue.

[0079] It is understandable that when the space is full, data priority needs to be used to make choices, with low-priority data being discarded as the basis. The first and second discard values ​​can be set according to the virtual threshold values ​​of their respective modules, which can also be understood as setting the lower limit of the virtual threshold values.

[0080] Furthermore, in this application, when the data frame is not a low-priority data frame, it is determined whether it is a medium-priority data frame; when it is a medium-priority data frame, it is determined whether the module to which the medium-priority data frame belongs contains low-priority data frames; when the module contains low-priority data frames, one low-priority data frame in the module is discarded, and a data frame is allocated to the corresponding queue; when the data frame is not a medium-priority data frame, it is determined whether the number of low-priority data frames in the module to which the arriving data frame belongs is greater than a first discard value; when it is greater than the first discard value, one low-priority data frame in the module is discarded, and a data frame is allocated to the corresponding queue; when it is less than the first discard value, it is determined whether the number of medium-priority data frames in the module is greater than a second discard value; when it is greater than the second discard value, one medium-priority data frame in the module is discarded, and a data frame is allocated to the corresponding queue; when it is less than the second discard value, the arriving data frame is discarded.

[0081] Understandably, by following the steps above, the cache space can be utilized to the maximum extent, and the cache space of each queue can be allocated reasonably when cache resources are scarce.

[0082] The following is combined Figures 2 to 5 The following describes embodiments of the queue management method of the present invention in some applications:

[0083] like Figure 2 As shown, when Ethernet sends packets, it puts the data into DMA (Direct Memory Access). The MAC then retrieves the data from the DMA and sends it out through the PHY. When the data volume is particularly large, insufficient bandwidth can lead to stuttering or even severe packet loss.

[0084] The queue management method in this embodiment sets a virtual threshold for each in-vehicle module based on the bandwidth of each module selected by each user to connect via in-vehicle Ethernet. This method has the advantages of good cache utilization and fairness, almost no high-priority data is discarded when cache resources are scarce, and while ensuring that all new users select in-vehicle Ethernet bandwidth, it also provides some users with excess bandwidth services as much as possible.

[0085] The cache module is managed using fixed-length cache blocks to store fixed-length enqueued data frames. Each priority level of each module corresponds to a queue, and cache blocks belonging to the same queue are linked together by a linked list. The cache distribution structure is as follows: Figure 3 As shown, the entire cache space allocates virtual exclusive space to each queue. The total cache space capacity is assumed to be 20 Mbits, and the entire cache space is divided into small cache units, each cache unit being 224 bytes, so the entire cache space has 11160 cache blocks.

[0086] If the number of data frames in a queue reaches the queue's dynamic threshold, all newly arriving data frames in that queue will be discarded by the queue manager. In this embodiment, as long as the entire queue manager has remaining buffer space, even if the queue length reaches the virtual threshold, data frames belonging to that queue can still enter the queue manager without being discarded; only when the entire buffer has no remaining space will the queue manager discard data frames from some queues whose length exceeds the virtual threshold. This approach can both prevent some queues from having idle buffer space while other queues are forced to discard data frames due to lack of buffer space, thus improving the overall buffer utilization efficiency, and prevent some queues from occupying too much buffer space when buffer resources are scarce, affecting the entry of data frames from other queues into the queue manager.

[0087] In an in-vehicle Ethernet switch system, the maximum switch capacity is assumed to be 10Gb / s. Therefore, the total bandwidth selected by users for all connection modules in the entire switch system will not exceed 10Gb / s. Assume a user selects a module bandwidth of B. n Where Mn is the virtual threshold value of the module's cache, B is the total bandwidth that can be provided, and M is the total cache size. The queue manager sets a larger virtual threshold value for modules that select larger bandwidth and a smaller virtual threshold value for modules that select smaller bandwidth.

[0088] like Figure 4 As shown, the queue manager divides the cache space of other modules in the vehicle into virtual cache spaces based on the ratio of each user's selected bandwidth to the total system bandwidth. When the entire cache is not full, data frames belonging to a queue are preferentially entered into the cache space allocated by the virtual threshold of that queue. If the queue length reaches the set virtual threshold, the data frame can still enter the queue manager, in which case it will occupy the remaining cache space of other queues. When the entire cache is full, if the queue length has not yet reached the set virtual threshold, the data frame of that queue can still enter the queue manager. If the queue length has reached the set virtual threshold, the lower priority data frame in the cache is discarded according to the priority of the data frames arriving at the queue manager. If there is no such data frame, the data frame arriving at the queue manager is discarded.

[0089] When the entire buffer is full, data frames belonging to queues whose queue leaders have not yet reached the virtual threshold can still enter the queue manager. The queue manager's entire buffer space is fixed, and in this situation, the queue manager must forcibly discard data frames from other queues. The queue manager's discarding strategy is to discard data frames from the module whose queue length exceeds the virtual threshold the most. Within a module, low-priority data frames are discarded first. If the number of low-priority data frames is less than the queue's minimum buffer threshold, medium-priority data frames are discarded. If the number of medium-priority data frames is less than the queue's minimum buffer threshold, the number of high-priority data frames must exceed the queue's minimum buffer threshold, in which case high-priority data frames are discarded. The minimum buffer threshold for each queue is 7 buffer blocks, ensuring that the queue can hold at least one longest Ethernet data frame when buffer resources are scarce.

[0090] like Figure 5 As shown, the specific operation is as follows:

[0091] 1. Initialize the virtual threshold cache for each queue according to the ratio of the bandwidth of each module in the vehicle to the total bandwidth selected by each user.

[0092] 2. When a data frame arrives at the buffer, first check if there is any remaining space in the entire buffer; if there is, proceed to step 12; otherwise, proceed to step 3.

[0093] 3. Determine whether the queue length of the module to which the arriving buffered data frame belongs exceeds the module's virtual threshold; if it does, proceed to step 7; otherwise, proceed to step 4.

[0094] 4. Since the module leader exceeds the virtual threshold, there are modules in the queue manager whose leaders exceed the virtual threshold. Therefore, the module with the most low-priority data frames is now selected from the modules whose leaders exceed the virtual threshold.

[0095] 5. Determine if the low-priority data frame of the module is greater than the minimum threshold value; if it is, the module discards a low-priority data frame and then executes step 12; otherwise, proceed with the following judgment.

[0096] 6. Determine if the number of priority data frames in the module is greater than the minimum threshold. If it is, the module discards a medium-priority data frame and then executes step 12. Otherwise, only the number of high-priority data frames is greater than the minimum threshold, so the queue manager discards a high-priority data frame and then executes step 12.

[0097] 7. The module leader exceeds its own virtual threshold, therefore the data frames that the module has entered into the queue manager or the data frames that have arrived in the buffer need to be discarded. Determine if the data frame arriving in the buffer is a low-priority data frame: if so, discard the arriving data frame and proceed to step 13; otherwise, continue to step 8 for judgment.

[0098] 8. Determine if the data frame arriving at the buffer is a medium-priority data frame: if so, proceed to step 9; otherwise, proceed to step 10.

[0099] 9. Determine if the module has low-priority data frames. If so, the queue manager discards a low-priority data frame for the user and then proceeds to step 12. Otherwise, discard the data frame that has arrived in the cache and then proceed to step 13.

[0100] 10. If the data frame arriving in the buffer is neither a low-priority nor a medium-priority data frame, then it must be a high-priority data frame. At this point, determine whether the number of low-priority data frames already in the buffer for this module exceeds the minimum threshold: if it does, the queue manager discards one low-priority data frame for this module and then proceeds to step 12; otherwise, proceed to step 11.

[0101] 11. Determine if the number of medium-priority data frames that have entered the cache for this module exceeds the minimum threshold: If it does, the queue manager discards one medium-priority data frame for this module and then proceeds to step 12; otherwise, directly discard the data frame that has arrived in the cache and then proceed to step 13.

[0102] 12. Data frames arriving in the buffer are entered into their corresponding queues.

[0103] 13. Determine if there are any more data frames arriving in the buffer: if so, proceed to step 2; otherwise, the queue manager's enqueue operation ends.

[0104] This embodiment sets corresponding virtual threshold values ​​for in-vehicle modules based on the bandwidth of each module selected by the user for the in-vehicle Ethernet connection. When the data volume in the queue manager is large, the virtual threshold ensures that modules selecting larger bandwidths have greater throughput services and that modules have at least the cache space set by the virtual threshold value. When the data volume is small, due to the virtual nature of the threshold, some modules can obtain a larger cache space exceeding their threshold value. With limited cache space and ensuring that other modules have cache space equal to the virtual threshold value, a priority preemption mechanism provides cache space exceeding the bandwidth limit for some modules with larger data volumes, thus providing some modules with greater bandwidth while ensuring that all modules use Ethernet bandwidth services normally.

[0105] For the purpose of simplicity, the method steps disclosed in the above embodiments are described as a series of actions. However, those skilled in the art should understand that the embodiments of the present invention are not limited to the described order of actions, because according to the embodiments of the present invention, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions involved are not necessarily essential to the embodiments of the present invention.

[0106] like Figure 6 As shown, the present invention also provides a queue management system, comprising:

[0107] The bandwidth value acquisition module 201 is configured to acquire the bandwidth values ​​of each module selected by the user to connect to the Ethernet in response to the Ethernet connection signal.

[0108] The virtual threshold setting module 202 is configured to set corresponding virtual threshold values ​​based on the bandwidth values ​​of each module.

[0109] The virtual cache space partitioning module 203 is configured to partition the total cache space into corresponding virtual cache spaces based on the ratio of the bandwidth values ​​of each module to the total bandwidth value.

[0110] The queue management module 204 is configured to, in response to a data frame arrival signal, call the virtual buffer space based on the virtual threshold value to allocate the data frame to each queue.

[0111] It is worth noting that although only some basic functional modules are disclosed in the embodiments of this invention, it does not mean that the composition of this system is limited to the above-mentioned basic functional modules. On the contrary, what this embodiment intends to express is that, based on the above-mentioned basic functional modules, those skilled in the art can arbitrarily add one or more functional modules in combination with existing technology to form an infinite number of embodiments or technical solutions. That is to say, this system is open rather than closed. The fact that this embodiment only discloses a few basic functional modules should not be considered as the scope of protection of the claims of this invention being limited to the disclosed basic functional modules. At the same time, for the convenience of description, the above device is described separately according to its functions as various units and modules. Of course, in implementing this invention, the functions of each unit and module can be implemented in one or more software and / or hardware.

[0112] like Figure 7 As shown, the present invention also provides an electronic device, including: a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the steps of a queue management method.

[0113] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. For example... Figure 7 The structure shown in this embodiment of the invention includes an electronic device comprising one or more processors 710 and a storage device 720; the processors 710 in this electronic device may be one or more. Figure 7Taking a processor 710 as an example; a storage device 720 is used to store one or more programs; the one or more programs are executed by the one or more processors 710, so that the one or more processors 710 implement the queue management method as described in any one embodiment of the present invention.

[0114] The electronic device may also include an input device 730 and an output device 740.

[0115] The processor 710, storage device 720, input device 730, and output device 740 in this electronic device can be connected via a bus or other means. Figure 7 Taking the example of a connection between China and Israel via a bus.

[0116] The storage device 720 in this electronic device serves as a computer-readable storage medium, capable of storing one or more programs. These programs can be software programs, computer-executable programs, or modules, such as the program instructions / modules corresponding to the queue management method provided in this embodiment. The processor 710 executes various functional applications and data processing of the electronic device by running the software programs, instructions, and modules stored in the storage device 720, thereby implementing the queue management method described in the above embodiment.

[0117] Storage device 720 may include a program storage area and a data storage area. The program storage area may store the operating system and applications required for at least one function; the data storage area may store data created based on the use of the electronic device. Furthermore, storage device 720 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other non-volatile solid-state storage device. In some instances, storage device 720 may further include memory remotely located relative to processor 710, which can be connected to the device via a network. Examples of such networks include, but are not limited to, the Internet, intranets, local area networks, mobile communication networks, and combinations thereof.

[0118] Input device 730 can be used to receive input digital or character information, and to generate key signal inputs related to user settings and function control of the electronic device. Output device 740 may include display devices such as a display screen.

[0119] The present invention also provides a computer-readable storage medium storing a computer program executable by an electronic device, which, when run on the electronic device, causes the electronic device to perform the steps of a queue management method.

[0120] Specifically, the computer storage medium in this embodiment of the invention can be any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. For example, a computer-readable storage medium can be—but is not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this embodiment, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0121] The present invention also provides a vehicle equipped with a queue management system as described above.

[0122] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some or all of the technical features therein. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present invention.

Claims

1. A queue management method, characterized in that, include: In response to the Ethernet connection signal, the bandwidth values ​​of each module selected by the user to connect to the Ethernet are obtained; Based on the bandwidth values ​​of each module, set corresponding virtual threshold values; Based on the ratio of the bandwidth values ​​of each module to the total bandwidth value, the total cache space is divided into corresponding virtual cache spaces; In response to the arrival signal of a data frame, the virtual buffer space is invoked based on the virtual threshold value to allocate the data frame to each queue; Specifically, in response to a data frame arrival signal, based on the virtual threshold value, the virtual buffer space is invoked to allocate the data frames to each queue, including: In response to a data frame arrival signal, the virtual buffer space is initialized; Determine whether the total cache space is full; When the total cache space is full, determine whether the virtual threshold value of the corresponding module has been exceeded; When the virtual threshold value is exceeded, it is determined whether the arriving data frame is a low-priority data frame; When it is a low-priority data frame, the arriving data frame is discarded; Determine whether any more data frames are expected to arrive; When no data frame arrives, the data frame allocation is complete; When a data frame arrives, continue to determine whether the total buffer space is full; If the virtual threshold value is not exceeded, find the module with the most low-priority data frames. Determine whether the number of low-priority data frames in the module is greater than a preset first discard value; When the value is greater than the first discard value, the module discards one of the low-priority data frames and allocates the data frame into the corresponding queue. When the number of medium-priority data frames in the module is less than the first discard value, it is determined whether the number of medium-priority data frames in the module is greater than the preset second discard value. When the value is greater than the second discard value, the module discards one of the medium-priority data frames and allocates the data frame into the corresponding queue. When the value is less than the second discard value, the module discards a high-priority data frame and allocates the data frame into the corresponding queue. If it is not a low-priority data frame, determine whether it is a medium-priority data frame; When it is a medium-priority data frame, determine whether the module to which the medium-priority data frame belongs contains the low-priority data frame; When the module contains the low-priority data frame, one of the low-priority data frames in the module is discarded, and the data frame is allocated into the corresponding queue. When it is not the medium-priority data frame, determine whether the low-priority data frame in the module to which the arriving data frame belongs is greater than the first discard value; When the value is greater than the first discard value, one of the low-priority data frames in the module is discarded, and the data frame is allocated into the corresponding queue. When the number of medium-priority data frames is less than the first discard value, it is determined whether the number of medium-priority data frames in the module is greater than the second discard value. When the value is greater than the second discard value, one of the medium-priority data frames in the module is discarded, and the data frame is allocated to the corresponding queue. When the value is less than the second discard value, the arriving data frame is discarded.

2. The queue management method according to claim 1, characterized in that, Based on the bandwidth values ​​of each module, set corresponding virtual threshold values, specifically including: Through the formula: Obtain the bandwidth values ​​of each module, where, The bandwidth value of each module selected by the user to connect to the Ethernet is B. n ; The total bandwidth value is B; The total cache space is M; The virtual threshold value is M n .

3. The queue management method according to claim 1, characterized in that, When the total buffer space is not full, the data frame is allocated into the corresponding queue.

4. A queue management system, characterized in that, The system is used to execute the queue management method as described in any one of claims 1-3; The system includes: The bandwidth value acquisition module is configured to acquire the bandwidth values ​​of each module selected by the user to connect to the Ethernet in response to the Ethernet connection signal. The virtual threshold setting module is configured to set corresponding virtual threshold values ​​based on the bandwidth values ​​of each module. The virtual cache space partitioning module is configured to partition the total cache space into corresponding virtual cache spaces based on the ratio of the bandwidth values ​​of each module to the total bandwidth value. The queue management module is configured to, in response to a data frame arrival signal, call the virtual buffer space based on the virtual threshold value to allocate the data frame to each queue.

5. An electronic device, characterized in that, include: The system includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus; the memory stores a computer program, which, when executed by the processor, causes the processor to perform the steps of the method according to any one of claims 1 to 3.

6. A computer-readable storage medium, characterized in that, It stores a computer program executable by an electronic device, which, when run on the electronic device, causes the electronic device to perform the steps of the method according to any one of claims 1 to 3.

7. A vehicle, characterized in that, The vehicle is equipped with the queue management system as described in claim 4.