Data processing method and device, equipment, storage medium and vehicle

By querying the ring cache queue and using the free area for data copy, the problem of low data transmission efficiency is solved and more efficient data transmission is achieved.

CN118740758APending Publication Date: 2024-10-01BEIJING CO WHEELS TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310312995.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-03-28
Publication Date
2024-10-01

AI Technical Summary

Technical Problem

In the prior art, during data transmission, when the data to be sent crosses the end of the ring buffer queue, two copies of the data are required to copy the data to the temporary buffer area, resulting in reduced data transmission efficiency.

Method used

Determine the cache area of ​​the data to be sent in the target ring cache queue, and query the neighbor ring cache queue to see if there is a free cache area. If it exists and the amount of data in the free area is not less than the amount of data to be sent, copy the data to the free area, reducing Number of copies and data volume.

Benefits of technology

Ensure the effectiveness of sendPtr and length, reduce the number of copies and data volume, and improve data transmission efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118740758A_ABST
    Figure CN118740758A_ABST
Patent Text Reader

Abstract

The invention discloses a data processing method and device, equipment, a storage medium and a vehicle. The method comprises the steps that a cache area of data to be sent is determined in a target annular cache queue, and the target annular cache queue is any one of a plurality of annular cache queues which are connected end to end; under the condition that the to-be-sent data crosses the tail of the target annular cache queue, a cache sub-region corresponding to the to-be-sent data is determined in the cache region, and the cache sub-region comprises any one of a queue head cache region and a queue tail cache region of the target annular cache queue; inquiring whether an idle cache region corresponding to the cache sub-region exists in the neighbor annular cache queue or not; and copying the to-be-sent data in the cache sub-region to the idle cache region under the condition that the idle cache region exists and the data volume corresponding to the idle cache region is not less than the data volume corresponding to the cache sub-region. According to the embodiment of the invention, the data transmission efficiency can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of communication technology, and in particular, relates to a data processing method, device, equipment, storage medium and vehicle. Background Art

[0002] In the field of communication technology, Ethernet and Transmission Control Protocol / Internet Protocol (TCP / IP) protocol stacks are usually used for data transmission. The upper-layer application of the AUTomotive Open System Architecture (AUTOSAR) can process the data transmitted by the TCP / IP protocol stack to implement the corresponding functions. Usually, the socket adapter layer (SoAd) can be located between the TCP / IP protocol stack and the upper-layer application of AUTOSAR, which is used to cache the data sent by the TCP / IP protocol stack and transmit the data to the upper-layer application when the upper-layer application needs to process the data. In order to cache data, a circular buffer queue can be created in SoAd. When transmitting data, SoAd needs to provide the upper-layer application with the address sendPtr and size length of the data to be sent in the circular buffer queue. If the data to be sent spans the tail of the circular buffer queue, the upper-layer application cannot obtain the required data based on sendPtr and length.

[0003] In order to enable the upper layer application to successfully obtain the required data, the prior art usually copies all the data to be sent to a temporary buffer area twice to ensure the validity of sendPtr and length. However, the above data processing method will reduce the data transmission efficiency. Summary of the invention

[0004] The embodiments of the present application provide a data processing method, apparatus, device, storage medium and vehicle, which can improve the data transmission efficiency.

[0005] In a first aspect, an embodiment of the present application provides a data processing method, the method comprising:

[0006] Determine a buffer area for data to be sent in a target circular buffer queue, wherein the target circular buffer queue is any one of a plurality of circular buffer queues connected end to end;

[0007] In a case where the data to be sent crosses the tail of the target circular buffer queue, determining a cache sub-region corresponding to the data to be sent in the cache region, the cache sub-region including any one of the head cache region and the tail cache region of the target circular buffer queue;

[0008] querying whether there is a free cache area corresponding to the cache sub-area in a neighboring circular cache queue, wherein the neighboring circular cache queue is a circular cache queue adjacent to the target circular cache queue among the multiple end-to-end connected circular cache queues;

[0009] In the case that the free cache area exists and the amount of data corresponding to the free cache area is not less than the amount of data corresponding to the cache sub-area, the to-be-sent data in the cache sub-area is copied to the free cache area.

[0010] In a possible implementation, before querying whether there is a free cache area corresponding to the cache sub-area in the neighbor ring cache queue, the method further includes:

[0011] Determine the size relationship between the amount of data corresponding to the head buffer area and the amount of data corresponding to the tail buffer area;

[0012] The querying whether there is an idle cache area corresponding to the cache sub-area in the neighbor ring cache queue includes:

[0013] When the amount of data corresponding to the head cache area is less than the amount of data corresponding to the tail cache area, query whether there is a head free cache area corresponding to the head cache area in the first neighbor circular cache queue, and the head of the first neighbor circular cache queue is connected to the tail of the target circular cache queue;

[0014] When the amount of data corresponding to the head cache area is not less than the amount of data corresponding to the tail cache area, query whether there is a tail free cache area corresponding to the tail cache area in the second neighbor circular cache queue, and the tail of the second neighbor circular cache queue is connected to the head of the target circular cache queue.

[0015] In a possible implementation, after querying whether there is a head free cache area corresponding to the head cache area in the first neighbor circular cache queue, the method further includes:

[0016] In the case where the free cache area at the head of the team does not exist, or the free cache area at the head of the team exists and the amount of data corresponding to the free cache area at the head of the team is less than the amount of data corresponding to the free cache area at the head of the team, query whether the free cache area at the tail of the team exists in the second neighbor circular cache queue;

[0017] The step of copying the to-be-sent data in the cache sub-area to the free cache area when the free cache area exists and the amount of data corresponding to the free cache area is not less than the amount of data corresponding to the cache sub-area comprises:

[0018] When there is a free cache area at the end of the team and the amount of data corresponding to the free cache area at the end of the team is not less than the amount of data corresponding to the cache area at the end of the team, the data to be sent in the cache area at the end of the team is copied to the free cache area at the end of the team.

[0019] In a possible implementation, after querying whether there is a tail free cache area corresponding to the tail cache area in the second neighbor circular cache queue, the method further includes:

[0020] In the case where the free cache area at the end of the team does not exist, or the free cache area at the end of the team exists and the amount of data corresponding to the free cache area at the end of the team is less than the amount of data corresponding to the free cache area at the end of the team, query whether the free cache area at the head of the team exists in the first neighbor circular cache queue;

[0021] The method further comprises: when the free cache area exists and the amount of data corresponding to the free cache area is not less than the amount of data corresponding to the cache sub-area, copying the to-be-sent data in the cache sub-area to the free cache area, further comprising:

[0022] When the amount of data corresponding to the free buffer area at the head of the team is not less than the amount of data corresponding to the free buffer area at the head of the team, the to-be-sent data in the free buffer area at the head of the team is copied to the free buffer area at the head of the team.

[0023] In a possible implementation, before determining the buffer area of ​​the data to be sent in the target ring buffer queue, the method further includes:

[0024] Saving cache control structures respectively corresponding to the plurality of circular cache queues in the form of an array, wherein the cache control structure includes an index position of the cache control structure in the array;

[0025] Before querying whether there is a free cache area corresponding to the cache sub-area in the neighbor ring cache queue, the method further includes:

[0026] When the index position of the target cache control structure corresponding to the target ring cache queue is index, obtaining a neighbor cache control structure with an index position of index-1 and / or index+1 in the array;

[0027] A ring cache queue corresponding to the neighbor cache control structure is determined as the neighbor ring cache queue.

[0028] In a possible implementation, the cache control structure further includes a queue head position and a length of the circular cache queue, and before querying whether there is an idle cache area corresponding to the cache sub-area in the neighbor circular cache queue, the method further includes:

[0029] Obtaining a target queue head position and a target length corresponding to the target circular buffer queue;

[0030] The target queue head position is moved backward by the target length to determine the queue head position of the first neighboring circular buffer queue corresponding to the target circular buffer queue, and the queue head of the first neighboring circular buffer queue is connected to the queue tail of the target circular buffer queue;

[0031] The target queue head position is moved forward by the target length to determine the queue head position of a second neighboring circular buffer queue corresponding to the target circular buffer queue, and the tail of the second neighboring circular buffer queue is connected to the queue head of the target circular buffer queue.

[0032] In a possible implementation, the cache control structure further includes a free cache start position and a cache data start position, and querying whether there is a free cache area corresponding to the cache sub-area in the neighbor ring cache queue includes:

[0033] Obtaining the free cache starting position and the cache data starting position corresponding to the neighbor cache queue;

[0034] When the value corresponding to the free cache start position is not less than the value corresponding to the cache data start position, it is determined that there is a free cache area corresponding to the cache sub-area in the neighbor ring cache queue.

[0035] In a second aspect, an embodiment of the present application provides a data processing device, the device comprising:

[0036] A first determining module, configured to determine a buffer area of ​​the data to be sent in a target circular buffer queue, wherein the target circular buffer queue is any one of a plurality of circular buffer queues connected end to end;

[0037] A second determining module is used to determine, in the cache area, a cache sub-area corresponding to the data to be sent when the data to be sent crosses the tail of the target circular cache queue, the cache sub-area including any one of the head cache area and the tail cache area of ​​the target circular cache queue;

[0038] A query module, used for querying whether there is a free cache area corresponding to the cache sub-area in a neighboring circular cache queue, wherein the neighboring circular cache queue is a circular cache queue adjacent to the target circular cache queue among the multiple end-to-end connected circular cache queues;

[0039] The copy module is used to copy the to-be-sent data in the cache sub-area to the free cache area when the free cache area exists and the amount of data corresponding to the free cache area is not less than the amount of data corresponding to the cache sub-area.

[0040] In a third aspect, an embodiment of the present application provides an electronic device, the electronic device comprising: a processor and a memory storing computer program instructions;

[0041] When the processor executes the computer program instructions, the processor implements any possible implementation method of the first aspect described above.

[0042] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium having computer program instructions stored thereon, which, when executed by a processor, implements a method in any possible implementation method of the first aspect described above.

[0043] In a fifth aspect, an embodiment of the present application provides a vehicle, the vehicle comprising at least one of the following:

[0044] A data processing device as in any one of the embodiments of the second aspect;

[0045] An electronic device as in any one of the embodiments of the third aspect;

[0046] A computer-readable storage medium as in any embodiment of the fourth aspect.

[0047] In the data processing method, device, equipment, storage medium and vehicle of the embodiment of the present application, since the neighbor circular cache queue is adjacent to the target circular cache queue, the validity of sendPtr and length can be ensured by copying the data to be sent in the cache sub-area to the free cache area corresponding to the cache sub-area when there is a free cache area corresponding to the cache sub-area in the neighbor circular cache queue and the amount of data corresponding to the free cache area is not less than the amount of data corresponding to the cache sub-area. Since the cache sub-area includes any one of the head cache area and the tail cache area of ​​the target circular cache queue, that is, only the data to be sent in the head cache area or the tail cache area is copied, so the number of copies and the amount of data copy can be reduced, thereby improving the data transmission efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] In order to more clearly illustrate the technical solution of the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.

[0049] Figure 1 is a schematic diagram of AUTOSAR-based data transmission provided in an embodiment of the present application;

[0050] Figure 2 It is a schematic diagram of a corresponding relationship between a cache control structure and a ring receiving cache area provided in an embodiment of the present application;

[0051] Figure 3 It is a schematic diagram of two scenarios of cache data in a circular cache queue provided by an embodiment of the present application;

[0052] Figure 4 This is a schematic diagram of a cached data that does not cross the end of a queue provided by an embodiment of the present application;

[0053] Figure 5 This is a schematic diagram of a cache data crossing the tail of a queue provided by an embodiment of the present application;

[0054] Figure 6 It is a flowchart of a data processing method provided in an embodiment of the present application;

[0055] Figure 7 It is a schematic diagram of a corresponding relationship between a cache control structure and a shared annular receiving cache area provided in an embodiment of the present application;

[0056] Figure 8 It is a schematic diagram of the correspondence between another cache control structure and a shared annular receiving cache area provided in an embodiment of the present application;

[0057] Fig. 9 is a schematic diagram of a data processing method provided in an embodiment of the present application;

[0058] Fig.10 is a schematic diagram of another data processing method provided in an embodiment of the present application;

[0059] Fig.11 It is a flowchart of another data processing method provided in an embodiment of the present application;

[0060] Fig.12 is a structural schematic diagram of a data processing device provided in an embodiment of the present application;

[0061] Fig.13 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0062] In order to more clearly understand the above-mentioned purposes, features and advantages of the present application, the scheme of the present application will be further described below. It should be noted that the embodiments of the present application and the features in the embodiments can be combined with each other without conflict.

[0063] In the following description, many specific details are set forth to facilitate a full understanding of the present application, but the present application may also be implemented in other ways different from those described herein; obviously, the embodiments in the specification are only part of the embodiments of the present application, rather than all of the embodiments.

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

[0065] As described in the background technology, the socket adaptor (SoAd) can be located between the TCP / IP protocol stack and the upper-layer application of AUTOSAR, and is used to cache the data sent by the TCP / IP protocol stack, and transmit data to the upper-layer application when the upper-layer application needs to process the data. Among them, the AUTOSAR standard follows the concept of static communication relationship, that is, it is predetermined at compile time and strictly enforced at runtime. The AUTOSAR communication service module is based on the transmission of protocol data unit (PDU), and the source and destination of the transmitted data are predetermined at compile time. Among them, PDU can be the data format for communication between upper-layer applications. Socket Adaptor can provide PDU-based AUTOSAR communication services on the basis of the TCP / IP protocol stack by establishing a predetermined configuration (including the information required by AUTOSAR) and opening some options for updating at runtime. In addition, the Socket Adaptor module can decouple the callback-based AUTOSAR software architecture from the socket-based communication processing in TCP / IP, and create an interface between the PDU-based AUTOSAR communication service module and the socket-based TCP / IP protocol stack to map the PDU ID to the socket connection and vice versa.

[0066] Based on this, the schematic diagram of AUTOSAR-based data transmission can be as follows Figure 1 As shown. Among them, the TCP / IP network protocol stack can receive Ethernet messages sent by the vehicle-mounted Ethernet switch, and then perform data transmission based on the messages. In addition, the receiving cache may include a circular cache queue and its corresponding cache control structure, and the circular cache queue may specifically be a circular receiving cache queue. Generally, the circular cache queue can also be called a circular cache area, and the circular receiving cache queue can also be called a circular receiving cache area. A circular cache queue can correspond to a cache control structure.

[0067] In the prior art, the corresponding relationship between the buffer control structure and the ring receiving buffer area can be as follows: Figure 2 As shown. The ring buffer control structure may include buffer, head, tail and size. Among them, the buffer pointer may point to the head of the ring buffer area, the head may save the starting position of the cached data, the tail may save the starting position of the free cache, and the size may indicate the length of the ring buffer queue.

[0068] When SoAd transmits data to the upper layer application, SoAd needs to provide the upper layer application with the address sendPtr and size length of the data to be sent in the circular buffer queue. Figure 3 The two scenarios shown in FIG. 1 are as follows. Therefore, when a circular buffer queue is used to transmit data to an upper layer application, the following two situations are usually encountered.

[0069] Case 1: If Figure 4 As shown, if the data to be sent does not cross the tail of the queue, directly point sendPtr to the head position, and then provide sendPtr and the size of the data to be sent to the upper-layer application.

[0070] Case 2: If Figure 5 As shown, if the data to be sent crosses the end of the queue, a temporary buffer area is usually provided in the prior art, and then the data to be sent is copied to the temporary buffer area through the following two steps:

[0071] (1) copying the data to be sent in the tail buffer area of ​​the ring buffer area to the head buffer area of ​​the temporary buffer area;

[0072] (2) The data to be sent in the head buffer area of ​​the ring buffer area is copied to an area of ​​the temporary buffer area that is adjacent to the head buffer area and located after the head buffer area.

[0073] In this way, sendPtr is pointed to the head of the queue in the temporary buffer, and then sendPtr and length are provided to the upper-level application.

[0074] If the data to be sent crosses the end of the queue, the existing solutions have the following defects: (1) it is necessary to copy all the data to be sent to the temporary buffer area through two memory copies; (2) the amount of data to be copied is the amount of data corresponding to all the data to be sent. Here, the number of copies and the amount of copied data are both large, which will reduce the data transmission efficiency. In addition, multiple copies and copying all the data to be sent will cause performance consumption.

[0075] Therefore, in order to solve the problems of the prior art, the embodiments of the present application provide a data processing method, device, equipment, storage medium and vehicle.

[0076] The following first introduces the data processing method provided in the embodiment of the present application.

[0077] Figure 6 FIG. 1 is a flow chart of a data processing method provided by an embodiment of the present application. Figure 6 As shown, the data processing method provided in the embodiment of the present application includes the following steps:

[0078] S610, determining a cache area of ​​data to be sent in a target circular cache queue, where the target circular cache queue is any one of a plurality of circular cache queues connected end to end;

[0079] S620: When the data to be sent crosses the tail of the target circular buffer queue, determine a cache sub-region corresponding to the data to be sent in the cache region, where the cache sub-region includes any one of the head cache region and the tail cache region of the target circular buffer queue;

[0080] S630, query whether there is a free cache area corresponding to the cache sub-area in a neighboring ring cache queue, where the neighboring ring cache queue is a ring cache queue adjacent to the target ring cache queue among a plurality of ring cache queues connected end to end;

[0081] S640: If there is a free cache area and the amount of data corresponding to the free cache area is not less than the amount of data corresponding to the cache sub-area, copy the to-be-sent data in the cache sub-area to the free cache area.

[0082] In the data processing method of the embodiment of the present application, since the neighbor circular buffer queue is adjacent to the target circular buffer queue, the validity of sendPtr and length can be ensured by copying the data to be sent in the cache sub-area to the free cache area corresponding to the cache sub-area when there is a free cache area corresponding to the cache sub-area in the neighbor circular buffer queue and the amount of data corresponding to the free cache area is not less than the amount of data corresponding to the cache sub-area. Since the cache sub-area includes any one of the head cache area and the tail cache area of ​​the target circular buffer queue, that is, only the data to be sent in the head cache area or the tail cache area is copied, so the number of copies and the amount of data copy can be reduced, thereby improving the data transmission efficiency.

[0083] The specific implementation methods of the above steps are introduced below.

[0084] In some embodiments, in S610, multiple circular cache queues may be connected end to end, that is, the addresses of the multiple circular cache queues may be continuous. Multiple circular cache queues with continuous addresses may be shared circular cache queues. The target circular cache queue may be any one of the multiple circular cache queues with continuous addresses. In order to obtain a shared circular cache queue, a cache control structure array may be opened. That is, the cache control structures corresponding to the multiple circular cache queues may be stored in the form of an array. The correspondence between the cache control structure and the shared circular receiving buffer area may be as follows: Figure 7As shown. Among them, the cache control structures corresponding to different ring receiving buffers can be the same. The cache control structure may include index, buffer, head, tail and size. Among them, index can be the index position of the cache control structure in the array. The specific data structure of the cache control structure can be as follows:

[0085]

[0086] As an example, the cache area may be the area between the head and the tail (excluding the tail). Figure 3 As shown, the cache area can be an area between 3 and n as shown in scenario one, or an area between 4094 and n as shown in scenario two.

[0087] In some embodiments, in S620, if the cache area satisfies the inequality head+length>size, it can be considered that the data to be sent spans the tail of the target circular buffer queue. In addition, the head cache area can be the area between buffer and tail (excluding tail), and the tail cache area can be the area between head and tail.

[0088] As an example, Figure 3 As shown in the scenario 2 in FIG. 1 , the cache area may include both the head position 0 and the tail position 4095 of the target circular cache queue. At this time, the cache sub-area may include the area between 4094 and 4095 (i.e., the tail cache area) and the area between 0 and n (i.e., the head cache area).

[0089] In some embodiments, in S630, the neighbor circular buffer queue may include a first neighbor circular buffer queue and a second neighbor circular buffer queue. Among them, the head of the first neighbor circular buffer queue may be connected to the tail of the target circular buffer queue. That is, the first neighbor circular buffer queue may be the next neighbor circular buffer queue adjacent to the target circular buffer queue. The tail of the second neighbor circular buffer queue may be connected to the head of the target circular buffer queue. That is, the second neighbor circular buffer queue may be the previous neighbor circular buffer queue adjacent to the target circular buffer queue. The previous neighbor circular buffer queue and the next neighbor circular buffer queue of the target circular buffer queue may exist in the shared circular buffer queue at the same time, or only the previous neighbor circular buffer queue or the next neighbor circular buffer queue may exist.

[0090] As an example, Figure 8As shown, the shared circular buffer queue can simultaneously contain the previous neighbor circular buffer queue and the next neighbor circular buffer queue of the target circular buffer queue. Among them, the current pointer can point to the target buffer control structure, that is, the buffer control structure corresponding to the target circular receiving buffer area. The before pointer can point to the previous neighbor buffer control structure, that is, the buffer control structure corresponding to the previous neighbor circular receiving buffer area. The next pointer can point to the next neighbor buffer control structure, that is, the buffer control structure corresponding to the next neighbor circular receiving buffer area.

[0091] In addition, the free cache area may be an area that does not include cached data. The free cache area may include a head free cache area and a tail free cache area. The head free cache area may be a free area including the head position, and the tail free area may be a free area including the tail position. For example, Figure 3 As shown in the scenario 1 in FIG, the free cache area at the head of the queue may be an area between 0 and 2, and the free cache area at the tail of the queue may be an area between n+1 and 4095.

[0092] As an example, the free cache area corresponding to the cache sub-area may be a head free cache area in the first neighbor circular cache queue, or a tail free cache area in the second neighbor circular cache queue.

[0093] Based on this, in some embodiments, the above S630 may specifically include:

[0094] Get the free cache start position and cache data start position corresponding to the neighbor cache queue;

[0095] When the value corresponding to the free cache start position is not less than the value corresponding to the cache data start position, it is determined that there is a free cache area corresponding to the cache sub-area in the neighbor ring cache queue.

[0096] Specifically, if the neighbor circular cache queue is the previous neighbor circular cache queue, the following formula inequality can be used to query whether there is a free cache area corresponding to the cache sub-area in the neighbor circular cache queue: before->tail>=before->head. That is, if the above inequality holds, it can be determined that there is a free cache area corresponding to the cache sub-area in the previous neighbor circular cache queue. If the neighbor circular cache queue is the next neighbor circular cache queue, the following formula can be used to query whether there is a free cache area corresponding to the cache sub-area in the neighbor circular cache queue: next->tail>=next->head. That is, if the above inequality holds, it can be determined that there is a free cache area corresponding to the cache sub-area in the next neighbor circular cache queue.

[0097] Based on this, in order to query whether there is a free cache area corresponding to the cache sub-area in the neighbor ring cache queue, in some embodiments, before the above S630, the following may also be included:

[0098] Get the neighbor ring buffer queue corresponding to the target ring buffer queue.

[0099] Here, the neighbor ring buffer queue corresponding to the target ring buffer queue may include a first neighbor ring buffer queue and a second neighbor ring buffer queue.

[0100] As an example, since the target ring buffer queue and its corresponding neighbor ring buffer queue may be ring buffer queues in a shared ring buffer queue, the addresses of the ring buffer queues pointed to by the buffer pointer in the cache control structure are continuous. Therefore, the neighbor ring buffer queue can be accessed directly by adding the offset to the buffer address.

[0101] Based on this, in some embodiments, before querying whether there is a free cache area corresponding to the cache sub-area in the neighboring ring cache queue, the following method may also be included (that is, obtaining the neighboring ring cache queue corresponding to the target ring cache queue may specifically include):

[0102] Get the target queue head position and target length corresponding to the target ring buffer queue;

[0103] The target queue head position is moved backward by the target length, and the queue head position of the first neighboring circular buffer queue corresponding to the target circular buffer queue is determined, and the queue head of the first neighboring circular buffer queue is connected to the queue tail of the target circular buffer queue;

[0104] The target queue head position is moved forward by the target length to determine the queue head position of the second neighboring circular buffer queue corresponding to the target circular buffer queue, and the queue tail of the second neighboring circular buffer queue is connected to the queue head of the target circular buffer queue.

[0105] Here, the target queue head position may be buffer, and the target length may be size. Since multiple cache control structures may be the same, after determining the queue head position, the cache queue at the queue head position and the target length thereafter may be determined as the neighboring circular cache queue corresponding to the target circular cache queue.

[0106] As another example, since the cache control structure includes an index, the corresponding cache control structure can be found through the index.

[0107] Based on this, in order to improve the efficiency of obtaining the neighbor ring cache queue, in some embodiments, before querying whether there is a free cache area corresponding to the cache sub-area in the neighbor ring cache queue, it may also include (that is, obtaining the neighbor ring cache queue corresponding to the target ring cache queue, which may specifically include):

[0108] When the index position of the target cache control structure corresponding to the target ring cache queue is index, obtain the neighbor cache control structure with the index position of index-1 and / or index+1 in the array;

[0109] The ring cache queue corresponding to the neighbor cache control structure is determined as the neighbor ring cache queue.

[0110] In this way, by directly acquiring the neighbor circular buffer queue according to the index position in the array, the efficiency of acquiring the neighbor circular buffer queue can be improved.

[0111] In some embodiments, in S640, when the cache sub-region is a tail cache region, the data volume corresponding to the cache sub-region may specifically be the data length tail_length in the tail cache region. The calculation method of tail_length may be as follows:

[0112] tail_length=current->size-current->head.

[0113] In the case where the cache sub-area is the tail cache area, the free cache area may be the tail free cache area in the previous neighbor circular cache queue, and the data volume corresponding to the free cache area may be specifically before->size-before->tail. Based on this, if the inequality (before->tail>=before->head)&&(before->size-before->tail>=tail_length) is satisfied, the data to be sent in the tail cache area may be copied to the tail free cache area in the previous neighbor circular cache queue.

[0114] As an example, Fig. 9 As shown, since the data length of the data to be copied (i.e., the data to be sent in the tail buffer area) is 2, and Fig. 9 It can be seen that the data length that can be cached in the free buffer area at the end of the queue in the previous neighbor buffer is greater than 2, so the data to be copied can be copied to the free buffer area at the end of the queue in the previous neighbor ring buffer queue. Fig. 9 As shown in the figure, by pointing sendPtr to the location 4094 in the previous neighbor cache, data can be transmitted to the upper layer application. Fig. 9In the example, the current cache may include a target circular cache queue and a corresponding cache control structure. The previous neighbor cache may correspond to the previous neighbor circular cache queue and a corresponding cache control structure. The next neighbor cache may correspond to the next neighbor circular cache queue and a corresponding cache control structure.

[0115] In addition, when the cache sub-region is the head cache region, the data volume corresponding to the cache sub-region may specifically be the data length head_length in the head cache region. The calculation method of head_length may be as follows:

[0116] head_length=length-(current->size-current->head).

[0117] In the case where the cache sub-area is the head cache area, the free cache area may be the head free cache area in the next neighbor circular cache queue, and the data volume corresponding to the free cache area may be specifically next->head. Based on this, if the inequality (next->tail>=next->head)&&(next->head>=head_length) is satisfied, the data to be sent in the head cache area may be copied to the head free cache area in the next neighbor circular cache queue.

[0118] As an example, Fig.10 As shown, since the data length of the data to be copied (i.e., the data to be sent in the buffer area at the head of the queue) is n+1, and Fig.10 It can be seen that the length of data that can be cached in the free buffer area at the head of the next neighbor buffer is greater than n+1, so the data to be copied can be copied to the free buffer area at the head of the next neighbor buffer. Fig.10 As shown in the figure, by pointing sendPtr to the location 4094 in the current cache, data can be transmitted to the upper layer application. Fig.10 In the example, the current cache may include a target circular cache queue and a corresponding cache control structure. The previous neighbor cache may correspond to the previous neighbor circular cache queue and a corresponding cache control structure. The next neighbor cache may correspond to the next neighbor circular cache queue and a corresponding cache control structure.

[0119] Based on this, in order to improve the efficiency of data transmission, in some embodiments, before the above S630, the following steps may also be included:

[0120] Determine the size relationship between the amount of data corresponding to the cache area at the head of the queue and the amount of data corresponding to the cache area at the tail of the queue;

[0121] Based on this, the above S630 may specifically include:

[0122] When the amount of data corresponding to the head cache area is less than the amount of data corresponding to the tail cache area, query whether there is a head free cache area corresponding to the head cache area in the first neighbor circular cache queue, and the head of the first neighbor circular cache queue is connected to the tail of the target circular cache queue;

[0123] When the amount of data corresponding to the head cache area is not less than the amount of data corresponding to the tail cache area, query whether there is a tail free cache area corresponding to the tail cache area in the second neighbor circular cache queue, and the tail of the second neighbor circular cache queue is connected to the head of the target circular cache queue.

[0124] Here, if the amount of data corresponding to the cache area at the head of the team is less than the amount of data corresponding to the cache area at the tail of the team, it is possible to preferentially query whether there is a free cache area at the head of the team corresponding to the cache area at the head of the team in the first neighbor circular cache queue. That is, the data in the cache area at the head of the team can be preferentially copied. If the amount of data corresponding to the cache area at the head of the team is greater than the amount of data corresponding to the cache area at the tail of the team, it is possible to preferentially query whether there is a free cache area at the tail of the team corresponding to the cache area at the tail of the team in the second neighbor circular cache queue. That is, the data in the cache area at the tail of the team can be preferentially copied. If the amount of data corresponding to the cache area at the head of the team is equal to the amount of data corresponding to the cache area at the tail of the team, the order of querying the free cache area at the head of the team and the free cache area at the tail of the team is not limited.

[0125] In this way, by preferentially copying data with a smaller data volume, the time for data copying can be reduced and the efficiency of data transmission can be improved.

[0126] Based on this, in order to improve the success rate of data transmission, in some embodiments, after querying whether there is a head free buffer area corresponding to the head buffer area in the first neighbor ring buffer queue, the following method may be further included:

[0127] In the case where there is no free cache area at the head of the team, or there is a free cache area at the head of the team and the amount of data corresponding to the free cache area at the head of the team is less than the amount of data corresponding to the free cache area at the head of the team, query whether there is a free cache area at the tail of the team in the second neighbor circular cache queue;

[0128] Based on this, if there is a free cache area and the amount of data corresponding to the free cache area is not less than the amount of data corresponding to the cache sub-area, copying the data to be sent in the cache sub-area to the free cache area may specifically include:

[0129] When there is a free buffer area at the end of the team and the amount of data corresponding to the free buffer area at the end of the team is not less than the amount of data corresponding to the buffer area at the end of the team, the data to be sent in the buffer area at the end of the team is copied to the free buffer area at the end of the team.

[0130] Here, if the data in the head buffer area cannot be copied to the head free buffer area, the query can continue to check whether there is a tail free buffer area in the second neighbor circular buffer queue. If there is a tail free buffer area in the second neighbor circular buffer queue, and the data in the tail buffer area can be copied to the tail free buffer area, the success rate of data transmission can be improved by copying the data to be sent in the tail buffer area to the tail free buffer area.

[0131] Based on this, in order to improve the success rate of data transmission, in some embodiments, after querying whether there is a tail free buffer area corresponding to the tail buffer area in the second neighbor ring buffer queue, the following method may also be included:

[0132] In the case where there is no free cache area at the end of the queue, or there is a free cache area at the end of the queue and the amount of data corresponding to the free cache area at the end of the queue is less than the amount of data corresponding to the cache area at the end of the queue, query whether there is a free cache area at the head of the queue corresponding to the cache area at the end of the queue in the first neighbor circular cache queue;

[0133] Based on this, when there is a free cache area and the amount of data corresponding to the free cache area is not less than the amount of data corresponding to the cache sub-area, copying the data to be sent in the cache sub-area to the free cache area may specifically include:

[0134] When the amount of data corresponding to the free buffer area at the head of the team is not less than the amount of data corresponding to the free buffer area at the head of the team, the data to be sent in the free buffer area at the head of the team is copied to the free buffer area at the head of the team.

[0135] Here, if the data in the tail buffer area cannot be copied to the tail free buffer area, you can continue to query whether there is a head free buffer area in the first neighbor circular buffer queue. If there is a head free buffer area in the first neighbor circular buffer queue, and the data in the head buffer area can be copied to the head free buffer area, the success rate of data transmission can be improved by copying the data to be sent in the head buffer area to the head free buffer area.

[0136] It should be noted that if the data in the head buffer area cannot be copied to the head free buffer area, and the data in the tail buffer area cannot be copied to the tail free buffer area, the data to be transmitted can be copied to the temporary buffer area to ensure successful data transmission.

[0137] Based on this, in order to better describe the entire solution, some specific examples are given based on the above embodiments.

[0138] For example, Fig.11 As shown, the data processing method in the embodiment of the present application may specifically include the following steps:

[0139] S111, when the data to be sent in the target ring buffer queue crosses the tail of the queue, determine whether the amount of data in the head buffer area is greater than the amount of data in the tail buffer area, if so, execute S112, if not, execute S116;

[0140] S112, determine whether the tail buffer area of ​​the previous neighbor ring buffer is free, if so, execute S113, if not, execute S114;

[0141] S113, copying the data in the tail buffer area to the tail buffer area of ​​the previous neighbor ring buffer queue;

[0142] S114, determine whether the head buffer area of ​​the next neighbor ring buffer is free, if so, execute S115, if not, execute S1110;

[0143] S115, copying the data in the head buffer area to the head buffer area of ​​the next neighboring ring buffer queue;

[0144] S116, determine whether the head buffer area of ​​the next neighbor ring buffer is free, if so, execute S117, if not, execute S118;

[0145] S117, copy the data in the head buffer area to the head buffer area of ​​the next neighbor ring buffer queue

[0146] S118, determine whether the tail buffer area of ​​the previous neighbor ring buffer is free, if so, execute S119, if not, execute S1110;

[0147] S119, copy the data in the tail buffer area to the tail buffer area of ​​the previous neighbor ring buffer queue

[0148] S1110, copy data to a temporary buffer area;

[0149] S1111. Provide sndPtr and length to the upper-layer application to transmit data.

[0150] Here, if the tail cache area of ​​the previous neighbor circular buffer is free, then there is a tail free cache area in the previous neighbor circular buffer and the amount of data corresponding to the tail free cache area is smaller than the amount of data corresponding to the tail cache area; if the head cache area of ​​the next neighbor circular buffer is free, then there is a head free cache area in the next neighbor circular buffer and the amount of data corresponding to the head free cache area is smaller than the amount of data corresponding to the head cache area.

[0151] For another example, taking the case where the ring buffer queue length is 4096 bytes and the average PDU length is 1400 bytes, the number of copies and the number of bytes copied of the prior art and the embodiment of the present application under different bandwidths are compared. The comparison results can be shown in Table 1.

[0152] Table 1

[0153]

[0154] In this way, the number of memory copies and the amount of memory copied data can be effectively reduced during the data transmission from the Soad receiving buffer to the upper-level application. By reducing the number of memory copies and the amount of memory copied data, the CPU usage time of the current message processing task can be reduced, the overall operation efficiency of the system can be improved, and the processing of the current message can be accelerated, effectively reducing the delay of message processing and improving the overall bandwidth.

[0155] Based on the data processing method provided in the above embodiment, the present application also provides a specific implementation of a data processing device. Please refer to the following embodiment.

[0156] like Fig.12 As shown, the data processing device 1200 provided in the embodiment of the present application includes the following modules:

[0157] A first determining module 1210 is used to determine a buffer area of ​​the data to be sent in a target circular buffer queue, where the target circular buffer queue is any one of a plurality of circular buffer queues connected end to end;

[0158] A second determining module 1220 is configured to determine, in a cache area, a cache sub-area corresponding to the data to be sent when the data to be sent crosses the tail of the target circular cache queue, the cache sub-area including any one of the head cache area and the tail cache area of ​​the target circular cache queue;

[0159] A query module 1230 is used to query whether there is a free cache area corresponding to the cache sub-area in a neighboring circular cache queue, where the neighboring circular cache queue is a circular cache queue adjacent to the target circular cache queue among a plurality of circular cache queues connected end to end;

[0160] The copy module 1240 is used to copy the to-be-sent data in the cache sub-region to the free cache region when there is a free cache region and the data volume corresponding to the free cache region is not less than the data volume corresponding to the cache sub-region.

[0161] The data processing device 1200 is described in detail below, as follows:

[0162] In some embodiments, the data processing device 1200 may further include:

[0163] A third determination module is used to determine the size relationship between the amount of data corresponding to the head cache area and the amount of data corresponding to the tail cache area before querying whether there is a free cache area corresponding to the cache sub-area in the neighbor ring cache queue;

[0164] Based on this, the query module 1230 may specifically include:

[0165] A first query submodule is used to query whether there is a first-team free cache area corresponding to the first-team cache area in the first neighbor circular cache queue when the amount of data corresponding to the first-team cache area is less than the amount of data corresponding to the last-team cache area, and the first-team of the first neighbor circular cache queue is connected to the last-team of the target circular cache queue;

[0166] The second query submodule is used to query whether there is a tail free cache area corresponding to the tail cache area in the second neighbor circular cache queue when the amount of data corresponding to the head cache area is not less than the amount of data corresponding to the tail cache area, and the tail of the second neighbor circular cache queue is connected to the head of the target circular cache queue.

[0167] In some embodiments, the query module 1230 may further include:

[0168] A third query submodule is used to query whether there is a free cache area at the end of the queue in the second neighbor circular cache queue when there is no free cache area at the head of the queue, or when there is a free cache area at the head of the queue and the amount of data corresponding to the free cache area at the head of the queue is less than the amount of data corresponding to the free cache area at the head of the queue;

[0169] Based on this, the copy module 1240 may specifically include:

[0170] The first copy submodule is used to copy the to-be-sent data in the tail buffer area to the tail free buffer area when there is a tail free buffer area and the amount of data corresponding to the tail free buffer area is not less than the amount of data corresponding to the tail buffer area.

[0171] In some embodiments, the query module 1230 may further include:

[0172] A fourth query submodule is used to query whether there is a head free cache area in the first neighbor ring cache queue when there is no tail free cache area, or when there is a tail free cache area and the amount of data corresponding to the tail free cache area is less than the amount of data corresponding to the tail cache area;

[0173] Based on this, the copy module 1240 may further specifically include:

[0174] The second copy submodule is used to copy the to-be-sent data in the head buffer area to the head buffer area when the data amount corresponding to the head buffer area is not less than the data amount corresponding to the head buffer area.

[0175] In some embodiments, the data processing device 1200 may further include:

[0176] A storage module, used for storing cache control structures respectively corresponding to a plurality of circular cache queues in the form of an array before determining a cache area for data to be sent in a target circular cache queue, wherein the cache control structure includes an index position of the cache control structure in the array;

[0177] The data processing device 1200 may further include:

[0178] A first acquisition module is used to acquire a neighbor cache control structure with an index position of index-1 and / or index+1 in the array when the index position of the target cache control structure corresponding to the target circular cache queue is index before querying whether there is a free cache area corresponding to the cache sub-area in the neighbor circular cache queue;

[0179] The fourth determining module is used to determine that the ring cache queue corresponding to the neighbor cache control structure is the neighbor ring cache queue.

[0180] In some embodiments, the cache control structure also includes a queue head position and a length of the circular cache queue. Based on this, the data processing device 1200 may also include:

[0181] A second acquisition module is used to acquire a target queue head position and a target length corresponding to a target circular cache queue before querying whether there is a free cache area corresponding to the cache sub-area in the neighbor circular cache queue;

[0182] a fifth determining module, configured to move the target queue head position backward by a target length, determine the queue head position of a first neighboring circular buffer queue corresponding to the target circular buffer queue, and connect the queue head of the first neighboring circular buffer queue to the queue tail of the target circular buffer queue;

[0183] The sixth determination module is used to move the target queue head position forward by the target length to determine the queue head position of the second neighbor circular buffer queue corresponding to the target circular buffer queue, and the tail of the second neighbor circular buffer queue is connected to the queue head of the target circular buffer queue.

[0184] In some of these embodiments, the cache control structure further includes a free cache start position and a cache data start position.

[0185] Based on this, the query module 1230 may further specifically include:

[0186] An acquisition submodule, used to acquire a free cache start position and a cache data start position corresponding to a neighbor cache queue;

[0187] The determination submodule is used to determine whether there is a free cache area corresponding to the cache sub-area in the neighbor ring cache queue when the value corresponding to the free cache start position is not less than the value corresponding to the cache data start position.

[0188] In the data processing device of the embodiment of the present application, since the neighbor circular buffer queue is adjacent to the target circular buffer queue, the validity of sendPtr and length can be ensured by copying the data to be sent in the cache sub-area to the free cache area corresponding to the cache sub-area when there is a free cache area corresponding to the cache sub-area in the neighbor circular buffer queue and the amount of data corresponding to the free cache area is not less than the amount of data corresponding to the cache sub-area. Since the cache sub-area includes any one of the head cache area and the tail cache area of ​​the target circular buffer queue, that is, only the data to be sent in the head cache area or the tail cache area is copied, so the number of copies and the amount of data copy can be reduced, thereby improving the data transmission efficiency.

[0189] Based on the data processing method provided in the above embodiment, the embodiment of the present application also provides a specific implementation of the electronic device. Fig.13 A schematic diagram of an electronic device 1300 provided in an embodiment of the present application is shown.

[0190] The electronic device 1300 may include a processor 1310 and a memory 1320 storing computer program instructions.

[0191] Specifically, the processor 1310 may include a central processing unit (CPU), or an application specific integrated circuit (ASIC), or may be configured to implement one or more integrated circuits of the embodiments of the present application.

[0192] The memory 1320 may include a large capacity memory for data or instructions. By way of example and not limitation, the memory 1320 may include a hard disk drive (HDD), a floppy disk drive, a flash memory, an optical disk, a magneto-optical disk, a magnetic tape, or a universal serial bus (USB) drive or a combination of two or more of these. In appropriate cases, the memory 1320 may include a removable or non-removable (or fixed) medium. In appropriate cases, the memory 1320 may be inside or outside the integrated gateway disaster recovery device. In a specific embodiment, the memory 1320 is a non-volatile solid-state memory.

[0193] The memory may include a read-only memory (ROM), a random access memory (RAM), a magnetic disk storage medium device, an optical storage medium device, a flash memory device, an electrical, optical or other physical / tangible memory storage device. Thus, typically, the memory includes one or more tangible (non-transitory) computer-readable storage media (e.g., a memory device) encoded with software including computer-executable instructions, and when the software is executed (e.g., by one or more processors), it is operable to perform the operations described with reference to the method according to the first aspect of the present application.

[0194] The processor 1310 implements any one of the data processing methods in the above embodiments by reading and executing computer program instructions stored in the memory 1320 .

[0195] In one example, the electronic device 1300 may further include a communication interface 1330 and a bus 1340. Fig.13 As shown, the processor 1310, the memory 1320, and the communication interface 1330 are connected via a bus 1340 and communicate with each other.

[0196] The communication interface 1330 is mainly used to implement communication between various modules, devices, units and / or equipment in the embodiments of the present application.

[0197] Bus 1340 includes hardware, software or both, and the parts of electronic equipment are coupled to each other. For example, but not limitation, bus may include accelerated graphics port (AGP) or other graphics bus, enhanced industrial standard architecture (EISA) bus, front side bus (FSB), hypertransport (HT) interconnection, industrial standard architecture (ISA) bus, infinite bandwidth interconnection, low pin count (LPC) bus, memory bus, micro channel architecture (MCA) bus, peripheral component interconnection (PCI) bus, PCI-Express (PCI-X) bus, serial advanced technology attachment (SATA) bus, video electronics standard association local (VLB) bus or other suitable bus or two or more of these combinations. In appropriate cases, bus 1340 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the application considers any suitable bus or interconnection.

[0198] Exemplarily, the electronic device 1300 may be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (PDA).

[0199] The electronic device can execute the data processing method in the embodiment of the present application, thereby realizing the combination Figures 6 to 12 The data processing method and device described.

[0200] In addition, in combination with the data processing method in the above embodiments, the present application embodiment can provide a computer-readable storage medium for implementation. The computer-readable storage medium stores computer program instructions; when the computer program instructions are executed by a processor, any one of the data processing methods in the above embodiments is implemented.

[0201] In addition, the embodiment of the present application further provides a vehicle, which may include at least one of the following:

[0202] A data processing device as in any one of the embodiments of the second aspect;

[0203] An electronic device as in any one of the embodiments of the third aspect;

[0204] The computer-readable storage medium in any one of the embodiments of the fourth aspect will not be described in detail here.

[0205] It should be clear that the present application is not limited to the specific configuration and processing described above and shown in the figures. For the sake of simplicity, a detailed description of the known method is omitted here. In the above embodiments, several specific steps are described and shown as examples. However, the method process of the present application is not limited to the specific steps described and shown, and those skilled in the art can make various changes, modifications and additions, or change the order between the steps after understanding the spirit of the present application.

[0206] The functional blocks shown in the above-described block diagram can be implemented as hardware, software, firmware or a combination thereof. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present application are programs or code segments that are used to perform the required tasks. The program or code segment can be stored in a machine-readable medium, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, etc. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.

[0207] It should also be noted that the exemplary embodiments mentioned in this application describe some methods or systems based on a series of steps or devices. However, this application is not limited to the order of the above steps, that is, the steps can be performed in the order mentioned in the embodiment, or in a different order from the embodiment, or several steps can be performed simultaneously.

[0208] The above reference is according to the method of the embodiment of the present application, the flow chart of the device (system) and the computer program product and / or the block diagram described various aspects of the present application.It should be understood that each square box in the flow chart and / or the block diagram and the combination of each square box in the flow chart and / or the block diagram can be realized by computer program instructions.These computer program instructions can be provided to the processor of a general-purpose computer, a special-purpose computer or other programmable data processing device to produce a machine so that these instructions executed by the processor of the computer or other programmable data processing device enable the realization of the function / action specified in one or more square boxes of the flow chart and / or the block diagram.Such a processor can be but is not limited to a general-purpose processor, a special-purpose processor, a special application processor or a field programmable logic circuit.It can also be understood that each square box in the block diagram and / or the flow chart and the combination of the square boxes in the block diagram and / or the flow chart can also be realized by the dedicated hardware that performs the specified function or action, or can be realized by the combination of dedicated hardware and computer instructions.

[0209] The above is only a specific implementation of the present application. Those skilled in the art can clearly understand that for the convenience and simplicity of description, the specific working processes of the systems, modules and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be repeated here. It should be understood that the protection scope of the present application is not limited to this. Any technician familiar with the technical field can easily think of various equivalent modifications or replacements within the technical scope disclosed in this application, and these modifications or replacements should be included in the protection scope of this application.

Claims

1. A data processing method, It is characterized in that include: Determine a buffer area of ​​the data to be sent in a target circular buffer queue, wherein the target circular buffer queue is any one of a plurality of circular buffer queues connected end to end; In a case where the data to be sent crosses the tail of the target circular buffer queue, determining a cache sub-region corresponding to the data to be sent in the cache region, the cache sub-region including any one of the head cache region and the tail cache region of the target circular buffer queue; querying whether there is a free cache area corresponding to the cache sub-area in a neighboring circular cache queue, wherein the neighboring circular cache queue is a circular cache queue adjacent to the target circular cache queue among the multiple end-to-end connected circular cache queues; In the case that the free cache area exists and the amount of data corresponding to the free cache area is not less than the amount of data corresponding to the cache sub-area, the to-be-sent data in the cache sub-area is copied to the free cache area.

2. The method according to claim 1, It is characterized in that Before querying whether there is a free cache area corresponding to the cache sub-area in the neighbor ring cache queue, the method further includes: Determine the size relationship between the amount of data corresponding to the head buffer area and the amount of data corresponding to the tail buffer area; The querying whether there is an idle cache area corresponding to the cache sub-area in the neighbor ring cache queue includes: When the amount of data corresponding to the head cache area is less than the amount of data corresponding to the tail cache area, query whether there is a head free cache area corresponding to the head cache area in the first neighbor circular cache queue, and the head of the first neighbor circular cache queue is connected to the tail of the target circular cache queue; When the amount of data corresponding to the head cache area is not less than the amount of data corresponding to the tail cache area, query whether there is a tail free cache area corresponding to the tail cache area in the second neighbor circular cache queue, and the tail of the second neighbor circular cache queue is connected to the head of the target circular cache queue.

3. The method according to claim 2, It is characterized in that After querying whether there is a head free cache area corresponding to the head cache area in the first neighbor circular cache queue, the method further includes: In the case where the free cache area at the head of the team does not exist, or the free cache area at the head of the team exists and the amount of data corresponding to the free cache area at the head of the team is less than the amount of data corresponding to the free cache area at the head of the team, query whether the free cache area at the tail of the team exists in the second neighbor circular cache queue; The step of copying the to-be-sent data in the cache sub-area to the free cache area when the free cache area exists and the amount of data corresponding to the free cache area is not less than the amount of data corresponding to the cache sub-area comprises: When there is a free cache area at the end of the team and the amount of data corresponding to the free cache area at the end of the team is not less than the amount of data corresponding to the cache area at the end of the team, the data to be sent in the cache area at the end of the team is copied to the free cache area at the end of the team.

4. The method according to claim 2, It is characterized in that After querying whether there is a tail free cache area corresponding to the tail cache area in the second neighbor circular cache queue, the method further includes: In the case where the free cache area at the end of the team does not exist, or the free cache area at the end of the team exists and the amount of data corresponding to the free cache area at the end of the team is less than the amount of data corresponding to the free cache area at the end of the team, query whether the free cache area at the head of the team exists in the first neighbor circular cache queue; The method further comprises: when the free cache area exists and the amount of data corresponding to the free cache area is not less than the amount of data corresponding to the cache sub-area, copying the to-be-sent data in the cache sub-area to the free cache area, further comprising: When the amount of data corresponding to the free buffer area at the head of the team is not less than the amount of data corresponding to the free buffer area at the head of the team, the to-be-sent data in the free buffer area at the head of the team is copied to the free buffer area at the head of the team.

5. The method according to claim 1, It is characterized in that Before determining the buffer area of ​​the data to be sent in the target ring buffer queue, the method further includes: Saving cache control structures respectively corresponding to the plurality of circular cache queues in the form of an array, wherein the cache control structure includes an index position of the cache control structure in the array; Before querying whether there is a free cache area corresponding to the cache sub-area in the neighbor ring cache queue, the method further includes: When the index position of the target cache control structure corresponding to the target ring cache queue is index, obtaining a neighbor cache control structure with an index position of index-1 and / or index+1 in the array; A ring cache queue corresponding to the neighbor cache control structure is determined as the neighbor ring cache queue.

6. The method according to claim 5, It is characterized in that The cache control structure also includes a queue head position and a length of the circular cache queue. Before querying whether there is an idle cache area corresponding to the cache sub-area in the neighbor circular cache queue, the method also includes: Obtaining a target queue head position and a target length corresponding to the target circular buffer queue; The target queue head position is moved backward by the target length to determine the queue head position of the first neighboring circular buffer queue corresponding to the target circular buffer queue, and the queue head of the first neighboring circular buffer queue is connected to the queue tail of the target circular buffer queue; The target queue head position is moved forward by the target length to determine the queue head position of a second neighboring circular buffer queue corresponding to the target circular buffer queue, and the tail of the second neighboring circular buffer queue is connected to the queue head of the target circular buffer queue.

7. The method according to claim 5, It is characterized in that The cache control structure also includes a free cache starting position and a cache data starting position, and the querying of whether there is a free cache area corresponding to the cache sub-area in the neighbor ring cache queue includes: Obtaining the free cache starting position and the cache data starting position corresponding to the neighbor cache queue; When the value corresponding to the free cache start position is not less than the value corresponding to the cache data start position, it is determined that there is a free cache area corresponding to the cache sub-area in the neighbor ring cache queue.

8. A data processing device, It is characterized in that The device comprises: A first determining module, configured to determine a buffer area of ​​the data to be sent in a target circular buffer queue, wherein the target circular buffer queue is any one of a plurality of circular buffer queues connected end to end; A second determining module is used to determine, in the cache area, a cache sub-area corresponding to the data to be sent when the data to be sent crosses the tail of the target circular cache queue, the cache sub-area including any one of the head cache area and the tail cache area of ​​the target circular cache queue; A query module, used for querying whether there is a free cache area corresponding to the cache sub-area in a neighboring circular cache queue, wherein the neighboring circular cache queue is a circular cache queue adjacent to the target circular cache queue among the multiple end-to-end connected circular cache queues; The copy module is used to copy the to-be-sent data in the cache sub-area to the free cache area when the free cache area exists and the amount of data corresponding to the free cache area is not less than the amount of data corresponding to the cache sub-area.

9. An electronic device, It is characterized in that The electronic device comprises: a processor and a memory storing computer program instructions; When the processor executes the computer program instructions, the data processing method according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium, It is characterized in that The computer-readable storage medium stores computer program instructions, and when the computer program instructions are executed by a processor, the data processing method according to any one of claims 1 to 7 is implemented.

11. A vehicle, It is characterized in that Include at least one of the following: The data processing device according to claim 8; The electronic device as claimed in claim 9; The computer readable storage medium of claim 10.