Data transmission method and device for automobile open system AUTOSAR

By establishing an association directory in the protocol stack target cache of the AUTOSAR system and associating it with the ring queue, data packets are directly transmitted through the ring queue, solving the memory consumption and efficiency reduction caused by additional copy operations in the AUTOSAR system, achieving more efficient data transmission.

CN119945830APending Publication Date: 2025-05-06BEIJING CO WHEELS TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311460235.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-11-03
Publication Date
2025-05-06

AI Technical Summary

Technical Problem

The current AUTOSAR system has additional copy operations during the process of sending and receiving Ethernet packets, resulting in reduced memory consumption and data transmission efficiency, affecting the system operation speed.

Method used

By establishing an associated directory in the target cache of the protocol stack and associating it with the top-level directory of the ring queue of the AUTOSAR Ethernet card layer, packet transmission is directly carried out through the ring queue, avoiding additional copy operations.

Benefits of technology

It improves the system's operating speed and data transmission efficiency, avoids false overflow, and quickly determines whether the queue is full or empty through linear space.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119945830A_ABST
    Figure CN119945830A_ABST
Patent Text Reader

Abstract

The invention provides a data transmission method and device for an automobile open system AUTOSAR, and the method comprises the steps: receiving a data package in response to a transmission instruction of the data package, and storing the data package in a target cache of a protocol stack; and establishing an associated directory in the target cache, associating the associated directory with a top-level directory of an annular queue of an Ethernet card layer of the AUTOSAR, and transmitting the data packet through the annular queue. Since the association catalog of the target cache is associated with the top-level catalog of the annular queue, the data in the target cache can be accessed by accessing the associated top-level catalog of the annular queue, so that the data transmission can be directly performed through the annular queue without respectively performing one copy in the data transmission process, and the data transmission efficiency is improved. Therefore, the running speed of the system and the use experience of a user are improved, meanwhile, the false overflow phenomenon can be avoided, and the data transmission effect is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of vehicle detection technology, and in particular to a data transmission method and device for an automotive open system AUTOSAR. Background Art

[0002] AUTomotive Open System Architecture (AUTOSAR) defines a set of distributed, function-driven automotive electronic software development methods and software architecture standardization solutions on electronic control units so that they can be applied to different automotive platforms, improve software reuse and reduce development costs.

[0003] In the current technology, the memory required for AUTOSAR Ethernet data packet transmission and reception is uniformly managed by the Ethernet card layer. During the data packet transmission and reception process, there is an operation that requires the data packet to be copied to the cache allocated by the protocol stack itself, that is, there is an additional copy operation. For example, during the data packet transmission process, due to the existence of a timeout retransmission mechanism and the inability to occupy the driver's memory without releasing it, the protocol stack needs to apply for memory from the Ethernet card layer's circular cache queue. Therefore, the protocol stack will additionally apply for a cache from its own memory pool to store the data packets to be sent. When it is determined that the conditions for sending the data packet are met, the stored data packet will be copied to the Ethernet card layer's circular cache queue for transmission.

[0004] In this regard, current technology consumes memory while also reducing the efficiency of data packet transmission, slowing down the system's operating speed. At the same time, due to the existence of data packet copying and other processing, it has an adverse impact on the efficiency of system operation. Summary of the invention

[0005] The present disclosure aims to solve one of the technical problems in the related art at least to some extent.

[0006] Therefore, an object of the present disclosure is to provide a data transmission method for the automotive open system AUTOSAR.

[0007] A second objective of the present disclosure is to provide a data transmission device for the automotive open system AUTOSAR.

[0008] A third objective of the present disclosure is to provide an electronic device.

[0009] A fourth object of the present disclosure is to provide a non-transitory computer-readable storage medium.

[0010] A fifth object of the present disclosure is to provide a vehicle.

[0011] To achieve the above-mentioned purpose, the first aspect of the present disclosure proposes a data transmission method for the automotive open system AUTOSAR, comprising: in response to a transmission indication of a data packet, receiving a data packet and storing the data packet in a target cache of a protocol stack, wherein the target cache is a cache allocated by a memory pool of the protocol stack for the data packet; establishing an associated directory in the target cache, associating the associated directory with the top-level directory of a ring queue of an Ethernet card layer of AUTOSAR, and transmitting the data packet through the ring queue.

[0012] According to one embodiment of the present disclosure, after establishing an associated directory in the target cache, associating the associated directory with the top-level directory of the ring queue of the Ethernet card layer of AUTOSAR, and transmitting the data packet through the ring queue, the method further includes: in response to receiving an advance callback function notification sent by the Ethernet card layer, deleting the top-level directory of the ring cache queue from the associated directory of the target cache.

[0013] According to one embodiment of the present disclosure, the transmitting of the data packet through the circular queue establishes an associated directory in the target cache, associates the associated directory with the top-level directory of the circular queue of the Ethernet card layer of AUTOSAR, and transmits the data packet through the circular queue, including: sending a first pointer of the target cache to the circular queue of the Ethernet card layer; and sending the first pointer to the target sending object through the circular queue.

[0014] According to an embodiment of the present disclosure, the method further includes: in response to receiving a data packet sending success indication sent by the Ethernet card layer, deleting the first pointer of the target cache from the ring queue.

[0015] According to one embodiment of the present disclosure, before transmitting the data packet through the ring queue, it also includes: based on a preset Ethernet standard, standardizing the data packet to generate an Ethernet standard data packet; encapsulating the Ethernet standard data packet, and updating the data packet obtained after encapsulation to the data packet.

[0016] According to one embodiment of the present disclosure, establishing an associated directory in the target cache, associating the associated directory with the top-level directory of the circular queue of the Ethernet card layer of AUTOSAR, and transmitting the data packet through the circular queue includes: obtaining interrupt information sent by the Ethernet card layer, wherein the interrupt information includes a second pointer to the data packet; passing the second pointer of the data packet to the target cache through the circular queue, and deleting the second pointer from the circular queue; and writing the data packet into the target cache based on the second pointer.

[0017] To achieve the above-mentioned purpose, the second aspect of the present disclosure proposes a data transmission device for the automotive open system AUTOSAR, including: a receiving module, used to receive a transmission indication of a data packet, and allocate a target cache for the data packet from the memory pool of the protocol stack according to the transmission indication; a transmission module, used to establish an associated directory in the target cache, and associate the associated directory with the top-level directory of the ring queue of the Ethernet card layer of AUTOSAR, and transmit the data packet through the ring queue.

[0018] To achieve the above-mentioned purpose, the third aspect embodiment of the present disclosure proposes an electronic device, comprising: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to implement the data transmission method for the automotive open system AUTOSAR as described in the first aspect embodiment of the present disclosure.

[0019] To achieve the above-mentioned purpose, the fourth aspect embodiment of the present disclosure proposes a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to implement the data transmission method for the automotive open system AUTOSAR as described in the first aspect embodiment of the present disclosure.

[0020] To achieve the above-mentioned objective, a fifth aspect of the present disclosure proposes a vehicle, comprising the electronic device proposed in the third aspect.

[0021] In the embodiment of the present disclosure, in response to the transmission indication of the data packet, the data packet is received and stored in the target cache of the protocol stack, the target cache is the cache allocated by the protocol stack memory pool for the data packet, and then an associated directory is established in the target cache, and the associated directory is associated with the top-level directory of the circular queue of the Ethernet card layer of AUTOSAR, and the data packet is transmitted through the circular queue. By allocating the target cache and associating the associated directory of the target cache with the top-level directory of the circular queue, compared with the prior art of directly transmitting data through the Ethernet card layer and the protocol stack, since the associated directory of the target cache is associated with the top-level directory of the circular queue, the data in the target cache can be accessed by accessing the top-level directory of the circular queue after the association, so the present disclosure does not need to have a copy in the process of data transmission, and can directly transmit data through the circular queue, thereby improving the operating speed of the system and the user experience, and at the same time, data transmission through the circular queue can avoid false overflow phenomenon, and at the same time, the linear space of the data is used to quickly know whether the queue is full or empty, thereby improving the effect of data transmission. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 is a flow chart of a data transmission method for an automotive open system AUTOSAR according to an embodiment of the present disclosure;

[0023] Figure 2 It is a flow chart of a data transmission method for an automotive open system AUTOSAR in the current technology according to one embodiment of the present disclosure;

[0024] Figure 3 is a flow chart of another data transmission method for an automotive open system AUTOSAR according to an embodiment of the present disclosure;

[0025] Figure 4 is a flow chart of another data transmission method for an automotive open system AUTOSAR according to an embodiment of the present disclosure;

[0026] Figure 5 A block diagram of a data transmission device for an automotive open system AUTOSAR proposed in the present disclosure;

[0027] Figure 6 The present invention provides a block diagram of an electronic device. DETAILED DESCRIPTION

[0028] Embodiments of the present disclosure are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present disclosure, and should not be construed as limiting the present disclosure.

[0029] In order to solve the above problems, the present disclosure proposes a data transmission method for the automotive open system AUTOSAR.

[0030] Figure 1 FIG. 1 is a schematic diagram of an exemplary implementation of a data transmission method for an automotive open system AUTOSAR proposed in the present disclosure, such as Figure 1 As shown, the data transmission method for the automotive open system AUTOSAR includes the following steps:

[0031] S101, in response to a transmission indication of a data packet, receiving a data packet and storing the data packet in a target cache of a protocol stack, where the target cache is a cache allocated for the data packet by a memory pool of a protocol stack.

[0032] In current technology, such as Figure 2 As shown, during the data transmission process, the protocol stack needs to apply for memory from the driver's send buffer. The data is copied once during the reception and transmission process, which consumes memory and reduces the efficiency of data transmission. At the same time, copying data in the interrupt reception context has an adverse effect on the efficiency of system operation.

[0033] In order to solve the above problem, the solution in the present disclosure is to transmit data by associating the ring queues of the Ethernet card layer.

[0034] It should be noted that the execution subject in the present disclosure is the AUTOSAR protocol stack. The protocol stack can determine the current AUTOSAR data packet transmission indication by monitoring the thread. The data packet transmission indication carries the data packet to be transmitted.

[0035] In the embodiments of the present disclosure, there may be multiple transmission instructions, which are not limited here and are determined according to actual conditions. For example, the data packet transmission instruction may include data packet sending, data packet receiving, etc.

[0036] It should be noted that the target cache in the embodiment of the present disclosure is determined by applying for a memory pool in the protocol stack.

[0037] In the embodiment of the present disclosure, different transmission instructions may correspond to different ways of allocating the target cache. For example, Figure 3 As shown, when a data packet is sent, a sending buffer can be applied based on the data packet to be sent, and then the data packet to be sent is stored in the sending buffer; when a data packet is received, a receiving buffer can be pre-allocated based on the data packet to be received.

[0038] S102, establishing an associated directory in the target cache, and associating the associated directory with the top-level directory of the ring queue of the Ethernet card layer of AUTOSAR, and transmitting the data packet through the ring queue.

[0039] In a tree structure, we call the main node of the tree the root. Figure 2 As shown, we refer to the main directory in the file system as the root directory.

[0040] Since the association operation will hide the original files in the associated directory, the root directory and the original system directory cannot be used as association points, which may cause system abnormalities or even crashes. In the present disclosure, an association directory is established under the root directory, which is specifically associated with the top-level directory of the ring queue of the Ethernet card layer, so as to avoid affecting the normal operation of the system.

[0041] After the top-level directory of the ring queue of the Ethernet card layer of AUTOSAR is associated with the associated directory, the command line access to this associated directory is equivalent to accessing the ring queue. Any operation on the associated directory is equivalent to an operation on the target cache. In this way, data transmission through the ring queue of the Ethernet card layer can achieve direct access to the target cache through the data channel without copying.

[0042] Different from the traditional protocol stack, the write interface uses the copy mode to copy from the Ethernet card layer to the memory space of the protocol stack. The target cache allocated in the disclosed example transmits data by associating a circular queue, which occupies less memory than the prior art.

[0043] It should be noted that the circular queue is used for data transmission in the present disclosure, which can avoid false overflow phenomenon, and at the same time, the linear space of data is used to quickly know whether the queue is full or empty, thereby improving the effect of data transmission.

[0044] In the embodiment of the present disclosure, in response to the transmission indication of the data packet, the data packet is received and stored in the target cache of the protocol stack, the target cache is the cache allocated by the protocol stack memory pool for the data packet, and then an associated directory is established in the target cache, and the associated directory is associated with the top-level directory of the circular queue of the Ethernet card layer of AUTOSAR, and the data packet is transmitted through the circular queue. By allocating the target cache and associating the associated directory of the target cache with the top-level directory of the circular queue, compared with the prior art of directly transmitting data through the Ethernet card layer and the protocol stack, since the associated directory of the target cache is associated with the top-level directory of the circular queue, the data in the target cache can be accessed by accessing the top-level directory of the circular queue after the association, so the present disclosure does not need to have a copy in the process of data transmission, and can directly transmit data through the circular queue, thereby improving the operating speed of the system and the user experience, and at the same time, data transmission through the circular queue can avoid false overflow phenomenon, and at the same time, the linear space of the data is used to quickly know whether the queue is full or empty, thereby improving the effect of data transmission.

[0045] In one embodiment of the present disclosure, an associated directory is established in the target cache, and the associated directory is associated with the top-level directory of the ring queue of the Ethernet card layer of AUTOSAR, so that after the ring queue of the Ethernet card layer transmits the data packet through the ring queue, the top-level directory of the ring cache queue can be deleted from the associated directory of the target cache in response to receiving an advance callback function notification sent by the ring queue.

[0046] In the above embodiment, based on the transmission indication, a target buffer is allocated for the data packet from the memory pool of the protocol stack according to the transmission indication, and the target buffer can also be allocated for the data packet by Figure 4 Explaining further, the method includes:

[0047] S401, when the transmission instruction indicates that a data packet is transmitted from the protocol stack to the Ethernet card layer, a sending buffer with a length that meets the preset requirements is applied from the memory pool of the protocol stack as a target buffer based on the length of the data packet, and the data packet is stored in the target buffer.

[0048] It should be noted that the transmission of data packets can be divided into two types, one is AUTOSAR receiving data packets, that is, the data packets are transmitted from the Ethernet card layer to the protocol stack, and the other is AUTOSAR sending data packets, that is, the data packets are transmitted from the protocol stack to the Ethernet card layer. In the embodiment of the present disclosure, the sending buffer may include multiple memory fragments, and the memory pool may be divided into multiple fixed-length and aligned memory fragments. It should be noted that the size of each memory fragment is set in advance and can be changed according to actual design needs, and no limitation is made here. For example, the length of each memory fragment may be 4K, 8K, 16K, 32K, 64K, 128K, etc.

[0049] It should be noted that since the memory segments in the memory pool are pre-aligned and prepared, the target cache that meets the preset requirements is allocated, and the memory segment with the most appropriate size is selected first. If the memory segment with the most appropriate size has been allocated, other memory segments with larger lengths are allocated. Each length of memory segment uses a free list to store allocatable memory segments. When allocating, the head memory segment of the free list is given priority, and when recycling, it is placed at the end of the free list, which can improve allocation performance. When the size of the cache to be allocated exceeds the maximum memory segment of the memory pool, the allocation fails.

[0050] In the embodiment of the present disclosure, when sending a data packet to be transmitted, Figure 2 As shown, the data packet is sent from the Protocol Data Unit (PDU) adaptation layer, the protocol stack applies for the send buffer Tx buffer1 to store the data packet, and encapsulates the data packet to generate a standard Ethernet data packet, and finally sends it to the target sending object through the ring queue of the Ethernet card layer.

[0051] In an embodiment of the present disclosure, an associated directory is established in the target cache, and the associated directory is associated with the top-level directory of the circular queue of the Ethernet card layer of AUTOSAR, and the data packet is transmitted through the circular queue. The first pointer of the target cache can be first sent to the target sending object through the circular queue of the Ethernet card layer.

[0052] It should be noted that, in response to receiving the data packet sending success indication sent by the Ethernet card layer, the first pointer of the target cache is deleted from the ring queue.

[0053] In the above embodiment, based on the transmission indication, the data packet is transmitted through the ring queue, and the transmission indication can also be transmitted through the ring queue. Figure 5 Explaining further, the method includes:

[0054] S501, sending the first pointer of the target cache to the ring queue of the Ethernet card layer.

[0055] It should be noted that, since the data packet is stored in the target cache, the first pointer of the target cache is the pointer of the data packet.

[0056] S502, sending the first pointer to the target sending object through the circular queue.

[0057] It should be noted that the target object is the object that ultimately needs to load the data package. The target object can be of multiple types and is not limited here.

[0058] The target sending object can obtain the first pointer through the circular queue based on the connection with the Ethernet card layer, and load and obtain data based on the first pointer.

[0059] The transmission instruction is that when a data packet is transmitted from the Ethernet card layer to the protocol stack, a receiving buffer with a length that meets the preset requirements is applied from the memory pool of the protocol stack as a target buffer based on the length of the data packet, and the data packet is stored in the target buffer.

[0060] In one possible implementation, Figure 3 As shown, when the transmission indication is that the data packet is transmitted from the Ethernet card layer to the protocol stack, a sufficient number of receive buffers Rx buffer1 are allocated when the protocol stack is initialized, and then the associated directory is associated with the top-level directory of the ring queue of the Ethernet card layer of AUTOSAR to realize the reception of the data packet.

[0061] An associated directory is established in the target cache, and the associated directory is associated with the top-level directory of the ring queue of the Ethernet card layer of AUTOSAR, and the data packet is transmitted through the ring queue. The interrupt information sent by the ring queue can be first obtained, and the interrupt information contains the second pointer of the data packet. Then, the second pointer of the data packet is passed to the target cache through the ring queue, and the second pointer is deleted from the ring queue. Then, based on the second pointer, the data packet is written into the target cache.

[0062] It should be noted that after the ring queue receives the data packet, an interrupt is triggered, and the second pointer of the data packet and the length of the data packet are passed to the protocol stack in the interrupt context. At this time, the protocol stack receives the interrupt information sent by the ring queue, and then applies for a receive buffer based on the length of the data packet, and uses the receive buffer as the target buffer, and then passes the second pointer of the data packet to the target buffer through the ring queue. In this way, applying for a receive buffer based on the length of the data packet can prevent data from being unable to be transmitted due to too small a buffer allocation.

[0063] After applying for the receive buffer, the protocol stack deletes the target buffer where the Ethernet data packet is located from the ring queue, transfers the applied target buffer to the node just deleted, and exits the interrupt context.

[0064] In some scenarios, the protocol stack fails to apply for a target cache with enough space from the memory pool, and then exits and re-acquires. For example, if the length of the data packet is 1500 bytes, it is necessary to apply for a cache of more than 1500 bytes as the target cache. If there is no cache of 1500 bytes, the interrupt context is directly exited, which is treated as a packet loss.

[0065] In one embodiment of the present disclosure, the protocol stack allocates a pointer to a buffer (pointer to a buffer, pbuf) to the circular data queue, and the memory structure of each pbuf includes the length of the data packet and the second pointer of the data packet. According to the window size, the data space of appropriate length is intercepted, and the pointer of the pbuf points to the first address of the data space, and the length of the pbuf is set to the length of the data intercepted this time. Each time the interface is written successfully, it means that the protocol stack module has the right to use the target cache, then the corresponding target cache must be queried according to the written data space, and the reference count is increased by one. When different target cache data spaces are written to the protocol stack, different pbuf memories are used to save the address and length, and all pbufs are connected in a one-way linked list. When the protocol stack sends a data packet, it sends the data packet pointed to by each pbuf in sequence from the head of the linked list, and the sequence number of each data packet increases according to the sent length. When a response packet of data is received, it means that the protocol stack no longer uses the data packet, and then the right to use the target cache can be released, and the context information of the target cache can be queried through the data space, and the reference count can be reduced by one, and the pbuf can be deleted from the linked list. The target cache allocated by the Ethernet card layer is generally not released until a response is received from the other end, because the data space may need to be retransmitted after a timeout. Therefore, under normal circumstances, the life cycle of the target cache is that the Ethernet card layer allocates the target cache and initializes the reference count to one; writes to the protocol stack in DMA mode, and the protocol stack increases the reference count by one; the protocol stack sends a data packet, and decreases the reference count by one after receiving the response packet of the data packet; after the Ethernet card layer receives the response to the request, it decreases the reference count by one. At this time, the reference count of the target cache is zero and is reclaimed by the memory allocator.

[0066] Corresponding to the data transmission methods for the open automobile system AUTOSAR provided in the above-mentioned embodiments, an embodiment of the present disclosure further provides a data transmission device for the open automobile system AUTOSAR. Since the data transmission device for the open automobile system AUTOSAR provided in the embodiment of the present disclosure corresponds to the data transmission methods for the open automobile system AUTOSAR provided in the above-mentioned embodiments, the implementation methods of the above-mentioned data transmission methods for the open automobile system AUTOSAR are also applicable to the data transmission device for the open automobile system AUTOSAR provided in the embodiment of the present disclosure, and will not be described in detail in the following embodiments.

[0067] Figure 6 This is a schematic diagram of a data transmission device for the automotive open system AUTOSAR proposed in the present disclosure, such as Figure 6 As shown, the data transmission device 600 for the automotive open system AUTOSAR includes: a receiving module 610 and a transmitting module 620 .

[0068] The receiving module 610 is used to receive a data packet in response to a transmission indication of the data packet and store the data packet in a target cache of the protocol stack, where the target cache is a cache allocated by the protocol stack memory pool for the data packet.

[0069] The transmission module 620 is used to establish an associated directory in the target cache, associate the associated directory with the top-level directory of the ring queue of the Ethernet card layer of AUTOSAR, and transmit the data packet through the ring queue.

[0070] In one embodiment of the present disclosure, the receiving module 610 is further configured to: in response to receiving an advance callback function notification sent by the Ethernet card layer, delete the top-level directory of the ring buffer queue from the associated directory of the target buffer.

[0071] In one embodiment of the present disclosure, the transmission module 620 is further used to: send the first pointer of the target cache to the ring queue of the Ethernet card layer; and send the first pointer to the target sending object through the ring queue.

[0072] In one embodiment of the present disclosure, the transmission module 620 is further configured to: in response to receiving a data packet sending success indication sent by the Ethernet card layer, delete the first pointer of the target cache from the ring queue.

[0073] In one embodiment of the present disclosure, the receiving module 610 is further used to: standardize the data packet based on a preset Ethernet standard to generate an Ethernet standard data packet; encapsulate the Ethernet standard data packet, and update the encapsulated data packet to a data packet.

[0074] In one embodiment of the present disclosure, the receiving module 610 is also used to: obtain interrupt information sent by the Ethernet card layer, the interrupt information includes a second pointer to the data packet; pass the second pointer of the data packet to the target cache through a ring queue, and delete the second pointer from the ring queue; based on the second pointer, write the data packet to the target cache.

[0075] In this way, by allocating a target cache and associating the associated directory of the target cache with the top-level directory of the circular queue for mounting, there is no need for a copy during the receiving and sending processes respectively. Data can be transmitted directly through the circular queue, thereby improving the system's operating speed and user experience. At the same time, data transmission through the circular queue can avoid false overflow phenomena. At the same time, the linear space of the data is used to quickly know whether the queue is full or empty, thereby improving the effect of data transmission.

[0076] In order to implement the above embodiment, the present disclosure also provides an electronic device 700, such as Figure 6As shown, the electronic device 700 includes: a processor 701 and a memory 702 that is communicatively connected to the processor, the memory 702 stores instructions that can be executed by at least one processor, and the instructions are executed by at least one processor 701 to implement a data transmission method for an automotive open system AUTOSAR as in the first aspect of the embodiment of the present disclosure.

[0077] In order to implement the above embodiments, the embodiments of the present disclosure further propose a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable a computer to implement a data transmission method for the automotive open system AUTOSAR as in the first aspect of the embodiments of the present disclosure.

[0078] In order to implement the above embodiments, the embodiments of the present disclosure further propose a computer program product, including a computer program, which, when executed by a processor, implements the data transmission method for the automotive open system AUTOSAR as in the first aspect of the embodiments of the present disclosure.

[0079] In the description of the present disclosure, it should be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "up", "down", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside", "clockwise", "counterclockwise", "axial", "radial", "circumferential" and the like indicate orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present disclosure and simplifying the description, and do not indicate or imply that the referred device or element must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as a limitation on the present disclosure.

[0080] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of the features. In the description of the present disclosure, the meaning of "plurality" is two or more, unless otherwise clearly and specifically defined.

[0081] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present disclosure. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.

[0082] Although the embodiments of the present disclosure have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present disclosure. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present disclosure.

Claims

1. A data transmission method for the automotive open system AUTOSAR, characterized in that: The method comprises: In response to a transmission indication of a data packet, receiving a data packet and storing the data packet in a target cache of a protocol stack, wherein the target cache is a cache allocated by a memory pool of the protocol stack for the data packet; An associated directory is established in the target cache, and the associated directory is associated with a top-level directory of a ring queue of an Ethernet card layer of AUTOSAR, and the data packet is transmitted through the ring queue.

2. The method according to claim 1, characterized in that After establishing an associated directory in the target cache, associating the associated directory with the top-level directory of the ring queue of the Ethernet card layer of AUTOSAR, and transmitting the data packet through the ring queue, the method further includes: In response to receiving the advance callback function notification sent by the Ethernet card layer, the top-level directory of the ring buffer queue is deleted from the associated directory of the target buffer.

3. The method according to claim 2, characterized in that The step of establishing an associated directory in the target cache, associating the associated directory with a top-level directory of a ring queue of an Ethernet card layer of AUTOSAR, and transmitting the data packet through the ring queue includes: Sending the first pointer of the target cache to the ring queue of the Ethernet card layer; The first pointer is sent to a target sending object through the circular queue.

4. The method according to claim 3, characterized in that The method further comprises: In response to receiving a data packet sending success indication sent by the Ethernet card layer, the first pointer of the target cache is deleted from the ring queue.

5. The method according to claim 2, characterized in that: Before transmitting the data packet through the ring queue, the method further includes: Based on a preset Ethernet standard, the data packet is subjected to standardization processing to generate a standard Ethernet data packet; The Ethernet standard data packet is encapsulated, and the data packet obtained after encapsulation is updated to the data packet.

6. The method according to claim 1, characterized in that The step of establishing an associated directory in the target cache, associating the associated directory with a top-level directory of a ring queue of an Ethernet card layer of AUTOSAR, and transmitting the data packet through the ring queue includes: Obtaining interrupt information sent by the Ethernet card layer, wherein the interrupt information includes a second pointer of the data packet; passing the second pointer of the data packet to the target cache through the ring queue, and deleting the second pointer from the ring queue; Based on the second pointer, the data packet is written into the target cache.

7. A data transmission device for the automotive open system AUTOSAR, characterized in that: The device comprises: A receiving module, used for receiving a transmission indication of a data packet, and allocating a target buffer for the data packet from a memory pool of the protocol stack according to the transmission indication; The transmission module is used to establish an associated directory in the target cache, associate the associated directory with the top-level directory of the ring queue of the Ethernet card layer of AUTOSAR, and transmit the data packet through the ring queue.

8. An electronic device, characterized in that: Including memory and processor; The processor runs a program corresponding to the executable program code by reading the executable program code stored in the memory, so as to implement the method according to any one of claims 1 to 7.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

10. A vehicle, characterized in that: Comprising the electronic device as claimed in claim 9.