Vehicle-mounted system inter-chip communication method, device, equipment, medium and product

By adding a protocol layer between the application layer and the driving layer of the vehicle system, format conversion and verification of the transmitted data, and generating data packets containing control, message and verification fields, it solves the problem of not saving bandwidth in the prior art. It also ensures the problem of communication reliability, achieving efficient and reliable inter-chip communication between vehicle systems.

CN119484651APending Publication Date: 2025-02-18SHANGHAI JUCHUANG ZHIXING INTELLIGENT TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411443030.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-15
Publication Date
2025-02-18

AI Technical Summary

Technical Problem

The existing inter-chip communication methods of on-board systems cannot save bandwidth, and ensure communication reliability and data integrity.

Method used

A protocol layer is added between the application layer and the driving layer, and the data to be transmitted is received through the protocol layer, and the data is converted in format based on the preset transmission protocol to generate target data. The target data includes multiple data packets, each data packet includes a control field, a message field and a verification field. The driver layer stores these data in a preset send queue and transmits it to the receiver.

Benefits of technology

By adding a protocol layer to process and format conversion, more precise control of communication is achieved, which not only saves bandwidth, but also improves communication reliability and data integrity.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119484651A_ABST
    Figure CN119484651A_ABST
Patent Text Reader

Abstract

The invention provides a vehicle-mounted system inter-chip communication method and device, equipment, a medium and a product. The method comprises the steps that a protocol layer receives to-be-transmitted data sent by an application layer; the protocol layer performs format conversion on to-be-transmitted data based on a preset transmission protocol to obtain target data, the target data comprises N data packets, each data packet comprises a control field, a message field and a verification field, the control field is used for indicating the category of the data packet, the message field is used for carrying application data, and the verification field is used for verifying the application data; the verification field is used for verifying the integrity of the data packet, and N is a positive integer; and the driving layer stores the target data in a preset sending queue, and transmits the target data to a receiving end according to the preset sending queue. The technical problem that bandwidth cannot be saved and communication reliability and data integrity cannot be ensured in the communication process in the prior art is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application belongs to the field of vehicle-mounted communication technology, and in particular, relates to a vehicle-mounted system inter-chip communication method, device, equipment, medium and product. Background Art

[0002] In-vehicle communication systems usually use serial communication to communicate. However, as more and more applications are installed in in-vehicle systems, the bandwidth of serial communication is limited, and problems such as data blocking, coverage, and packet loss often occur.

[0003] In the related technology, the mode of sending data only when the data content of the inter-chip communication of the vehicle system changes is usually adopted. However, this sending and receiving mode cannot save bandwidth while ensuring the reliability of communication and the integrity of data;

[0004] Therefore, there is an urgent need for a communication method that can save bandwidth while ensuring the reliability of communication and the integrity of data. Summary of the invention

[0005] The embodiments of the present application provide a vehicle-mounted system inter-chip communication method, device, equipment, storage medium and computer program product to solve the technical problem of not being able to save bandwidth while ensuring communication reliability and data integrity during the communication process.

[0006] In the first aspect, an embodiment of the present application provides an inter-chip communication method of an in-vehicle system, which is applied at a transmitting end, and a protocol layer is added between the application layer and the driver layer at the transmitting end; the method comprises: the protocol layer receives the data to be transmitted sent by the application layer; the protocol layer performs format conversion on the data to be transmitted based on a preset transmission protocol to obtain target data, wherein the target data comprises N data packets, each data packet comprises a control field, a message field and a check field, wherein the control field is used to indicate the category of the data packet, the message field is used to carry application data, and the check field is used to check the integrity of the data packet, and N is a positive integer; the driver layer stores the target data in a preset sending queue, and transmits the target data to the receiving end according to the preset sending queue.

[0007] In the second aspect, an embodiment of the present application provides an inter-chip communication method for an in-vehicle system, which is applied at a receiving end, and the method includes: receiving target data transmitted by a sending end, the target data includes N data packets, each data packet includes a control field, a message field and a check field, wherein the control field is used to distinguish the category of the data packet, the message field is used to carry application data, and the check field is used to check the integrity of the data packet, and N is a positive integer; checking the target data according to the check field.

[0008] In the third aspect, an embodiment of the present application provides an inter-chip communication device for a vehicle-mounted system, which is used at a transmitting end, and the device includes an application layer and a driver layer, and a protocol added between the application layer and the driver layer, wherein the protocol layer is used to receive data to be transmitted sent by the application layer; the protocol layer is used to convert the format of the data to be transmitted based on a preset transmission protocol to obtain target data, wherein the target data includes N data packets, each data packet includes a control field, a message field and a check field, wherein the control field is used to indicate the category of the data packet, the message field is used to carry application data, and the check field is used to check the integrity of the data packet, and N is a positive integer; the driver layer is used to store the target data in a preset sending queue, and transmit the target data to the receiving end according to the preset sending queue.

[0009] In the fourth aspect, an embodiment of the present application provides an inter-chip communication device of a vehicle-mounted system, which is used at the receiving end, and the device includes: a receiving module, used to receive target data transmitted by a sending end, the target data includes N data packets, each data packet includes a control field, a message field and a check field, wherein the control field is used to distinguish the category of the data packet, the message field is used to carry application data, and the check field is used to check the integrity of the data packet, and N is a positive integer; a check module, used to check the target data according to the check field.

[0010] In a fifth aspect, an embodiment of the present application provides an electronic device, comprising: a processor and a memory storing programs or instructions; the processor implements the above method when executing the program or instructions.

[0011] In a sixth aspect, an embodiment of the present application provides a machine-readable storage medium, on which a program or instruction is stored, and the program or instruction implements the above method when executed by a processor.

[0012] In a seventh aspect, an embodiment of the present application provides a computer program product. When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the above method.

[0013] The inter-chip communication method of the vehicle system provided in the embodiment of the present application adds a protocol layer between the application layer and the driver layer, and the protocol layer receives the data to be transmitted sent by the application layer, and after the protocol layer processes the data, transmits it to the receiving end based on a preset sending queue; the present application sends the data after processing the data by adding a protocol layer, and the data packet obtained by format conversion contains several fields. These data packets are used for communication, and more precise control of the communication can be achieved according to the control field, channel field, data field and check field of each data packet, thereby saving bandwidth while improving the reliability of communication. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0015] Figure 1 is a schematic diagram of a system architecture without a protocol layer according to an embodiment of the present invention;

[0016] Figure 2 is a schematic diagram of a system architecture with a protocol layer according to an embodiment of the present invention;

[0017] Figure 3 is a flow chart of an inter-chip communication method of an in-vehicle system applied at a transmitting end according to an embodiment of the present invention;

[0018] Figure 4 is a schematic diagram of a process of successfully acquiring data from an application layer according to an embodiment of the present invention;

[0019] Figure 5 is a schematic diagram of a process of obtaining data interruption from an application layer according to an embodiment of the present invention;

[0020] Figure 6 is a schematic diagram of the structure of a data packet according to an embodiment of the present invention;

[0021] Figure 7 is a schematic diagram of a process in which a sending end loses frame i and sends frame i+1 according to an embodiment of the present invention;

[0022] Figure 8 is a schematic diagram of a process of retransmitting i frames when i frames are lost at a transmitting end according to an embodiment of the present invention;

[0023] Fig. 9 is a schematic diagram of a process of i-frame damage at a sending end according to an embodiment of the present invention;

[0024] Fig.10 is a schematic diagram of the architecture of an in-vehicle system according to an embodiment of the present invention;

[0025] Fig.11 is a schematic diagram of a handshake process between a sending end and a receiving end according to an embodiment of the present invention;

[0026] Fig.12 is a flow chart of an inter-chip communication method of an in-vehicle system applied at a receiving end according to an embodiment of the present invention;

[0027] Fig.13 is a schematic diagram of the structure of a second preset receiving queue according to an embodiment of the present invention;

[0028] Fig.14 is a schematic diagram of a structure after a second preset receiving queue is overwritten by new data according to an embodiment of the present invention;

[0029] Fig.15 is a schematic diagram of a structure after data in a second preset receiving queue is released according to an embodiment of the present invention;

[0030] Fig.16 is a schematic diagram of a structure of a second preset receiving queue after new data is inserted according to an embodiment of the present invention;

[0031] Fig.17 is a structural block diagram of an inter-chip communication device of an in-vehicle system applied at a transmitting end according to an embodiment of the present invention;

[0032] Fig.18 is a structural block diagram of an inter-chip communication device of an in-vehicle system applied at a receiving end according to an embodiment of the present invention;

[0033] Fig.19 is a schematic structural diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0034] The features and exemplary embodiments of various aspects of the present application will be described in detail below. In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are only intended to explain the present application, rather than to limit the present application. For those skilled in the art, the present application can be implemented without the need for some of these specific details. The following description of the embodiments is only to provide a better understanding of the present application by illustrating the examples of the present application.

[0035] It should be noted that, in this article, relational terms such as first and second, etc. 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 terms "include", "comprise" or any other variants thereof are 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 statement "include..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0036] In addition, it should be noted that the acquisition, storage, use, and processing of data in the embodiments of this application are in compliance with the relevant provisions of national laws and regulations. It should be noted that in the embodiments of this application, some existing solutions in the industry such as certain software, components, and models may be mentioned, and they should be considered as exemplary. Their purpose is only to illustrate the feasibility of the implementation of the technical solution of this application, but it does not mean that the applicant has or will necessarily use the solution.

[0037] For ease of understanding, before explaining the solution provided in the present application, the inventive concept of the solution provided in the present application is first explained.

[0038] The vehicle communication system usually communicates by serial communication. However, as the number of applications installed in the vehicle system increases, the bandwidth of the serial communication is limited, and problems such as data blocking, coverage, and packet loss often occur. Specifically, the inter-chip communication of the vehicle system in the prior art directly calls the serial communication driver to send data, and can also add a check byte. However, when the check fails, the received data is directly discarded. Figure 1 is a schematic diagram of a system architecture without a protocol layer according to an embodiment of the present invention. Figure 1 As shown, in the prior art, when the microcontroller unit MCU101 (Micro-Controller Unit, MCU) of the vehicle system and the system chip SoC102 (System on Chip, SoC) use the serial port to communicate between the vehicle system chips, the system only includes an application layer 103 and a driver layer 104. The application layer 103 directly calls the driver layer 104 interface to send data out, and there is no communication mechanism that guarantees reliability and integrity and is implemented as an independent protocol layer module.

[0039] At the same time, when the communication volume is not large, periodic transmission of application information can also ensure the reliability of communication and the integrity of data. However, when the communication load increases and the data content needs to be changed before transmission, the existing technology cannot identify packet loss problems, let alone recover from packet loss and data verification failure. The reliability and integrity of inter-chip communication in the vehicle system cannot be guaranteed. Once a communication problem occurs, it will cause functional failure, which will affect driving safety.

[0040] In summary, the existing transmission and reception mode cannot save bandwidth while ensuring communication reliability and data integrity.

[0041] In order to solve the problems of the prior art, the embodiment of the present application provides a method for inter-chip communication of an in-vehicle system, which can be applied in scenarios such as a microcontroller unit of an in-vehicle system and a system chip communicating using a serial port. For example, Figure 2is a schematic diagram of a system architecture with a protocol layer according to an embodiment of the present invention. Figure 2 As shown, the microcontroller unit 101 and the system chip 102 of the vehicle-mounted system both include an application layer 103, a protocol layer 105 and a driver layer 104. They can serve as the transmitting end and the receiving end of the embodiment of the present invention.

[0042] Figure 3 is a flow chart of an inter-chip communication method of an in-vehicle system applied at a transmitting end according to an embodiment of the present invention. The transmitting end adds a protocol layer between the application layer and the driver layer, such as Figure 3 As shown, the vehicle-mounted system inter-chip communication method may include the following steps:

[0043] S310, the protocol layer receives the data to be transmitted sent by the application layer.

[0044] Figure 4 FIG. 1 is a schematic diagram of a process of successfully obtaining data from the application layer according to an embodiment of the present invention. Figure 4 As shown, the protocol layer 105 and the application layer 103 can realize the sending and receiving of the data to be transmitted through the ipc_Write interface. S410, the application program of the application layer 103 can send the data to be transmitted to the protocol layer 105 by calling the ipc_Write interface. S402, the sending of the transmission data is completed and the call is ended. The protocol layer 105 can be the inter-processor communication transmission protocol layer (IPC) of the vehicle system.

[0045] Figure 5 FIG. 1 is a flow chart of obtaining data interrupt from the application layer according to an embodiment of the present invention. Figure 5As shown, S501, if the protocol layer 105 receives the data to be transmitted sent by the application layer 103 and a reception interruption occurs, the received data needs to be copied to the receiving queue pData managed internally by the protocol layer 105; S502, the protocol layer 105 can notify the application layer 103 to process the data through the operating system event (OS) or by calling the callback function of the application layer 103; S503, after receiving the notification, the application layer 103 can call the ipc_Read interface to check the data first; S504, then copy the data of the protocol layer 105 receiving queue to the memory managed by the application layer 103. For channels with small data volume and high real-time requirements, the application layer 103 can also directly perform relevant processing according to the data of the protocol layer 105 receiving queue, S505, and then call the ipc_MemoryFree() interface of the protocol layer 105 to release the memory. In this way, the overhead of memory copying can be saved. S506, after the application layer 103 copies the data or directly parses and processes the data, there is still data information (messages, msgs) to be processed, and the above steps can be repeated.

[0046] For example, the ipc_Write interface is as follows:

[0047]

[0048]

[0049] The example: ipc_Read interface is as follows:

[0050]

[0051] For example, the ipc_Memoryfree interface is as follows:

[0052]

[0053] S320: The protocol layer performs format conversion on the data to be transmitted based on a preset transmission protocol to obtain target data.

[0054] In S320, the target data usually includes a data packet, and then the target data is sent as a complete frame of data. In the case where the target data includes multiple data packets, the multiple data packets can be combined into one frame by adding a length in front of the data packet, or specific identifiers can be added before and after the data packet. In an example, if multiple data packets are combined into one frame by adding a specific identifier 0x7E, escape processing needs to be added synchronously. For example, if 0x7E appears in the frame data, it is escaped to 0x7D5E, and 0x7D in the corresponding frame data is escaped to 0x7D5D, that is, once 0x7E or 0x7D appears in the frame, 0x7D is inserted and the fifth bit of the escaped byte is inverted.

[0055] In this embodiment, each data packet may include a control field, a message field and a check field, wherein the control field is used to indicate the category of the data packet, the message field is used to carry application data, and the check field is used to check the integrity of the data packet.

[0056] In this way, by setting the fields of the data packet, different functions of the data packet can be implemented according to the different fields of the data packet, so that the communication process of the system can be controlled more accurately.

[0057] S330, the driver layer stores the target data in a preset sending queue, and transmits the target data to the receiving end according to the preset sending queue.

[0058] In S330, the preset sending queue can be a linear queue. For situations where there is no restriction on using dynamic memory allocation, dynamic memory can be directly used to apply for system computing and storage resources on demand. The driver layer can send target data to the receiving end according to the preset sending queue order.

[0059] In an embodiment of the present application, a protocol layer is added between the application layer and the driver layer, and the protocol layer receives the data to be transmitted sent by the application layer, and after being processed by the protocol layer, it is transmitted to the receiving end based on a preset sending queue; the present application sends the data after processing the data by adding a protocol layer, and the data packet obtained by format conversion contains several fields. These data packets are used for communication, and more precise control of the communication can be achieved according to the control field, channel field, data field and check field of each data packet, thereby saving bandwidth while improving the reliability of communication.

[0060] In some embodiments, the categories of data packets include information frames, control frames, and handshake frames;

[0061] Among them, the control field of the information frame includes the sending sequence number and the receiving sequence number; the control field of the control frame only includes the receiving sequence number; the control field of the handshake frame does not include the sending sequence number and the receiving sequence number.

[0062] For example, the format of the control field is shown in Table 1 below:

[0063] Table 1

[0064]

[0065] For example, when the data packet is an information frame, it means that the data packet carries application layer data.

[0066] Among them, the control field Bit1 of the information frame is fixed to 0.

[0067] Bit 2 to 4 are the transmission sequence number N(S), which can be incremented from 0. Each time a frame of data is sent, the transmission sequence number N(S) of the information frame increases by 1, and returns to 0 after reaching the preset transmission queue length value N-1 and re-accumulates. For example, if the preset transmission queue length is 5, then N=5, and the value range of N(S) is 0 to 4.

[0068] Bit5 is the error identification bit. When a frame of data is received and the sequence number is misplaced (the sending sequence number is misplaced or the receiving sequence number is misplaced) or the data verification fails, Bit5 of the next frame of data (feedback information) to be sent can be set to 1, otherwise it is 0.

[0069] Bit 6 to 8 are the receiving sequence number N(R), with an initial value of 0. They can be used as feedback information to indicate the expected sending sequence number to be received.

[0070] The message field of the information frame is used to carry application layer data.

[0071] The check field of the information frame is set according to the check method of the receiving end, and there is no limitation on this.

[0072] For example, when the data packet is a control frame, the data packet does not carry application layer data and can be used to control communication processes and interactions.

[0073] Among them, Bit1 of the control field of the control frame is fixed to 1, Bit2 is fixed to 0, Bit3-4 are reserved and initially 0, Bit5 is an error identification bit, and Bit7-8 is the receiving sequence number N(R).

[0074] Among them, the message field of the control frame is empty.

[0075] The check field of the control frame is set according to the check method of the receiving end, and there is no limitation on this.

[0076] For example, when the data packet is a handshake frame, the data packet is used for handshaking between the sender and the receiver.

[0077] Among them, Bit1 of the control field of the handshake frame is fixed to 1, Bit2 is fixed to 1, Bit3 is fixed to 0, and Bit4 to 8 are reserved and initially 0.

[0078] Among them, the message field of the handshake frame is used to carry handshake request data and handshake response data.

[0079] For example, the message fields of the handshake frame may be as shown in Table 2 and Table 3 below;

[0080] Handshake request data format: Table 2

[0081]

[0082] Handshake response data format: Table 3

[0083]

[0084] The check field of the handshake frame is set according to the check method of the receiving end and is not limited thereto.

[0085] In some embodiments, the message field includes a channel field and a data field, the data field is used to carry application data, and the channel field is used to determine the application corresponding to the application data.

[0086] Figure 6 is a schematic diagram of the structure of a data packet according to an embodiment of the present invention, such as Figure 6 As shown, the length of the control field 106Control can be 1 byte (8 bits), the length of the message field 107Information is a variable length, and the length of the check field 108 can be 2 bytes (16 bits), wherein the message field 107Information can be composed of a channel field 109Channel and a data field 110Payload, the length of the channel field 109Channel can be 1 byte (8 bits), and the length of the data field 110Payload can be 0 to 256 bytes.

[0087] In this way, by limiting the length of the data field, the length of the data packet can be limited to 4 to 260 bytes, thereby avoiding excessive consumption of the memory of the preset sending queue.

[0088] The data field Payload is used to carry application data. The application data can be defined according to the actual application of the system. For example, as shown in Table 4 below.

[0089] Table 4

[0090]

[0091]

[0092] The value of the channel field Channel can be used to determine the application corresponding to the application data, such as 1 for navigation data, 2 for instrument data, etc. According to the actual application definition of the system, an example is shown in the following Table 5.

[0093] Table 5

[0094] Channel Name Priority Description / Purpose 0 CONTROL 0 Used by the inter-chip communication protocol layer. 1 POWER 1 Power management. 2 IVI 2 Central control platform. 3 NAV 3 Navigation data. 4 … … …

[0095] In some embodiments, when the category of the data packet of the target data is an information frame, the driver layer stores the target data in a preset sending queue, and transmits the target data to the receiving end according to the preset sending queue, including:

[0096] Extracting the message field of the information frame, and obtaining the transmission data according to the data field in the message field, where the transmission data is the application data carried by the data field;

[0097] Determine the priority based on the channel field in the message field, and the priority is determined based on the application corresponding to the application data;

[0098] Based on the priority, the transmission data is stored in a preset transmission queue, and the transmission data is transmitted to the receiving end according to the preset transmission queue.

[0099] In this embodiment, there is no restriction on the use of dynamic memory allocation. Dynamic memory can be used directly to apply for resources on demand. The protocol layer can maintain the mapping relationship between memory addresses and sent data according to priority, and the sending tasks / threads are sent according to the preset sending queue order.

[0100] For example, the preset sending queue length is 5, and there are 3 data to be sent in the current preset sending queue, namely Channel 1data address, Channel 2data address, and Channel 3data address. If the sending data is Channel 4data address and the sending data has the lowest priority, then based on the priority, the sending data is inserted into the end of the preset sending queue, as shown in Table 6 below:

[0101] Table 6

[0102] Channel 1 data address Channel 2 data address Channel 3 data address Channel 4 data address null

[0103] For example, the preset sending queue length is 5, and there are 4 data to be sent in the current preset sending queue, namely Channel 1data address, Channel 2data address, Channel 3data address, and Channel 4data address. If the sending data is Channel 5data address, and the priority of the sending data is smaller than Channel 1data address, but greater than the priority of other data to be sent, then based on the priority, the sending data is inserted into the corresponding position of the preset sending queue, as shown in Table 7 below:

[0104] Table 7

[0105] Channel 1 data address Channel 5 data address Channel 2 data address Channel 3 data address Channel 4 data address

[0106] In this embodiment, if the preset sending queue is full, you can try to send again after a delay. The protocol layer will not overwrite the old data when the preset sending queue is full, because the preset sending queue is full can be divided into two situations. One is that the instantaneous traffic at the application layer is too large, resulting in an increase in data. This situation can be alleviated by waiting. The other is congestion caused by system operation errors and cannot be recovered. The system communication can be timed out and the system can be restarted to recover after a communication problem occurs that has not been recovered after a timeout.

[0107] In some embodiments, storing the transmission data in a preset transmission queue, and transmitting the transmission data to the receiving end according to the preset transmission queue, includes:

[0108] receiving feedback information sent by a receiving end, where the feedback information is a data packet generated by the receiving end in response to the mth transmission data in a preset transmission queue, where m is a positive integer;

[0109] According to the feedback information, determine the m+1th sending data in the preset sending queue;

[0110] Transmit the m+1th transmission data to the receiving end.

[0111] In this embodiment, the feedback information may include control frames and information frames. Within a preset time interval, if the receiving end needs to send application layer data to the sending end, the generated data packet is an information frame including the application layer data. If the receiving end does not need to send application layer data to the sending end, the generated data packet is only used for feedback information and is a control frame that does not include application layer data.

[0112] In some embodiments, the feedback information includes an error flag, and determining, according to the feedback information, the m+1th transmission data in the preset transmission queue includes:

[0113] Determine whether the error flag of the feedback information matches the preset flag;

[0114] When the error flag of the feedback information matches the preset flag, the m+1th transmission data in the preset transmission queue is determined according to the reception sequence number of the feedback information.

[0115] In this embodiment, the preset flag bit may be 1, the fifth bit Bit5 of the byte of the control field of the feedback information may be an error flag bit, and the error flag bit may be 0 or 1.

[0116] When the error flag of the feedback information does not match the preset flag, that is, when the error flag of the feedback information is 0, it means that the mth sent data has been correctly received by the receiving end, and the data before the m sent data have also been received. The first m data in the preset sending queue can be cleared from the preset sending queue.

[0117] When the error flag of the feedback information matches the preset flag, that is, when the error flag of the feedback information is 1, it means that the mth transmitted data is not correctly received by the receiving end, and it is necessary to determine the m+1th transmitted data in the preset sending queue based on the receiving sequence number of the feedback information.

[0118] When the receiving sequence number N(R) of the received feedback information is equal to the expected N(S), the m+1th transmission data in the preset transmission queue is determined according to the expected N(S).

[0119] When the receiving sequence number N(R) of the received feedback information is m, it is determined that the m+1th transmission data in the preset transmission queue is the mth transmission data.

[0120] When no feedback information of the mth sending data is received within the preset time range, the m+1th sending data of the preset sending queue is determined as the mth sending data. For example, the preset time range may be 10ms*the length of the preset sending queue.

[0121] When it is determined that the m+1th transmission data in the preset transmission queue is the mth transmission data, but there is no mth transmission data in the preset transmission queue, it means that the status of the receiving end and the transmitting end are inconsistent. In order to ensure normal communication and improve the fault tolerance and robustness of the system, the transmission sequence number N(S) of the m+1th transmission data can be forced to be synchronized to m, that is, N(S) = m. The check field can also be recalculated to avoid the problem that the wrong check field is backed up, resulting in the check failure after retransmission.

[0122] The mth transmitted data (ith frame data) cannot be correctly received by the receiving end, which can be summarized into three situations, as shown below:

[0123] Figure 7 is a flow chart of a case where a transmitting end loses frame i and sends frame i+1 according to an embodiment of the present invention, such as Figure 7 As shown, S701, the sending end 109 sends the i-th frame data to the receiving end 110, but the i-th frame is lost and is not received by the receiving end 110; S702, the sending end 109 sends the i+1-th frame data to the receiving end 110, the receiving end 110 receives the i+1-th frame data, and identifies that the I+1-th frame data is an old frame or a skipped frame; S703, the receiving end 110 sends the error identification bit Bit5=1 of the control field Control, receives the feedback information (control frame or information frame) of the sequence number N(R)=i, and instructs the sending end 109 to resend the i-frame; S704-S705, the sending end 109 falls back to the i-frame, and resends the i-frame and the subsequent information frame (i+1 frame) that has been sent.

[0124] Figure 8 is a schematic diagram of a process of retransmitting i frames when i frames are lost at a transmitting end according to an embodiment of the present invention, such as Figure 8 As shown, S801, the sending end 109 sends the i-th frame data to the receiving end 110, but the i-th frame is lost and is not received by the receiving end 110, S802, the sending end 109 does not send the i+1-th frame data to the receiving end 110, so the receiving end 110 does not send feedback information of the reception error. After the feedback information of the i-th frame data is not received within a preset time range, the sending end 109 resends the i-th frame data to the receiving end 110; S803, until the correct feedback information sent by the receiving end 110 is received.

[0125] Fig. 9 is a flow chart of a sending end i frame damage according to an embodiment of the present invention, such as Fig. 9 As shown, S901, the sending end 109 sends the i-th frame data to the receiving end 110, and the i-th frame data is received by the receiving end 110, but the i-th frame data fails the verification; S902, the receiving end 110 sends the error identification bit Bit5=1 of the control field Control, receives the feedback information (control frame or information frame) of the sequence number N(R)=i, and instructs the sending end 109 to resend the i-frame; S903, the sending end 109 falls back to the i-frame, and resends the i-frame and the subsequent information frames that have been sent.

[0126] Fig.10 is a schematic diagram of the architecture of a vehicle-mounted system according to an embodiment of the present invention. Fig.10As shown, the vehicle-mounted system includes an operating system, a microcontroller unit, and another chip. The microcontroller unit includes an application layer 103, a protocol layer 105, and a driver layer 104. The operating system can record events occurring between the microcontroller unit and the other chip. The application layer 103 of the microcontroller unit sends application data to the protocol layer 105. The protocol layer 105 can process the application data and write it into the driver layer 104, so that the driver layer 104 can send the processed protocol layer 105 data to the other chip. The driver layer 104 can read the protocol layer 105 data, and the protocol layer 105 can receive the protocol layer 105 data of the other chip.

[0127] In some embodiments, when the target data includes a data packet and the type of the data packet is a handshake frame, after transmitting the target data to the receiving end according to the preset sending queue, the method further includes:

[0128] Receive and verify the response message generated by the receiving end based on the handshake frame:

[0129] When the channel field of the response message is consistent with the channel field of the handshake frame, a data transmission channel between the sender and the receiver is established.

[0130] For example, Fig.11 is a schematic diagram of a handshake process between a sending end and a receiving end according to an embodiment of the present invention, such as Fig.11 As shown, SoC102 is the active handshake party, and MCU101 is the receiving handshake party.

[0131] S601, MCU101 starts and waits for SoC102 to initiate a handshake. Before the handshake is completed, MCU101 should not send any information frames and control frames to SoC102. SoC102 starts and sends a handshake request to MCU101. For example, the handshake request can be a handshake frame. The control field Control of the handshake frame is 0x03, the channel field Channel of the handshake frame is 0, and the data field Payload[0] of the handshake frame can be filled with a custom value such as M. Payload[1] is filled with the protocol version number of SoC102, and a 200ms timer is started. Before the handshake is completed, SoC102 should not send any information frames and control frames to MCU101.

[0132] S602, determine whether a response message sent by MCU101 is received before the 200ms timer expires. If no response message sent by MCU101 is received before the 200ms timer expires, execute S603, otherwise execute S604.

[0133] S603, SoC102 sends another handshake request to MCU101, fills in Payload[0] which is different from the previous handshake request, and restarts the 200ms timing until SoC102 receives a correct response message within 200ms, and determines that the handshake is completed;

[0134] S604, after receiving the handshake request from SoC102, MCU101 sends a response message, and the data field Payload[0] of the handshake frame is filled with the Payload data received from SoC102, and Payload[1] is filled with the protocol version number of MCU101.

[0135] S605, after receiving the response message, SoC102 checks the data field Payload for consistency and determines that the handshake is completed. If the protocol version number does not match, an error is reported. If Payload[0] is inconsistent with the handshake request sent last time, SoC102 ignores this response. After the handshake is completed, SoC102 sends an information frame to MCU101, and both parties start normal data transmission.

[0136] In some embodiments, the method further comprises:

[0137] If no feedback information sent by the receiving end is received within a preset time period, transmitting the control frame to the receiving end;

[0138] The feedback information is a data packet generated by the receiving end in response to the sending data.

[0139] In this embodiment, the preset time period can be 10ms, which is not limited. If no feedback information sent by the receiving end is received within the preset time period, under normal circumstances, the sending end can send retransmission data to the receiving end, or send subsequent data in the preset sending list to the receiving end. However, if there is no subsequent data to be sent, or the system is congested, a control frame can be sent to the receiving end.

[0140] In this way, by sending control frames, the communication continuity between the sending end and the receiving end can be ensured, thereby improving the robustness of the communication.

[0141] Fig.12 FIG. 1 is a flow chart of an inter-chip communication method of an in-vehicle system applied at a receiving end according to an embodiment of the present invention. Fig.12 As shown, the vehicle-mounted system inter-chip communication method may include the following steps:

[0142] S1210, receiving target data transmitted by the sender, the target data includes N data packets, each data packet includes a control field, a message field and a check field, wherein the control field is used to distinguish the category of the data packet, the message field is used to carry application data, and the check field is used to check the integrity of the data packet, and N is a positive integer.

[0143] S1220, verify the target data according to the verification field.

[0144] In S1220, a cyclic redundancy check (CRC) may be used, or other check methods may be specified according to circumstances, which is not limited.

[0145] In some embodiments, after verifying the target data according to the verification field, the method further includes:

[0146] generating feedback information according to a verification result obtained by verifying the target data and a control field of the target data;

[0147] Transmit feedback information to the sender.

[0148] In this embodiment, the control field of the target data includes the sending sequence number N(S). When the sending sequence number N(S)=m of the control field of the received target data is an old frame or a skipped frame, the target data is directly discarded, and the error identification bit Bit5=1 of the control field of the generated feedback information, and the receiving sequence number is N(R)=expected N(S).

[0149] In this embodiment, when the sending sequence number N(S)=m of the control field of the received target data is a sequential frame, but the verification result is a verification failure, most of the target data are directly discarded, and the error identification bit Bit5=1 of the control field of the generated feedback information is generated, and the receiving sequence number is N(R)=m.

[0150] In some embodiments, the receiving end adds a protocol layer between the application layer and the driver layer; after verifying the target data according to the check field, the method further includes:

[0151] In the case where the preset dynamic memory allocation rule does not limit the dynamic memory allocation, the protocol layer stores the target data in the first preset receiving queue, so that the application layer receives the target data according to the first preset receiving queue, and the first preset receiving queue is a linear queue;

[0152] When dynamic memory allocation is limited by preset dynamic memory allocation rules, the protocol layer stores the target data in a second preset receiving queue so that the application layer receives the target data according to the second preset receiving queue, and the second preset receiving queue is a ring queue.

[0153] In this embodiment, when the preset dynamic memory allocation rules do not limit dynamic memory allocation, the protocol layer can dynamically apply for memory in the order of receiving target data to obtain the memory address. The application program of the application layer stores the target data according to the memory address and releases the target data of the preset receiving queue.

[0154] For example, if the length of the first preset receiving queue is 5, there are 5 target data in the current first preset receiving queue, as shown in Table 8 below, namely Data 1 address or Index, Data 2 address or Index, Data 3 address or Index, Data 4 address or Index, and Data 5 address or Index.

[0155] Table 8

[0156] Data 1address or Index Data 2address or Index Data 3address or Index Data 4address or Index Data 5address or Index

[0157] If Data 6address or Index is received at this time, since the first preset receiving queue is full and no application can release memory, in order to avoid occupying protocol layer resources for a long time without releasing memory, the application can directly overwrite the oldest data. The first preset receiving queue after overwriting is shown in Table 9 below.

[0158] Table 9

[0159] Data 2address or Index Data 3address or Index Data 4address or Index Data 5address or Index Data 6address or Index

[0160] In this way, since the memory occupancy is bound to the channel, if the overwritten data is not in the same channel as the current data, even if the application of the original channel requests to release the data again after overwriting, if the channels are inconsistent, it will not lead to erroneous release. This also reduces the impact of data overwriting to a certain extent.

[0161] If the first preset receiving queue after overwriting, Data 2 address or Index and Data 4 address or Index are released by the application layer, the obtained first preset receiving queue is shown in Table 10 below.

[0162] Table 10

[0163] Data 3address or Index Data 5address or Index Data 6address or Index EMPTY EMPTY

[0164] If the first preset receiving queue released by the application layer receives new target data Data 7 addressor Index, the obtained first preset receiving queue is shown in the following Table 11:

[0165] Table 11

[0166] Data 3address or Index Data 5address or Index Data 6address or Index Data 7address or Index EMPTY

[0167] In this embodiment, when the preset dynamic memory allocation rule limits dynamic memory allocation, the protocol layer stores the target data in the second preset receiving queue so that the application layer receives the target data according to the second preset receiving queue, and the second preset receiving queue is a ring queue.

[0168] In the case where dynamic memory allocation is limited for security reasons, if memory resources are abundant, because the receive queue is used for buffering and distribution between the IPC and application layers, the length is not limited like the send queue. In this case, a static memory queue can be applied for according to a certain redundant maximum length of the receive queue and the maximum length of the message. The memory occupation and recovery are managed using the memory address or offset table.

[0169] For example, Fig.13 is a schematic diagram of the structure of a second preset receiving queue according to an embodiment of the present invention, such as Fig.13 As shown, the current second preset receiving queue length is 5, and it is a circular queue including a head pointer Head and a tail pointer Tail. There are 5 target data in the current second preset receiving queue, namely Data 1address or Index, Data 2address or Index, Data 3address or Index, Data 4address or Index, and Data 5addressor Index.

[0170] For example, Fig.14 is a schematic diagram of a structure after a second preset receiving queue is overwritten by new data according to an embodiment of the present invention, such as Fig.14 As shown, if Data 6address or Index is received at this time, and the length of the head pointer and Data 6 is greater than the tail pointer, it means that the second preset receiving queue is full and no application can release the memory. In order to avoid occupying protocol layer resources for a long time without releasing the memory, the application can directly overwrite the oldest data to obtain the overwritten second preset receiving queue.

[0171] In this way, since the memory occupancy is bound to the channel, if the overwritten data is not in the same channel as the current data, even if the application of the original channel requests to release the data again after overwriting, if the channels are inconsistent, it will not lead to erroneous release. This also reduces the impact of data overwriting to a certain extent.

[0172] For example, Fig.15 is a schematic diagram of a structure after data in a second preset receiving queue is released according to an embodiment of the present invention, such as Fig.15As shown, if the second preset receiving queue after overwriting, Data2address or Index and Data4address or Index are released by the application layer, the tail pointer offset is updated to Data3, because the application program of the application layer may be using Data3, so Data3 cannot be moved.

[0173] For example, Fig.16 is a schematic diagram of a structure of a second preset receiving queue after new data is inserted according to an embodiment of the present invention, such as Fig.16 As shown, if the first preset receiving queue after being released by the application layer receives new target data Data7address or Index, and the sum of the head pointer and the length of Data 7 is less than or equal to the tail pointer, it means that Data 7 can be stored in the second preset receiving queue, Data 7 is stored in Head, and the Head offset is updated.

[0174] It is understandable that if the second preset receiving queue is a circular queue, since the length of the receiving queue is uncertain, it is conducive to buffering more messages; although the circular queue may be fragmented, there will be no leakage problem, because the fragmentation is caused by the fact that early data should have been released earlier but has not been released for a long time, and the early data will eventually be released or overwritten, so the free area will still become a continuous space; when updating the head pointer offset, it may span multiple information frames, because when the queue is full, a long information frame may cover multiple short information frames; when updating the tail pointer offset, it may also span multiple information frames, because the possible memory fragments may be connected into a continuous space after releasing a frame of data.

[0175] Fig.17 A schematic diagram of the structure of an inter-chip communication device of an in-vehicle system applied at the transmitting end provided by another embodiment of the present application is shown. For the sake of convenience of explanation, only the part related to the embodiment of the present application is shown.

[0176] Reference Fig.17 The vehicle-mounted system inter-chip communication device 1700 is applied at the transmitting end and may include an application layer 1701 and a driver layer 1702, and a protocol layer 1703 added between the application layer 1701 and the driver layer 1702;

[0177] The protocol layer 1703 is used to receive the data to be transmitted sent by the application layer 1701;

[0178] The protocol layer 1703 is used to perform format conversion on the data to be transmitted based on a preset transmission protocol to obtain target data, wherein the target data includes N data packets, each of which includes a control field, a message field and a check field, wherein the control field is used to indicate the category of the data packet, the message field is used to carry application data, and the check field is used to check the integrity of the data packet, and N is a positive integer;

[0179] The driver layer 1702 is used to store the target data in a preset sending queue and transmit the target data to the receiving end according to the preset sending queue.

[0180] In some embodiments, the driving layer 1702 may include the following units:

[0181] An extraction unit, configured to extract a message field of the information frame when the category of the data packet of the target data is an information frame, and obtain transmission data according to a data field in the message field, wherein the transmission data is application data carried by the data field;

[0182] A determination unit, configured to determine a priority according to a channel field in a message field, wherein the priority is determined based on an application corresponding to the application data;

[0183] The sending unit is used to store the sending data in a preset sending queue based on the priority, and transmit the sending data to the receiving end according to the preset sending queue.

[0184] In some embodiments, the sending unit may include the following subunits:

[0185] A receiving subunit, configured to receive feedback information sent by a receiving end, wherein the feedback information is a data packet generated by the receiving end in response to the mth transmission data in a preset transmission queue, where m is a positive integer;

[0186] A determination subunit, used to determine the m+1th transmission data in the preset transmission queue according to the feedback information;

[0187] The transmission subunit is used to transmit the (m+1)th transmission data to the receiving end.

[0188] In some embodiments, the above-mentioned determination subunit may further include:

[0189] The feedback information includes an error flag, and determining whether the error flag of the feedback information matches a preset flag;

[0190] When the error flag of the feedback information matches the preset flag, the m+1th transmission data in the preset transmission queue is determined according to the reception sequence number of the feedback information.

[0191] In some embodiments, the above-mentioned vehicle-mounted system inter-chip communication device 1700 may include the following modules:

[0192] A receiving module, configured to receive and verify a response message generated by the receiving end according to the handshake frame after transmitting the target data to the receiving end according to a preset sending queue, when the target data includes a data packet and the type of the data packet is a handshake frame;

[0193] The establishing module is used to establish a data transmission channel between the sending end and the receiving end when the channel field of the response message is consistent with the channel field of the handshake frame.

[0194] In some embodiments, the transmission module is further used to:

[0195] When no feedback information sent by the receiving end is received within a preset time period, the control frame is transmitted to the receiving end.

[0196] Fig.18 A schematic diagram of the structure of an inter-chip communication device of an in-vehicle system applied at a receiving end provided by another embodiment of the present application is shown. For ease of explanation, only the parts related to the embodiment of the present application are shown.

[0197] Reference Fig.18 , the vehicle-mounted system inter-chip communication device 1800 may include:

[0198] The receiving module 1801 is used to receive target data transmitted by the sending end, where the target data includes N data packets, each of which includes a control field, a message field and a check field, wherein the control field is used to distinguish the category of the data packet, the message field is used to carry application data, and the check field is used to check the integrity of the data packet, and N is a positive integer;

[0199] The verification module 1802 is used to verify the target data according to the verification field.

[0200] In some embodiments, the above-mentioned vehicle-mounted system inter-chip communication device 1800 may include the following modules:

[0201] A generating module, configured to generate feedback information according to a verification result obtained by verifying the target data and a control field of the target data after verifying the target data according to the verification field;

[0202] The transmission module is used to transmit the feedback information to the sending end.

[0203] In some embodiments, the above-mentioned vehicle-mounted system inter-chip communication device 1800 may include the following modules:

[0204] A storage module, configured to store the target data in a preset receiving queue at the protocol layer after verifying the target data according to the check field, in the case where the dynamic memory allocation is limited by the preset dynamic memory allocation rule, so that the application layer receives the target data according to the preset receiving queue;

[0205] The application module is used to dynamically apply for memory in the order of receiving target data at the protocol layer to obtain the memory address when the preset dynamic memory allocation rule does not limit the dynamic memory allocation; the application layer stores the target data according to the memory address.

[0206] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application, and are devices corresponding to the above-mentioned vehicle-mounted system inter-chip communication method. All implementation methods in the above-mentioned method embodiment are applicable to the embodiment of the device. Its specific functions and the technical effects brought about can be found in the method embodiment part, which will not be repeated here.

[0207] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.

[0208] Fig.19 is a schematic diagram of the structure of an electronic device according to an embodiment of the present invention. Fig.19 As shown:

[0209] The device may include a processor 1901 and a memory 1902 storing programs or instructions.

[0210] When the processor 1901 executes the program, the steps in any of the above method embodiments are implemented.

[0211] Exemplarily, the program may be divided into one or more modules / units, one or more modules / units are stored in the memory 1902, and executed by the processor 1901 to complete the present application. One or more modules / units may be a series of program instruction segments capable of completing a specific function, and the instruction segments are used to describe the execution process of the program in the device.

[0212] Specifically, the processor 1901 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.

[0213] Memory 1902 may include a large capacity memory for data or instructions. By way of example and not limitation, memory 1902 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. Where appropriate, memory 1902 may include removable or non-removable (or fixed) media. Where appropriate, memory 1902 may be inside or outside the integrated gateway disaster recovery device. In a particular embodiment, memory 1902 is a non-volatile solid-state memory.

[0214] The memory may include read-only memory (ROM), random access memory (RAM), magnetic disk storage media devices, optical storage media devices, flash memory devices, electrical, optical or other physical / tangible memory storage devices. Thus, typically, the memory includes one or more tangible (non-transitory) machine-readable storage media (e.g., memory devices) 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 an aspect of the present disclosure.

[0215] The processor 1901 implements any one of the methods in the above embodiments by reading and executing the program or instruction stored in the memory 1902 .

[0216] In one example, the electronic device may further include a communication interface 1903 and a bus 1904. The processor 1901, the memory 1902, and the communication interface 1903 are connected via the bus 1904 and communicate with each other.

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

[0218] Bus 1904 includes hardware, software or both, and the components of online data flow billing 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-end 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 1904 may include one or more buses. Although the present application embodiment describes and shows a specific bus, the present application considers any suitable bus or interconnection.

[0219] In addition, in combination with the method in the above embodiment, the embodiment of the present application may provide a machine-readable storage medium for implementation. The machine-readable storage medium stores a program or instruction; when the program or instruction is executed by a processor, any one of the methods in the above embodiment is implemented. The machine-readable storage medium can be read by a machine such as a computer.

[0220] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface and the processor are coupled, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

[0221] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.

[0222] An embodiment of the present application provides a computer program product, which is stored in a machine-readable storage medium. The program product is executed by at least one processor to implement the various processes of the above-mentioned method embodiment and can achieve the same technical effect. To avoid repetition, it will not be repeated here.

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

[0224] The functional modules shown in the above block diagram can be implemented as hardware, software, firmware or their combination. When implemented in hardware, it can be, for example, an electronic circuit, an application specific integrated circuit (ASIC), suitable 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. Programs or code segments can be stored in machine-readable media, or transmitted on a transmission medium or a communication link by a data signal carried in a carrier wave. "Machine-readable media" can include any medium that can store or transmit 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. Code segments can be downloaded via computer grids such as the Internet, intranets, etc.

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

[0226] Aspects of the present disclosure are described above with reference to the flowchart and / or block diagram of the method, device (system) and program product according to the embodiment of the present disclosure. It should be understood that each box in the flowchart and / or block diagram and the combination of each box in the flowchart and / or block diagram can be implemented by a computer program or instruction. These programs or instructions can be provided to a 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 implementation of the function / action specified in one or more boxes of the flowchart and / or 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 box in the block diagram and / or flowchart and the combination of boxes in the block diagram and / or flowchart can also be implemented by dedicated hardware that performs a specified function or action, or can be implemented by a combination of dedicated hardware and computer instructions.

[0227] The above are only specific implementation methods 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 vehicle-mounted system inter-chip communication method, characterized in that: The method is applied to a transmitting end, wherein the transmitting end is provided with a protocol layer between the application layer and the driver layer; the method comprises: The protocol layer receives the data to be transmitted sent by the application layer; The protocol layer performs format conversion on the data to be transmitted based on a preset transmission protocol to obtain target data, wherein the target data includes N data packets, each data packet includes a control field, a message field and a check field, wherein the control field is used to indicate the category of the data packet, the message field is used to carry application data, and the check field is used to check the integrity of the data packet, and N is a positive integer; The driving layer stores the target data in a preset sending queue, and transmits the target data to a receiving end according to the preset sending queue.

2. The method according to claim 1, characterized in that The categories of the data packets include information frames, control frames and handshake frames; Among them, the control field of the information frame includes a sending sequence number and a receiving sequence number; the control field of the control frame only includes a receiving sequence number; and the control field of the handshake frame does not include a sending sequence number and a receiving sequence number.

3. The method according to claim 2, characterized in that The message field includes a channel field and a data field, the data field is used to carry the application data, and the channel field is used to determine the application corresponding to the application data.

4. The method according to claim 3, characterized in that In a case where the category of the data packet of the target data is an information frame, the driver layer stores the target data in a preset sending queue, and transmits the target data to a receiving end according to the preset sending queue, including: Extracting a message field of the information frame, and obtaining transmission data according to a data field in the message field, wherein the transmission data is application data carried by the data field; Determine a priority according to a channel field in the message field, wherein the priority is determined based on an application corresponding to the application data; Based on the priority, the sending data is stored in the preset sending queue, and the sending data is transmitted to the receiving end according to the preset sending queue.

5. The method according to any one of claims 1 to 4, characterized in that: The storing the sending data in a preset sending queue, and transmitting the sending data to the receiving end according to the preset sending queue, comprises: receiving feedback information sent by the receiving end, wherein the feedback information is a data packet generated by the receiving end in response to the mth transmission data in the preset transmission queue, where m is a positive integer; Determine, according to the feedback information, the m+1th transmission data in the preset transmission queue; The m+1th transmission data is transmitted to the receiving end.

6. The method according to claim 5, characterized in that The feedback information includes an error flag, and determining, according to the feedback information, the m+1th transmission data in the preset transmission queue, includes: Determining whether the error flag of the feedback information matches a preset flag; When the error flag of the feedback information matches the preset flag, the m+1th transmission data in the preset transmission queue is determined according to the reception sequence number of the feedback information.

7. The method according to claim 3, characterized in that In the case where the target data includes a data packet and the type of the data packet is a handshake frame, after transmitting the target data to the receiving end according to the preset sending queue, the method further includes: Receiving and verifying a response message generated by the receiving end according to the handshake frame; When the channel field of the response message is consistent with the channel field of the handshake frame, a data transmission channel between the sending end and the receiving end is established.

8. The method according to any one of claims 1 to 4, 6 or 7, characterized in that The method further comprises: If no feedback information sent by the receiving end is received within a preset time period, transmitting a control frame to the receiving end; The feedback information is a data packet generated by the receiving end in response to the sending data.

9. A method for inter-chip communication of an in-vehicle system, characterized in that: Applied at the receiving end, the method includes: Receive target data transmitted by a sending end, the target data includes N data packets, each data packet includes a control field, a message field and a check field, wherein the control field is used to distinguish the category of the data packet, the message field is used to carry application data, and the check field is used to check the integrity of the data packet, and N is a positive integer; The target data is verified according to the verification field.

10. The method according to claim 9, characterized in that After verifying the target data according to the verification field, the method further includes: generating feedback information according to a verification result obtained by verifying the target data and a control field of the target data; The feedback information is transmitted to the sending end.

11. The method according to claim 9, characterized in that The receiving end is provided with a protocol layer between the application layer and the driver layer; after verifying the target data according to the verification field, the method further includes: In a case where the preset dynamic memory allocation rule does not limit dynamic memory allocation, the protocol layer stores the target data in a first preset receiving queue, so that the application layer receives the target data according to the first preset receiving queue, and the first preset receiving queue is a linear queue; When dynamic memory allocation is limited by preset dynamic memory allocation rules, the protocol layer stores the target data in a second preset receiving queue so that the application layer receives the target data according to the second preset receiving queue, and the second preset receiving queue is a ring queue.

12. A device for inter-chip communication of an in-vehicle system, characterized in that: Applied at the transmitting end, the device includes an application layer and a driver layer, and a protocol added between the application layer and the driver layer, wherein: The protocol layer is used to receive the data to be transmitted sent by the application layer; The protocol layer is used to perform format conversion on the data to be transmitted based on a preset transmission protocol to obtain target data, wherein the target data includes N data packets, each data packet includes a control field, a message field and a check field, wherein the control field is used to indicate the category of the data packet, the message field is used to carry application data, and the check field is used to check the integrity of the data packet, and N is a positive integer; The driver layer is used to store the target data in a preset sending queue and transmit the target data to a receiving end according to the preset sending queue.

13. A device for inter-chip communication of an in-vehicle system, characterized in that: Applied at a receiving end, the device comprises: A receiving module, used to receive target data transmitted by a sending end, wherein the target data includes N data packets, each of which includes a control field, a message field and a check field, wherein the control field is used to distinguish the category of the data packet, the message field is used to carry application data, and the check field is used to check the integrity of the data packet, and N is a positive integer; A verification module is used to verify the target data according to the verification field.

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

15. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer program instructions, which, when executed by a processor, implement the method according to any one of claims 1 to 11.

16. A computer program product, characterized in that When the instructions in the computer program product are executed by a processor of an electronic device, the electronic device executes the method according to any one of claims 1 to 11.