WO2023216503A1 - 一种用于车辆智驾的多核异构通信方法与***、存储介质 - Google Patents
一种用于车辆智驾的多核异构通信方法与***、存储介质 Download PDFInfo
- Publication number
- WO2023216503A1 WO2023216503A1 PCT/CN2022/124943 CN2022124943W WO2023216503A1 WO 2023216503 A1 WO2023216503 A1 WO 2023216503A1 CN 2022124943 W CN2022124943 W CN 2022124943W WO 2023216503 A1 WO2023216503 A1 WO 2023216503A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- data
- core
- vehicle
- slave
- data channel
- Prior art date
Links
- 238000000034 method Methods 0.000 title claims abstract description 104
- 238000004891 communication Methods 0.000 title claims abstract description 47
- 239000000872 buffer Substances 0.000 claims abstract description 237
- 230000008569 process Effects 0.000 claims abstract description 57
- 239000000284 extract Substances 0.000 claims abstract description 29
- 238000004590 computer program Methods 0.000 claims description 7
- 230000005540 biological transmission Effects 0.000 abstract description 14
- 238000010586 diagram Methods 0.000 description 6
- 238000005516 engineering process Methods 0.000 description 6
- 230000006870 function Effects 0.000 description 5
- 238000012545 processing Methods 0.000 description 3
- 230000008054 signal transmission Effects 0.000 description 3
- 230000008447 perception Effects 0.000 description 2
- 101100236764 Caenorhabditis elegans mcu-1 gene Proteins 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000002457 bidirectional effect Effects 0.000 description 1
- 238000013075 data extraction Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 238000013507 mapping Methods 0.000 description 1
- 238000005259 measurement Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000001360 synchronised effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F15/00—Digital computers in general; Data processing equipment in general
- G06F15/16—Combinations of two or more digital computers each having at least an arithmetic unit, a program unit and a register, e.g. for a simultaneous processing of several programs
- G06F15/163—Interprocessor communication
Definitions
- the present invention relates to the technical field of intelligent driving, and in particular to a multi-core heterogeneous communication method and system and storage medium for intelligent driving of vehicles.
- multi-core heterogeneous autonomous driving platforms usually use a main core to manage the transmission of data. This often causes the main core to process sequentially when transmitting a large amount of data. If each core accesses DDR (Double Data Rate SDRAM), the double data rate will be doubled. Synchronous dynamic random access memory (commonly known as DDR) has no order of priority. It depends on the process on each core to seize resources by itself, which will cause uncertainty in signal transmission delay and is not suitable for large-scale multi-core heterogeneous smart driving SOCs. (System on Chip, system-level chip) platform use. Therefore, it is urgent to propose a communication technology suitable for large-scale multi-core heterogeneous smart driving SOC platforms.
- DDR Double Data Rate SDRAM
- the purpose of the present invention is to propose a multi-core heterogeneous communication method, system and storage medium for intelligent driving of vehicles to achieve high efficiency and low delay in cross-core transmission of information on intelligent driving of vehicles, and is suitable for large-scale multi-core Use of heterogeneous intelligent driving SOC platform.
- the embodiment of the present invention proposes a multi-core heterogeneous communication method for intelligent vehicle driving, including:
- the multi-core includes a master core and multiple slave cores; data channels are provided between the master core and the multiple slave cores, and each data channel is provided with multiple circular buffers; The data channel is used for the slave core to send data to the main core, and the circular buffer is used to store the data being sent in the data channel;
- the methods include:
- the main core starts the IPC-Adapter-SVC process
- the plurality of slave cores respectively receive different vehicle internal data or vehicle external data; and put the vehicle internal data or vehicle external data into a circular buffer in the data channel between it and the master core;
- the IPC-Adapter-SVC process obtains the priority of each data channel, and extracts the vehicle internal data or vehicle external data from the circular buffer in each data channel in order of priority; Internal data or vehicle external data are distributed to different intelligent driving processes run by the main core through the distributed middleware DDS.
- the vehicle's memory stores a data structure
- the data structure at least includes a plurality of Vring structures
- the plurality of Vring structures correspond to a plurality of data channels in a one-to-one correspondence
- the Vring structure at least includes a data structure that can be used buffer index
- the method includes:
- the value of the buffer index of the Vring structure corresponding to the data channel can be used Add 1 to indicate the current working position of any slave core;
- the IPC-Adapter-SVC process obtains the priority of each data channel, and extracts the vehicle internal data or vehicle external data from the circular buffer in each data channel in order of priority, including:
- the buffer index can be used to read the Vring structure corresponding to the any data channel. value, determine the position of the circular buffer from which data is currently to be extracted based on the value of the available buffer index; and extract the vehicle internal data or vehicle internal data from the corresponding circular buffer according to the position of the circular buffer from which data is currently to be extracted. external data.
- each data channel is provided with N circular buffers; N is greater than 0;
- the methods include:
- the buffer index that can be used in any Vring structure is increased by 1, if the value of the buffer index that can be used in any Vring structure is equal to N at this time, then the buffer index that can be used in any Vring structure is added The value is set to 1.
- the method includes:
- the Vring structure corresponding to any data channel can be read. Use the value of the buffer index to determine the location of the circular buffer where data is currently to be stored; and store the vehicle internal data to be sent or Vehicle external data is stored in the corresponding circular buffer.
- the vehicle's memory stores multiple ShmloVirtio structures, the multiple ShmloVirtio structures are in one-to-one correspondence with multiple data channels, and each ShmloVirtio structure records the priority and circular buffer of its corresponding data channel.
- the methods include:
- the IPC channel Before executing the step of starting the IPC-Adapter-SVC process by the main core, the IPC channel is initialized, and the priority of each data channel and the number and capacity of circular buffers are configured.
- data channels are provided between the multiple slave cores, and each data channel is provided with multiple circular buffers; the data channels are used for any slave core to send data to another slave core.
- the circular buffer is used to store data being sent in the data channel;
- the plurality of slave cores include at least a first slave core and a second slave core;
- the methods include:
- the first slave core receives vehicle internal data or vehicle external data; and puts the vehicle internal data or vehicle external data into a circular buffer in the data channel between it and the second slave core;
- the second slave core obtains the priority of each data channel and extracts the vehicle internal data or vehicle external data from the circular buffer in each data channel in order of priority.
- the plurality of slave cores include at least one core used for system expansion.
- Embodiments of the present invention also propose a multi-core heterogeneous communication system for intelligent driving of vehicles, including a master core and multiple slave cores; data channels are provided between the master core and the multiple slave cores. And each of the data channels is provided with multiple circular buffers; the data channel is used for the slave core to send data to the main core, and the circular buffer is used to store the data being sent in the data channel. data;
- the main core is used to run the IPC-Adapter-SVC process
- the plurality of slave cores are respectively used to receive different vehicle internal data or vehicle external data; and put the vehicle internal data or vehicle external data into a circular buffer in the data channel between it and the master core;
- the IPC-Adapter-SVC process is used to obtain the priority of each data channel, and extract the vehicle internal data or vehicle external data from the circular buffer in each data channel in order of priority;
- the vehicle internal data or vehicle external data are distributed to different intelligent driving processes run by the main core through the distributed middleware DDS.
- the vehicle's memory stores a data structure
- the data structure at least includes a plurality of Vring structures
- the plurality of Vring structures correspond to a plurality of data channels in a one-to-one correspondence
- the Vring structure at least includes a data structure that can be used buffer index
- the buffer index of the Vring structure corresponding to the data channel can be used Add 1 to the value to indicate the current working position of any slave core
- the IPC-Adapter-SVC process is specifically used to read the Vring structure corresponding to any data channel when it extracts the vehicle internal data or vehicle external data from the circular buffer in any data channel.
- the value of the usable buffer index determine the position of the circular buffer currently to be extracted according to the value of the usable buffer index; and extract the data from the corresponding circular buffer according to the position of the circular buffer currently to be extracted. Describe vehicle internal data or vehicle external data.
- each data channel is provided with N circular buffers; N is greater than 0;
- the buffer index that can be used in any Vring structure is increased by 1, if the value of the buffer index that can be used in any Vring structure is equal to N at this time, then the buffer index that can be used in any Vring structure is added The value is set to 1.
- the vehicle's memory stores multiple ShmloVirtio structures, the multiple ShmloVirtio structures are in one-to-one correspondence with multiple data channels, and each ShmloVirtio structure records the priority and circular buffer of its corresponding data channel.
- the main core Before starting the IPC-Adapter-SVC process, the main core initializes the IPC channel and configures the priority of each data channel and the number and capacity of circular buffers.
- data channels are provided between the multiple slave cores, and each data channel is provided with multiple circular buffers; the data channels are used for any slave core to send data to another slave core.
- the circular buffer is used to store data being sent in the data channel;
- the plurality of slave cores include at least a first slave core and a second slave core;
- the first slave core is used to receive vehicle internal data or vehicle external data; and put the vehicle internal data or vehicle external data into a circular buffer in the data channel between it and the second slave core;
- the second slave core is used to obtain the priority of each data channel, and extract the vehicle internal data or vehicle external data from the circular buffer in each data channel in order of priority.
- Embodiments of the present invention also provide a computer-readable storage medium on which a computer program is stored.
- the computer program is executed by a processor, the steps of the multi-core heterogeneous communication method for intelligent vehicle driving in the above embodiments are implemented.
- the data channels between the master core and multiple slave cores are given priorities respectively.
- the master core sets up the IPC-Adapter-SVC process.
- the IPC-Adapter-SVC process obtains the priority of each data channel and sorts it by priority.
- the vehicle internal data or vehicle external data are extracted from the circular buffer in each data channel in turn; and the vehicle internal data or vehicle external data are distributed to different intelligences running on the main core through the distributed middleware DDS. driving process.
- the priority of the data transmission channel between each core can be designed independently by each core. This can ensure that different signals can be prioritized according to the real-time requirements.
- each embodiment of the present invention combines IPC inter-core communication technology and distributed middleware The combination of DDS technology can achieve high efficiency in cross-core transmission of vehicle intelligent driving information, and is suitable for use on large-scale multi-core heterogeneous intelligent driving SOC platforms.
- Figure 1 is a schematic flowchart of a multi-core heterogeneous communication method for intelligent vehicle driving in an embodiment of the present invention.
- Figure 2 is a schematic structural diagram of the ICP+DDS model in the embodiment of the present invention.
- Figure 3 is a schematic diagram of all data channels of multi-core heterogeneous communication being laid out in the memory in the embodiment of the present invention.
- Figure 4 is a schematic diagram of the vqBaseAddr structure in an embodiment of the present invention.
- FIG. 5 is a schematic diagram of the VringBaseAddr structure in an embodiment of the present invention.
- Figure 6 is a schematic diagram of the PrimeBaseAddr structure in an embodiment of the present invention.
- Figure 7 is a schematic diagram of a Vring structure in an embodiment of the present invention.
- the multi-core includes a master core and multiple slave cores; Data channel, and each data channel is provided with multiple circular buffers; the data channel is used for the slave core to send data to the main core, and the circular buffer is used to store the data in the data channel. Data being sent.
- the method in this embodiment includes the following steps:
- Step S1 The main core starts the IPC-Adapter-SVC process.
- Step S2 The plurality of slave cores respectively receive different vehicle internal data or vehicle external data; and put the vehicle internal data or vehicle external data into a circular buffer buffer in the data channel between the slave core and the main core. .
- the different vehicle internal data refers to CAN IMU data, etc.
- the vehicle external data refers to camera data, ultrasonic (USS) data, etc., that is, the data that needs to be used in the intelligent driving decision-making process.
- Step S3 The IPC-Adapter-SVC process obtains the priority of each data channel, and extracts the vehicle internal data or vehicle external data from the circular buffer in each data channel in order of priority; and The vehicle internal data or vehicle external data is distributed to different intelligent driving processes run by the main core through the distributed middleware DDS.
- the data channels between the main core and multiple slave cores are given priorities respectively.
- the main core sets up an IPC-Adapter-SVC process, and the IPC-Adapter-SVC process obtains the priority of each data channel. levels, and extract the vehicle internal data or vehicle external data from the circular buffer in each data channel in sequence according to priority; and distribute the vehicle internal data or vehicle external data to all vehicles through the distributed middleware DDS Describes the different intelligent driving processes run by the main core.
- the priority of the data transmission channel between each core can be designed independently. This can ensure that different signals can be prioritized according to the real-time requirements, and a channel priority can be found through system debugging.
- the IPC+DDS model of this specific example is shown in Figure 2.
- Figure 2 shows six Of course, the present invention is not limited to the IPC+DDS model of Figure 2.
- the six cores include one master core A72 and five slave cores MCU1_0, MCU2_0, MCU2_1, MCU3_1, and MCU3_0.
- the slave cores MCU1_0, MCU2_0, MCU2_1, MCU3_1, and MCU3_0 can be understood as satellite cores of the main core A72, and can be installed with, for example, Autosar system, RTOS system, etc.
- each core can be allocated as follows.
- the slave core MCU1_0 is responsible for CAN IMU data distribution, and the slave core MCU2_0 is responsible for collecting camera data and distributing it to
- the main core A72 and the slave core MCU2_1 are responsible for collecting ultrasonic (USS) data and distributing it to the main core A72.
- the slave core MCU3_0 is responsible for controlling the algorithm and status management and outputting some signals to interact with the main core A72.
- the input of the slave core MCU3_0 is the path of the main core A72.
- the slave core MCU3_1 is a reserved core and is used when the system is expanded.
- the main core A72 is used for other algorithm parts of intelligent driving decisions such as automatic parking, such as perception process, positioning process and AVM (panoramic image monitoring). , Around View Monitor) process requires data from each satellite core.
- automatic parking such as perception process, positioning process and AVM (panoramic image monitoring).
- AVM panoramic image monitoring
- Around View Monitor requires data from each satellite core.
- the above are just examples. In actual applications, the specific number of slave cores and the functions of each slave core can be adjusted appropriately.
- the CAN IMU USS control algorithm inter-core communication is carried out through the above-mentioned IPC+DDS model.
- the priority of this ring access memory DDR can be configured in the ShmloVitro structure. .
- the CAN signal from MCU1_0 has the highest priority, and some key signals such as vehicle speed must have the highest priority. That is, the channel between MCU1_0 and A72 has the highest priority when accessing DDR. In this way, priority configuration can ensure that the priority of each channel accessing DDR is arranged in a reasonable order to ensure the real-time nature of the signal.
- the cameras include front-view and surround-view release services, which are also configured in this way and then centrally released to the main core A72 for use in the intelligent driving process.
- the data volume is relatively large. Therefore, in this embodiment, it is preferable to set up the front-view process and the surround-view process in the main core A72, which are used to directly receive the front-view image and the surround-view image of the camera respectively, and then distribute the data to the smart phone through the distributed middleware DDS.
- Driving process as shown in Figure 2, intelligent driving processes include perception, positioning, AVM, etc.
- IPC-Adapter-SVC In addition to camera data, other vehicle internal/external data are forwarded through the IPC-Adapter-SVC process. All signals forward data through the distributed middleware DDS, which then ensures that each algorithm of the main core A72 subscribes to the data and uses it as needed. Specifically, in this embodiment, different algorithm nodes can subscribe to the same data for processing. For example, the CAN signal will be subscribed in large quantities, the image data of the camera will be subscribed by the sensing module and the AVM module, and the IMU (inertial measurement unit) of the CAN bus will be subscribed. Unit) data will be subscribed by the positioning module.
- IMU intial measurement unit
- the vehicle's memory stores a data structure.
- the data structure is a way for a computer to store and organize data.
- the memory is preferably but not limited to DDR, and the data structure at least includes multiple Vring structures.
- the multiple Vring structures correspond to multiple data channels one-to-one. As mentioned in the above example, assuming there are 30 data channels, there are corresponding 30 Vring structures.
- the Vring structures at least contain Buffer index can be used;
- the method includes:
- Step S4 When any slave core puts the vehicle internal data or vehicle external data into the circular buffer buffer in the data channel between it and the master core, the Vring structure corresponding to the data channel can be used.
- the value of the buffer index is increased by 1 to indicate the current working position of any slave core.
- step S3 the IPC-Adapter-SVC process obtains the priority of each data channel, and extracts the vehicle internal data from the circular buffer buffer in each data channel in order of priority. or vehicle external data, including:
- the IPC-Adapter-SVC process extracts the vehicle internal data or vehicle external data from the circular buffer buffer in any data channel, read the available buffer index of the Vring structure corresponding to the any data channel.
- the value of the buffer index is used to determine the position of the circular buffer buffer currently to be extracted; and the vehicle is extracted from the corresponding circular buffer buffer according to the position of the circular buffer buffer currently to be extracted.
- data channels are provided between the plurality of slave cores, and each data channel is provided with multiple circular buffers; the data channels are used for any slave core to send data to another slave core.
- Data the circular buffer buffer is used to store the data being sent in the data channel.
- each core in the IPC+DDS model shown in Figure 2, a total of 6 cores participate in IPC communication, and each core needs to communicate with other cores.
- each core is set to There are two data channels, RX (receiving) and TX (transmitting), between the two cores, which are responsible for bidirectional data transmission.
- RX transmits
- TX transmitting
- Each core needs to participate in the communication of 10 data channels. This The 30 data channels are tiled on the memory as shown in Figure 3, including the vqBaseAddr structure, the VringBaseAddr structure and the PrimeBaseAddr structure.
- the vqBaseAddr structure is the starting address of the 32M memory allocated to the IPC. This value is specified in the operating system (OS). 4K is allocated in the DDR memory to store the Shmlo structure. This 4K The memory model is shown in Figure 4.
- Each core has a corresponding Shmlo structure.
- Figure 4 shows the Shmlo structure corresponding to the main core A72.
- the Shmlo structures corresponding to other slave cores are the same, so the figure 4 does not show too much.
- the model of the VringBaseAddr structure is shown in Figure 5, which is used to store the ShmVirtio structure of 30 data channels. Each data channel has a corresponding ShmVirtio structure; the ShmVirtio structure is used to store 30 data channels.
- Manage the circular buffer buffer in the data channel which contains the channel number of the data channel, the Vring structure, and the configuration parameters of the circular buffer buffer including size, priority, number, etc., which can be adjusted according to technical requirements ShmVirtio Structure, configure required parameters, the present invention is not limited to the example shown in Figure 5.
- the PrimeBaseAddr is used to store transmitted data.
- 64 2K circular buffer buffers are configured for each data channel.
- the model is shown in Figure 6.
- Figure 6 shows the main There are 64 2K buffers for the data channel between core A72 and slave core MCU1_0.
- the buffer settings of other data channels are consistent with the data channels between master core A72 and slave core MCU1_0. You can refer to the section between master core A72 and slave core MCU1_0.
- data transmission between cores can be performed by reading and writing data through the three models shown in Figures 4 to 6 above, and each core can perform data transmission through the priority in the ShmVirtio structure corresponding to the channel number. Read and write, you can adjust the priority of data transmission of the corresponding channel.
- each data channel is provided with N circular buffers; N is greater than 0.
- N 64.
- Figure 7 is a specific example of the Vring structure in the embodiment of the present invention.
- the Vring structure includes the number of buffers, the descriptor of the buffer, the available buffer index and the used buffer index.
- Figure 7 shows A vring contains 64 buffers.
- the buffer index can be used to indicate the buffer location that the sender can use when transmitting and storing data.
- the buffer index has been used to indicate the buffer location that the receiver has extracted when performing data extraction, so that the receiver can continue. Extract the next buferr data.
- the idx of the buffer index that can be used is increased by 1 to indicate that it is working at a position where the buffer index can be used, let The data receiver Host knows where the available buffers start.
- the available buffer index is maintained by the data sender Guest and provided to the data receiver Host.
- the Host retrieves the buffer from the Vring structure based on the information provided in the usable buffer index, it updates the used buffer index after processing.
- Each time it retrieves the buffer it adds 1 to the idx of the used buffer index to indicate that it is working in the current state. Which position in the buffer index to use.
- Parameters such as 64 and 2K can be configured as needed to meet the needs of system expansion. For example, adding a driving function to the parking system will increase the amount of data and the number of buffers can be adjusted.
- parameters such as the number of 64 and the size of 2K can be configured as needed to meet the needs of system expansion. For example, adding a driving function to the parking system will increase the amount of data and the buffer can be modified. The number is adjusted.
- the method of this embodiment includes:
- Step S5 When the value of the usable buffer index of any Vring structure (that is, the idx of the available buffer in Figure 7) is increased by 1, if the value of the usable buffer index of any Vring structure is equal to N at this time, Then set the value of the available buffer index of any Vring structure to 1, indicating which buffer position you are currently working on.
- the value of the usable buffer index of any Vring structure that is, the idx of the available buffer in Figure 7
- Step S6 When any slave core puts the vehicle internal data or vehicle external data into the circular buffer buffer in the data channel between it and the master core, read the Vring corresponding to any data channel.
- the value of the usable buffer index of the structure is used to determine the position of the circular buffer buffer where the data is currently to be stored; and based on the position of the circular buffer buffer where the data is currently to be stored, the position of the buffer to be stored is determined.
- the sent vehicle internal data or vehicle external data is stored in the corresponding circular buffer buffer.
- Step S7 Before executing the step of starting the IPC-Adapter-SVC process by the main core, initialize the IPC channel and configure the priority of each data channel and the number and capacity of circular buffer buffers.
- the plurality of slave cores include at least a first slave core and a second slave core.
- the method of this embodiment includes:
- Step S8 The first slave core receives vehicle internal data or vehicle external data; and puts the vehicle internal data or vehicle external data into the circular buffer buffer in the data channel between it and the second slave core;
- Step S9 The second slave core obtains the priority of each data channel, and extracts the vehicle internal data or vehicle external data from the circular buffer buffer in each data channel in order of priority.
- the plurality of slave cores include at least one core used for system expansion, such as the slave core MCU3_1 in Figure 2, which means that this system can be expanded.
- the slave core MCU3_1 in Figure 2 which means that this system can be expanded.
- Inter-core communication only needs to be configured with communication parameters between the new core and other cores.
- the communication of the entire multi-core heterogeneous platform has formed a closed loop.
- the main core A72 communicates with each satellite core through IPC+DDS, and the communication of each automatic parking module is ensured through configuring parameters. Low latency and high efficiency ensure the effective operation of the system.
- the positioning module of the parking algorithm requires the wheel speed information BCS_FLWheelSpd of the left front wheel.
- the value of the IPC status in the structure Shmlo is 1, indicating that it is enabled.
- the BCS_FLWheelSpd signal is obtained from the core MCU1.
- a CAN bus signal Put this CAN bus signal in the Idt-Can-Signal-Rx-Route-Fast structure.
- the slave core MCU1_0's own core number ID is 1, and the CAN signal is sent to the master core A72.
- the corresponding data channel number ID is 0.
- the slave core MCU1_0 needs to write the BCS_FLWheelSpd data, that is, Idt-Can-Signal-Rx-Route-Fast, to the data channel numbered 0, among which the ShmVirtio structure of 10 channels in the Shmlo structure Represents one core communicating with the other five cores.
- Each communication has two channels, RX and TX.
- the ShmVirtio structure can set the parameters of the channel to transmit data, such as priority, because the wheel speed signal is a more important signal. , so the priority can be set higher.
- Each data channel contains 64 circular buffers, and the size of each buffer is 2K.
- each data structure to be sent can represent a buffer.
- MCU1_0 places the buffer containing the BCS_FLWheelSpd signal in the memory DDR. At this time, the value of the buffer index can be increased by 1 to indicate that it is working at a location where the buffer index can be used. , let the Host know where the available buffer starts. MCU1_0 has been putting data into the channel while the program is running, so the value of the buffer index available at this time will continue to increase.
- the IpcAdapterSVC process of the main core A72 will fetch the buffer from VRing based on the information provided in the available buffer index, and continuously fetch the Idt-Can-Signal-Rx-Route-Fast structure from the buffer through channel 0, and update it after processing.
- the used buffer index then adds 1 to the corresponding value to indicate where you are working.
- the used buffer index is maintained by the data receiver Host (in this case, the main core A72) and is provided to the data sender Guest (in this example) MCU1_0) used.
- idx equals 64, the pointer will redirect to the first circular buffer buffer.
- the IpcAdapterSVC process will forward the BCS_FLWheelSpd signal through DDS, and the algorithm processes of the main core A72, such as the positioning algorithm and mapping algorithm, will subscribe.
- the algorithm processes of the main core A72 such as the positioning algorithm and mapping algorithm
- another embodiment of the present invention also proposes a multi-core heterogeneous communication system for intelligent vehicle driving, which can be used to implement the method described in the above embodiment.
- the example system includes a master core and multiple slave cores; a data channel is provided between the master core and the multiple slave cores, and each of the data channels is provided with multiple circular buffer buffers; so The data channel is used for the slave core to send data to the main core, and the circular buffer buffer is used to store the data being sent in the data channel;
- the main core is used to run the IPC-Adapter-SVC process
- the plurality of slave cores are respectively used to receive different vehicle internal data or vehicle external data; and put the vehicle internal data or vehicle external data into a circular buffer buffer in the data channel between it and the master core;
- the IPC-Adapter-SVC process is used to obtain the priority of each data channel, and extract the vehicle internal data or vehicle external data from the circular buffer buffer in each data channel in order of priority; and
- the vehicle internal data or vehicle external data is distributed to different intelligent driving processes run by the main core through the distributed middleware DDS.
- the vehicle's memory stores a data structure
- the data structure at least includes a plurality of Vring structures
- the plurality of Vring structures correspond to a plurality of data channels in a one-to-one correspondence
- the Vring structure at least includes a data structure that can be used buffer index
- the IPC-Adapter-SVC process is specifically used to read the Vring structure corresponding to any data channel when it extracts the vehicle internal data or vehicle external data from the circular buffer buffer in any data channel.
- the value of the usable buffer index of the body is determined according to the value of the usable buffer index to determine the position of the circular buffer buffer currently to be extracted; and based on the position of the circular buffer buffer currently to be extracted, the corresponding circular buffer is Extract the vehicle internal data or vehicle external data from the buffer.
- each data channel is provided with N circular buffer buffers; N is greater than 0;
- the buffer index that can be used in any Vring structure is increased by 1, if the value of the buffer index that can be used in any Vring structure is equal to N at this time, then the buffer index that can be used in any Vring structure is added The value is set to 1.
- the vehicle's memory stores multiple ShmloVirtio structures, the multiple ShmloVirtio structures are in one-to-one correspondence with multiple data channels, and each ShmloVirtio structure records the priority and circular buffer of its corresponding data channel.
- the main core Before starting the IPC-Adapter-SVC process, the main core initializes the IPC channel and configures the priority of each data channel and the number and capacity of circular buffer buffers.
- data channels are provided between the plurality of slave cores, and each data channel is provided with multiple circular buffers; the data channels are used for any slave core to send data to another slave core.
- Data the circular buffer buffer is used to store data being sent in the data channel;
- the plurality of slave cores include at least a first slave core and a second slave core;
- the first slave core is used to receive vehicle internal data or vehicle external data; and put the vehicle internal data or vehicle external data into a circular buffer buffer in the data channel between it and the second slave core;
- the second slave core is used to obtain the priority of each data channel, and extract the vehicle internal data or vehicle external data from the circular buffer buffer in each data channel in order of priority.
- the plurality of slave cores include at least one core used for system expansion.
- the system of the above embodiment corresponds to the method of the above embodiment. Therefore, the undetailed parts of the system of the above embodiment can be obtained by referring to the content of the method of the above embodiment, that is, the specific steps recorded in the method of the above embodiment.
- the content can be understood as the functions that can be implemented by the system of the above embodiments, and will not be described again here.
- the multi-core heterogeneous communication system used for intelligent vehicle driving in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium.
- Another embodiment of the present invention also provides a computer-readable storage medium on which a computer program is stored.
- the computer program is executed by a processor, the multi-core heterogeneous communication method for intelligent vehicle driving described in the above embodiment is implemented. A step of.
- the computer-readable storage medium may include: any entity or device capable of carrying the computer program code, recording media, U disk, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (R value OM, R value read-Only MemoR value y), random access memory (R value AM, R value and Access MemoR value y), electrical carrier signal, telecommunications signal and software distribution media, etc.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Hardware Design (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Small-Scale Networks (AREA)
Abstract
本发明涉及一种用于车辆智驾的多核异构通信方法与***、存储介质,多核包括一个主核和多个从核;主核与多个从核之间均设置有数据通道,每一数据通道均设置有多个循环缓冲区;数据通道用于从核向主核发送数据,循环缓冲区存储数据通道中正在发送的数据;多个从核分别接收不同的车辆内部数据或车辆外部数据;并将车辆内部数据或车辆外部数据投入其与主核之间的数据通道中的循环缓冲区;IPC-ADAPTER-SVC进程按照获取的每一数据通道的优先级,依次分别从每一数据通道中的循环缓冲区提取车辆内部数据或车辆外部数据;并将车辆内部数据或车辆外部数据通过分布式中间件分发给主核运行的不同智驾进程;实现跨核传输的高效率性和低时延性。
Description
本申请要求于2022年05月13日提交中国专利局,申请号为202210516675.6,发明名称为“一种用于车辆智驾的多核异构通信方法与***、存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本发明涉及智能驾驶技术领域,具体涉及一种用于车辆智驾的多核异构通信方法与***、存储介质。
随着智驾技术的发展,越来越多的传感器被用在智驾***上,信号的传递越来越繁重,各个模块信号和消息的传递,所用平台经常都是复杂的多核异构自动驾驶平台,信息的跨核传输的高效率性和低时延性显得尤为重要。
目前,多核异构自动驾驶平台通常采用一个主核来管理发送数据,这样在传输大量数据时往往会造成主核处理会有先后顺序,如果每个核访问DDR(Double Data Rate SDRAM,双倍速率同步动态随机存储器,***台使用。因此,亟待提出一种适用于大型的多核异构智驾SOC平台使用的通信技术。
发明内容
本发明的目的在于提出一种用于车辆智驾的多核异构通信方法与***、存储介质,以实现车辆智驾方面信息的跨核传输的高效率性和低时延性,适用于大型的多核异构智驾SOC平台使用。
本发明的实施例提出一种用于车辆智驾的多核异构通信方法,包括:
所述多核包括一个主核和多个从核;所述主核与所述多个从核之间均设置有数据通道,且每一所述数据通道均设置有多个循环缓冲区;所述数据通道用于所述从核向所述主核发送数据,所述循环缓冲区用于存储所述数据通道中正在发送的数据;
所述方法包括:
所述主核启动IPC-Adapter-SVC进程;
所述多个从核分别接收不同的车辆内部数据或车辆外部数据;并将所述车辆内部数据或车辆外部数据投入其与所述主核之间的数据通道中的循环缓冲区;
所述IPC-Adapter-SVC进程获取每一数据通道的优先级,并按优先级排序依次分别从每一数据通道中的循环缓冲区提取所述车辆内部数据或车辆外部数据;并将所述车辆内部数据或车辆外部数据通过分布式中间件DDS分发给所述主核运行的不同智驾进程。
优选地,其中,车辆的存储器存储有数据结构,所述数据结构至少包括多个Vring结构体,所述多个Vring结构体与多个数据通道一一对应,所述Vring结构体至少包含可使用buffer索引;
其中,所述方法包括:
当任意一个从核将所述车辆内部数据或车辆外部数据放入其与所述主核之间的数据通道中的循环缓冲区时,该数据通道对应的Vring结构体的可使用buffer索引的值加1,以指示该任意一个从核的当前工作位置;
其中,所述IPC-Adapter-SVC进程获取每一数据通道的优先级,并按优先级排序依次分别从每一数据通道中的循环缓冲区提取所述车辆内部数据或车辆外部数据,包括:
当所述IPC-Adapter-SVC进程从任意一个数据通道中的循环缓冲区提取所述车辆内部数据或车辆外部数据时,读取该任意一个数据通道所对应的Vring结构体的可使用buffer索引的值,根据该可使用buffer索引的值确定当前要提取数据的循环缓冲区的位置;并根据所述当前要提取数据的循环缓冲区的位置从对应循环缓冲区中提取所述车辆内部数据或车辆外部数据。
优选地,其中,每一个数据通道均设置有N个循环缓冲区;N大于0;
所述方法包括:
当任意一个Vring结构体的可使用buffer索引的值加1时,若此时该任意一个Vring结构体的可使用buffer索引的值等于N,则将该任意一个Vring结构体的可使用buffer索引的值设置为1。
优选地,所述方法包括:
当任意一个从核将所述车辆内部数据或车辆外部数据放入其与所述主核之间的数据通道中的循环缓冲区时,读取该任意一个数据通道所对应的Vring结构体的可使用buffer索引的值,根据该可使用buffer索引的值确定当前要存入数据的循环缓冲区的位置;并根据所述当前要存入数据的循环缓冲区的位置将待发送的车辆内部数据或车辆外部数据存入对应循环缓冲区。
优选地,其中,车辆的存储器存储有多个ShmloVirtio结构,所述多个ShmloVirtio结构与多个数据通道一一对应,每一个所述ShmloVirtio结构中记录与其对应的数据通道的优先级以及循环缓冲区的个数和容量;
所述方法包括:
在执行所述主核启动IPC-Adapter-SVC进程的步骤之前,初始化IPC通道,配置每一所述数据通道的优先级以及循环缓冲区的个数和容量。
优选地,所述多个从核之间均设置有数据通道,且每一所述数据通道均设置有多个循环缓冲区;所述数据通道用于任意一个从核向另一个从核发送数据,所述循环缓冲区用于存储所述数据通道中正在发送的数据;所述多个从核至少包括第一从核和第二从核;
所述方法包括:
所述第一从核接收车辆内部数据或车辆外部数据;并将该车辆内部数据或车辆外部数据投 入其与所述第二从核之间的数据通道中的循环缓冲区;
所述第二从核获取每一数据通道的优先级,并按优先级排序依次分别从每一数据通道中的循环缓冲区提取该车辆内部数据或车辆外部数据。
优选地,所述多个从核至少包含一个用于***扩展时使用的核。
本发明的实施例还提出一种用于车辆智驾的多核异构通信***,包括一个主核和多个从核;所述主核与所述多个从核之间均设置有数据通道,且每一所述数据通道均设置有多个循环缓冲区;所述数据通道用于所述从核向所述主核发送数据,所述循环缓冲区用于存储所述数据通道中正在发送的数据;
所述主核用于运行IPC-Adapter-SVC进程;
所述多个从核分别用于接收不同的车辆内部数据或车辆外部数据;并将所述车辆内部数据或车辆外部数据投入其与所述主核之间的数据通道中的循环缓冲区;
所述IPC-Adapter-SVC进程用于获取每一数据通道的优先级,并按优先级排序依次分别从每一数据通道中的循环缓冲区提取所述车辆内部数据或车辆外部数据;并将所述车辆内部数据或车辆外部数据通过分布式中间件DDS分发给所述主核运行的不同智驾进程。
优选地,其中,车辆的存储器存储有数据结构,所述数据结构至少包括多个Vring结构体,所述多个Vring结构体与多个数据通道一一对应,所述Vring结构体至少包含可使用buffer索引;
其中,当任意一个从核将所述车辆内部数据或车辆外部数据放入其与所述主核之间的数据通道中的循环缓冲区时,该数据通道对应的Vring结构体的可使用buffer索引的值加1,以指示该任意一个从核的当前工作位置;
其中,所述IPC-Adapter-SVC进程具体用于当其从任意一个数据通道中的循环缓冲区提取所述车辆内部数据或车辆外部数据时,读取该任意一个数据通道所对应的Vring结构体的可使用buffer索引的值,根据该可使用buffer索引的值确定当前要提取数据的循环缓冲区的位置;并根据所述当前要提取数据的循环缓冲区的位置从对应循环缓冲区中提取所述车辆内部数据或车辆外部数据。
优选地,其中,每一个数据通道均设置有N个循环缓冲区;N大于0;
当任意一个Vring结构体的可使用buffer索引的值加1时,若此时该任意一个Vring结构体的可使用buffer索引的值等于N,则将该任意一个Vring结构体的可使用buffer索引的值设置为1。
优选地,其中,车辆的存储器存储有多个ShmloVirtio结构,所述多个ShmloVirtio结构与多个数据通道一一对应,每一个所述ShmloVirtio结构中记录与其对应的数据通道的优先级以及循环缓冲区的个数和容量;
所述主核启动IPC-Adapter-SVC进程之前,初始化IPC通道,配置每一所述数据通道的优先级以及循环缓冲区的个数和容量。
优选地,所述多个从核之间均设置有数据通道,且每一所述数据通道均设置有多个循环缓冲区;所述数据通道用于任意一个从核向另一个从核发送数据,所述循环缓冲区用于存储所述数据通道中正在发送的数据;所述多个从核至少包括第一从核和第二从核;
所述第一从核用于接收车辆内部数据或车辆外部数据;并将该车辆内部数据或车辆外部数据投入其与第二从核之间的数据通道中的循环缓冲区;
所述第二从核用于获取每一数据通道的优先级,并按优先级排序依次分别从每一数据通道中的循环缓冲区提取该车辆内部数据或车辆外部数据。
本发明的实施例还提出一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现上述实施例的用于车辆智驾的多核异构通信方法的步骤。
本发明的各实施例至少具有以下有益效果:
对主核与多个从核之间的数据通道分别赋予优先级,主核设置IPC-Adapter-SVC进程,所述IPC-Adapter-SVC进程获取每一数据通道的优先级,并按优先级排序依次分别从每一数据通道中的循环缓冲区提取所述车辆内部数据或车辆外部数据;并将所述车辆内部数据或车辆外部数据通过分布式中间件DDS分发给所述主核运行的不同智驾进程。在本发明的各实施例中,每个核之间的数据传输通道可以由各个核单独设计优先级,这样可以保证不同的信号之间可以按照实时性要求的高低进行通道优先级排序,通过调试可以找到一个合理的优先级顺序,以满足不同的信号在智驾应用的实时性要求,实现车辆智驾方面信息的跨核传输的低时延性。而且,目前相关的现有通信方法,只使用一种通信方式,比如单一的DDS通信或者单一的某种核间通信方式,而本发明的各实施例将IPC核间通信技术和分布式中间件DDS技术相结合,能够实现车辆智驾方面信息的跨核传输的高效率性,适用于大型的多核异构智驾SOC平台使用。
本发明的实施例的其它特征和优点将在随后的说明书中阐述。
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本发明实施例中一种用于车辆智驾的多核异构通信方法的流程示意图。
图2为本发明实施例中ICP+DDS模型的结构示意图。
图3为本发明实施例中多核异构通信的所有数据通道平铺在存储器中的示意图。
图4为本发明实施例中vqBaseAddr结构体的示意图。
图5为本发明实施例中VringBaseAddr结构体的示意图。
图6为本发明实施例中PrimeBaseAddr结构体的示意图。
图7为本发明实施例中Vring结构体的示意图。
以下将参考附图详细说明本公开的各种示例性实施例、特征和方面。另外,为了更好的说明本发明,在下文的具体实施例中给出了众多的具体细节。本领域技术人员应当理解,没有某 些具体细节,本发明同样可以实施。在一些实例中,对于本领域技术人员熟知的手段未作详细描述,以便于凸显本发明的主旨。
本发明的一个实施例提出一种用于车辆智驾的多核异构通信方法,所述多核包括一个主核和多个从核;所述主核与所述多个从核之间均设置有数据通道,且每一所述数据通道均设置有多个循环缓冲区;所述数据通道用于所述从核向所述主核发送数据,所述循环缓冲区用于存储所述数据通道中正在发送的数据。
参阅图1,本实施例的方法包括如下步骤:
步骤S1、所述主核启动IPC-Adapter-SVC进程。
步骤S2、所述多个从核分别接收不同的车辆内部数据或车辆外部数据;并将所述车辆内部数据或车辆外部数据投入其与所述主核之间的数据通道中的循环缓冲区buffer。
具体而言,所述不同的车辆内部数据指的是CAN IMU数据等,所述车辆外部数据指的是摄像头数据、超声波(USS)数据等,即智驾决策过程中需要用到的数据。
步骤S3、所述IPC-Adapter-SVC进程获取每一数据通道的优先级,并按优先级排序依次分别从每一数据通道中的循环缓冲区提取所述车辆内部数据或车辆外部数据;并将所述车辆内部数据或车辆外部数据通过分布式中间件DDS分发给所述主核运行的不同智驾进程。
在本发明实施例中,对主核与多个从核之间的数据通道分别赋予优先级,主核设置IPC-Adapter-SVC进程,所述IPC-Adapter-SVC进程获取每一数据通道的优先级,并按优先级排序依次分别从每一数据通道中的循环缓冲区提取所述车辆内部数据或车辆外部数据;并将所述车辆内部数据或车辆外部数据通过分布式中间件DDS分发给所述主核运行的不同智驾进程。在本发明的各实施例中,每个核之间的数据传输通道可以单独设计优先级,这样可以保证不同的信号之间可以按照实时性要求的高低进行通道优先级排序,通过***调试找到一个合理的优先级顺序,以满足不同的信号在智驾应用的实时性要求,实现车辆智驾方面信息的跨核传输的低时延性。而且,目前相关的现有通信方法,只使用一种通信方式,比如单一的DDS(Data,Distribution,Service,数据分发服务)通信或者单一的某种核间通信方式,而本发明的各实施例将IPC核间通信技术和分布式中间件DDS技术相结合,能够实现车辆智驾方面信息的跨核传输的高效率性,适用于大型的多核异构智驾SOC平台使用。
为了方便阐述本发明实施例的原理,以使得本发明实施例更容易被理解,列举一种具体例子进行具体说明,该具体例子的IPC+DDS模型如图2所示,图2示出了六个核的应用情况,当然,本发明并不局限于图2的IPC+DDS模型,该六个核包括一个主核A72和五个从核MCU1_0、MCU2_0、MCU2_1、MCU3_1、MCU3_0,从核MCU1_0、MCU2_0、MCU2_1、MCU3_1、MCU3_0可以理解为是所述主核A72的卫星核,可以安装例如是Autosar***、RTOS***等。在车辆智驾(智能驾驶,例如自动驾驶、自动泊车等)的具体场景中,可以按以下方式分配各个核的功能,从核MCU1_0负责CAN IMU数据分发,从核MCU2_0负责采集摄像头数据分发到主核A72,从核MCU2_1负责采集超声波(USS)数据分发到主核A72,从核MCU3_0负责控制算法、状态管理输出一些信号与主核A72进行交互,从核MCU3_0的输入是主核A72的路点信息,此外还有从核MCU3_1是预留的核,***扩展时使用,主核A72用于自动泊车等智驾 决策的其他算法部分,例如感知进程、定位进程和AVM(全景式影像监控,Around View Monitor)进程,需要各个卫星核的数据。以上只是举例,在实际应用中,具体的从核的数量以及各个从核的功能可以进行适当调整。
举例而言,主核A72要接收的数据中CAN IMU USS控制算法核间通信都是通过上述IPC+DDS模型进行核间通信的,其中在ShmloVitro结构体中可以配置这个环访问存储器DDR的优先级。比如MCU1_0出来的CAN信号优先级最高,一些车速等关键信号要有最高的优先级,也就是MCU1_0和A72之间的通道访问DDR的优先级最高。这样通过优先级的配置可以保证每个通道访问DDR的优先级按照合理的顺序排列,保证信号的实时性。此外,摄像头包括前视和环视发布服务,也是通过这种方式配置然后集中发布到主核A72以供智驾进程使用,但由于前视和环视发布服务的数据实时性要求比较高,数据量比较大,因此,在本实施例中,优选在主核A72中设置前视进程和环视进程,分别用于直接接收摄像头的前视图像和环视图像,然后通过分布式中间件DDS进行数据分发给智驾进程,如图2所示,智驾进程例如是感知、定位、AVM等。除了摄像头数据以外,其他车辆内部/外部数据都通过IPC-Adapter-SVC进程进行转发。所有信号通过分布式中间件DDS转发数据,然后可以保证主核A72的各个算法按照需要去订阅这些数据并且使用。具体地,在本实施例中,不同的算法节点可以订阅相同的数据进行处理,比如,CAN信号会被大量订阅,摄像头的图像数据会被感知模块和AVM模块订阅,CAN总线的IMU(惯性测量单元)数据会被定位模块订阅。
优选地,其中,车辆的存储器存储有数据结构,具体地,所述数据结构是计算机存储、组织数据的方式,本实施例中所述存储器优选但不限于为DDR,所述数据结构至少包括多个Vring结构体,所述多个Vring结构体与多个数据通道一一对应,如上例子所述,假设有30个数据通道,则有对应的30个Vring结构体,所述Vring结构体至少包含可使用buffer索引;
在本实施例中,所述方法包括:
步骤S4、当任意一个从核将所述车辆内部数据或车辆外部数据放入其与所述主核之间的数据通道中的循环缓冲区buffer时,该数据通道对应的Vring结构体的可使用buffer索引的值加1,以指示该任意一个从核的当前工作位置。
在本实施例中,所述步骤S3,IPC-Adapter-SVC进程获取每一数据通道的优先级,并按优先级排序依次分别从每一数据通道中的循环缓冲区buffer提取所述车辆内部数据或车辆外部数据,包括:
当所述IPC-Adapter-SVC进程从任意一个数据通道中的循环缓冲区buffer提取所述车辆内部数据或车辆外部数据时,读取该任意一个数据通道所对应的Vring结构体的可使用buffer索引的值,根据该可使用buffer索引的值确定当前要提取数据的循环缓冲区buffer的位置;并根据所述当前要提取数据的循环缓冲区buffer的位置从对应循环缓冲区buffer中提取所述车辆内部数据或车辆外部数据。
优选地,所述多个从核之间均设置有数据通道,且每一所述数据通道均设置有多个循环缓冲区buffer;所述数据通道用于任意一个从核向另一个从核发送数据,所述循环缓冲区buffer用于存储所述数据通道中正在发送的数据。
具体而言,在本实施例中,如图2所示的IPC+DDS模型,IPC通信总共有6个核参与通信,每个核都需要去其他核之间进行通信,本实施例中设置每两个核之间都有RX(接收)和TX(发送)两条数据通道,分别负责双向的数据传输,6个核就有30个通道,每个核需要参与10个数据通道的通信,这30个数据通道平铺在内存上如图3所示,包括vqBaseAddr结构体、VringBaseAddr结构体和PrimeBaseAddr结构体。
在本实施例中,所述vqBaseAddr结构体是划分给IPC的32M内存的起始地址,该值在操作***(Operating System,OS)中指定,在DDR内存中分配4K储存Shmlo结构体,这4K内存模型如图4所示,每一个核都有对应的Shmlo结构体,图4中示出了主核A72所对应的Shmlo结构体,其他的从核所对应的Shmlo结构体与其相同,因此图4中不做过多展示。
在本实施例中,所述VringBaseAddr结构的模型如图5所示,其用于储存30个数据通道的ShmVirtio结构体,每一个数据通道都有一个对应的ShmVirtio结构体;该ShmVirtio结构体用于管理数据通道中的循环缓冲区buffer,其包含有数据通道的通道编号、所述Vring结构体、循环缓冲区buffer的配置参数包括大小、优先级、个数等,可以具体根据技术需求进行调整ShmVirtio结构体,配置所需参数,本发明不限于图5所示例子。
在本实施例中,所述PrimeBaseAddr用于储存传输的数据,在一个具体示例中,配置每个数据通道64个2K的循环缓冲区buffer,模型如图6所示,图6中示出了主核A72与从核MCU1_0之间的数据通道的64个2K的buffer,其他数据通道的buffer设置与主核A72与从核MCU1_0之间的数据通道一致,可以参考主核A72与从核MCU1_0部分。
需说明的是,本实施例中核与核之间的数据传输可以通过以上图4至6的三个模型进行数据的读写,以及各个核通过对对应通道编号的ShmVirtio结构体中的优先级进行读写,可以调整对应通道的数据传输的优先级。
优选地,其中,每一个数据通道均设置有N个循环缓冲区buffer;N大于0,如图6所示的模型中,N=64。
具体而言,图7为本发明实施例中Vring结构体的具体例子,在该例子中,Vring结构体包括buffer的数量、buffer的描述符、可使用buffer索引和已使用buffer索引,图7示出了一个vring包含64个buffer,可使用buffer索引指示进行数据传输存储时发送方可以使用的buffer位置,已使用buffer索引指示进行数据提取时接收方已经提取过的buffer位置,以便于接收方继续进行下一个buferr的数据的提取。
具体地,在每个通道的64个buffer,例如,当MCU3_0向对应的环中写入一帧数据时将可使用buffer索引的idx加1,以表示自己工作在可使用buffer索引的位置,让数据接收方Host知道可用的buffer从哪里开始。可使用buffer索引是数据发送方Guest维护,提供给数据接收方Host使用。当Host根据可使用buffer索引中提供的信息从Vring结构体中取出buffer,处理完后更新已使用buffer索引,每一次取buffer,就将已使用buffer索引的idx加1.以表示自己工作在已使用buffer索引中的哪个位置。其中64和2K等参数是可以根据需要配置的,以满足***扩展的需求,比如在泊车***的基础上加上行车功能,这样数据量会变大,可以对buffer个数进行调整。
需说明的是,其中数量64和大小2K等参数是可以根据需要配置的,以满足***扩展的需求,比如在泊车***的基础上加上行车功能,这样数据量会变大,可以对buffer个数进行调整。
进一步地,本实施例的方法包括:
步骤S5、当任意一个Vring结构体的可使用buffer索引的值(即图7中的可用buffer的idx)加1时,若此时该任意一个Vring结构体的可使用buffer索引的值等于N,则将该任意一个Vring结构体的可使用buffer索引的值设置为1,指示当前工作到哪一个buffer的位置。
步骤S6、当任意一个从核将所述车辆内部数据或车辆外部数据放入其与所述主核之间的数据通道中的循环缓冲区buffer时,读取该任意一个数据通道所对应的Vring结构体的可使用buffer索引的值,根据该可使用buffer索引的值确定当前要存入数据的循环缓冲区buffer的位置;并根据所述当前要存入数据的循环缓冲区buffer的位置将待发送的车辆内部数据或车辆外部数据存入对应循环缓冲区buffer。
步骤S7、在执行所述主核启动IPC-Adapter-SVC进程的步骤之前,初始化IPC通道,配置每一所述数据通道的优先级以及循环缓冲区buffer的个数和容量。
在一个具体例子中,所述多个从核至少包括第一从核和第二从核。
进一步地,本实施例的方法包括:
步骤S8、所述第一从核接收车辆内部数据或车辆外部数据;并将该车辆内部数据或车辆外部数据投入其与所述第二从核之间的数据通道中的循环缓冲区buffer;
步骤S9、所述第二从核获取每一数据通道的优先级,并按优先级排序依次分别从每一数据通道中的循环缓冲区buffer提取该车辆内部数据或车辆外部数据。
优选地,所述多个从核至少包含一个用于***扩展时使用的核,例如图2中的从核MCU3_1,意味着这个***是可以进行扩展的,当扩展了新的核需要通信时,只需要配置新的核与其他核的通信参数就可以实现核间通信。
可以理解的是,通过本实施例方法的如上步骤,整个多核异构平台的通信已经形成闭环,主核A72和各个卫星核进行IPC+DDS通信,通过配置参数保证各个自动泊车模块的通信满足低延迟,高效率保证***的有效运行。
为了使得本发明实施例更容易被理解,下面列举一个具体应用例子进行补充说明。
例如,泊车算法的定位模块需要左前轮的轮速信息BCS_FLWheelSpd,先初始化IPC,这时结构体Shmlo中的IPC status的值为1,表示使能,BCS_FLWheelSpd这个信号通过从核MCU1获取BCS_FLWheelSpd这一个CAN总线信号,将这个CAN总线信号放在Idt-Can-Signal-Rx-Route-Fast结构体里面,假设,从核MCU1_0自己核的编号ID为1,CAN信号要发到的主核A72的对应数据通道编号ID为0,从核MCU1_0要将BCS_FLWheelSpd数据,也就是Idt-Can-Signal-Rx-Route-Fast写到编号为0的数据通道,其中Shmlo结构体中10个通道的ShmVirtio结构体分别表示一个核与其他5个核通信,每个通信有RX和TX两个通道,具体地,ShmVirtio结构体可以设置该通道传输数据的参数,比如优先级,因为轮速信号是比较重要的信号,所以可以将优先级设的高一些,每一个数据通道包含64个循环缓冲区buffer,每个buffer的大小为2K,如图6,每一个要发送的数据结构体(例如Idt-Can-Signal-Rx-Route-Fast结构体) 可以代表是一个buffer,MCU1_0将包含BCS_FLWheelSpd信号的buffer放在存储器DDR中,此时可使用buffer索引的值加1,以表示自己工作在可使用buffer索引的位置,让Host端知道可用的buffer从哪里开始。在程序运行时MCU1_0一直在向通道中放数据,所以此时可使用buffer索引的值会一直增加。
此时主核A72的IpcAdapterSVC进程会根据可使用buffer索引中提供的信息从VRing中取出buffer不断的经过通道0向buffer中取Idt-Can-Signal-Rx-Route-Fast结构体,处理完之后更新已使用buffer索引然后对应的值加1,以表示自己工作在哪个位置,已使用buffer索引是数据接收方Host(此例中是主核A72)维护,提供给数据发送方Guest(此例中为MCU1_0)使用。当idx等于64时,指针会重新指向第一个循环缓存区buffer。然后IpcAdapterSVC进程会通过DDS转发BCS_FLWheelSpd这个信号,主核A72的算法进程比如定位算法和建图算法会订阅。通过这个流程可以保证信号在多核中高效率传输,可以被不同的节点订阅。
与上述实施例的方法对应,本发明的另一个实施例还提出一种用于车辆智驾的多核异构通信***,可以用于实施上述实施例所述的方法,可以参阅图2,本实施例的***包括一个主核和多个从核;所述主核与所述多个从核之间均设置有数据通道,且每一所述数据通道均设置有多个循环缓冲区buffer;所述数据通道用于所述从核向所述主核发送数据,所述循环缓冲区buffer用于存储所述数据通道中正在发送的数据;
所述主核用于运行IPC-Adapter-SVC进程;
所述多个从核分别用于接收不同的车辆内部数据或车辆外部数据;并将所述车辆内部数据或车辆外部数据投入其与所述主核之间的数据通道中的循环缓冲区buffer;
所述IPC-Adapter-SVC进程用于获取每一数据通道的优先级,并按优先级排序依次分别从每一数据通道中的循环缓冲区buffer提取所述车辆内部数据或车辆外部数据;并将所述车辆内部数据或车辆外部数据通过分布式中间件DDS分发给所述主核运行的不同智驾进程。
优选地,其中,车辆的存储器存储有数据结构,所述数据结构至少包括多个Vring结构体,所述多个Vring结构体与多个数据通道一一对应,所述Vring结构体至少包含可使用buffer索引;
其中,当任意一个从核将所述车辆内部数据或车辆外部数据放入其与所述主核之间的数据通道中的循环缓冲区buffer时,该数据通道对应的Vring结构体的可使用buffer索引的值加1,以指示该任意一个从核的当前工作位置;
其中,所述IPC-Adapter-SVC进程具体用于当其从任意一个数据通道中的循环缓冲区buffer提取所述车辆内部数据或车辆外部数据时,读取该任意一个数据通道所对应的Vring结构体的可使用buffer索引的值,根据该可使用buffer索引的值确定当前要提取数据的循环缓冲区buffer的位置;并根据所述当前要提取数据的循环缓冲区buffer的位置从对应循环缓冲区buffer中提取所述车辆内部数据或车辆外部数据。
优选地,其中,每一个数据通道均设置有N个循环缓冲区buffer;N大于0;
当任意一个Vring结构体的可使用buffer索引的值加1时,若此时该任意一个Vring结构体的可使用buffer索引的值等于N,则将该任意一个Vring结构体的可使用buffer索引的值设置为1。
优选地,其中,车辆的存储器存储有多个ShmloVirtio结构,所述多个ShmloVirtio结构与多个数据通道一一对应,每一个所述ShmloVirtio结构中记录与其对应的数据通道的优先级以及循环缓冲区buffer的个数和容量;
所述主核启动IPC-Adapter-SVC进程之前,初始化IPC通道,配置每一所述数据通道的优先级以及循环缓冲区buffer的个数和容量。
优选地,所述多个从核之间均设置有数据通道,且每一所述数据通道均设置有多个循环缓冲区buffer;所述数据通道用于任意一个从核向另一个从核发送数据,所述循环缓冲区buffer用于存储所述数据通道中正在发送的数据;所述多个从核至少包括第一从核和第二从核;
所述第一从核用于接收车辆内部数据或车辆外部数据;并将该车辆内部数据或车辆外部数据投入其与第二从核之间的数据通道中的循环缓冲区buffer;
所述第二从核用于获取每一数据通道的优先级,并按优先级排序依次分别从每一数据通道中的循环缓冲区buffer提取该车辆内部数据或车辆外部数据。
优选地,所述多个从核至少包含一个用于***扩展时使用的核。
以上所描述的实施例的***仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现实施例的***的方案的目的。
需说明的是,上述实施例的***与上述实施例的方法对应,因此,上述实施例的***未详述部分可以参阅上述实施例的方法的内容得到,即上述实施例的方法记载的具体步骤内容可以理解为上述实施例的***所能够实现的功能,此处不再赘述。
并且,上述实施例用于车辆智驾的多核异构通信***若以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。
本发明的另一实施例还提出一种计算机可读存储介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现上述实施例所述用于车辆智驾的多核异构通信方法的步骤。
具体而言,所述计算机可读存储介质可以包括:能够携带所述计算机程序代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(R值OM,R值ead-Only MemoR值y)、随机存取存储器(R值AM,R值andom Access MemoR值y)、电载波信号、电信信号以及软件分发介质等。
以上已经描述了本发明的各实施例,上述说明是示例性的,并非穷尽性的,并且也不限于所披露的各实施例。在不偏离所说明的各实施例的范围和精神的情况下,对于本技术领域的普通技术人员来说许多修改和变更都是显而易见的。本文中所用术语的选择,旨在最好地解释各实施例的原理、实际应用或对市场中的技术改进,或者使本技术领域的其它普通技术人员能理解本文披露的各实施例。
Claims (13)
- 一种用于车辆智驾的多核异构通信方法,其特征在于,包括:所述多核包括一个主核和多个从核;所述主核与所述多个从核之间均设置有数据通道,且每一所述数据通道均设置有多个循环缓冲区;所述数据通道用于所述从核向所述主核发送数据,所述循环缓冲区用于存储所述数据通道中正在发送的数据;所述方法包括:所述主核启动IPC-Adapter-SVC进程;所述多个从核分别接收不同的车辆内部数据或车辆外部数据;并将所述车辆内部数据或车辆外部数据投入其与所述主核之间的数据通道中的循环缓冲区;所述IPC-Adapter-SVC进程获取每一数据通道的优先级,并按优先级排序依次分别从每一数据通道中的循环缓冲区提取所述车辆内部数据或车辆外部数据;并将所述车辆内部数据或车辆外部数据通过分布式中间件DDS分发给所述主核运行的不同智驾进程。
- 根据权利要求1所述的多核异构通信方法,其特征在于,其中,车辆的存储器存储有数据结构,所述数据结构至少包括多个Vring结构体,所述多个Vring结构体与多个数据通道一一对应,所述Vring结构体至少包含可使用buffer索引;其中,所述方法包括:当任意一个从核将所述车辆内部数据或车辆外部数据放入其与所述主核之间的数据通道中的循环缓冲区时,该数据通道对应的Vring结构体的可使用buffer索引的值加1,以指示该任意一个从核的当前工作位置;其中,所述IPC-Adapter-SVC进程获取每一数据通道的优先级,并按优先级排序依次分别从每一数据通道中的循环缓冲区提取所述车辆内部数据或车辆外部数据,包括:当所述IPC-Adapter-SVC进程从任意一个数据通道中的循环缓冲区提取所述车辆内部数据或车辆外部数据时,读取该任意一个数据通道所对应的Vring结构体的可使用buffer索引的值,根据该可使用buffer索引的值确定当前要提取数据的循环缓冲区的位置;并根据所述当前要提取数据的循环缓冲区的位置从对应循环缓冲区中提取所述车辆内部数据或车辆外部数据。
- 根据权利要求2所述的多核异构通信方法,其特征在于,其中,每一个数据通道均设置有N个循环缓冲区;N大于0;所述方法包括:当任意一个Vring结构体的可使用buffer索引的值加1时,若此时该任意一个Vring结构体的可使用buffer索引的值等于N,则将该任意一个Vring结构体的可使用buffer索引的值设置为1。
- 根据权利要求2所述的多核异构通信方法,其特征在于,所述方法包括:当任意一个从核将所述车辆内部数据或车辆外部数据放入其与所述主核之间的数据通道中的循环缓冲区时,读取该任意一个数据通道所对应的Vring结构体的可使用buffer索引的值,根 据该可使用buffer索引的值确定当前要存入数据的循环缓冲区的位置;并根据所述当前要存入数据的循环缓冲区的位置将待发送的车辆内部数据或车辆外部数据存入对应循环缓冲区。
- 根据权利要求1所述的多核异构通信方法,其特征在于,其中,车辆的存储器存储有多个ShmloVirtio结构,所述多个ShmloVirtio结构与多个数据通道一一对应,每一个所述ShmloVirtio结构中记录与其对应的数据通道的优先级以及循环缓冲区的个数和容量;所述方法包括:在执行所述主核启动IPC-Adapter-SVC进程的步骤之前,初始化IPC通道,配置每一所述数据通道的优先级以及循环缓冲区的个数和容量。
- 根据权利要求1所述的多核异构通信方法,其特征在于,所述多个从核之间均设置有数据通道,且每一所述数据通道均设置有多个循环缓冲区;所述数据通道用于任意一个从核向另一个从核发送数据,所述循环缓冲区用于存储所述数据通道中正在发送的数据;所述多个从核至少包括第一从核和第二从核;所述方法包括:所述第一从核接收车辆内部数据或车辆外部数据;并将该车辆内部数据或车辆外部数据投入其与所述第二从核之间的数据通道中的循环缓冲区;所述第二从核获取每一数据通道的优先级,并按优先级排序依次分别从每一数据通道中的循环缓冲区提取该车辆内部数据或车辆外部数据。
- 根据权利要求1-6中任一项所述的多核异构通信方法,其特征在于,所述多个从核至少包含一个用于***扩展时使用的核。
- 一种用于车辆智驾的多核异构通信***,其特征在于,包括一个主核和多个从核;所述主核与所述多个从核之间均设置有数据通道,且每一所述数据通道均设置有多个循环缓冲区;所述数据通道用于所述从核向所述主核发送数据,所述循环缓冲区用于存储所述数据通道中正在发送的数据;所述主核用于运行IPC-Adapter-SVC进程;所述多个从核分别用于接收不同的车辆内部数据或车辆外部数据;并将所述车辆内部数据或车辆外部数据投入其与所述主核之间的数据通道中的循环缓冲区;所述IPC-Adapter-SVC进程用于获取每一数据通道的优先级,并按优先级排序依次分别从每一数据通道中的循环缓冲区提取所述车辆内部数据或车辆外部数据;并将所述车辆内部数据或车辆外部数据通过分布式中间件DDS分发给所述主核运行的不同智驾进程。
- 根据权利要求8所述的多核异构通信***,其特征在于,其中,车辆的存储器存储有数据结构,所述数据结构至少包括多个Vring结构体,所述多个Vring结构体与多个数据通道一一对应,所述Vring结构体至少包含可使用buffer索引;其中,当任意一个从核将所述车辆内部数据或车辆外部数据放入其与所述主核之间的数据通道中的循环缓冲区时,该数据通道对应的Vring结构体的可使用buffer索引的值加1,以指示该任意一个从核的当前工作位置;其中,所述IPC-Adapter-SVC进程具体用于当其从任意一个数据通道中的循环缓冲区提取 所述车辆内部数据或车辆外部数据时,读取该任意一个数据通道所对应的Vring结构体的可使用buffer索引的值,根据该可使用buffer索引的值确定当前要提取数据的循环缓冲区的位置;并根据所述当前要提取数据的循环缓冲区的位置从对应循环缓冲区中提取所述车辆内部数据或车辆外部数据。
- 根据权利要求9所述的多核异构通信***,其特征在于,其中,每一个数据通道均设置有N个循环缓冲区;N大于0;当任意一个Vring结构体的可使用buffer索引的值加1时,若此时该任意一个Vring结构体的可使用buffer索引的值等于N,则将该任意一个Vring结构体的可使用buffer索引的值设置为1。
- 根据权利要求10所述的多核异构通信***,其特征在于,其中,车辆的存储器存储有多个ShmloVirtio结构,所述多个ShmloVirtio结构与多个数据通道一一对应,每一个所述ShmloVirtio结构中记录与其对应的数据通道的优先级以及循环缓冲区的个数和容量;所述主核启动IPC-Adapter-SVC进程之前,初始化IPC通道,配置每一所述数据通道的优先级以及循环缓冲区的个数和容量。
- 根据权利要求8所述的多核异构通信***,其特征在于,所述多个从核之间均设置有数据通道,且每一所述数据通道均设置有多个循环缓冲区;所述数据通道用于任意一个从核向另一个从核发送数据,所述循环缓冲区用于存储所述数据通道中正在发送的数据;所述多个从核至少包括第一从核和第二从核;所述第一从核用于接收车辆内部数据或车辆外部数据;并将该车辆内部数据或车辆外部数据投入其与第二从核之间的数据通道中的循环缓冲区;所述第二从核用于获取每一数据通道的优先级,并按优先级排序依次分别从每一数据通道中的循环缓冲区提取该车辆内部数据或车辆外部数据。
- 一种计算机可读存储介质,其上存储有计算机程序,其特征在于,所述计算机程序被处理器执行时实现权利要求1-7中任一项所述用于车辆智驾的多核异构通信方法的步骤。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210516675.6 | 2022-05-13 | ||
CN202210516675.6A CN117093531A (zh) | 2022-05-13 | 2022-05-13 | 一种用于车辆智驾的多核异构通信方法与***、存储介质 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2023216503A1 true WO2023216503A1 (zh) | 2023-11-16 |
Family
ID=88729572
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2022/124943 WO2023216503A1 (zh) | 2022-05-13 | 2022-10-12 | 一种用于车辆智驾的多核异构通信方法与***、存储介质 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN117093531A (zh) |
WO (1) | WO2023216503A1 (zh) |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20180165127A1 (en) * | 2016-12-13 | 2018-06-14 | GM Global Technology Operations LLC | Method of data exchange between a primary core and a secondary core in a real-time operating system |
CN209233868U (zh) * | 2018-12-26 | 2019-08-09 | 上海华元创信软件有限公司 | 一种华元tb4自适应总线网联适配终端装置及*** |
US20210158691A1 (en) * | 2019-11-22 | 2021-05-27 | International Business Machines Corporation | Consensus-based monitoring of driving behavior in connected vehicle systems |
CN113442938A (zh) * | 2021-08-31 | 2021-09-28 | 国汽智控(北京)科技有限公司 | 车载计算***、电子设备和车辆 |
CN114281389A (zh) * | 2022-01-26 | 2022-04-05 | 阿波罗智能技术(北京)有限公司 | 用于片上***soc升级的方法、装置以及自动驾驶车辆 |
-
2022
- 2022-05-13 CN CN202210516675.6A patent/CN117093531A/zh active Pending
- 2022-10-12 WO PCT/CN2022/124943 patent/WO2023216503A1/zh unknown
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20180165127A1 (en) * | 2016-12-13 | 2018-06-14 | GM Global Technology Operations LLC | Method of data exchange between a primary core and a secondary core in a real-time operating system |
CN209233868U (zh) * | 2018-12-26 | 2019-08-09 | 上海华元创信软件有限公司 | 一种华元tb4自适应总线网联适配终端装置及*** |
US20210158691A1 (en) * | 2019-11-22 | 2021-05-27 | International Business Machines Corporation | Consensus-based monitoring of driving behavior in connected vehicle systems |
CN113442938A (zh) * | 2021-08-31 | 2021-09-28 | 国汽智控(北京)科技有限公司 | 车载计算***、电子设备和车辆 |
CN114281389A (zh) * | 2022-01-26 | 2022-04-05 | 阿波罗智能技术(北京)有限公司 | 用于片上***soc升级的方法、装置以及自动驾驶车辆 |
Also Published As
Publication number | Publication date |
---|---|
CN117093531A (zh) | 2023-11-21 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN1026733C (zh) | 多媒体信号处理器计算机*** | |
US10467154B2 (en) | Multi-port multi-sideband-GPIO consolidation technique over a multi-drop serial bus | |
CA2170458C (en) | Multi-cluster computer system | |
CN109933438B (zh) | 高速共享内存数据收发*** | |
CN106648896B (zh) | 一种Zynq芯片在异构称多处理模式下双核共享输出外设的方法 | |
EP3529706A1 (en) | Gpu remote communication with triggered operations | |
EP3470971A1 (en) | Method, apparatus, and system for accessing memory device | |
CN103793291A (zh) | 分布式数据复制方法和装置 | |
WO2021164560A1 (zh) | 一种多核芯片及其调度方法 | |
CN115981751B (zh) | 一种近存计算***以及近存计算方法、装置、介质及设备 | |
CN117312201B (zh) | 一种数据传输方法、装置及加速器设备、主机和存储介质 | |
CN104050111A (zh) | 通过具有不同时序要求的相应命令访问不同类型的存储器 | |
WO2023216503A1 (zh) | 一种用于车辆智驾的多核异构通信方法与***、存储介质 | |
JP2003501892A (ja) | 電子ネットワークにおけるコンテクストを切り換える装置及び方法 | |
CN114185830A (zh) | 基于mailbox的多处理器通信方法、设备、***和存储介质 | |
US11252457B2 (en) | Multimedia streaming and routing apparatus and operation method of the same | |
CN115883022B (zh) | Dma传输控制方法、装置、电子设备及可读存储介质 | |
CN109032818B (zh) | 一种同构***核间同步与通信的方法 | |
CN209784995U (zh) | 大数据运算加速***和芯片 | |
CN115033520B (zh) | Iic数据传输方法、装置、单片机设备及存储介质 | |
CN115374035A (zh) | 基于单片机的串口扩展方法、串口扩展设备和清洁机器人 | |
CN112740193A (zh) | 大数据运算加速***执行运算的方法 | |
US20120124272A1 (en) | Flash memory apparatus | |
JP2505298B2 (ja) | スプリットバスにおける可変バス幅指定方式及び可変バス幅情報受信方式 | |
KR101519243B1 (ko) | Usb 디바이스 공유 시스템 및 그 제어 방법 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 22941441 Country of ref document: EP Kind code of ref document: A1 |