Intermediate communication method, system and device based on microcontroller unit and system on chip

By setting up enhanced middleware on MCU and SOC chips in the automotive industry, the conversion and frame processing of intermediate communication formats are realized, which solves the problem of instability in communication between MCU and SOC and improves the development of intelligent driving technology.

CN116112577BActive Publication Date: 2025-05-06上海零念科技有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310106703.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-02-13
Publication Date
2025-05-06
Estimated Expiration
2043-02-13

AI Technical Summary

Technical Problem

In the automotive industry, microcontroller unit (MCU) chips and system-on-chip (SOC) chips lead to unstable communication due to different operating system communication standards, which affects the development of intelligent driving technology.

Method used

Using an intermediate communication method based on the microcontroller unit and the system on chip, the first and second enhanced middleware are provided on the MCU and the SOC, respectively. The method includes receiving data to be transmitted, converting it into an intermediate format, framing processing, matching scheduling points to send, receiving and converting data frame blocks to achieve stable communication across the MCU and SOC.

Benefits of technology

Through intermediate format mapping and frame processing, communication protocols between different operating systems are coordinated to ensure the efficiency and stability of data transmission, and the problem of instability of communication between MCU and SOC is solved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116112577B_ABST
    Figure CN116112577B_ABST
Patent Text Reader

Abstract

The present invention provides an intermediate communication method, system and device based on a microcontroller unit and a system on chip. A mapping is established between a first communication standard at a microcontroller unit end and a second communication standard at a system on chip end through an intermediate format, data is converted into an intermediate format for cross-system platform transmission, and communication protocols between different operating systems are coordinated. By framing data elements, the size of each data frame block is limited, and a preset source software execution unit and a software execution unit are cyclically executed in the form of a preset thread. The data frame block corresponding to the source software execution unit is matched to the corresponding software execution unit in the first enhanced middleware through a matching scheduling point and sent. At the system on chip end, the second enhanced middleware calls the second connector software module to cyclically receive the data frame block and save it in the data frame block global table. After reading, it is converted into data under the second communication standard to complete the communication with the system on chip software component.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of industrial operating system software, and in particular to an intermediate communication method, system and device based on a microcontroller unit and a system on chip. Background Art

[0002] In the current industrial field, deterministic real-time systems are the basic requirement to ensure their safety and high reliability. With the development of modern smart cars, the development of various domain controllers has shown a trend of multi-core heterogeneity. Usually, a domain controller, especially an autonomous driving domain controller, contains both resource-constrained MCU (microcontroller unit) chips and computing resource-rich SOC (system on chip) chips. The MCU chip is mainly responsible for processing vehicle control signals related to high functional safety, and the SOC chip mainly processes various autonomous driving algorithms.

[0003] In the automotive industry, the communication standards of the operating systems used by MCU chips are not unified with those of the operating systems of SOC chips. How to ensure real-time, secure and reliable communication within and between domains, especially the communication between MCU chips and SOC chips, has become the main bottleneck restricting the development of intelligent driving technology. Therefore, a new communication method between microcontroller units and on-chip systems is urgently needed. Summary of the invention

[0004] In view of this, an embodiment of the present invention provides an intermediate communication method, system and device based on a microcontroller unit and a system on a chip to eliminate or improve one or more defects existing in the prior art and solve the problem of unstable communication between the microcontroller unit and the system on a chip due to different operating system communication standards, which affects the iterative development of domain control.

[0005] The technical solution of the present invention is as follows:

[0006] In one aspect, the present invention provides an intermediate communication method based on a microcontroller unit and a system on chip, the method is performed based on a first enhanced middleware provided in the microcontroller unit and a second enhanced middleware provided in the system on chip, the first enhanced middleware is provided with a first connector software module, the second enhanced middleware is provided with a second connector software module, the method comprises:

[0007] The first enhanced middleware receives the data to be transmitted sent by the software component in the micro control unit according to the first communication standard, and the first enhanced middleware converts the data to be transmitted into an intermediate format.

[0008] The first enhanced middleware calculates the byte size of each data element in the data to be transmitted in the intermediate format and its source software execution unit, performs frame processing on the data to be transmitted, and constructs each data element into multiple data frame blocks with a length less than or equal to a preset maximum number of bytes, each data frame block only contains data elements of the same source software execution unit.

[0009] The first enhanced middleware sends each data frame block to the software execution unit whose scheduling point matches the source software execution unit according to the scheduling point of the source software execution unit, and sends it to the Ethernet through the first connector software module according to the preset sending function corresponding to each data frame block.

[0010] The second enhanced middleware calls the second connector software module to cyclically receive the data frame blocks sent by the first connector software module, and saves the data frame blocks in a data frame block global table according to a predefined protocol.

[0011] Each software execution unit in the second connector software module polls the data frame block global table according to a preset receiving function, obtains the updated data frame block, converts the data frame block in the intermediate format into data under the second communication standard and sends it to the software component of the system on chip.

[0012] In some embodiments, the first enhanced middleware calculates the byte size of each data element in the data to be transmitted in the intermediate format and its source software execution unit, performs frame processing on the data to be transmitted, and constructs each data element into a plurality of data frame blocks whose length is less than or equal to a preset maximum number of bytes, including:

[0013] Within the restriction that the data length of the data frame block is less than or equal to the preset maximum number of bytes, multiple data elements that are continuous in the intermediate format and whose data length is less than the preset maximum number of bytes are combined into a single data frame block, and data elements in the intermediate format whose data length is greater than the preset maximum number of bytes are split into multiple data frame blocks.

[0014] In some embodiments, the first enhanced middleware sends each data frame block to a software execution unit in the first enhanced middleware whose scheduling point matches the source software execution unit according to the scheduling point of the source software execution unit to which it belongs, and the source software execution unit and the software execution unit are alternately arranged and cyclically executed in the form of preset threads; for a specified data frame block, the first scheduling point of the source software execution unit to which the data frame block belongs and the second scheduling point closest to the first scheduling point are obtained, and the specified data frame block is sent to the software execution unit to which the second scheduling point belongs.

[0015] In some embodiments, the first connector software module and the second connector software module perform data transmission by establishing a UDP communication socket.

[0016] In some embodiments, before the first enhanced middleware receives the data to be transmitted sent by the software component in the micro control unit according to the first communication standard, it also includes:

[0017] The data structures of the microcontroller unit and the system loaded on the system on chip are pre-constructed in the first enhanced middleware and the second enhanced middleware by using a modeling tool, and a mapping from a first communication standard on the microcontroller unit to a second communication standard on the system on chip is established by using an intermediate format.

[0018] In some embodiments, the first communication standard is the AUTOSAR CP standard.

[0019] In some embodiments, the second communication standard includes: DDS, SomeIP, ROS2 and CyberRT.

[0020] On the other hand, the present invention also provides an intermediate communication system based on a microcontroller unit and a system on chip, comprising:

[0021] A micro control unit, wherein the micro control unit is provided with a first enhanced middleware, and the first enhanced middleware is further provided with a first connector software module;

[0022] A system on chip, wherein the system on chip is provided with a second enhanced middleware, and the second enhanced middleware is further provided with a second connector software module;

[0023] The first enhanced middleware and the second enhanced middleware execute the above-mentioned intermediate communication method based on the micro control unit and the system on chip.

[0024] On the other hand, the present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the program.

[0025] On the other hand, the present invention also provides a computer-readable storage medium having a computer program stored thereon, characterized in that the program implements the steps of the above method when executed by a processor.

[0026] The beneficial effects of the present invention are at least:

[0027] The intermediate communication method, system and device based on the microcontroller and the system on chip, the method establishes a mapping between the first communication standard of the microcontroller end and the second communication standard of the system on chip end through an intermediate format, converts the data into the intermediate format for transmission in the process of communicating between the microcontroller and the system on chip, and coordinates the communication protocols between different operating systems. By framing the data elements and limiting the size of each data frame block, the efficiency of data transmission can be guaranteed. At the same time, the preset source software execution unit and the software execution unit are cyclically executed in the form of a preset thread, and the data frame block corresponding to the source software execution unit is matched to the corresponding software execution unit in the first enhanced middleware by matching the scheduling point and sent to ensure the stability of communication between the microcontroller and the system on chip. At the system on chip end, the second enhanced middleware calls the second connector software module to cyclically receive the data frame block and save it in the data frame block global table, and converts it into data under the second communication standard after reading to complete the communication with the system on chip software component.

[0028] Additional advantages, purposes, and features of the present invention will be described in part in the following description, and will become apparent to those skilled in the art after studying the following, or may be learned from the practice of the present invention. The purposes and other advantages of the present invention may be achieved and obtained by the structures specifically pointed out in the written description, claims, and drawings.

[0029] Those skilled in the art will appreciate that the objectives and advantages that can be achieved with the present invention are not limited to the above specific description, and the above and other objectives that can be achieved by the present invention will be more clearly understood from the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] The drawings described herein are used to provide a further understanding of the present invention, constitute a part of the present application, and do not constitute a limitation of the present invention. In the drawings:

[0031] Figure 1 It is a schematic diagram of the structure of an intermediate communication system based on a micro control unit and a system on chip according to an embodiment of the present invention. DETAILED DESCRIPTION

[0032] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the embodiments and the accompanying drawings. Here, the illustrative embodiments of the present invention and their descriptions are used to explain the present invention, but are not intended to limit the present invention.

[0033] It should also be noted that, in order to avoid obscuring the present invention due to unnecessary details, only structures and / or processing steps closely related to the solutions according to the present invention are shown in the accompanying drawings, while other details that are not closely related to the present invention are omitted.

[0034] It should be emphasized that the term “include / comprises” when used herein refers to the presence of features, elements, steps or components, but does not exclude the presence or addition of one or more other features, elements, steps or components.

[0035] It should also be noted that, unless otherwise specified, the term “connection” herein may refer not only to a direct connection but also to an indirect connection involving an intermediate.

[0036] The communication between the MCU chip and the SOC chip is limited due to the different operating systems and communication protocols used. The software development of the communication part between the MCU chip and the SOC chip will become a bottleneck for the rapid iterative development of the entire domain control. This application provides an enhanced middleware communication method based on the traditional AUTOSAR mechanism. This method allows MCU-side applications and SOC-side applications using different communication interfaces to communicate in real time and reliably. Since this communication method adopts the modeling concept of traditional AUTOSAR, the communication data between the MCU and SOC ends will be assigned a fixed receiving and transmitting frequency through the modeling tool, thereby ensuring the certainty of data transmission.

[0037] Specifically, the present invention provides an intermediate communication method based on a microcontroller unit and a system on a chip, such as Figure 1 As shown, the method is performed based on a first enhanced middleware provided in a microcontroller unit and a second enhanced middleware provided in a system on chip, the first enhanced middleware is provided with a first connector software module, and the second enhanced middleware is provided with a second connector software module, and the method includes steps S101 to S104:

[0038] Step S101: the first enhanced middleware receives data to be transmitted sent by a software component in a micro control unit according to a first communication standard, and the first enhanced middleware converts the data to be transmitted into an intermediate format.

[0039] Step S102: The first enhanced middleware calculates the byte size of each data element in the data to be transmitted in the intermediate format and its source software execution unit, performs frame processing on the data to be transmitted, and constructs each data element into multiple data frame blocks with a length less than or equal to a preset maximum number of bytes, each data frame block only contains data elements of the same source software execution unit.

[0040] Step S103: the first enhanced middleware sends each data frame block to the software execution unit whose scheduling point matches the source software execution unit according to the scheduling point of the source software execution unit, and sends it to the Ethernet through the first connector software module according to the preset sending function corresponding to each data frame block.

[0041] Step S104: the second enhanced middleware calls the second connector software module to cyclically receive the data frame blocks sent by the first connector software module, and saves the data frame blocks in the data frame block global table according to a predefined protocol;

[0042] Step S105: each software execution unit in the second connector software module polls the data frame block global table according to the preset receiving function, obtains the updated data frame block, converts the data frame block in the intermediate format into data under the second communication standard and sends it to the software component of the system on chip.

[0043] In some embodiments, before step S101, that is, before the first enhanced middleware receives the data to be transmitted sent by the software component in the microcontroller unit according to the first communication standard, it also includes: pre-constructing the data structure of the microcontroller unit and the system loaded on the system on chip through a modeling tool in the first enhanced middleware and the second enhanced middleware, and establishing a mapping from the first communication standard on the microcontroller unit to the second communication standard on the system on chip through an intermediate format.

[0044] Among them, the mapping is constructed in a way that an intermediate format is set. During the data transmission process, the data is first converted into an intermediate format at the sending end and transmitted through a bus and a network, and then the data in the intermediate format is converted into the data format of the receiving end at the receiving end.

[0045] In some embodiments, the first communication standard is the AUTOSAR CP standard.

[0046] In some embodiments, the second communication standard includes: DDS (a distributed real-time communication middleware protocol), SomeIP (a vehicle-mounted communication middleware protocol), ROS2 (a robot operating system) and CyberRT (a communication middleware protocol implemented by Baidu).

[0047] In step S101, the software component refers to the program application, which can be recorded as SWC. In the micro control unit, the software component is the data to be transmitted sent based on the first communication standard. Specifically, it is transmitted to the first enhanced middleware through the virtual function bus RTE, and the first enhanced middleware first converts the data to be transmitted into an intermediate format according to a preset mapping relationship.

[0048] It should be noted here that the data to be transmitted is sent by the source software execution unit source runnable of the software component, and is received and forwarded by the software execution unit runnable in the first enhanced middleware. The source runnable and the runnable are pre-set and cyclically executed according to the functions of the program in the actual application process. For example, they are set in the order of sourcerunnable 1, runnable 1, source runnable 2, runnable 2, source runnable 3, and runnable3, where runnable 1 is used to receive data from source runnable 1, runnable 2 is used to receive data from source runnable 2, and runnable 3 is used to receive data from source runnable 3.

[0049] In step S102, in order to ensure stability during data transmission, a fixed receiving and transmitting frequency is allocated through a modeling tool, and the data to be transmitted needs to be framed. This ensures that during the transmission process, the size of each data frame block is limited to the preset maximum number of bytes. In the intermediate format, the data to be transmitted is actually composed of data elements DataElement, and the data frame block Frame is established with the data element as the smallest unit. The data frame block Frame can be of two types, one is a sharedframe, which contains one or more DataElements. The other is a multiframe, which contains a part of a large DataElement, and multiple Frames with the same ID number come from a larger DataElement.

[0050] In some embodiments, the first enhanced middleware calculates the byte size of each data element in the data to be transmitted in the intermediate format and its source software execution unit, performs frame processing on the data to be transmitted, and constructs each data element into multiple data frame blocks with a length less than or equal to a preset maximum number of bytes, including: within the limit that the data length of the data frame block is less than or equal to the preset maximum number of bytes, combining data elements in the intermediate format that are continuous and have multiple data lengths less than the preset maximum number of bytes into a single data frame block, and splitting data elements in the intermediate format that have a data length greater than the preset maximum number of bytes into multiple data frame blocks.

[0051] After the framing is completed, the framing information will be saved in the database, which also ensures that the data frame block used for transmission is within the preset maximum number of bytes.

[0052] In some embodiments, in step S103, the first enhanced middleware sends each data frame block to the software execution unit whose scheduling point matches the source software execution unit according to the scheduling point of the source software execution unit to which it belongs, and the source software execution unit and the software execution unit are alternately set and cyclically executed in the form of preset threads; for a specified data frame block, the first scheduling point of the source software execution unit to which the data frame block belongs and the second scheduling point closest to the first scheduling point are obtained, and the specified data frame block is sent to the software execution unit to which the second scheduling point belongs.

[0053] Since the source software execution unit of the SWC corresponds to the software execution unit of the first enhanced middleware, the matching and sending are performed through the scheduling point in the present application. The data frame block is assigned to the runnable of the first enhanced middleware closest to the sourcerunnable scheduling point corresponding to the first data element. For example, for the preset source runnable 1, runnable 1, source runnable 2, runnable 2, source runnable3, runnable 3, if the first data element DataElement of the data frame block Frame belongs to source runnable1, it is assigned to runnable 1 and sent.

[0054] In some embodiments, the first connector software module and the second connector software module perform data transmission by establishing a UDP communication socket.

[0055] In step S104, the second enhanced middleware receives the network message through the second connector software module according to the preset thread, and parses the data frame block Frame according to the protocol and stores it in the data frame block global table.

[0056] In step S105, when there is an update in the data frame block global table, the data frame block in the intermediate format is converted into data in the second communication standard, and the data is transmitted to the software program of the system on chip by calling the virtual transmission bus through the callback function.

[0057] Furthermore, based on steps similar to steps S101 to S105 , data transmission from the system on chip to the micro control unit can be achieved.

[0058] On the other hand, the present invention also provides an intermediate communication system based on a microcontroller unit and a system on chip, comprising:

[0059] A micro control unit, wherein the micro control unit is provided with a first enhanced middleware, and the first enhanced middleware is further provided with a first connector software module;

[0060] A system on chip, wherein the system on chip is provided with a second enhanced middleware, and the second enhanced middleware is further provided with a second connector software module;

[0061] The first enhanced middleware and the second enhanced middleware execute the above-mentioned intermediate communication method based on the micro control unit and the system on chip.

[0062] On the other hand, the present invention also provides an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above method when executing the program.

[0063] On the other hand, the present invention also provides a computer-readable storage medium having a computer program stored thereon, characterized in that the program implements the steps of the above method when executed by a processor.

[0064] The present invention will be described below in conjunction with specific embodiments:

[0065] like Figure 1 As shown, this embodiment shows two hosts, one on the MCU side and the other on the SOC side. Middleware and Connector are deployed in both hosts, and these two components are the core of enhanced middleware. The SWC on the MCU side and the APP on the SOC side need to rely on enhanced middleware for forwarding and receiving. The underlying communication protocols of the middleware on both ends can be flexibly switched through configuration, among which ETH Ethernet is the default configuration.

[0066] The entire enhanced middleware component generation steps are:

[0067] 1. Use modeling tools to construct all data structures that need to be transmitted between the MCU and SOC ends, and establish mapping through intermediate formats.

[0068] 2. Use the modeling tool to configure the maximum number of bytes of a transmission frame, FrameMaxSize (in bytes).

[0069] 3. If the SOC uses the DDS protocol for communication, it is necessary to establish a mapping relationship between the DDS Topic and the DataElement in traditional AUTOSAR.

[0070] 4. The information in steps 1 and 2 above will be saved in the database.

[0071] 5. Calculate the byte size (ByteSize) of all data structures (DataElement) that need to be transmitted and its source runnable.

[0072] 6. Run the data framing script to provide framing information for generating Middleware components.

[0073] The minute hand algorithm is as follows:

[0074] The complete algorithm is based on traversing all DataElements as a framework.

[0075] Set four flags:

[0076] last_rnbl is used to record the source runnable to which the previous DataElement belongs. The initial value is set to an empty string "".

[0077] current_offset is used to record the offset position of a DataElement in a sharedFrame. If it is in multiframe, the mark is always 0.

[0078] last_frame_id is used to record the id of the last traversed Frame. Its initial value is set to 0.

[0079] last_frame is used to record the category of the last traversed frame. The options are empty string "", "multiframe" and "sharedframe". Set its initial value to empty string "".

[0080] Algorithm flow:

[0081] Traverse all DataElements once, taking out one DataElement each time for processing.

[0082] If the size of this DataElement is equal to FrameMaxSize, then the DataElement is split into multiple multiframes. The value of frame_id is updated to last_frame_id+1, and the value of current_offset is set to 0.

[0083] At the same time, multi_frame_counter is used to record the number of multiframes that the DataElement is split into. The value of multi_frame_counter is (DataElementSize / FrameMaxSize) + 1. The values ​​of frame_id, current_offset, and multi_frame_counter of the DataElement are updated to the database. Then the value of last_frame_id is updated to last_frame_id + multi_frame_counter, the value of last_frame is updated to "multiframe", and the value of last_rnbl is updated to src_rnbl.

[0084] If the size of this DataElement is less than FrameMaxSize, then continue to divide the situation:

[0085] If last_frame_id is equal to 0 or last_frame is equal to "multiframe" or last_frame is equal to "" or src_rnbl is not equal to last_rnbl, then frame_id is updated to last_frame_id+1, and the value of current_offset is updated to current_offset+frame_size. The values ​​of frame_id and current_offset of the DataElement are updated to the database. Then the value of last_frame_id is updated to frame_id, and the value of current_offset is updated to 0.

[0086] If last_frame is equal to "sharedframe" and src_rnbl is equal to last_rnbl, then continue to divide the case:

[0087] If the size of DataElement plus the size of current_offset is less than FrameMaxSize, then update the value of frame_id to last_frame_id, and the value of current_offset to the size of DataElement plus current_offset. Update the values ​​of frame_id and current_offset of the DataElement to the database.

[0088] If the size of DataElement plus the size of current_offset is greater than or equal to FrameMaxSize, then update the value of frame_id to last_frame_id+1, and update the value of current_offset to 0. Update the values ​​of frame_id and current_offset of the DataElement to the database.

[0089] Then update the value of last_frame_id to frame_id.

[0090] In both cases, after either case ends, the value of last_frame must be updated to "sharedframe" and the value of last_rnbl must be updated to src_rnbl.

[0091] After the framing algorithm is finished, each DataElement has been assigned to each Frame, and the framing information is saved in the database. There are two types of Frames, one is sharedframe, which contains one or more DataElements. The other is multiframe, which contains part of a large DataElement. Multiple Frames with the same ID number are combined into one DataElement.

[0092] 7. Run the Middleware code generator, the core logic of the Middleware code generator:

[0093] The code generation process at the receiving end is as follows: Generate a receiving callback function for all received frames.

[0094] The code generation process on the sending end is as follows: Take out the scheduling points of each runnable from the database, including the scheduling points of all runnables of the Middleware. Traverse all Frames and find the source runnable to which the first DataElement in the Frame belongs. Perform a second round of traversal for each Frame in the first round of traversal, traversing all the runnables of the Middleware. During the traversal process, by comparing the scheduling point of the source runnable of each Frame with the scheduling point of the Middleware runnable, the Frame is assigned to the runnable of the Middleware whose scheduling point is closest to the scheduling point of the source runnable of the Frame.

[0095] After the above process is completed, each Frame is assigned to a specific Middleware runnable to be sent. Each Frame will generate a corresponding sending function, which is responsible for sending the DataElement contained in the Frame.

[0096] The workflow of the entire enhanced middleware is as follows:

[0097] The sending process includes:

[0098] 1) The Middleware module calls the Connector module initialization function to establish a UDP communication socket.

[0099] 2) Each SWC transmits data to the Middleware module through RTE.

[0100] 3) Each runnable in the Middleware module runs in threaded mode and receives data transmitted by each SWC by calling RTE, and then calls the Frame sending function of the Connector module to send each Frame.

[0101] The receiving process includes:

[0102] 1) The Middleware module calls the initialization function of the Connector module. In addition to creating a UDP communication socket, it also creates a data receiving thread. This thread cyclically receives network messages through the UDP communication socket, parses the Frame according to the protocol defined by the Connector, and saves the message content of each Frame to the Frame global table in the Connector module, and sets the data update bit.

[0103] 2) Each runnable in the Middleware module runs in threaded mode and polls the Frame global table by calling the Frame receiving function of the Connector module. If the data is updated, the corresponding Frame callback function will be triggered. The callback function will call RTE to transmit the data to the APP.

[0104] 3) APP calls RTE to receive data.

[0105] In summary, the intermediate communication method, system and device based on the microcontroller and the system on chip, the method establishes a mapping between the first communication standard of the microcontroller end and the second communication standard of the system on chip end through an intermediate format, converts the data into the intermediate format for transmission in the process of communicating between the microcontroller and the system on chip, and coordinates the communication protocols between different operating systems. By framing the data elements and limiting the size of each data frame block, the efficiency of data transmission can be guaranteed. At the same time, the preset source software execution unit and the software execution unit are cyclically executed in the form of a preset thread, and the data frame block corresponding to the source software execution unit is matched to the corresponding software execution unit in the first enhanced middleware by matching the scheduling point and sent to ensure the stability of communication between the microcontroller and the system on chip. At the system on chip end, the second enhanced middleware calls the second connector software module to cyclically receive the data frame block and save it in the data frame block global table, and converts it into data under the second communication standard after reading to complete the communication with the system on chip software component.

[0106] It should be understood by those skilled in the art that the exemplary components, systems and methods described in conjunction with the embodiments disclosed herein can be implemented in hardware, software or a combination of the two. Whether it is performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention. When implemented in hardware, it can be, for example, an electronic circuit, an application-specific integrated circuit (ASIC), appropriate firmware, a plug-in, a function card, etc. When implemented in software, the elements of the present invention are programs or code segments used to perform the required tasks. The program or code segment can be stored in a machine-readable medium or transmitted on a transmission medium or a communication link via a data signal carried in a carrier. "Machine-readable medium" can include any medium capable of storing or transmitting information. Examples of machine-readable media include electronic circuits, semiconductor memory devices, ROM, flash memory, erasable ROM (EROM), floppy disks, CD-ROMs, optical disks, hard disks, optical fiber media, radio frequency (RF) links, and the like. The code segment can be downloaded via a computer network such as the Internet, an intranet, etc.

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

[0108] In the present invention, features described and / or illustrated for one embodiment may be used in the same or similar manner in one or more other embodiments, and / or combined with features of other embodiments or replace features of other embodiments.

[0109] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the embodiments of the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. An intermediate communication method based on a microcontroller unit and a system on chip, characterized in that: The method is performed based on a first enhanced middleware provided in a microcontroller unit and a second enhanced middleware provided in a system on chip, wherein the first enhanced middleware is provided with a first connector software module and the second enhanced middleware is provided with a second connector software module, and the method includes: The first enhanced middleware receives the data to be transmitted sent by the software component in the micro control unit according to the first communication standard, and converts the data to be transmitted into an intermediate format by the first enhanced middleware; The first enhanced middleware calculates the byte size of each data element in the data to be transmitted in the intermediate format and its source software execution unit, performs frame processing on the data to be transmitted, and constructs each data element into a plurality of data frame blocks whose length is less than or equal to a preset maximum number of bytes, each data frame block only contains data elements of the same source software execution unit; The first enhanced middleware sends each data frame block to a software execution unit whose scheduling point matches the source software execution unit according to the scheduling point of the source software execution unit, and sends it to the Ethernet through the first connector software module according to the preset sending function corresponding to each data frame block; The second enhanced middleware calls the second connector software module to cyclically receive the data frame blocks sent by the first connector software module, and saves the data frame blocks in a data frame block global table according to a predefined protocol; Each software execution unit in the second connector software module polls the data frame block global table according to a preset receiving function, obtains the updated data frame block, converts the data frame block in the intermediate format into data under the second communication standard and sends it to the software component of the system on chip.

2. The intermediate communication method based on a microcontroller unit and a system on chip according to claim 1, characterized in that: The first enhanced middleware calculates the byte size of each data element in the data to be transmitted in the intermediate format and its source software execution unit, performs frame processing on the data to be transmitted, and constructs each data element into a plurality of data frame blocks whose length is less than or equal to a preset maximum number of bytes, including: Within the restriction that the data length of the data frame block is less than or equal to the preset maximum number of bytes, multiple data elements that are continuous in the intermediate format and whose data length is less than the preset maximum number of bytes are combined into a single data frame block, and data elements in the intermediate format whose data length is greater than the preset maximum number of bytes are split into multiple data frame blocks.

3. The intermediate communication method based on a microcontroller unit and a system on chip according to claim 1, characterized in that: The first enhanced middleware sends each data frame block to a software execution unit in the first enhanced middleware whose scheduling point matches the source software execution unit according to the scheduling point of the source software execution unit to which it belongs, and the source software execution unit and the software execution unit are alternately arranged and cyclically executed in the form of preset threads; for a specified data frame block, the first scheduling point of the source software execution unit to which the data frame block belongs and the second scheduling point closest to the first scheduling point are obtained, and the specified data frame block is sent to the software execution unit to which the second scheduling point belongs.

4. The intermediate communication method based on a microcontroller unit and a system on chip according to claim 1, characterized in that: The first connector software module and the second connector software module perform data transmission by establishing a UDP communication socket.

5. The intermediate communication method based on a microcontroller unit and a system on chip according to claim 1, characterized in that: Before the first enhanced middleware receives the data to be transmitted sent by the software component in the micro control unit according to the first communication standard, the method further includes: The data structures of the microcontroller unit and the system loaded on the system on chip are pre-constructed in the first enhanced middleware and the second enhanced middleware by using a modeling tool, and a mapping from a first communication standard on the microcontroller unit to a second communication standard on the system on chip is established by using an intermediate format.

6. The intermediate communication method based on a microcontroller unit and a system on chip according to claim 5, characterized in that: The first communication standard is the AUTOSAR CP standard.

7. The intermediate communication method based on a microcontroller unit and a system on chip according to claim 5, characterized in that: The second communication standards include: DDS, SomeIP, ROS2 and CyberRT.

8. An intermediate communication system based on a microcontroller unit and a system on chip, characterized in that: include: A micro control unit, wherein the micro control unit is provided with a first enhanced middleware, and the first enhanced middleware is further provided with a first connector software module; A system on chip, wherein the system on chip is provided with a second enhanced middleware, and the second enhanced middleware is further provided with a second connector software module; The first enhanced middleware and the second enhanced middleware execute the intermediate communication method based on a micro control unit and a system on chip according to any one of claims 1 to 7.

9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps of the method according to any one of claims 1 to 7 are implemented.

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

Citation Information

Patent Citations

  • Data scheduling method and device

    CN110831215A

  • USB conversion interface device

    CN112256615A