An electronic control unit internal communication management method and apparatus
By constructing a virtual transport layer independent of the application layer inside the ECU, and managing the internal chip communication of the ECU based on priority, the reliability and efficiency issues of internal communication of the ECU are solved, and the reliable transmission and efficient communication of key data are realized.
Patent Information
- Application Number
- CN202611515868.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-28
- Publication Date
- 2026-11-27
AI Technical Summary
In the field of automotive electronics, the lack of a unified transmission layer framework protocol for chip communication within the electronic control unit (ECU) makes it difficult to guarantee communication reliability and efficiency, and engineers' self-defined communication management methods vary greatly.
A virtual transmission layer independent of the application layer is built inside the ECU. Priorities are divided based on the functional safety level and real-time requirements of the data, and differentiated retransmission control and load rate sensing buffer control are implemented, including synchronous and asynchronous response mechanisms and piggyback response methods.
It enables the rational scheduling of internal communication resources within the ECU, ensuring reliable transmission of critical data in complex environments, improving communication efficiency and reliability, and avoiding communication congestion under high load conditions.
Smart Images

Figure CN123185148A_ABST
Abstract
Description
Technical Field
[0001] This application relates to chip communication technology, and more specifically, to a method and apparatus for internal communication management of an electronic control unit. Background Technology
[0002] In the field of automotive electronics, electronic control units (ECUs) typically integrate multiple dedicated driver chips, which primarily interact with each other via a serial communication interface. The serial interface standard defines the electrical characteristics and frame format of the physical and data link layers, ensuring reliable bit-level transmission of single-frame data, but it does not specify transport layer functions such as communication session management, failure handling, and flow control.
[0003] In practical software design, engineers typically need to define the application-layer communication logic themselves based on the chip datasheet, and incorporate some transport layer processing code into it. Due to the lack of a unified transport layer framework protocol, the communication management methods implemented by different projects and different engineers vary greatly, making it difficult to effectively guarantee the reliability and efficiency of current ECU internal communication. Summary of the Invention
[0004] In view of the above, this application provides the following technical solution:
[0005] The first aspect of this application provides a method for managing internal communication of an electronic control unit, including:
[0006] Based on a pre-built virtual transmission layer, priorities are assigned according to the functional safety level or real-time requirements of the data to be transmitted. The virtual transmission layer is built on top of the physical communication interface inside the electronic control unit and is independent of the application layer.
[0007] A unified transmission management strategy is executed based on the aforementioned priority.
[0008] The transmission management strategy includes: differentiated retransmission control when transmission fails, and real-time monitoring of communication load rate and buffering control of transmitted data based on priority when the load rate exceeds a set load rate threshold.
[0009] In one possible implementation, prioritizing data based on its functional safety level or real-time requirements includes:
[0010] The data to be transmitted is divided into high priority, medium priority, and low priority; among them, the higher the functional safety level of the data, the higher the priority; and the higher the real-time requirement of the data, the higher the priority.
[0011] The differentiated retransmission control includes:
[0012] If the failed data transmission is high-priority data, retransmit the data within the current communication cycle;
[0013] If the data that failed to be sent is medium-priority data, resend the data in the next communication cycle;
[0014] If the data that failed to be sent was low-priority data, it will not be resent.
[0015] In one possible implementation, the priority-based buffering control of transmitted data includes:
[0016] Real-time monitoring of communication load rate; when the load rate exceeds the set load rate threshold, buffering control of transmitted data is performed based on the priority, wherein low-priority data and / or medium-priority data are buffered first.
[0017] The method for calculating the communication load rate is adjusted according to the duplex mode of the physical communication interface;
[0018] A load rate hysteresis comparison mechanism is introduced. When the load rate exceeds the first threshold, buffer control is activated, and when the load rate falls back to below the second threshold, buffer control is deactivated. The first threshold is greater than the second threshold.
[0019] In one possible implementation, the method further includes a response time control step:
[0020] For data with real-time requirements exceeding the real-time threshold, a synchronization mechanism is used for response processing, which directly triggers the operating system's event response.
[0021] For data whose real-time requirements are no higher than the real-time threshold, an asynchronous mechanism is used for response processing, the data is stored in a queue and processed in the next task cycle.
[0022] One possible implementation also includes:
[0023] Using the piggyback acknowledgment method, after receiving the data, the receiver attaches an acknowledgment bit to the feedback data frame and returns it to the sender;
[0024] After sending data, the sender uses hardware resources to save the response data in a non-blocking manner and checks the response in the next cycle to complete the confirmation.
[0025] In one possible implementation, the virtual transport layer completes static configuration based on hardware configuration parameters before the communication link is established; the hardware configuration parameters include at least one of communication pin mapping, device address configuration, and communication baud rate configuration.
[0026] In one possible implementation, before the virtual transport layer executes the transport management policy, the following steps are also included:
[0027] Perform an initial handshake between the sender and receiver to confirm that both parties are in a communicable state and are ready to communicate.
[0028] If the initial handshake fails, the data transmission process is prohibited.
[0029] One possible implementation also includes:
[0030] The transmitted data is verified in the virtual transport layer;
[0031] The internal chip of the electronic control unit is used first for verification; if the internal chip does not have a verification bit, an independent verification byte is added to the data frame.
[0032] In one possible implementation, the physical communication interface includes an SPI, I2C, or UART interface.
[0033] The second aspect of this application provides an internal communication management device for an electronic control unit, comprising:
[0034] A virtual layer construction module is used to build a virtual transmission layer on top of the physical communication interface inside the electronic control unit. The virtual transmission layer is independent of the application layer and is used to manage data transmission between chips inside the electronic control unit.
[0035] The priority allocation module is used to prioritize data based on its functional safety level or real-time requirements.
[0036] The strategy execution module is used to execute a unified transmission management strategy based on the priority; wherein the transmission management strategy includes: differentiated retransmission control when transmission fails, and real-time monitoring of communication load rate and buffering control of transmitted data based on priority when the load rate exceeds a set threshold.
[0037] As described above, this application discloses a method and apparatus for managing internal communication of an electronic control unit (ECU). The solution pre-constructs a virtual transport layer independent of the application layer on top of the physical communication interface within the ECU, providing a unified logical management platform for internal communication. The solution implements differentiated retransmission control when data transmission fails, ensuring maximum accessibility of critical data with limited communication resources. Simultaneously, when the load rate exceeds a set threshold, low-priority and / or medium-priority data is buffered first, while high-priority data is transmitted first, effectively avoiding communication congestion under high load conditions. Through this solution, reasonable scheduling of internal communication resources within the ECU is achieved, ensuring reliable transmission of high-functional safety and high-real-time data in complex communication environments, and overall improving the efficiency and reliability of internal communication within the ECU. Attached Figure Description
[0038] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of this application. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0039] Figure 1 This is a flowchart illustrating an internal communication management method for an electronic control unit disclosed in an embodiment of this application;
[0040] Figure 2 This is a flowchart illustrating the implementation of the priority-based buffer control mechanism disclosed in an embodiment of this application.
[0041] Figure 3 This is a schematic diagram of the response time control process disclosed in the embodiments of this application;
[0042] Figure 4 This is a schematic diagram of the communication implementation process of the virtual transport layer disclosed in the embodiments of this application;
[0043] Figure 5 This is a schematic diagram of the structure of an internal communication management device for an electronic control unit disclosed in an embodiment of this application. Detailed Implementation
[0044] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0045] The embodiments of this application can be applied to electronic devices. This application does not limit the product form of the electronic device, which may include but is not limited to smartphones, tablets, wearable devices, personal computers (PCs), netbooks, etc., and can be selected according to application requirements.
[0046] Figure 1 This is a flowchart illustrating an internal communication management method for an electronic control unit (ECU) disclosed in an embodiment of this application. For ease of understanding, the ECU in a vehicle will be used as an example in the following description. See also... Figure 1 As shown, the internal communication management method of the electronic control unit may include:
[0047] Step 101: Based on the pre-built virtual transmission layer, prioritize the data to be transmitted according to its functional safety level or real-time requirements. The virtual transmission layer is built on the physical communication interface inside the electronic control unit and is independent of the application layer.
[0048] In this application, the virtual transport layer can be understood as a logical layer at the software architecture level. It is constructed during the power-on initialization of the electronic control unit and persists throughout the entire runtime. The construction process may include allocating necessary memory space, initializing data queues, registering interrupt service functions, and configuring hardware parameters. The virtual transport layer resides above the physical communication interface but is logically completely separated from the application layer. When the application layer needs to send data, it does not directly operate the physical communication interface but instead submits the data to be transmitted to the virtual transport layer, which is responsible for all subsequent scheduling and transmission. This architectural design allows application layer developers to avoid concern themselves with the complexity of the underlying communication and also facilitates unified management and optimization of communication behavior.
[0049] The virtual transport layer of this invention can be built on top of various types of physical communication interfaces, including but not limited to SPI (Serial Peripheral Interface), I2C (Inter-Integrated Circuit), and UART (Universal Asynchronous Receiver / Transmitter). By abstracting the differences between these various physical interfaces, the virtual transport layer provides a unified communication service interface for the application layer, eliminating the need for the application layer to be concerned with which underlying physical interface is used.
[0050] Upon receiving a transmission request from the application layer, the virtual transport layer first parses the attributes of the data to be transmitted, particularly its functional safety level and real-time requirements. The functional safety level can be the ASIL (Automotive Safety Integrity Level) level that the data belongs to in the domain functional safety standard, reflecting the data's importance to vehicle safety. Real-time requirements refer to the maximum allowable delay time from the sender to the receiver; data with higher real-time requirements has a lower tolerance for transmission latency. The virtual transport layer prioritizes data based on these attributes, ensuring that subsequent transmission management is differentiated according to the actual importance of the data.
[0051] Step 102: Execute a unified transmission management strategy based on the priority; wherein the transmission management strategy includes: differentiated retransmission control when transmission fails, and real-time monitoring of communication load rate and buffering control of transmitted data based on priority when the load rate exceeds a set load rate threshold.
[0052] After prioritizing data, the virtual transport layer executes a unified transport management strategy based on that priority. This transport management strategy is a set of rules predefined and configured within the virtual transport layer, applicable to all data passing through it, thus achieving uniformity in communication management.
[0053] Differentiated retransmission control refers to the virtual transport layer adopting different retransmission strategies based on the data's priority category when data transmission fails. For example, higher-priority data can be retransmitted as soon as possible to minimize retransmission latency; for low-priority data, considering its relatively low importance, the virtual transport layer may retransmit it in the next cycle after a transmission failure, or simply discard the data without retransmission. This differentiated retransmission mechanism ensures the reliability of critical data while avoiding resource waste and congestion exacerbation caused by indiscriminate retransmission.
[0054] In the application, the virtual transport layer monitors the current communication load rate in real time, which is the ratio of used communication bandwidth to total available bandwidth. When the load rate exceeds a preset load rate threshold, the virtual transport layer can control the buffered transmission of low-priority data, while prioritizing the transmission of high-priority data. In this way, under high load conditions, the system can automatically protect the transmission channel of high-priority data, preventing burst transmissions of low-priority data from crowding out the bandwidth of important data. When the load rate falls below a safe level, the buffered data is then transmitted gradually according to priority.
[0055] In summary, the electronic control unit (ECU) internal communication management scheme disclosed in this embodiment constructs a virtual transport layer independent of the application layer above the physical communication interface within the ECU. This virtual transport layer provides unified management of data transmission between chips within the ECU. The virtual transport layer is pre-built during system initialization and persists throughout the entire operating cycle, providing a unified service for multiple data transmissions. The application layer does not need to be aware of the underlying communication details; it only needs to submit the data to be transmitted to the virtual transport layer. The virtual transport layer prioritizes the data based on its functional safety level or real-time requirements and executes a unified transmission management strategy, including differentiated retransmission control and load-aware buffer control, based on these priorities.
[0056] This embodiment provides a unified logical management platform for internal communication within the electronic control unit (ECU) by pre-constructing a virtual transport layer independent of the application layer on top of the physical communication interface within the ECU. The solution implements differentiated retransmission control when data transmission fails, ensuring maximum accessibility of critical data with limited communication resources. Simultaneously, when the load rate exceeds a set threshold, low-priority and / or medium-priority data is buffered first, while high-priority data is transmitted first, effectively avoiding communication congestion under high load conditions. Through this solution, rational scheduling of internal communication resources within the ECU is achieved, ensuring reliable transmission of high-functional-safety-level and high-real-time-sensitivity data in complex communication environments, and overall improving the efficiency and reliability of internal communication within the ECU.
[0057] In one implementation, prioritizing data based on its functional safety level or real-time requirements includes: dividing the data to be transmitted into high priority, medium priority, and low priority; wherein, data with higher functional safety levels has higher priority, and data with higher real-time requirements has higher priority.
[0058] When prioritizing data, the virtual transport layer comprehensively considers both the functional safety level and real-time requirements of the data.
[0059] For functional safety levels, following the definitions of relevant safety standards, ASIL levels from lowest to highest are QM (Quality Management, no functional safety requirements), ASIL A, ASIL B, ASIL C, and ASIL D. Data at higher levels has a greater impact on vehicle safety and should therefore be assigned a higher communication priority. For example, data related to vehicle braking control typically has an ASIL D level and is classified as high priority; while data related to in-vehicle infotainment systems typically belongs to the QM level and is classified as low priority.
[0060] For real-time requirements, the virtual transport layer evaluates data based on the maximum allowable transmission latency. Data with higher real-time requirements, i.e., shorter maximum allowable latency, should be assigned higher priority. For example, engine speed feedback data requires millisecond-level response times; its real-time requirement is higher than that of general diagnostic log data, and therefore it should be classified as higher priority.
[0061] In the actual classification process, if the evaluation results of a piece of data are inconsistent in the two dimensions of functional safety level and real-time requirements, the virtual transport layer can use preset arbitration rules, such as taking the functional safety level as the main basis or taking the higher evaluation result of the two as the standard, to determine the final priority category of the data.
[0062] The differentiated retransmission control may include:
[0063] If the failed data transmission is high-priority data, it will be retransmitted within the current communication cycle. When the virtual transport layer detects a high-priority data transmission failure, it will immediately initiate a retransmission process within the current communication cycle. Specifically, the virtual transport layer will resubmit the data to the physical communication interface for transmission within the remaining time slice of the current communication cycle. Since high-priority data often involves critical vehicle safety functions, any transmission delay could lead to serious safety consequences. Therefore, retransmission within the current cycle minimizes the end-to-end delay from data generation to successful delivery, meeting the stringent functional safety requirements for fault tolerance time intervals.
[0064] If the failed transmission data is medium-priority data, it will be retransmitted in the next communication cycle. For medium-priority data, the virtual transport layer, upon detecting a transmission failure, will not immediately retransmit it in the current communication cycle. Instead, it will mark the data as pending retransmission and schedule its retransmission for the next communication cycle. Specifically, since other high-priority data may still need to be transmitted in the current communication cycle, immediately retransmitting medium-priority data could create resource contention with the transmission of high-priority data, thus affecting the timely delivery of high-priority data. By delaying it to the next communication cycle, medium-priority data is given a chance to retry while avoiding interference with high-priority data in the current cycle.
[0065] If the data that fails to be transmitted is low-priority data, it will not be retransmitted. For low-priority data, the virtual transport layer discards the data directly after a transmission failure without any retransmission. Specifically, since low-priority data usually does not involve vehicle safety-critical functions, its importance is low, and retransmission operations would consume additional communication bandwidth and processing resources. In resource-constrained ECU environments, limited resources are used to ensure the transmission of high-priority and medium-priority data. Furthermore, low-priority data is often substitutable; for example, ambient temperature data periodically collected by sensors, even if a transmission fails, the next collected data can still reflect the current state, thus eliminating the need for retransmission.
[0066] This embodiment defines differentiated retransmission rules, which specify that high-priority data is retransmitted in the current communication cycle, medium-priority data is retransmitted in the next communication cycle, and low-priority data is not retransmitted. This not only ensures the reliable transmission of critical data but also effectively avoids the waste of resources and congestion risks caused by indiscriminate retransmission, further improving the precision and efficiency of communication management.
[0067] In one implementation, the priority-based buffering control of transmitted data may include: real-time monitoring of communication load rate, and when the load rate exceeds a set load rate threshold, buffering control of transmitted data based on the priority, wherein low-priority data and / or medium-priority data are buffered preferentially.
[0068] The virtual transport layer continuously monitors the communication load rate during operation. The load rate is calculated based on the ratio between the actual data transmission volume of the physical communication interface and its theoretical maximum transmission capacity. When the load rate exceeds a pre-set threshold (e.g., 75%), the virtual transport layer determines that the current communication is under high load and immediately initiates a priority-based buffering control mechanism. Under this mechanism, the virtual transport layer prioritizes buffering low-priority data and / or medium-priority data, allowing this data to be temporarily stored in the transmission queue, while high-priority data is allowed to be sent directly or jump the queue. The "and / or" here encompasses three possible buffering strategies: buffering only low-priority data, buffering only medium-priority data, and buffering both low-priority and medium-priority data. The specific strategy adopted can be dynamically adjusted according to the actual system configuration and current load conditions. By prioritizing the buffering of low-priority and / or medium-priority data, high-priority data can still obtain sufficient bandwidth resources under high load conditions, thereby ensuring the transmission quality of critical data.
[0069] The calculation method for the communication load rate is adjusted according to the duplex mode of the physical communication interface. Different physical communication interfaces have different duplex modes, including full-duplex and half-duplex modes (in the field of communication, simplex mode only supports unidirectional communication, half-duplex mode supports bidirectional communication but can only transmit in one direction at a time, and full-duplex mode supports simultaneous bidirectional communication). In full-duplex mode, sending and receiving can occur simultaneously, so the load rate calculation needs to consider the bandwidth occupancy in both the sending and receiving directions. Typically, the load rate is the ratio of the sum of the sent and received data volumes to the total bandwidth. In half-duplex mode, since only sending or receiving operations can occur at a time, the load rate calculation needs to consider the sending load and receiving load separately, taking the larger of the two values or calculating based on the actual time occupancy ratio in each communication direction. The virtual transport layer identifies the duplex mode of the current physical communication interface during construction and selects an appropriate load rate calculation method accordingly to ensure the accuracy of the load rate assessment.
[0070] The load rate can be either an instantaneous load rate or an average load rate. In implementation, counters related to the instantaneous and average load rates can be defined in the interrupt service routine to detect transmitted and received data and initiate a priority-based buffer control mechanism. Figure 2 This is a flowchart illustrating the implementation of the priority-based buffer control mechanism disclosed in the embodiments of this application, which can be combined with... Figure 2 Understand the content of this embodiment.
[0071] In addition, a load rate hysteresis comparison mechanism can be introduced. Buffer control is activated when the load rate exceeds a first threshold, and buffer control is deactivated when the load rate falls below a second threshold, where the first threshold is greater than the second threshold.
[0072] To prevent frequent switching of buffer control strategies (i.e., strategy oscillation) caused by small fluctuations in load rate around a set load rate threshold, this embodiment introduces a load rate hysteresis comparison mechanism. This mechanism sets two different thresholds: a first threshold (start threshold) and a second threshold (release threshold), with the first threshold being greater than the second threshold. When the load rate rises from below the first threshold to above it, the virtual transport layer initiates priority-based buffer control; when the load rate falls from above the second threshold to below it, the virtual transport layer releases buffer control and resumes normal transmission mode. Since there is a hysteresis interval between the first and second thresholds (e.g., the first threshold is 75% and the second threshold is 60%), the system will not switch states when the load rate fluctuates within this interval, effectively avoiding frequent strategy switching and ensuring the stability of communication management.
[0073] In one implementation, the internal communication management method of the electronic control unit may further include a response time control step. This includes: for data with real-time requirements higher than a real-time threshold, a synchronous mechanism is used for response processing, which directly triggers the operating system's event response; for data with real-time requirements no higher than the real-time threshold, an asynchronous mechanism is used for response processing, storing the data in a queue and processing it in the next task cycle.
[0074] Figure 3 This is a schematic diagram of the response time control flow disclosed in an embodiment of this application. (In conjunction with...) Figure 3 As shown, the virtual transport layer categorizes data into time-sensitive and non-time-sensitive data based on real-time requirements. The real-time threshold is a pre-defined time parameter used to distinguish whether data is time-sensitive. For data with real-time requirements exceeding this threshold (i.e., time-sensitive data), the virtual transport layer employs a synchronization mechanism for response. Under this mechanism, when data arrives, the virtual transport layer does not store it in any queue or buffer but directly triggers the operating system's event response. Upon receiving this event, the operating system immediately interrupts any currently executing low-priority tasks and processes the time-sensitive data.
[0075] For data with real-time requirements below the real-time threshold (i.e., non-time-sensitive data), the virtual transport layer employs an asynchronous mechanism for response processing. Under this asynchronous mechanism, data is first stored in a receive queue, awaiting the end of the current task cycle. When the next task cycle arrives, the virtual transport layer reads the data from the queue and submits it to the operating system for further processing. This asynchronous mechanism allows non-time-sensitive data to remain synchronized with the system's main task cycle, avoiding the impact of frequent interruptions on overall system performance, while ensuring that the data is ultimately processed reliably.
[0076] This embodiment provides differentiated response time control for data with varying real-time requirements. For time-sensitive data with real-time requirements exceeding a threshold, a synchronous mechanism directly triggers the operating system's event response without intermediary data transfer through queues or buffers, achieving extremely low-latency response processing. For data with real-time requirements below the threshold, an asynchronous mechanism is used to store it in a queue and process it in the next task cycle, ensuring the overall stability of the system. This combined synchronous and asynchronous response time control method guarantees the real-time performance of critical data while also considering system processing efficiency and resource utilization.
[0077] In one implementation, the internal communication management method of the electronic control unit may also include: using a piggyback acknowledgment method, whereby the receiver, after receiving data, attaches an acknowledgment bit to the feedback data frame and returns it to the sender.
[0078] In traditional communication acknowledgment mechanisms, the receiver needs to send a separate acknowledgment frame (ACK frame) to the sender after successfully receiving data, which increases communication overhead. To reduce this overhead, this embodiment employs a piggybacking acknowledgment method. Specifically, after successfully receiving data from the sender, the receiver does not send a separate acknowledgment frame. Instead, it appends an acknowledgment bit (e.g., a one-bit ACK flag) to the feedback data frame that it is about to send to the sender, such as at the end of the feedback data frame. In this way, the acknowledgment information shares the same data frame with normal data transmission, effectively reducing the consumption of communication bandwidth.
[0079] After sending data, the sender can use hardware resources to save the response data in a non-blocking manner and check the response in the next cycle to complete the confirmation.
[0080] Specifically, after sending data, the sender does not block and wait for the receiver's acknowledgment; instead, it immediately returns and continues executing other tasks. The sender utilizes the ECU's internal hardware resources (such as a direct memory access (DMA) controller and interrupt controller) to automatically save the received acknowledgment data. Because this process is completed automatically by hardware, the CPU does not need to actively poll or wait, thus achieving non-blocking acknowledgment saving. In the next communication cycle or task cycle, the sender checks the acknowledgment data in the memory buffer to confirm whether the previously sent data has been successfully received by the receiver. If the confirmation is successful, the corresponding transmission record is cleared; if the confirmation fails or no acknowledgment is received, subsequent processing is performed according to the aforementioned differentiated retransmission control rules. This non-blocking design ensures that the communication process will not be halted due to waiting for acknowledgment, thus logically not constituting additional delay caused by the acknowledgment mechanism.
[0081] This embodiment employs a piggybacking response method, attaching the acknowledgment bit to the end of the feedback data frame and returning it to the sender, effectively reducing the additional communication overhead caused by the acknowledgment mechanism. Simultaneously, the sender utilizes hardware resources to store the acknowledgment data in a non-blocking manner, eliminating the need for blocking and waiting, and checks the acknowledgment in the next cycle to complete the confirmation. This achieves a non-blocking communication process, ensuring that communication efficiency is not affected by acknowledgment waiting, and further improving the overall performance of internal communication within the ECU.
[0082] In one implementation, the virtual transport layer completes static configuration based on hardware configuration parameters before the communication link is established; the hardware configuration parameters include at least one of communication pin mapping, device address configuration, and communication baud rate configuration.
[0083] Before the communication link is formally established, the virtual transport layer needs to be statically configured based on hardware configuration parameters during the system power-on initialization phase. Static configuration means that these parameters are set once when the system starts up and remain unchanged throughout the entire operating cycle.
[0084] By using static configuration based on hardware configuration parameters, the virtual transport layer obtains all the necessary hardware information during construction, enabling it to correctly drive the physical communication interface in subsequent communication management. Static configuration avoids the complexity of dynamically modifying communication parameters during runtime, improving system stability and reliability, while also complying with functional safety standards requiring communication parameters to remain immutable during operation.
[0085] This embodiment pre-constructs the virtual transport layer by statically configuring it based on hardware configuration parameters before establishing the communication link, ensuring that the virtual transport layer has correct hardware communication capabilities from the time of construction. The hardware configuration parameters remain unchanged during operation, guaranteeing the stability and reliability of communication.
[0086] In one implementation, before the virtual transport layer executes the transport management strategy, it may further include: performing an initial handshake between the sender and receiver to confirm that the two communicating parties are in a communicable state and ready; if the initial handshake fails, the data transmission process is prohibited.
[0087] Before the virtual transport layer completes its pre-construction and is ready to execute transmission management policies, an initialization handshake process is required between the sending and receiving ends. The purpose of this handshake is to confirm that both devices at both ends of the communication link are powered on, initialized, and in a communicable state. Specifically, the sending end first sends a handshake request signal to the receiving end. Upon receiving this request, the receiving end, if ready, returns a handshake acknowledgment signal. After receiving the acknowledgment, the sending end confirms that the receiving end is ready, and then both parties enter the normal data transmission phase.
[0088] If the sending end does not receive a handshake response from the receiving end within the preset timeout period, or if the received response indicates that the receiving end is not ready, the initial handshake is considered to have failed. In this case, the virtual transport layer prohibits entry into the normal data transmission process and can trigger corresponding error handling procedures, such as logging errors, reporting communication failures to the application layer, or attempting to re-execute the handshake process. The initial handshake mechanism effectively avoids communication failures or data corruption caused by data transmission when one party is not ready, thus improving the system's robustness.
[0089] In one implementation, the communication management method within the electronic control unit may further include: verifying the transmitted data at the virtual transmission layer; preferentially using the check bit built into the internal chip of the electronic control unit for verification; if the internal chip does not have a check bit, controlling the addition of an independent check byte to the data frame.
[0090] The virtual transport layer verifies data before sending and / or after receiving it to detect errors during data transmission. Verification mechanisms are crucial for ensuring communication reliability, especially in automotive electronic environments where electromagnetic interference can cause data bit flipping; verification can promptly detect such errors.
[0091] The virtual transport layer prioritizes utilizing the hardware verification functions built into the internal chips of the ECU (such as the communication peripherals of the MCU). Many modern MCUs' SPI, I2C, or UART peripherals support hardware CRC (Cyclic Redundancy Check) or parity checks, which can be performed automatically without consuming CPU resources. If the internal chip provides a parity bit, the virtual transport layer directly configures and uses that hardware verification function.
[0092] If the internal chip lacks a check bit, or if the application layer requires a different check algorithm than the hardware check, the virtual transport layer will add a separate check byte to the data frame. For example, an 8-bit or 16-bit CRC check byte can be appended to the end of the data frame, calculated by the software during transmission and verified during reception.
[0093] Through this flexible verification method, the virtual transport layer can adapt to different hardware conditions and application requirements, ensuring the integrity of data during transmission, effectively detecting and preventing errors in data transmission, and further improving the reliability of communication.
[0094] Figure 4 This is a schematic diagram of the communication implementation process of the virtual transport layer disclosed in the embodiments of this application. The following is in conjunction with... Figure 4 Here is a specific example.
[0095] Encoding configuration (Phase A) is a static preparation phase before the communication link is established. Its purpose is to synchronize the configuration parameters of the sender and receiver, ensuring reliable and stable communication. Based on the configuration preparation in Phase A, the ECU enters initialization (Phase B) upon power-up. This involves the two communicating parties handshaking to establish communication, ensuring both sides are ready and the communication loop is closed. If the handshake fails to establish communication, the process will not proceed to the next stage. After successful initialization, the message sending phase begins. After message sending, the CRC checksum received from the receiver is verified (Phase C). If correct, the next message sending sequence begins; otherwise, it indicates a sending failure and enters the retransmission phase (Phase E). The retransmission mechanism prioritizes messages. Message sending utilizes interrupts for load rate control (Phase D) to prevent excessive communication bus load and frame loss. Simultaneously, message sending and receiving require response time control (Phase F) to monitor whether the entire sending and receiving link meets time constraints.
[0096] In summary, A (configuration) is the preparation before the ECU is powered on, B (initialization) is the initialization after power-on, and both stages are to ensure that the communication link is correct and normal. Message sending and receiving processing is the main process, C (verification) is a natural action accompanying sending and receiving, D (load control) and F (response control) are background monitoring mechanisms to prevent system communication overload, and E (retransmission) is exception handling for communication failures. By encapsulating this communication management (flow control, error correction, real-time performance) in steps A through F to form a virtual transmission layer, upper-layer applications only need to simply call the sending interface to achieve truly "transparent transmission".
[0097] For the foregoing method embodiments, in order to simplify the description, they are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, because according to this application, some steps can be performed in other orders or simultaneously. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0098] The methods described in the above-disclosed embodiments of this application are detailed in terms of their specific implementation methods. These methods can be implemented using various types of devices. Therefore, this application also discloses a device, and specific embodiments are given below for detailed explanation.
[0099] Figure 5 This is a schematic diagram of the internal communication management device of an electronic control unit disclosed in an embodiment of this application. See also... Figure 5 As shown, the internal communication management device 50 of the electronic control unit may include:
[0100] The virtual layer construction module 501 is used to build a virtual transmission layer on top of the physical communication interface inside the electronic control unit. The virtual transmission layer is independent of the application layer and is used to manage data transmission between chips inside the electronic control unit.
[0101] Priority allocation module 502 is used to allocate priorities based on the functional safety level or real-time requirements of the data to be transmitted.
[0102] The strategy execution module 503 is used to execute a unified transmission management strategy based on the priority; wherein the transmission management strategy includes: differentiated retransmission control when transmission fails, and real-time monitoring of communication load rate and buffering control of transmitted data based on priority when the load rate exceeds a set threshold.
[0103] This embodiment provides a unified logical management platform for internal communication within the electronic control unit (ECU) by pre-constructing a virtual transport layer independent of the application layer on top of the physical communication interface within the ECU. The solution implements differentiated retransmission control when data transmission fails, ensuring maximum accessibility of critical data with limited communication resources. Simultaneously, when the load rate exceeds a set threshold, low-priority and / or medium-priority data is buffered first, while high-priority data is transmitted first, effectively avoiding communication congestion under high load conditions. Through this solution, rational scheduling of internal communication resources within the ECU is achieved, ensuring reliable transmission of high-functional-safety-level and high-real-time-sensitivity data in complex communication environments, and overall improving the efficiency and reliability of internal communication within the ECU.
[0104] The specific implementation of the internal communication management device of the aforementioned electronic control unit and its various modules, as well as other possible implementations, can be found in the relevant sections of the method embodiments, and will not be repeated here.
[0105] The internal communication management device of any electronic control unit in the above embodiments includes a processor and a memory. The virtual layer construction module, priority division module, strategy execution module, etc. in the above embodiments are all stored in the memory as program modules, and the processor executes the above program modules stored in the memory to realize the corresponding functions.
[0106] The processor contains a kernel, which retrieves the corresponding program modules from memory. One or more kernels can be configured, and the processing of accessed data can be achieved by adjusting kernel parameters.
[0107] The memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0108] In an exemplary embodiment, a computer-readable storage medium is also provided, which can be directly loaded into the internal memory of a computer and contains software code. After being loaded and executed by the computer, the computer program can implement the steps shown in any embodiment of the above-described electronic control unit internal communication management method.
[0109] In an exemplary embodiment, a computer program product is also provided, which can be directly loaded into the internal memory of a computer and contains software code. After being loaded and executed by the computer, the computer program can implement the steps shown in any embodiment of the electronic control unit internal communication management method described above.
[0110] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since they correspond to the methods disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to the method section.
[0111] It should also be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0112] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0113] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A method for managing internal communication of an electronic control unit, characterized in that, include: Based on a pre-built virtual transmission layer, priorities are assigned according to the functional safety level or real-time requirements of the data to be transmitted. The virtual transmission layer is built on top of the physical communication interface inside the electronic control unit and is independent of the application layer. A unified transmission management strategy is executed based on the aforementioned priority. The transmission management strategy includes: differentiated retransmission control when transmission fails, and real-time monitoring of communication load rate and buffering control of transmitted data based on priority when the load rate exceeds a set load rate threshold.
2. The method according to claim 1, characterized in that, The prioritization based on the functional safety level or real-time requirements of the data to be transmitted includes: The data to be transmitted is divided into high priority, medium priority, and low priority; among them, the higher the functional safety level of the data, the higher the priority; and the higher the real-time requirement of the data, the higher the priority. The differentiated retransmission control includes: If the failed data transmission is high-priority data, retransmit the data within the current communication cycle; If the data that failed to be sent is medium-priority data, resend the data in the next communication cycle; If the data that failed to be sent was low-priority data, it will not be resent.
3. The method according to claim 2, characterized in that, The priority-based buffering control of transmitted data includes: Real-time monitoring of communication load rate; when the load rate exceeds the set load rate threshold, buffering control of transmitted data is performed based on the priority, wherein low-priority data and / or medium-priority data are buffered first. The method for calculating the communication load rate is adjusted according to the duplex mode of the physical communication interface; A load rate hysteresis comparison mechanism is introduced. When the load rate exceeds the first threshold, buffer control is activated, and when the load rate falls back to below the second threshold, buffer control is deactivated. The first threshold is greater than the second threshold.
4. The method according to claim 1, characterized in that, The method further includes a response time control step: For data with real-time requirements exceeding the real-time threshold, a synchronization mechanism is used for response processing, which directly triggers the operating system's event response. For data whose real-time requirements are no higher than the real-time threshold, an asynchronous mechanism is used for response processing, the data is stored in a queue and processed in the next task cycle.
5. The method according to claim 1, characterized in that, Also includes: Using the piggyback acknowledgment method, after receiving the data, the receiver attaches an acknowledgment bit to the feedback data frame and returns it to the sender; After sending data, the sender uses hardware resources to save the response data in a non-blocking manner and checks the response in the next cycle to complete the confirmation.
6. The method according to claim 1, characterized in that, Before the communication link is established, the virtual transport layer completes static configuration based on hardware configuration parameters; the hardware configuration parameters include at least one of communication pin mapping, device address configuration, and communication baud rate configuration.
7. The method according to claim 1, characterized in that, Before the virtual transport layer executes the transport management policy, the following is also included: Perform an initial handshake between the sender and receiver to confirm that both parties are in a communicable state and are ready to communicate. If the initial handshake fails, the data transmission process is prohibited.
8. The method according to claim 1, characterized in that, Also includes: The transmitted data is verified in the virtual transport layer; The verification is performed using the built-in verification bit of the chip inside the electronic control unit. If the internal chip does not have a check bit, an independent check byte is added to the data frame.
9. The method according to claim 1, characterized in that, The physical communication interface includes SPI, I2C, or UART interfaces.
10. An internal communication management device for an electronic control unit, characterized in that, include: A virtual layer construction module is used to build a virtual transmission layer on top of the physical communication interface inside the electronic control unit. The virtual transmission layer is independent of the application layer and is used to manage data transmission between chips inside the electronic control unit. The priority allocation module is used to prioritize data based on its functional safety level or real-time requirements. The strategy execution module is used to execute a unified transmission management strategy based on the priority; wherein the transmission management strategy includes: differentiated retransmission control when transmission fails, and real-time monitoring of communication load rate and buffering control of transmitted data based on priority when the load rate exceeds a set threshold.
