Platoon escape method and apparatus

By constructing an escape queue in a high-speed switch and determining the escape address based on the distance between read and write pointers, the problem of slow data escape speed is solved, enabling fast data escape and normal output.

CN117579554BActive Publication Date: 2026-07-24BEIJING CO WHEELS TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING CO WHEELS TECH CO LTD
Filing Date
2022-08-08
Publication Date
2026-07-24

AI Technical Summary

Technical Problem

In high-speed switches, the existing packet-by-packet escape data method is not fast enough when data congestion occurs, resulting in an abnormal situation where a large amount of data enters the input port, while the output port is busy escaping data but has no data output.

Method used

By obtaining the port write speed, read speed, and quantity of the shared memory unit, the minimum safe distance between the read pointer and the write pointer is determined, and a bitmap escape queue describing the data attributes of the storage queue is constructed. The read pointer is then directly jumped to the escape address to escape the data.

Benefits of technology

It improves the data escape speed, avoids a large amount of data being wasted on the escape process, prevents data backlog at the input port, and ensures normal output at the output port.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117579554B_ABST
    Figure CN117579554B_ABST
Patent Text Reader

Abstract

The application discloses a queue escape method and device, and relates to the information technology field, which comprises the following steps: acquiring the port write speed, the port read speed and the port quantity of a shared storage unit; determining the minimum safe distance between the read pointer and the write pointer of a storage queue according to the port write speed, the port read speed and the port quantity; if the position distance between the current read pointer and the write pointer is smaller than the minimum safe distance, then according to the minimum safe distance and the current position of the write pointer, the escape queue corresponding to the storage queue is inquired to determine the escape address of the storage queue, wherein the escape queue is a pre-constructed bitmap describing the data attributes in the storage queue; and the read pointer is jumped to the escape address to complete the escape action. By applying the technical scheme of the application, the data escape speed can be improved, so that the normal output of the output port data can be ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of information technology, specifically to a queue escape method and apparatus. Background Technology

[0002] To achieve efficient utilization of on-chip storage resources, shared storage is typically used for unified management in applications requiring high-speed data packet storage and forwarding. However, shared storage presents the problem of simultaneous read / write access from multiple ports. When the write speed exceeds the read speed for an extended period, queue congestion and overflow issues can occur. To avoid these problems, shared storage units manage enqueues and dequeues separately.

[0003] Currently, when congestion occurs in the dequeue, data is typically read from the storage and escaped packet by packet using an implicit linked list. However, this method is only suitable for switching devices with relatively low processing speeds, such as gigabit switches. For 10-gigabit or higher speed switches, this packet-by-packet data escape method suffers from insufficient data escape speed when congestion occurs. This can lead to an abnormal situation where a large amount of data continuously enters the input port, while the output port is busy escaping data and has no data output. Summary of the Invention

[0004] In view of this, this application provides a queue escape method and apparatus, which mainly improves the data escape speed, thereby ensuring the normal output of data from the output port.

[0005] According to a first aspect of the present invention, a queue escape method is provided, comprising:

[0006] Obtain the port write speed, port read speed, and number of ports for the shared storage unit;

[0007] Based on the port write speed, the port read speed, and the number of ports, determine the minimum safe distance between the read pointer and the write pointer of the storage queue;

[0008] If the current position distance between the read pointer and the write pointer is less than the minimum safe distance, then the escape queue corresponding to the storage queue is queried according to the minimum safe distance and the current position of the write pointer to determine the escape address of the storage queue, wherein the escape queue is a pre-constructed bitmap describing the data attributes in the storage queue;

[0009] The read pointer is then redirected to the escape address to complete the escape action.

[0010] Optionally, before querying the escape queue corresponding to the storage queue based on the minimum safe distance and the current position of the write pointer to determine the escape address of the storage queue, the method further includes:

[0011] Construct an escape queue corresponding to the storage queue, wherein the address space in the escape queue corresponds one-to-one with the address space in the storage queue;

[0012] When message data is written to the storage queue, the data in the corresponding address space of the storage queue is determined according to the attributes of each data segment in the message data.

[0013] Optionally, constructing the escape queue corresponding to the storage queue includes:

[0014] The write width, read width, and write depth of the RAM corresponding to the escape queue are set respectively, wherein the write depth of the RAM is equal to the write depth of the storage queue;

[0015] The escape queue is constructed based on the write width, the read width, and the write depth.

[0016] Optionally, determining the data in the corresponding address space of the storage queue based on the attributes of each data segment in the message data includes:

[0017] For the target data in each of the data frames, if the target data is the first data frame of the message data, then a first value is written into the corresponding address space of the storage queue;

[0018] If the target data is not the first data of the message data, then a second value is written into the corresponding address space of the storage queue.

[0019] Optionally, the step of querying the escape queue corresponding to the storage queue based on the minimum safe distance and the current position of the write pointer, and determining the escape address of the storage queue, includes:

[0020] The minimum escape address of the read pointer is determined based on the current position of the write pointer and the minimum safe distance.

[0021] The escape address of the storage queue is determined based on the minimum escape address and the escape queue corresponding to the storage queue.

[0022] Optionally, determining the escape address of the storage queue based on the minimum escape address and the escape queue corresponding to the storage queue includes:

[0023] Accordingly, read the contents of the address space in the escape queue that are greater than the minimum escape address, and determine the packet header address of the first read content as the first value;

[0024] The packet header address is determined as the escape address of the storage queue.

[0025] According to a second aspect of the present invention, a queue escape device is provided, comprising:

[0026] The acquisition unit is used to acquire the port write speed, port read speed, and number of ports of the shared storage unit;

[0027] The determining unit is used to determine the minimum safe distance between the read pointer and the write pointer of the storage queue based on the port write speed, the port read speed and the number of ports;

[0028] The determining unit is further configured to, if the current positional distance between the read pointer and the write pointer is less than the minimum safe distance, query the escape queue corresponding to the storage queue based on the minimum safe distance and the current position of the write pointer, and determine the escape address of the storage queue, wherein the escape queue is a pre-constructed bitmap describing the data attributes in the storage queue;

[0029] The escape unit is used to jump the read pointer to the escape address to complete the escape action.

[0030] Optionally, the device further includes: a construction unit,

[0031] The construction unit is used to construct the escape queue corresponding to the storage queue, wherein the address space in the escape queue corresponds one-to-one with the address space in the storage queue;

[0032] The determining unit is further configured to, when message data is written into the storage queue, determine the data in the corresponding address space of the storage queue based on the attributes of each data segment in the message data.

[0033] Optionally, the construction unit is specifically used to set the write width, read width, and write depth of the RAM corresponding to the escape queue, wherein the write depth of the RAM is equal to the write depth of the storage queue; and to construct the escape queue according to the write width, the read width, and the write depth.

[0034] Optionally, the determining unit is specifically used to write a first value into the corresponding address space of the storage queue if the target data in each batch of data is the first batch of data in the message data.

[0035] If the target data is not the first data of the message data, then a second value is written into the corresponding address space of the storage queue.

[0036] Optionally, the determining unit includes: a first determining module and a second determining module.

[0037] The first determining module is used to determine the minimum escape address of the read pointer based on the current position of the write pointer and the minimum safe distance;

[0038] The second determining module is used to determine the escape address of the storage queue based on the minimum escape address and the escape queue corresponding to the storage queue.

[0039] Optionally, the second determining module is specifically used to read the contents of the address space in the escape queue that are greater than the minimum escape address, and determine the packet header address of the first read content as the first value; and determine the packet header address as the escape address of the storage queue.

[0040] According to a third aspect of the present invention, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, performs the following steps:

[0041] Obtain the port write speed, port read speed, and number of ports for the shared storage unit;

[0042] Based on the port write speed, the port read speed, and the number of ports, determine the minimum safe distance between the read pointer and the write pointer of the storage queue;

[0043] If the current position distance between the read pointer and the write pointer is less than the minimum safe distance, then the escape queue corresponding to the storage queue is queried according to the minimum safe distance and the current position of the write pointer to determine the escape address of the storage queue, wherein the escape queue is a pre-constructed bitmap describing the data attributes in the storage queue;

[0044] The read pointer is then redirected to the escape address to complete the escape action.

[0045] According to a fourth aspect of the present invention, an electronic device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to perform the following steps:

[0046] Obtain the port write speed, port read speed, and number of ports for the shared storage unit;

[0047] Based on the port write speed, the port read speed, and the number of ports, determine the minimum safe distance between the read pointer and the write pointer of the storage queue;

[0048] If the current position distance between the read pointer and the write pointer is less than the minimum safe distance, then the escape queue corresponding to the storage queue is queried according to the minimum safe distance and the current position of the write pointer to determine the escape address of the storage queue, wherein the escape queue is a pre-constructed bitmap describing the data attributes in the storage queue;

[0049] The read pointer is then redirected to the escape address to complete the escape action.

[0050] Fifthly, this application provides a vehicle including: electronic equipment as described in the fourth aspect.

[0051] This invention provides a queue escape method and apparatus that, compared with the prior art's method of escaping data packet by packet when data congestion occurs, can obtain the port write speed, port read speed, and number of ports of a shared storage unit; and determine the minimum safe distance between the read pointer and write pointer of the storage queue based on the port write speed, the port read speed, and the number of ports; if the current position distance between the read pointer and the write pointer is less than the minimum safe distance, then query the escape queue corresponding to the storage queue based on the minimum safe distance and the current position of the write pointer, determine the escape address of the storage queue, wherein the escape queue is a pre-constructed bitmap describing the data attributes in the storage queue, and finally jump the read pointer to the escape address to complete the escape action. Because this invention can determine the escape address of the storage queue based on the minimum safe distance between the read pointer and the write pointer when data congestion occurs, and directly jump the read pointer to the escape address to complete the escape action, it can directly invalidate large blocks of packet data skipped by the read pointer in the storage queue. Compared with the existing technology of escaping packet data one packet at a time, this invention can improve the data escape speed. Furthermore, this invention can prevent a large amount of scheduling from being wasted on data escape, and avoid the abnormal situation where a large amount of data keeps entering the storage unit input port while the output port is busy with data escape but no data is output.

[0052] The above description is only an overview of the technical solution of this application. In order to better understand the technical means of this application and to implement it in accordance with the contents of the specification, and to make the above and other objects, features and advantages of this application more obvious and understandable, the following are specific embodiments of this application. Attached Figure Description

[0053] 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.

[0054] 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.

[0055] The accompanying drawings, which are included to provide a further understanding of the invention and form part of this application, illustrate exemplary embodiments of the invention and, together with their description, serve to explain the invention and do not constitute an undue limitation thereof. In the drawings:

[0056] Figure 1 A schematic flowchart of a queue escape method provided by an embodiment of the present invention is shown;

[0057] Figure 2 A schematic diagram of the shared storage unit structure provided in an embodiment of the present invention is shown;

[0058] Figure 3 This invention provides a schematic flowchart of another queue escape method according to an embodiment of the invention.

[0059] Figure 4 A schematic diagram of a queue escape device provided in an embodiment of the present invention is shown;

[0060] Figure 5 This invention provides a schematic diagram of another queue escape device according to an embodiment of the invention.

[0061] Figure 6 A schematic diagram of the physical structure of an electronic device provided by an embodiment of the present invention is shown. Detailed Implementation

[0062] To better understand the above-mentioned objectives, features, and advantages of this application, the solution of this application will be further described below. It should be noted that, unless otherwise specified, the embodiments and features described in these embodiments can be combined with each other.

[0063] Currently, the packet-by-packet data escape method has the problem of insufficient data escape speed when data congestion occurs. This can lead to an abnormal situation where a large amount of data keeps entering the input port, but no data is output from the output port because it is busy escaping data.

[0064] To address the above problems, embodiments of the present invention provide a queue escape method, such as... Figure 1 As shown, the method includes:

[0065] 101. Obtain the port write speed, port read speed, and number of ports of the shared storage unit.

[0066] The ports include ports for writing data and ports for reading data. The number of ports for writing data and the number of ports for reading data can be set according to actual needs.

[0067] This invention is primarily applicable to scenarios where data overflow must be prevented and data escape occurs during data congestion. The executing entity of this invention is a device or equipment capable of performing data escape.

[0068] The storage unit structure in the embodiments of the present invention is as follows: Figure 2 As shown, the system includes multiple ports for writing data, multiple ports for reading data, a shared storage pool, a statistical prediction module, and an escape module. The data packets written through the ports carry an information identifier to indicate which port the data was read from. Ports that read data do so when the queue is not empty. Meanwhile, the storage resources in the shared storage pool are shared by all ports that read data. These resources can be allocated according to the needs of the ports that read data. The allocated storage space is contiguous and belongs to the corresponding port that reads data. This allocated address space can only be used by data packets forwarded to that specific port.

[0069] Furthermore, based on the information identifier carried in the data packet being written, it is written into the address space allocated to the corresponding read data port, thus forming a storage queue. During the writing process, the write addresses of a complete data packet are contiguous, and at most one port obtains the right to write to the storage unit at any given time, with all write ports having the same write rate. Similarly, when reading packet data, the integrity of the packet data must be guaranteed, and at most one port obtains the right to read from the storage unit at any given time, with the read rate of a single port being the same as the write rate of a single port.

[0070] Furthermore, in Figure 2 In this system, the statistical prediction module is primarily used to predict whether the storage queue is about to overflow. If the storage queue is about to overflow, the statistical prediction module determines the minimum safe distance between the read pointer and the write pointer and sends an escape signal to the escape module. This escape signal carries the minimum safe distance. Upon receiving the escape signal, the escape module determines the escape address of the storage queue based on the minimum safe distance carried in the escape signal and controls the read pointer to jump directly to that escape address to complete a single escape action, thereby ensuring the data escape speed.

[0071] Specifically, in this embodiment of the invention, when data escape occurs, the statistical prediction module will collect information such as the port write speed, port read speed, number of ports, and storage queue depth of the shared storage unit, so as to predict data overflow and data escape based on the above information.

[0072] 102. Determine the minimum safe distance between the read pointer and the write pointer of the storage queue based on the port write speed, the port read speed, and the number of ports.

[0073] In this embodiment of the invention, after obtaining the port write speed, port read speed and number of ports of the storage unit, the statistical prediction module will determine the minimum safe distance between the read pointer and the write pointer based on the port write speed, port read speed, number of ports and storage depth of the storage queue. If the positional distance between the read pointer and the write pointer is less than the minimum safe distance, it indicates that the storage queue is about to overflow and data escape is required.

[0074] 103. If the current position distance between the read pointer and the write pointer is less than the minimum safe distance, then query the escape queue corresponding to the storage queue according to the minimum safe distance and the current position of the write pointer, and determine the escape address of the storage queue.

[0075] The escape queue is a pre-constructed bitmap describing the data attributes in the storage queue. The address space in the escape queue corresponds one-to-one with the address space in the storage queue. Through this escape queue, the header position of the message data can be found quickly, so that the message data can be processed as a whole packet during the data escape process.

[0076] In this embodiment of the invention, after determining the minimum safe distance between the read pointer and the write pointer, the statistical prediction module calculates the positional distance between them based on their current positions. If the positional distance is greater than or equal to the minimum safe distance, it indicates that the storage queue will not experience data overflow, and data escape is not required. Conversely, if the positional distance is less than the minimum safe distance, it indicates that the storage queue is about to experience data overflow, and data escape is necessary. When it is determined that data escape is required, the statistical prediction module sends escape information to the escape module, which carries the minimum safe distance.

[0077] After receiving escape information from the statistical prediction module, the escape module determines the minimum escape address based on the minimum safe distance and the current position of the write pointer carried in the escape information. Then, it queries the escape queue corresponding to the storage queue based on the minimum escape address, finds the address space that is greater than the minimum escape address and appears for the first time in the packet header, and determines it as the actual escape address corresponding to the storage queue.

[0078] 104. Jump the read pointer to the escape address to complete the escape action.

[0079] In this embodiment of the invention, after determining the actual escape address of the storage queue, the read pointer is directly jumped to the actual escape address to complete the escape action. That is, the read pointer starts reading from the actual escape address, and the large block of packet data in the storage queue that is jumped by the read pointer is directly invalidated. This can avoid escaping packet data packet by packet, thereby improving the data escape speed.

[0080] This invention provides a queue escape method that, compared to existing technologies that escape data packet by packet when congestion occurs, can obtain the port write speed, port read speed, and number of ports of a shared storage unit; and determine the minimum safe distance between the read pointer and write pointer of the storage queue based on the port write speed, the port read speed, and the number of ports; if the current position distance between the read pointer and the write pointer is less than the minimum safe distance, then the escape queue corresponding to the storage queue is queried based on the minimum safe distance and the current position of the write pointer to determine the escape address of the storage queue, wherein the escape queue is a pre-constructed bitmap describing the data attributes in the storage queue, and finally the read pointer is jumped to the escape address to complete the escape action. Because this embodiment of the invention can determine the escape address of the storage queue based on the minimum safe distance between the read pointer and the write pointer when data congestion occurs, and directly jump the read pointer to the escape address to complete the escape action, it can directly invalidate the large number of packet data skipped by the read pointer in the storage queue. Compared with the prior art's method of escaping packet data one packet at a time, this embodiment of the invention can improve the data escape speed. Furthermore, this embodiment of the invention can prevent a large amount of scheduling from being wasted on data escape, and avoid the abnormal situation where a large amount of data keeps entering the storage unit input port while the output port is busy with data escape but no data is output.

[0081] Furthermore, to better illustrate the escape process of the storage queue described above, as a refinement and extension of the above embodiments, this invention provides another queue escape method, such as... Figure 3 As shown, the method includes:

[0082] 201. Construct the escape queue corresponding to the storage queue.

[0083] In this embodiment, the address spaces in the escape queue correspond one-to-one with the address spaces in the storage queue. To clearly describe the nature of the data in each address space of the storage queue, an escape queue corresponding to the storage queue is constructed to store the position of the first unsent packet in the shared storage unit. The address spaces in this escape queue correspond one-to-one with the address spaces in the storage queue.

[0084] When constructing the escape queue, the write width, read width, and write depth of the RAM corresponding to the escape queue are set respectively. The write depth of the RAM is equal to the write depth of the storage queue. The escape queue is constructed based on the write width, read width, and write depth. Specifically, the write width of the RAM can be set to 1, and the write depth of the RAM can be set to be equal to the depth of the shared storage unit. Simultaneously, the read width of the RAM can be set according to actual needs, such as setting the read width of the RAM to M, thereby allowing M write data to be read at once, thus improving the read speed.

[0085] 202. When message data is written to the storage queue, the data in the corresponding address space of the storage queue is determined according to the attributes of each data segment in the message data.

[0086] In this embodiment of the invention, the writing of the escape queue occurs simultaneously with the writing of the data packet to the shared storage unit. Specifically, step 202 includes: for the target data in each data segment, if the target data is the first data segment of the packet, a first value is written into the corresponding address space of the storage queue; if the target data is not the first data segment of the packet, a second value is written into the corresponding address space of the storage queue. Here, the target data can be any data segment in the packet, and the first and second values ​​can be set according to actual needs.

[0087] Specifically, if the packet data written to the storage queue is the first packet data of this packet, then the flag bit 1 of the first packet data is written to the corresponding address space of the escape queue; if the packet data written to the storage queue is not the first packet data of this packet, then 0 is written to the corresponding address space of the escape queue. This establishes a mapping relationship between the escape queue and the storage queue. The position of the packet header in the escape queue can be found through the flag bit 1, thus enabling whole-packet operations on the packet data and helping to ensure the integrity of the packet data.

[0088] 203. Obtain the port write speed, port read speed, and number of ports of the shared storage unit.

[0089] In this embodiment of the invention, the specific process of obtaining the port write speed, port read speed and number of ports of the shared storage unit is exactly the same as step 101.

[0090] 204. Determine the minimum safe distance between the read pointer and the write pointer of the storage queue based on the port write speed, the port read speed and the number of ports.

[0091] In this embodiment of the invention, the statistical prediction module determines the minimum safe distance between the read pointer and the write pointer based on information such as the port write speed, port read speed, number of ports and storage depth of the storage queue. If the positional distance between the read pointer and the write pointer is less than the minimum safe distance, it indicates that the storage queue is about to overflow and data escape is required.

[0092] 205. If the current positional distance between the read pointer and the write pointer is less than the minimum safe distance, then query the escape queue corresponding to the storage queue based on the minimum safe distance and the current position of the write pointer, and determine the escape address of the storage queue.

[0093] The escape queue is a pre-constructed bitmap describing the data attributes in the storage queue.

[0094] In this embodiment of the invention, to determine the true escape address of the storage queue, step 205 specifically includes: determining the minimum escape address of the read pointer based on the current position of the write pointer and the minimum safe distance; and determining the escape address of the storage queue based on the minimum escape address and the escape queue corresponding to the storage queue. Further, determining the escape address of the storage queue based on the minimum escape address and the escape queue corresponding to the storage queue includes: sequentially reading the contents of the address space in the escape queue that are greater than the minimum escape address, and determining the header address of the packet whose first read content is the first value; and determining the header address as the escape address of the storage queue.

[0095] For example, if the minimum safe distance is 100 and the current position of the write pointer is 1, adding the current position of the write pointer to the minimum safe distance gives the minimum escape address of the storage queue: 1 + 100 = 101. Since the data stored in the storage queue address space 101 may not be the first data of the message, and the operation of the message data requires a full-cycle operation, it is necessary to query the escape queue based on the minimum escape address 101. That is, read the contents of the address spaces in the escape queue that are greater than the minimum escape address 101 in turn, and find the message header address that is 1 for the first time. If the contents of the escape queue address space 102 are 0, it means that the data in the storage queue address space 102 is not the message header data. At this time, continue to read the contents of the escape queue address space 103. If the contents of the escape queue address space 103 are flag 1, it means that the data in the storage queue address space 103 is the message header data. At this time, 103 is determined as the actual escape address of the storage queue.

[0096] 206. Jump the read pointer to the escape address to complete the escape action.

[0097] In this embodiment of the invention, in order to improve the data escape speed, the read pointer is directly jumped to the actual escape address of the storage queue to complete the escape action. Large blocks of data that are skipped by the read pointer in the storage queue are directly invalidated.

[0098] Another queue escape method provided by this invention can determine the escape address of the storage queue based on the minimum safe distance between the read pointer and the write pointer when data congestion occurs, and directly jump the read pointer to the escape address to complete the escape action. Therefore, it can directly invalidate the large number of packet data skipped by the read pointer in the storage queue. Compared with the existing method of escaping packet data one packet at a time, this invention can improve the data escape speed. Furthermore, this invention can prevent a large amount of scheduling from being wasted on data escape and avoid the abnormal situation where a large amount of data is constantly entering the storage unit input port while the output port is busy with data escape but no data is output.

[0099] Furthermore, as Figure 1 In specific implementation, embodiments of the present invention provide a queue escape device, such as... Figure 4 As shown, the device includes: an acquisition unit 31, a determination unit 32, and an escape unit 33.

[0100] The acquisition unit 31 can be used to acquire the port write speed, port read speed and number of ports of the shared storage unit.

[0101] The determining unit 32 can be used to determine the minimum safe distance between the read pointer and the write pointer of the storage queue based on the port write speed, the port read speed and the number of ports.

[0102] The determining unit 32 can also be used to query the escape queue corresponding to the storage queue based on the minimum safe distance and the current position of the write pointer if the current position distance between the read pointer and the write pointer is less than the minimum safe distance, and determine the escape address of the storage queue, wherein the escape queue is a pre-constructed bitmap describing the data attributes in the storage queue.

[0103] The escape unit 33 can be used to jump the read pointer to the escape address to complete the escape action.

[0104] In specific application scenarios, such as Figure 5 As shown, the device also includes a construction unit 34.

[0105] The construction unit 34 can be used to construct the escape queue corresponding to the storage queue, wherein the address space in the escape queue corresponds one-to-one with the address space in the storage queue.

[0106] The determining unit 32 can also be used to determine the data in the corresponding address space of the storage queue according to the attributes of each data segment in the message data when the message data is written into the storage queue.

[0107] In a specific application scenario, the construction unit 34 is specifically used to set the write width, read width and write depth of the RAM corresponding to the escape queue, wherein the write depth of the RAM is equal to the write depth of the storage queue; and to construct the escape queue according to the write width, the read width and the write depth.

[0108] In a specific application scenario, the determining unit 32 can be used to determine the target data in each batch of data. If the target data is the first batch of data in the message data, a first value is written into the corresponding address space of the storage queue; if the target data is not the first batch of data in the message data, a second value is written into the corresponding address space of the storage queue.

[0109] In a specific application scenario, the determining unit 32 includes a first determining module 321 and a second determining module 322.

[0110] The first determining module 321 can be used to determine the minimum escape address of the read pointer based on the current position of the write pointer and the minimum safe distance.

[0111] The second determining module 322 can be used to determine the escape address of the storage queue based on the minimum escape address and the escape queue corresponding to the storage queue.

[0112] In a specific application scenario, the second determining module 322 can be used to read the contents of the address space in the escape queue that are greater than the minimum escape address, and determine the packet header address of the first read content as the first value; and determine the packet header address as the escape address of the storage queue.

[0113] It should be noted that other corresponding descriptions of the functional modules involved in the queue escape device provided in this embodiment of the invention can be found in [reference needed]. Figure 1 The corresponding description of the method shown will not be repeated here.

[0114] Based on the above, Figure 1 Accordingly, this embodiment of the invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor, performs the following steps: acquiring vehicle information corresponding to multiple vehicles; acquiring the port write speed, port read speed, and number of ports of a shared storage unit; determining the minimum safe distance between the read pointer and the write pointer of a storage queue based on the port write speed, the port read speed, and the number of ports; if the current positional distance between the read pointer and the write pointer is less than the minimum safe distance, querying the escape queue corresponding to the storage queue based on the minimum safe distance and the current position of the write pointer, and determining the escape address of the storage queue, wherein the escape queue is a pre-constructed bitmap describing the data attributes in the storage queue; and jumping the read pointer to the escape address to complete the escape action.

[0115] Based on the above, Figure 1 The method shown and as Figure 4 The embodiment of the device shown in the invention also provides a physical structural diagram of an electronic device, such as... Figure 6As shown, the electronic device includes: a processor 41, a memory 42, and a computer program stored in the memory 42 and executable on the processor. Both the memory 42 and the processor 41 are mounted on a bus 43. When the processor 41 executes the program, it performs the following steps: acquiring vehicle information corresponding to multiple vehicles; acquiring the port write speed, port read speed, and number of ports of a shared storage unit; determining the minimum safe distance between the read pointer and write pointer of the storage queue based on the port write speed, the port read speed, and the number of ports; if the current positional distance between the read pointer and the write pointer is less than the minimum safe distance, querying the escape queue corresponding to the storage queue based on the minimum safe distance and the current position of the write pointer, and determining the escape address of the storage queue, wherein the escape queue is a pre-constructed bitmap describing the data attributes in the storage queue; and jumping the read pointer to the escape address to complete the escape action.

[0116] When data congestion occurs, this embodiment of the invention can determine the escape address of the storage queue based on the minimum safe distance between the read pointer and the write pointer, and directly jump the read pointer to the escape address to complete the escape action. Therefore, it can directly invalidate the large number of packet data skipped by the read pointer in the storage queue. Compared with the existing technology of escaping packet data one packet at a time, this embodiment of the invention can improve the data escape speed. Furthermore, this embodiment of the invention can prevent a large amount of scheduling from being wasted on data escape, and avoid the abnormal situation where a large amount of data is constantly entering the storage unit input port while the output port is busy with data escape but no data is output.

[0117] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the term "comprising" or any other variations thereof is intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0118] The above description is merely a specific embodiment of this application, enabling those skilled in the art to understand or implement this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments described herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.

Claims

1. A queue escape method, characterized in that, include: Obtain the port write speed, port read speed, and number of ports for the shared storage unit; Based on the port write speed, the port read speed, and the number of ports, determine the minimum safe distance between the read pointer and the write pointer of the storage queue; If the current position distance between the read pointer and the write pointer is less than the minimum safe distance, then the escape queue corresponding to the storage queue is queried according to the minimum safe distance and the current position of the write pointer to determine the escape address of the storage queue, wherein the escape queue is a pre-constructed bitmap describing the data attributes in the storage queue; The read pointer is then redirected to the escape address to complete the escape action.

2. The method according to claim 1, characterized in that, Before determining the escape address of the storage queue by querying the escape queue corresponding to the storage queue based on the minimum safe distance and the current position of the write pointer, the method further includes: Construct an escape queue corresponding to the storage queue, wherein the address space in the escape queue corresponds one-to-one with the address space in the storage queue; When message data is written to the storage queue, the data in the corresponding address space of the storage queue is determined according to the attributes of each data segment in the message data.

3. The method according to claim 2, characterized in that, The construction of the escape queue corresponding to the storage queue includes: The write width, read width, and write depth of the RAM corresponding to the escape queue are set respectively, wherein the write depth of the RAM is equal to the write depth of the storage queue; The escape queue is constructed based on the write width, the read width, and the write depth.

4. The method according to claim 2, characterized in that, The step of determining the data in the corresponding address space of the storage queue based on the attributes of each data segment in the message data includes: For the target data in each of the data frames, if the target data is the first data frame of the message data, then a first value is written into the corresponding address space of the storage queue; If the target data is not the first data of the message data, then a second value is written into the corresponding address space of the storage queue.

5. The method according to claim 4, characterized in that, The step of querying the escape queue corresponding to the storage queue based on the minimum safe distance and the current position of the write pointer, and determining the escape address of the storage queue, includes: The minimum escape address of the read pointer is determined based on the current position of the write pointer and the minimum safe distance. The escape address of the storage queue is determined based on the minimum escape address and the escape queue corresponding to the storage queue.

6. The method according to claim 5, characterized in that, The step of determining the escape address of the storage queue based on the minimum escape address and the escape queue corresponding to the storage queue includes: Accordingly, read the contents of the address space in the escape queue that are greater than the minimum escape address, and determine the packet header address of the first read content as the first value; The packet header address is determined as the escape address of the storage queue.

7. A queue escape device, characterized in that, include: The acquisition unit is used to acquire the port write speed, port read speed, and number of ports of the shared storage unit; The determining unit is used to determine the minimum safe distance between the read pointer and the write pointer of the storage queue based on the port write speed, the port read speed and the number of ports; The determining unit is further configured to, if the current positional distance between the read pointer and the write pointer is less than the minimum safe distance, query the escape queue corresponding to the storage queue based on the minimum safe distance and the current position of the write pointer, and determine the escape address of the storage queue, wherein the escape queue is a pre-constructed bitmap describing the data attributes in the storage queue; The escape unit is used to jump the read pointer to the escape address to complete the escape action.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.

10. A vehicle, characterized in that, include: The electronic device as described in claim 9.