Communication protocol optimization method for multiprocessor communication system

By combining the hybrid communication method between CAN bus and SPI bus in a multiprocessor communication system, using historical data analysis and reinforcement learning optimization protocols, the real-time, reliability and resource efficiency problems in heterogeneous multi-core environments are solved, and efficient data transmission and system robustness are achieved.

CN120448324APending Publication Date: 2025-08-08ZHUHAI RADIANCE ELECTRIC
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202510492449.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-18
Publication Date
2025-08-08

AI Technical Summary

Technical Problem

Existing multiprocessor communication systems have insufficient real-time, reliability problems and high resource consumption in heterogeneous multi-core environments. Traditional communication protocols are difficult to dynamically adapt to the needs of different communication scenarios, resulting in limited communication delays, error detection capabilities and low resource efficiency.

Method used

The communication method combined with CAN bus and SPI bus is adopted to optimize the communication protocol through historical data analysis and reinforcement learning, and dynamically adjust the protocol parameters and error correction mechanism to achieve collaborative optimization of real-time, reliability and resource efficiency.

Benefits of technology

It improves the performance and reliability of multi-processor communication systems, reduces communication conflicts between cores, reduces end-to-end delays, improves data transmission efficiency and resource utilization, and adapts to the needs of different communication scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120448324A_ABST
    Figure CN120448324A_ABST
Patent Text Reader

Abstract

The invention provides a communication protocol optimization method for a multiprocessor communication system, which comprises the following steps of: constructing the multiprocessor communication system comprising a real-time core M3 and a logic core CORTX-A7, and setting an initial communication protocol; wherein the multiprocessor communication system adopts a communication mode of combining CAN bus communication and SPI bus communication; collecting historical communication data; based on the historical communication data, evaluating the performance of the initial communication protocol by using a data analysis algorithm; according to a performance evaluation result, an optimization strategy of a communication protocol is formulated by using an optimization algorithm, and an error correction mechanism is configured; and adjusting related parameters, rules and structures in the initial protocol according to an optimization strategy and an error correction mechanism so as to improve the performance and reliability of the multi-processor communication system. The method is suitable for the heterogeneous multi-core architecture of the real-time core and the logic core, and the system performance and reliability are improved by combining the communication mode of the CAN bus and the SPI bus.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of multi-processor communication, and in particular to a communication protocol optimization method for a multi-processor communication system. Background Art

[0002] With the rapid development of embedded systems and distributed computing, multi-processor communication systems are gaining widespread application in fields such as industrial automation, automotive electronics, and aerospace. These systems typically need to process real-time information (such as sensor data and control instructions) and file-based data (such as configuration files and log information), placing stringent demands on the real-time performance, reliability, and resource efficiency of communication protocols.

[0003] However, traditional communication protocols (such as CAN bus and SPI bus) have the following limitations in heterogeneous multi-core environments:

[0004] Insufficient real-time performance: The arbitration mechanism of the CAN bus and the clock synchronization method of the SPI bus may cause delays in high-priority data and fail to meet real-time requirements.

[0005] Reliability issues: Communication noise, electromagnetic interference, or hardware failures can easily cause data errors or loss, while traditional error correction mechanisms (such as simple retransmission) are inefficient and may increase bus load.

[0006] High resource consumption: Data interaction between heterogeneous cores requires frequent switching of communication modes, resulting in high CPU usage and increased power consumption, especially in resource-constrained embedded systems.

[0007] Furthermore, the CAN bus uses an event-triggered mechanism, making low-priority messages easily blocked by high-priority messages, resulting in delays in real-time information transmission. Error detection capabilities are limited (supporting only CRC checks), and error correction relies on upper-layer protocols, increasing communication overhead. The SPI bus operates in full-duplex mode, requiring strict clock synchronization. Clock deviations can lead to data misalignment or loss, and the lack of a built-in error recovery mechanism necessitates manual retransmission in the event of a transmission interruption, reducing system robustness.

[0008] Existing protocols are typically designed for a single communication scenario, making it difficult to simultaneously optimize real-time performance, reliability, and resource efficiency. For example, industrial control scenarios require low-latency, highly reliable communication, while in-vehicle networks require multi-node fault tolerance. Traditional protocols cannot dynamically adapt to these complex requirements.

[0009] Existing technologies have not yet solved the problem of collaborative optimization of real-time performance, reliability, and resource efficiency in heterogeneous multi-core communication systems, specifically including:

[0010] The lack of data-driven optimization methods for the CAN / SPI hybrid bus makes it difficult to dynamically adapt to different communication scenarios; the error correction mechanism and protocol parameters are not co-designed, resulting in low error recovery efficiency or high resource consumption; traditional optimization algorithms (such as genetic algorithms) have slow convergence speed and cannot meet real-time requirements.

[0011] Therefore, the present invention proposes a communication protocol optimization method for a multi-processor communication system based on historical data analysis and reinforcement learning. By dynamically adjusting protocol parameters and error correction mechanisms, the performance of the multi-processor communication system is improved, which has significant technical innovation and application value. Summary of the Invention

[0012] In response to the shortcomings of the existing technology, the present invention provides a communication protocol optimization method for a multi-processor communication system. This method is applicable to a heterogeneous multi-core architecture of real-time cores (such as ARM Cortex-M3) and logic cores (such as ARM Cortex-A7). By combining the communication modes of the CAN bus and the SPI bus, the system performance and reliability are improved.

[0013] The present invention achieves the above-mentioned purpose through the following technical solutions:

[0014] A communication protocol optimization method for a multi-processor communication system comprises the following steps:

[0015] Construct a multi-processor communication system including a real-time core M3 and a logic core CORTX-A7, and set an initial communication protocol; wherein the multi-processor communication system adopts a communication method combining CAN bus communication and SPI bus communication;

[0016] Collect historical communication data, the historical communication data including at least the amount of data transmitted, the transmission time, and the amount of error data transmitted through the CAN bus and the SPI bus in different communication scenarios and different time periods;

[0017] Based on the historical communication data, evaluating the performance of the initial communication protocol using a data analysis algorithm;

[0018] Based on the results of the performance evaluation, an optimization algorithm is used to formulate an optimization strategy for the communication protocol and configure an error correction mechanism; wherein the error correction mechanism includes a data retransmission mechanism and an error detection and correction coding mechanism. The data retransmission mechanism determines a retransmission strategy based on the error type and retransmission threshold. The error detection and correction coding mechanism uses a coding algorithm to encode and decode data to achieve error detection and correction.

[0019] According to the optimization strategy and error correction mechanism, relevant parameters, rules and structures in the initial protocol are adjusted to improve the performance and reliability of the multi-processor communication system.

[0020] According to a communication protocol optimization method for a multi-processor communication system provided by the present invention, the multi-processor communication system including a real-time core M3 and a logic core CORTX-A7 is constructed, including:

[0021] Select a microcontroller chip with a real-time core M3 and a logic core CORTX-A7. This chip has hardware interfaces that support CAN bus communication and SPI bus communication. Connect the CAN bus interface of the microcontroller chip to an external CAN bus network through a CAN transceiver to enable data exchange with other devices that support CAN communication. Connect the SPI bus interface of the microcontroller chip to a storage device or other peripheral device for file data transmission.

[0022] Configure a real-time operating system in the real-time core M3 and allocate a memory area for the real-time core M3 to cache real-time interaction information; set the interrupt priority of the real-time core M3 and process and forward it accordingly according to preset rules;

[0023] The logic processing program running in the logic core CORTX-A7 is used to manage the transmission and control of file-related data. The logic core CORTX-A7 is equipped with large-capacity memory and storage resources. The control program of the logic core CORTX-A7 is written so that it can control the transmission process of file data through the SPI bus based on the file transfer control signals received on the CAN bus, and perform file name verification and confirmation after the transmission is completed.

[0024] According to the present invention, a communication protocol optimization method for a multi-processor communication system is provided. When setting the initial communication protocol, physical memory DDR is allocated and divided into a transmit virtual ring buffer (TXVring Buffer) and a receive virtual ring buffer (RXVring Buffer). The M3 core sends data from the TXVring area and reads received data from the RXVring area, and the CORTX-A7 core sends data from the RXVring area and reads received data from the TXVring area. MU transmission units are configured to communicate and coordinate by transmitting messages through the MUs, thereby enabling bidirectional message transmission between multiple MU groups.

[0025] According to a communication protocol optimization method for a multi-processor communication system provided by the present invention, on the CORTX-A7 core, open, write and read function interfaces are provided for calling device files under / dev to realize communication with the M3 core; on the M3 core, rpmsg_lite_remote_init, rpmsg_lite_send and rpmsg_queue_recv function interfaces are provided for realizing communication with the CORTX-A7 core.

[0026] According to the present invention, a communication protocol optimization method for a multi-processor communication system is provided, wherein the multi-processor communication system adopts a communication mode combining CAN bus communication and SPI bus communication, including:

[0027] Real-time interactive information is transmitted in real time via the CAN bus. In CAN bus communication, high priority is assigned to real-time information, and the arbitration mechanism of the CAN bus ensures that such information is sent and received first.

[0028] According to a communication protocol optimization method for a multi-processor communication system provided by the present invention, when file-type data needs to be transmitted, the CAN bus is only used to transmit control signals of the file-type data, including the following steps:

[0029] The microcontroller chip sends an nth file transmission start instruction including a file number via the CAN bus, and then continues to transmit data with high real-time performance via the CAN bus.

[0030] After sending the file transfer start command, the microcontroller chip starts the transmission of file data through the SPI bus, and transmits the file data from the microcontroller chip to the CORTX-A7 core.

[0031] After the file data is transmitted, the microcontroller chip sends an nth file transmission end instruction containing the file number through the CAN bus.

[0032] Among them, after receiving the file transfer end instruction, the CORTX-A7 core verifies the received file, including file name verification and data integrity verification; after the verification passes, the CORTX-A7 core replies with a confirmation instruction to the microcontroller chip through the CAN bus, indicating that the file has been successfully received and verified.

[0033] According to a communication protocol optimization method for a multi-processor communication system provided by the present invention, the data retransmission mechanism includes:

[0034] During the file transfer process, if the CORTX-A7 core detects a file verification failure or a transmission error, it sends a retransmission request command to the microcontroller chip via the CAN bus;

[0035] After receiving the retransmission request instruction, the microcontroller chip retransmits the file data through the SPI bus until the CORTX-A7 core passes the verification and replies with a confirmation instruction.

[0036] According to a communication protocol optimization method for a multi-processor communication system provided by the present invention, historical communication data generated during the operation of the multi-processor communication system is collected, including at least communication timestamps, data packet sizes, transmission delays, packet loss rates, error rates, and communication types;

[0037] Preprocessing the collected historical communication data, including at least data cleaning, data normalization and data labeling;

[0038] Define key metrics for evaluating the performance of the initial communication protocol, including:

[0039] Real-time indicators: used to evaluate the transmission efficiency of real-time information;

[0040] Reliability index: used to evaluate the reliability and stability of communications;

[0041] Throughput index: used to evaluate the overall transmission capacity of the communication system;

[0042] Resource utilization indicators are used to evaluate the consumption of system resources by communication protocols.

[0043] According to a communication protocol optimization method for a multi-processor communication system provided by the present invention, an ensemble learning algorithm combined with time series analysis is used to evaluate the performance of an initial communication protocol, including:

[0044] Extract key features from pre-processed historical communication data and construct derived features;

[0045] The dataset is divided into training and test sets. A random forest or gradient boosting tree algorithm is used, with performance evaluation metrics as target variables, to train the model to learn the mapping relationship between communication data and performance.

[0046] Model the time series of communication data, use the time series model to identify periodic changes, trend changes, and abnormal fluctuations in communication performance, and combine the time series analysis results to evaluate the stability and adaptability of the communication protocol.

[0047] According to a communication protocol optimization method for a multi-processor communication system provided by the present invention, the optimization strategy adopts a strategy combining reinforcement learning with multi-objective optimization, specifically comprising the following steps:

[0048] Build a reinforcement learning framework: Define an intelligent agent responsible for determining communication protocol parameters and error correction mechanisms; build an environmental model to simulate or actually operate the communication system and provide real-time performance feedback; design a multi-objective reward function to comprehensively evaluate transmission efficiency, reliability, and resource consumption as the agent's optimization goals;

[0049] Multi-objective optimization goal setting, including:

[0050] Minimize transmission delay: Reduce end-to-end communication delay by optimizing packet size and transmission rate;

[0051] Maximize transmission reliability: Dynamically adjust the coding rate and retransmission strategy to reduce packet loss and bit error rates;

[0052] Minimize resource consumption: Balance coding overhead, retransmission times, and power control to reduce system energy consumption and bandwidth usage;

[0053] Among them, according to the channel conditions, load changes and error patterns, the communication protocol parameters and error correction mechanism are adjusted in real time to achieve adaptive optimization; the lightweight error correction mechanism is used first in light error scenarios, and the strong error correction mechanism is enabled in heavy error scenarios.

[0054] It can be seen that compared with the prior art, the present invention has the following beneficial effects:

[0055] The present invention realizes the parallel processing of real-time data (such as sensor information) and file-type data (such as configuration files) by combining the collaborative work of the real-time core M3 and the logic core CORTX-A7, and combining the hybrid communication mode of the CAN bus and the SPI bus, thereby reducing inter-core communication conflicts and end-to-end latency.

[0056] This invention utilizes a partitioned design of a transmit virtual ring buffer (TXVring) and a receive virtual ring buffer (RXVring). The M3 core and the CORTX-A7 core efficiently exchange data through the MU transfer unit, avoiding the lock contention issues associated with traditional shared memory access and improving data transmission efficiency. The real-time M3 core is equipped with a high-priority interrupt handling mechanism to ensure that critical real-time tasks (such as control instructions) are prioritized, reducing the impact of low-priority tasks (such as file transfers) on real-time performance.

[0057] This invention dynamically adjusts the retransmission strategy based on error type (e.g., random errors, burst errors) and retransmission thresholds, avoiding resource waste or delay accumulation caused by a fixed number of retransmissions and improving the retransmission success rate. It uses advanced coding algorithms such as LDPC and Turbo codes to encode and decode data, enabling error detection and correction, effectively reducing the bit error rate of the CAN and SPI buses, and excels in electromagnetic interference environments.

[0058] The present invention uses physical memory DDR partitioning (TXVring / RXVring) in conjunction with the MU transmission unit to achieve efficient data caching and transmission, avoiding memory fragmentation and redundant data copying, and reducing system energy consumption. The present invention provides streamlined function interfaces (such as rpmsg_lite_send for the M3 core and write for the CORTX-A7 core), reducing communication protocol stack overhead and improving resource utilization.

[0059] This system, through the collaborative work of the real-time core M3 and the logic core CORTX-A7, adapts to diverse scenarios, such as industrial control (which requires high real-time performance) and in-vehicle networks (which require high reliability). It balances performance and reliability by dynamically adjusting protocol parameters (such as transmission rate and retransmission threshold). Based on historical data analysis of different communication scenarios, it identifies communication bottlenecks and error patterns, generates targeted optimization strategies, and improves system robustness.

[0060] This invention combines the arbitration mechanism of the CAN bus with the full-duplex communication of the SPI bus, balancing the flexibility of multi-node communication with the stability of high-speed data transmission. It also combines historical communication data analysis with reinforcement learning algorithms to achieve dynamic optimization of communication protocol parameters, overcoming the limitations of traditional static protocol design.

[0061] In summary, this invention provides a new paradigm for communication protocol design in heterogeneous multi-core systems by building a collaborative communication framework between real-time and logic cores and supporting efficient interaction over a hybrid CAN / SPI bus. The collaborative design of heterogeneous multi-core architecture, hybrid bus communication, data-driven optimization, and adaptive error correction mechanisms significantly improves the performance, reliability, and resource efficiency of multi-processor communication systems, demonstrating significant technological innovation and broad application prospects.

[0062] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0063] Figure 1 The present invention is a flowchart of a method for optimizing a communication protocol for a multi-processor communication system.

[0064] Figure 2 It is a schematic diagram of a multi-processor communication system in an embodiment of a communication protocol optimization method for a multi-processor communication system according to the present invention. DETAILED DESCRIPTION

[0065] To make the objectives, technical solutions, and advantages of the present invention more clear, the technical solutions of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the embodiments described are only some of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the present invention.

[0066] References to "embodiments" herein mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present application. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute an independent or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.

[0067] See also Figure 1 and Figure 2 This embodiment provides a communication protocol optimization method for a multi-processor communication system, the method comprising the following steps:

[0068] Step S1, constructing a multi-processor communication system including the real-time core M3 and the logic core CORTX-A7, and setting an initial communication protocol; wherein the multi-processor communication system adopts a communication method combining CAN bus communication and SPI bus communication;

[0069] Step S2, collecting historical communication data, which at least includes the amount of transmitted data, transmission time, and error data volume transmitted through the CAN bus and SPI bus in different communication scenarios and different time periods; wherein the amount of transmitted data includes the specific number of bytes of real-time interactive information and file data, the transmission time is the start and end time difference of each communication, and the error data volume is the number of data bytes with errors during the transmission process.

[0070] Step S3, based on historical communication data, use a data analysis algorithm to evaluate the performance of the initial communication protocol; wherein, by analyzing the distribution pattern, correlation and change trend of the amount of transmitted data, transmission time and amount of error data in the historical communication data, the performance of the initial communication protocol in terms of transmission efficiency, real-time guarantee, stability and reliability is evaluated. Specific evaluation indicators include average transmission delay, maximum transmission delay, error rate and throughput.

[0071] Step S4: Based on the results of the performance evaluation, an optimization algorithm is used to formulate an optimization strategy for the communication protocol and configure an error correction mechanism. The optimization algorithm may be a genetic algorithm, a particle swarm optimization algorithm, or a simulated annealing algorithm. The optimization strategy is formulated by searching for the optimal combination of communication protocol parameters, rules, and structures. The error correction mechanism includes a data retransmission mechanism and an error detection and correction coding mechanism. The data retransmission mechanism determines a retransmission strategy based on an error type and a retransmission threshold. The error detection and correction coding mechanism uses a coding algorithm to encode and decode data to achieve error detection and correction.

[0072] In step S5, the relevant parameters, rules, and structures of the initial protocol are adjusted based on the optimization strategy and error correction mechanism to improve the performance and reliability of the multi-processor communication system. Specifically, adjustments include the communication protocol's frame format, transmission rate, priority allocation rules, data caching strategy, and the coordination mechanism between different buses.

[0073] In the above step S1, a multi-processor communication system including the real-time core M3 and the logic core CORTX-A7 is constructed, including:

[0074] A microcontroller chip with a real-time core M3 and a logic core CORTX-A7 is selected. The chip has a hardware interface that supports CAN bus communication and SPI bus communication; the CAN bus interface of the microcontroller chip is connected to the external CAN bus network through a CAN transceiver to realize data interaction with other devices that support CAN communication; the SPI bus interface of the microcontroller chip is connected to a storage device or other peripheral device for file data transmission.

[0075] A real-time operating system is configured in the real-time core M3 to process interactive information with high real-time requirements, such as telesignaling, telemetry, remote control, and SOE. A memory area is allocated to the real-time core M3 to cache real-time interactive information to ensure rapid data processing and response. The interrupt priority of the real-time core M3 is set so that it can promptly process the real-time interactive information received on the CAN bus and perform corresponding processing and forwarding according to preset rules.

[0076] Among them, the logic processing program running in the logic core CORTX-A7 is used to manage the transmission and control of file-type data; the logic core CORTX-A7 is configured with large-capacity memory and storage resources; and the control program of the logic core CORTX-A7 is written so that it can control the transmission process of file data through the SPI bus based on the file transfer control signal received on the CAN bus, and perform file name verification and confirmation reply after the transmission is completed.

[0077] Among them, the CAN bus interface is initialized and set up, including the configuration of parameters such as baud rate, working mode, filter, etc., to ensure that the CAN bus can transmit data stably and reliably;

[0078] Among them, the SPI bus interface is initialized and set, including the configuration of parameters such as clock polarity, clock phase, and data transmission mode to meet the requirements of file-type data transmission.

[0079] When setting the initial communication protocol, physical memory DDR is allocated and divided into a transmit virtual ring buffer (TXVring Buffer) and a receive virtual ring buffer (RXVring Buffer). The M3 core sends data from the TXVring area and reads received data from the RXVring area, while the CORTX-A7 core sends data from the RXVring area and reads received data from the TXVring area. An MU transfer unit is configured to communicate and coordinate via MU transfer messages, enabling multiple groups of MU bidirectional message transfers. This embodiment supports up to four groups of MU bidirectional message transfers, which can notify each other of data transfer status via interrupts, send up to 4 bytes of data, and wake up each other in low-power mode.

[0080] On the CORTX-A7 core, the RPMsg framework and Virtio driver model were used, encapsulating RPMsg as a tty file for application layer calls. On the M3 core, Virtio was ported and a simplified version of RPMsg was used. Because of the mutexes and semaphores involved, FreeRTOS was ultimately used to complete the encapsulation process. Finally, the data transfer process between the main processing core and the coprocessor core was implemented, including steps such as data packaging, shared memory cache management, interrupt notification, and data reception and confirmation.

[0081] On the CORTX-A7 core, the open, write, and read function interfaces are provided for calling device files under / dev to realize communication with the M3 core; on the M3 core, the rpmsg_lite_remote_init, rpmsg_lite_send, and rpmsg_queue_recv function interfaces are provided for realizing communication with the CORTX-A7 core.

[0082] In the above step S1, the multi-processor communication system adopts a communication method combining CAN bus communication and SPI bus communication, including:

[0083] For interactive information with high real-time requirements, including telesignaling, telemetry, remote control and SOE (Sequence of Events) data, real-time transmission is carried out through the CAN bus. In CAN bus communication, high priority is assigned to real-time information, and the arbitration mechanism of the CAN bus is used to ensure the priority sending and receiving of such information.

[0084] When file-type data needs to be transmitted, the CAN bus is only used to transmit the control signal of the file-type data, including the following steps:

[0085] The microcontroller chip sends an nth file transmission start instruction including a file number via the CAN bus, and then continues to transmit data with high real-time performance via the CAN bus.

[0086] After sending the file transfer start command, the microcontroller chip starts the transmission of file data through the SPI bus, and transmits the file data from the microcontroller chip to the CORTX-A7 core.

[0087] After the file data is transmitted, the microcontroller chip sends an nth file transmission end instruction containing the file number through the CAN bus.

[0088] After receiving the file transfer completion command, the CORTX-A7 core verifies the received file, including file name verification and data integrity verification. If the verification passes, the CORTX-A7 core sends a confirmation command to the microcontroller chip via the CAN bus, indicating that the file has been successfully received and verified. The coordinated operation of the CAN bus and the SPI bus enables efficient and reliable transmission of real-time information and file data.

[0089] Specifically, this embodiment utilizes a combined CAN bus and SPI bus communication method. This is because the communication data types are diverse, including interactive information with high real-time requirements, such as telesignaling, telemetry, remote control, and SOO. File-based data is also uploaded, most commonly waveform recording files and historical record files. During multi-processor communication, if files occupy too much communication time, this can impact the transmission of information requiring high real-time performance. Furthermore, file transfers are unidirectional. Therefore, a combined CAN bus and SPI bus communication method is employed. Interactive information requiring high real-time performance is exchanged in real time via the CAN bus. For file-based data, CAN communication only needs to transmit control signals for the file data. When a "transfer file" task is activated, CAN communication sends a file transfer start command (number n), followed by the transmission of high-performance data. The MCU's SPI begins transferring the file data. Upon completion, the MCU sends a file transfer end command (number n) via the CAN communication channel. After verifying the file name, the CORTX-A7 responds with a confirmation command via the CAN communication channel.

[0090] In the above steps S2 and S3, historical communication data generated during the operation of the multi-processor communication system is collected, including at least communication timestamps, data packet sizes, transmission delays, packet loss rates, error rates, and communication types (real-time information or file-type data);

[0091] Preprocess the collected historical communication data, including at least data cleaning (removing noise and outliers), data normalization (unifying data of different dimensions into the same range), and data labeling (marking communication success or failure status);

[0092] Define key metrics for evaluating the performance of the initial communication protocol, including:

[0093] Real-time indicators: such as average transmission delay, maximum transmission delay, and delay jitter, used to evaluate the transmission efficiency of real-time information;

[0094] Reliability indicators: such as packet loss rate, error rate, and retransmission rate, used to evaluate the reliability and stability of communications;

[0095] Throughput indicators: such as the amount of data transmitted per unit time, used to evaluate the overall transmission capacity of the communication system;

[0096] Resource utilization indicators, such as CPU usage and memory usage, are used to evaluate the consumption of system resources by communication protocols.

[0097] When evaluating the performance of the initial communication protocol, an ensemble learning algorithm combined with time series analysis is used, including:

[0098] Extract key features from preprocessed historical communication data, including communication timestamp, packet size, transmission delay, packet loss rate, error rate, and communication type; construct derived features such as delay jitter and throughput to more comprehensively reflect communication performance;

[0099] Divide the dataset into training and test sets to ensure consistency in data distribution to support model training and validation;

[0100] Using random forest or gradient boosting tree algorithms, with performance evaluation indicators (such as average transmission delay, packet loss rate, etc.) as target variables, the model is trained to learn the mapping relationship between communication data and performance.

[0101] Model the time series of communication data, use time series models such as ARIMA and LSTM to identify periodic changes, trend changes, and abnormal fluctuations in communication performance, and combine the time series analysis results to evaluate the stability and adaptability of the communication protocol.

[0102] In the above step S4, the optimization strategy adopts a strategy combining reinforcement learning with multi-objective optimization, which specifically includes the following steps:

[0103] Build a reinforcement learning framework: Define an agent responsible for deciding communication protocol parameters (such as packet size, transmission rate, retransmission strategy, etc.) and error correction mechanisms; build an environmental model to simulate or actually operate the communication system and provide real-time performance feedback (such as latency, packet loss rate, and bit error rate); design a multi-objective reward function to comprehensively evaluate transmission efficiency, reliability, and resource consumption as the agent's optimization goals;

[0104] Multi-objective optimization goal setting, including:

[0105] Minimize transmission delay: Reduce end-to-end communication delay by optimizing packet size and transmission rate;

[0106] Maximize transmission reliability: Dynamically adjust the coding rate and retransmission strategy to reduce packet loss and bit error rates;

[0107] Minimize resource consumption: Balance coding overhead, retransmission times, and power control to reduce system energy consumption and bandwidth usage;

[0108] Among them, according to the channel conditions, load changes and error patterns, the communication protocol parameters and error correction mechanism are adjusted in real time to achieve adaptive optimization; the lightweight error correction mechanism is used first in light error scenarios, and the strong error correction mechanism is enabled in heavy error scenarios.

[0109] The protocol parameters and error correction mechanisms are used as the joint action space for reinforcement learning, achieving global optimization through end-to-end training. Optimization is performed separately at the protocol layer and the physical layer, and a cross-layer feedback mechanism works together to improve overall communication performance.

[0110] In the above step S4, the data retransmission mechanism includes:

[0111] During the file transfer process, if the CORTX-A7 core detects a file verification failure or a transmission error, it sends a retransmission request command to the microcontroller chip via the CAN bus;

[0112] After receiving the retransmission request instruction, the microcontroller chip retransmits the file data through the SPI bus until the CORTX-A7 core passes the verification and replies with a confirmation instruction.

[0113] In step S4 above, the error detection and correction coding mechanism uses low-density parity-check codes (LDPC codes) to encode and decode data to achieve error detection and correction. Specifically, based on a preset LDPC code check matrix, the data to be transmitted is mapped into codewords, and check bits are generated through linear transformation of the check matrix. The check bits are then appended to the original data to form a coded data packet. The receiving end uses the belief propagation (BP) algorithm or the minimum sum (Min-Sum) algorithm to perform iterative decoding based on the received coded data packet and the same LDPC code check matrix, and detects and corrects erroneous bits in transmission through the check equation. Based on the error rate statistics of the communication scenario or real-time channel state information, the code rate, check matrix structure, or number of iterations of the LDPC code are dynamically adjusted to optimize the balance between error correction performance and resource consumption.

[0114] In summary, this embodiment achieves parallel processing of real-time data (such as sensor information) and file-type data (such as configuration files) through the collaborative work of the real-time core M3 and the logic core CORTX-A7, combined with a hybrid communication mode of the CAN bus and the SPI bus, thereby reducing inter-core communication conflicts and lowering end-to-end latency.

[0115] Furthermore, this embodiment utilizes a partitioned design for the transmit virtual ring buffer (TXVring) and receive virtual ring buffer (RXVring). The M3 core and the CORTX-A7 core efficiently exchange data through the MU transfer unit, avoiding lock contention issues associated with traditional shared memory access and improving data transmission efficiency. The real-time M3 core is equipped with a high-priority interrupt handling mechanism to ensure that critical real-time tasks (such as control instructions) receive priority, reducing the impact of low-priority tasks (such as file transfers) on real-time performance.

[0116] Furthermore, this embodiment dynamically adjusts the retransmission strategy based on error type (e.g., random error, burst error) and retransmission threshold, avoiding resource waste or delay accumulation caused by a fixed number of retransmissions and improving the retransmission success rate. Advanced coding algorithms such as LDPC and Turbo codes are used to encode and decode data, enabling error detection and correction, effectively reducing the bit error rate on the CAN and SPI buses, particularly in electromagnetic interference environments.

[0117] Furthermore, this embodiment uses physical memory DDR partitioning (TXVring / RXVring) in conjunction with the MU transmission unit to achieve efficient data caching and transmission, avoiding memory fragmentation and redundant data copying, and reducing system energy consumption. This embodiment provides streamlined function interfaces (such as rpmsg_lite_send for the M3 core and write for the CORTX-A7 core), reducing communication protocol stack overhead and improving resource utilization.

[0118] Furthermore, this embodiment, through the division of labor and collaboration between the real-time core M3 and the logic core CORTX-A7, adapts to diverse scenarios such as industrial control (with high real-time requirements) and in-vehicle networks (with high reliability requirements). Dynamically adjusting protocol parameters (such as transmission rate and retransmission threshold) achieves a balance between performance and reliability. Based on historical data analysis of different communication scenarios, communication bottlenecks and error patterns are identified, and targeted optimization strategies are generated to improve system robustness.

[0119] Furthermore, this embodiment combines the arbitration mechanism of the CAN bus with the full-duplex communication of the SPI bus, balancing the flexibility of multi-node communication with the stability of high-speed data transmission. This embodiment combines historical communication data analysis with reinforcement learning algorithms to achieve dynamic optimization of communication protocol parameters, breaking through the limitations of traditional static protocol design.

[0120] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0121] The above embodiments are only preferred embodiments of the present invention and cannot be used to limit the scope of protection of the present invention. Any non-substantial changes and replacements made by technicians in this field on the basis of the present invention fall within the scope of protection required by the present invention.

Claims

1. A communication protocol optimization method for a multi-processor communication system, characterized in that: The following steps are involved: Construct a multi-processor communication system including a real-time core M3 and a logic core CORTX-A7, and set an initial communication protocol; wherein the multi-processor communication system adopts a communication method combining CAN bus communication and SPI bus communication; Collect historical communication data, the historical communication data including at least the amount of data transmitted, the transmission time, and the amount of error data transmitted through the CAN bus and the SPI bus in different communication scenarios and different time periods; Based on the historical communication data, evaluating the performance of the initial communication protocol using a data analysis algorithm; Based on the results of the performance evaluation, an optimization algorithm is used to formulate an optimization strategy for the communication protocol and configure an error correction mechanism; wherein the error correction mechanism includes a data retransmission mechanism and an error detection and correction coding mechanism. The data retransmission mechanism determines a retransmission strategy based on the error type and retransmission threshold. The error detection and correction coding mechanism uses a coding algorithm to encode and decode data to achieve error detection and correction. According to the optimization strategy and error correction mechanism, relevant parameters, rules and structures in the initial protocol are adjusted to improve the performance and reliability of the multi-processor communication system.

2. The method according to claim 1, characterized in that The multi-processor communication system comprising the real-time core M3 and the logic core CORTX-A7 is constructed, including: Select a microcontroller chip with a real-time core M3 and a logic core CORTX-A7. This chip has hardware interfaces that support CAN bus communication and SPI bus communication. Connect the CAN bus interface of the microcontroller chip to an external CAN bus network through a CAN transceiver to enable data exchange with other devices that support CAN communication. Connect the SPI bus interface of the microcontroller chip to a storage device or other peripheral device for file data transmission. Configure a real-time operating system in the real-time core M3 and allocate a memory area for the real-time core M3 to cache real-time interaction information; set the interrupt priority of the real-time core M3 and process and forward it accordingly according to preset rules; The logic processing program running in the logic core CORTX-A7 is used to manage the transmission and control of file-related data. The logic core CORTX-A7 is equipped with large-capacity memory and storage resources. The control program of the logic core CORTX-A7 is written so that it can control the transmission process of file data through the SPI bus based on the file transfer control signals received on the CAN bus, and perform file name verification and confirmation after the transmission is completed.

3. The method according to claim 1, wherein: When setting the initial communication protocol, physical memory DDR is allocated and divided into a transmit virtual ring buffer (TXVringBuffer) and a receive virtual ring buffer (RXVringBuffer). The M3 core sends data from the TXVring area and reads received data from the RXVring area, while the CORTX-A7 core sends data from the RXVring area and reads received data from the TXVring area. MU transmission units are configured to communicate and coordinate by transmitting messages through them, enabling bidirectional message transmission between multiple MU groups.

4. The method according to claim 3, wherein: On the CORTX-A7 core, the open, write, and read function interfaces are provided for calling device files under / dev to realize communication with the M3 core; on the M3 core, the rpmsg_lite_remote_init, rpmsg_lite_send, and rpmsg_queue_recv function interfaces are provided for realizing communication with the CORTX-A7 core.

5. The method according to claim 1, wherein The multi-processor communication system adopts a communication method combining CAN bus communication and SPI bus communication, including: Real-time interactive information is transmitted in real time through the CAN bus. In CAN bus communication, high priority is assigned to real-time information, and the arbitration mechanism of the CAN bus ensures that such information is sent and received first.

6. The method according to claim 5, characterized in that: When file-type data needs to be transmitted, the CAN bus is only used to transmit the control signal of the file-type data, including the following steps: The microcontroller chip sends a file transfer start instruction No. n including the file number via the CAN bus, and then continues to transmit data with high real-time requirements via the CAN bus; After sending the file transfer start command, the microcontroller chip starts the file data transmission via the SPI bus, and transfers the file data from the microcontroller chip to the CORTX-A7 core; After the file data is transferred, the microcontroller chip sends a file transfer end instruction No. n containing the file number via the CAN bus; Among them, after receiving the file transfer end instruction, the CORTX-A7 core verifies the received file, including file name verification and data integrity verification; after the verification passes, the CORTX-A7 core replies with a confirmation instruction to the microcontroller chip through the CAN bus, indicating that the file has been successfully received and verified.

7. The method according to claim 5, characterized in that: The data retransmission mechanism includes: During the file transfer process, if the CORTX-A7 core detects a file verification failure or a transmission error, it sends a retransmission request command to the microcontroller chip via the CAN bus; After receiving the retransmission request instruction, the microcontroller chip retransmits the file data through the SPI bus until the CORTX-A7 core passes the verification and replies with a confirmation instruction.

8. The method according to claim 1, wherein: Collect historical communication data generated by the multi-processor communication system during operation, including at least communication timestamp, data packet size, transmission delay, packet loss rate, error rate and communication type; Preprocessing the collected historical communication data, including at least data cleaning, data normalization and data labeling; Define key metrics for evaluating the performance of the initial communication protocol, including: Real-time indicators: used to evaluate the transmission efficiency of real-time information; Reliability index: used to evaluate the reliability and stability of communications; Throughput index: used to evaluate the overall transmission capacity of the communication system; Resource utilization indicators are used to evaluate the consumption of system resources by communication protocols.

9. The method according to claim 8, characterized in that: When evaluating the performance of the initial communication protocol, an ensemble learning algorithm combined with time series analysis is used, including: Extract key features from pre-processed historical communication data and construct derived features; Divide the dataset into training and test sets, use the random forest or gradient boosting tree algorithm, use the performance evaluation index as the target variable, and train the model to learn the mapping relationship between communication data and performance; Model the time series of communication data, use the time series model to identify periodic changes, trend changes, and abnormal fluctuations in communication performance, and combine the time series analysis results to evaluate the stability and adaptability of the communication protocol.

10. The method according to any one of claims 1 to 9, characterized in that: The optimization strategy adopts a strategy of combining reinforcement learning with multi-objective optimization, which specifically includes the following steps: Build a reinforcement learning framework: Define an intelligent agent responsible for determining communication protocol parameters and error correction mechanisms; build an environmental model to simulate or actually operate the communication system and provide real-time performance feedback; design a multi-objective reward function to comprehensively evaluate transmission efficiency, reliability, and resource consumption as the agent's optimization goals; Multi-objective optimization goal setting, including: Minimize transmission delay: Reduce end-to-end communication delay by optimizing packet size and transmission rate; Maximize transmission reliability: Dynamically adjust the coding rate and retransmission strategy to reduce packet loss and bit error rates; Minimize resource consumption: Balance coding overhead, retransmission times, and power control to reduce system energy consumption and bandwidth usage; Among them, according to channel conditions, load changes and error patterns, communication protocol parameters and error correction mechanisms are adjusted in real time to achieve adaptive optimization; lightweight error correction mechanisms are used preferentially in light error scenarios, and strong error correction mechanisms are enabled in heavy error scenarios.

Citation Information

Cited By

  • Method and device for high-speed transmission of large files from PC (Personal Computer) to Android equipment based on serial port protocol

    CN121367697A