Inter-processor data interaction method of multi-core MCU and multi-core MCU system
By allocating independent and shared memory blocks to the processors of multi-core MCU systems and adopting address book broadcasting and announcement communication mechanisms, the problem of low data interaction efficiency between processors in multi-core MCU systems is solved, achieving stable and efficient data exchange and meeting the needs of efficient parallel processing.
Patent Information
- Application Number
- CN202611241354.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-08-17
- Publication Date
- 2026-11-10
- Estimated Expiration
- 2046-08-17
AI Technical Summary
In multi-core MCU systems, existing technologies lack efficient inter-processor data interaction mechanisms, which leads to a sharp increase in synchronization and communication overhead as the number of processor cores increases, resulting in a decline in system performance and an inability to meet the requirements of high-efficiency parallel processing.
Each processor is allocated an independent private memory block and a shared memory partition. Data interaction is carried out using a multiprocessor address book broadcast mechanism and an announcement communication mechanism. By creating a communication control block in the global shared memory block, orderly broadcasting and data exchange are achieved, avoiding data conflicts and competition.
It achieves stable and efficient data interaction, reduces communication latency and system overhead, improves system scalability and maintainability, avoids the phenomenon that the more processors there are, the slower the interaction becomes, and meets the requirements of complex systems for efficient parallel processing.
Smart Images

Figure CN122777472B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of inter-processor data interaction technology, specifically relating to an inter-processor data interaction method and a multi-core MCU system for a multi-core MCU. Background Technology
[0002] In modern embedded systems, such as the controller of a flywheel energy storage converter, multi-core microcontroller units (MCUs) are often used to work together to handle concurrent tasks with high real-time requirements, such as grid-connected control, motor control, communication, and protection. In a multi-core MCU architecture, different processor cores typically handle different computing and communication tasks. Understandably, this inevitably leads to a need for high-speed, large-scale data exchange between multiple processors.
[0003] Therefore, if the data interaction mechanism is poorly designed, the overhead for synchronization and communication will rise sharply with the increase in the number of processor cores, potentially leading to a decline in overall system performance. This can result in a situation where the more processors there are, the slower the interaction becomes, wasting multi-core processing power and failing to meet the high-efficiency parallel processing requirements of complex systems. Therefore, designing an efficient inter-processor data interaction mechanism is an urgent problem to be solved. Summary of the Invention
[0004] In order to overcome the shortcomings of the prior art, the present invention aims to provide a method for inter-processor data interaction of a multi-core MCU and a multi-core MCU system, so as to solve the problem of the lack of an efficient inter-processor data interaction mechanism in the prior art.
[0005] To achieve the above objectives, the present invention employs the following technical solution: In a first aspect, the present invention provides a method for inter-processor data interaction in a multi-core MCU, the multi-core MCU comprising N processors. The method includes: allocating an independent private memory block to each of the N processors, and allocating a shared memory partition to each processor within a global shared memory block of the multi-core MCU. Each processor has full read / write permissions to its allocated shared memory partition, and read-only permissions to shared memory partitions allocated to other processors. Each of the N processors creates at least one data area within its allocated shared memory partition, and stores metadata at the entry address of a first data area within the at least one data area. The metadata includes structural data and descriptive data describing the first data area. The first data area is at least one data area. Any data area within the shared memory partition; when a multi-core MCU is started, a multi-processor communication broadcast mechanism is used to control N processors to broadcast and receive broadcast confirmations. After the broadcasts by the N processors are completed, data interaction is performed through a multi-processor announcement communication mechanism. The multi-processor communication broadcast mechanism includes: controlling each of the N processors to broadcast in turn according to a preset broadcast order and preset broadcast method, controlling each of the N processors to record the broadcast content read, and receiving broadcast confirmations; the multi-processor announcement communication mechanism includes: controlling each of the N processors to publish data in at least one data area within its allocated shared memory partition, and reading at least one data area within the shared memory partition allocated to other processors; N is a positive integer.
[0006] Furthermore, the aforementioned inter-processor address book broadcasting mechanism is implemented through the following functions: setting a preset storage medium; performing specified encoding and encoding clearing operations on the preset storage medium; the inter-processor announcement communication mechanism is implemented through the following functions: setting read and write permissions for any of the N processors to the preset storage medium; and performing data reading and data writing on the preset storage medium.
[0007] Furthermore, in the aforementioned inter-processor address book broadcasting mechanism, each of the N processors has a unique broadcast code, which is used to identify the processor currently broadcasting. The inter-processor address book broadcasting mechanism includes a communication control block and a round-robin broadcasting method. The communication control block is a data structure defined in a global shared memory block, containing a broadcast code area, a metadata area, an address array area, and a status flag area. The round-robin broadcasting method is a broadcasting method in which the processor currently broadcasting initiates the broadcast in a preset broadcasting order, and the next processor to be broadcast confirms that the broadcast has been completed.
[0008] Furthermore, all N processors have rotating read and write permissions to the communication control block; the broadcast encoding area contains the broadcast encoding of the processor currently broadcasting; the metadata area contains the structural and descriptive data of the current broadcast content; the address array area contains the current broadcast content, which is the entry address of all data areas of the processor currently broadcasting; the status flag area includes the acknowledgment flag for each of the N processors, which is used to indicate whether the broadcast of its corresponding processor has been received by other processors.
[0009] Furthermore, the above-mentioned method determines that the current broadcast is ready when the broadcast code of the currently broadcasting processor is readable and its corresponding acknowledgment flag indicates that the broadcast has not been completed; and determines that the current broadcast has ended when the acknowledgment flag of the currently broadcasting processor indicates that the current broadcast has been received by another processor.
[0010] Furthermore, in the aforementioned round-robin broadcasting process, the execution content of the first processor in each round of broadcasting is as follows: reading the broadcast encoding area to identify the processor currently broadcasting; reading the metadata area to identify the structured data and descriptive data corresponding to the current broadcast content; reading the address array area and writing the acknowledgment flag corresponding to the first processor in the status flag area to indicate that the first processor has finished receiving the current broadcast content; wherein, the first processor is any processor among the N processors, excluding the processor currently broadcasting.
[0011] Furthermore, in the above-mentioned rotating broadcast method, the condition for determining the rotation is: the confirmation status flag area of the next processor to be broadcast in the preset broadcast order shows that all processors have finished receiving the current broadcast content.
[0012] Furthermore, each of the aforementioned N processors employs asynchronous operations when publishing data in at least one data area of its allocated shared memory partition or reading part or all of the data areas of other processors.
[0013] Secondly, the present invention also provides a multi-core MCU system, which includes N processors, private memory blocks corresponding one-to-one with the N processors, and a global shared memory block; the global shared memory block is divided into N shared memory partitions, each of which is allocated to one processor, and the N shared memory partitions correspond one-to-one with the N processors. Each processor has full read and write permissions for its allocated shared memory partitions and only read-only permissions for shared memory partitions allocated to other processors; each of the N processors is configured to: create at least one data area within its shared memory partition with full read and write permissions, and store metadata at the entry address of the first data area in the at least one data area. The metadata includes structural data and descriptive data describing the first data area, and the first data area is any number in the at least one data area. According to the data area; the multi-core MCU system also includes an inter-processor communication broadcast mechanism and an inter-processor announcement communication mechanism. N processors are configured to control the broadcasting and receiving of broadcasts through the inter-processor communication broadcast mechanism, and to exchange data through the inter-processor announcement communication mechanism after the broadcasts of the N processors are completed. The inter-processor communication broadcast mechanism includes: controlling each of the N processors to broadcast in turn according to a preset broadcast order and preset broadcast method, controlling each of the N processors to record the broadcast content read, and confirming the broadcast reception; the inter-processor announcement communication mechanism includes: controlling each of the N processors to publish data in at least one data area in its allocated shared memory partition, and to read at least one data area in the shared memory partition allocated to other processors; N is a positive integer.
[0014] Thirdly, the present invention also provides an electronic device including a processor and a memory, the memory storing a program or instructions executable on the processor, the program or instructions, when executed by the processor, implementing the steps of the method described in the first aspect.
[0015] Fourthly, the present invention also provides a readable storage medium on which a program or instructions are stored, which, when executed by a processor, implement the steps of the method described in the first aspect.
[0016] Fifthly, the present invention also provides a chip, the chip including a processor and a communication interface, the communication interface being coupled to the processor, the processor being used to run programs or instructions to implement the method as described in the first aspect.
[0017] In a sixth aspect, the present invention also provides a computer program product stored in a storage medium, which is executed by at least one processor to implement the method as described in the first aspect.
[0018] Compared with the prior art, the present invention has the following beneficial effects: On the one hand, by allocating independent private memory blocks and shared memory partitions with clear permissions (full read and write access for itself, read-only access for others) to each processor, the independence of each processor's core tasks and the security of its data are physically guaranteed. This avoids data conflicts and competition issues that may occur when multiple processors access data concurrently, laying the foundation for stable and efficient data interaction. On the other hand, by executing a multi-processor communication book broadcasting mechanism at the initial startup of the multi-core MCU, each processor can automatically and orderly broadcast and obtain the data area entry addresses of all other processors, forming a global data communication book. This achieves automatic discovery and synchronization of data locations without manual configuration, improving the system's scalability and maintainability. When processors or data areas in the system change, the broadcasting process can be re-executed to complete the update. Furthermore, after completing the address broadcasting, the system enters the multi-processor announcement communication mechanism stage. At this time, the data interaction between processors is simplified to direct memory read and write operations, i.e., one processor writes to its dedicated shared memory partition (publishes an announcement), and other processors directly read the partition as needed (view the announcement). This approach bypasses the complex IPC mechanisms based on traditional message queues or interrupts, reduces communication latency and system overhead, and enables high-speed, large-scale data exchange. This effectively solves the performance degradation problem caused by data interaction bottlenecks and avoids the phenomenon that the more processors there are, the slower the interaction becomes. Attached Figure Description
[0019] To more clearly illustrate the technical solutions in the embodiments of the present invention 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 some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is a flowchart of a data interaction method between processors in a multi-core MCU provided by the present invention; Figure 2 This is a schematic diagram of the multiprocessor memory allocation structure in a multi-core MCU provided by the present invention; Figure 3 This is a schematic diagram illustrating the working principle of an IPC mechanism provided by the present invention; Figure 4 This is a schematic diagram of a first processor broadcasting an IPC address according to the present invention; Figure 5 This is a schematic diagram of the process of broadcasting IPC addresses by the g-th processor provided by the present invention. Detailed Implementation
[0021] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0022] It should be noted that the terms "first," "second," etc., in the specification and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0023] The inter-processor data interaction method and multi-core MCU system provided by the present invention will be described in detail below with reference to the accompanying drawings, through specific embodiments and application scenarios.
[0024] The inter-processor data interaction method and multi-core MCU system provided by this invention can be applied to scenarios of independent / shared memory data interaction between multiple processors of multi-core MCUs in flywheel energy storage converters.
[0025] Before providing a more detailed description of the inter-processor data interaction method and multi-core MCU system provided by this invention, the terms and concepts used in this invention will be explained, and the terms and concepts used in this invention will be interpreted as follows.
[0026] (1) Multi-core MCU: refers to an integrated chip containing multiple independently running processors.
[0027] (2) Local Random Access Memory (LRAM): refers to an independent memory block allocated to each of the N processors for internal use by the processor, ensuring the privacy and independence of the processor core task data and avoiding data conflicts when multiple tasks are concurrent.
[0028] (3) Global Shared Random Access Memory (GSRAM): refers to the memory block inside a multi-core MCU that can be accessed by all processors and is the physical basis for realizing data interaction between processors.
[0029] (4) Shared memory partition: refers to a memory region allocated and distributed to each processor within the global shared memory block. Each processor has full read and write permissions for its allocated shared memory partition, but only read-only permissions for shared memory partitions allocated to other processors. This permission allocation mechanism enables ordered and conflict-free data sharing.
[0030] (5) Data area: refers to the area within the shared memory partition allocated to the processor, which is formed by declaring data structures such as arrays and structures and is specifically used for broadcasting data for the current processor. It can be understood that the data area is the basic unit of data publishing.
[0031] (6) Metadata: refers to information stored at the entry address of the data area, used to describe the data area, including structured data (such as data structure information) and descriptive data (such as data area size and data name). The existence of metadata makes the data area self-interpretable and reduces the coupling of inter-processor communication.
[0032] (7) Interprocessor Communication Broadcast Mechanism: This refers to a communication mechanism established during the initial startup of a multi-core MCU to enable all processors to obtain the entry addresses of each data area in the shared memory partition of other processors. This mechanism is implemented through Interprocessor Communication (IPC), controlling N processors to take turns broadcasting and receiving confirmations. Its essence is to establish a data address communication book shared by all processors.
[0033] (8) Inter-processor announcement communication mechanism: This refers to the mechanism by which processors perform daily data interaction after the address book broadcast mechanism is completed. Under this mechanism, processors publish (write) data in the data area of their shared memory partition and read data from the shared memory partitions of other processors as needed.
[0034] (9) Communication Control Block: This refers to a data structure defined in a global shared memory block, containing a broadcast encoding area, a metadata area, an address array area, and a status flag area (also called IPC STS in this invention), used to coordinate and control the various processors during the address book broadcasting process. It contains a broadcast encoding area, a metadata area, an address array area, and a status flag area, and is the core control structure for implementing ordered broadcasting.
[0035] (10) IPC STS: refers to the communication control block.
[0036] (11) IPC SET function: also known as IPC set operation, refers to any processor performing a content writing operation on the storage medium agreed in IPC STS.
[0037] (12) IPC ACK function: also known as IPC acknowledgment clearing operation, refers to any processor performing content clearing operation on the storage medium agreed in IPC STS.
[0038] This invention provides a method for inter-processor data interaction in a multi-core MCU. Figure 1 The diagram illustrates a flowchart of an inter-processor data interaction method for a multi-core MCU provided by this invention. This method can be applied to a multi-core MCU system containing N processors, where N is a positive integer. Figure 1 As shown, the inter-processor data interaction method for a multi-core MCU provided by the present invention may include the following steps 101 to 103.
[0039] Step 101: Allocate an independent private memory block for each of the N processors, and allocate a shared memory partition for each processor in the global shared memory block of the multi-core MCU.
[0040] Each processor has full read and write permissions for the shared memory partitions allocated to it, but only read-only permissions for the shared memory partitions allocated to other processors.
[0041] In some embodiments of the present invention, the processor is taken as a central processing unit (CPU) as an example, such as... Figure 2 As shown, for a multi-core MCU with N CPUs, the system can allocate a completely independent private memory block for each CPU, which can only be accessed by itself. This ensures that the operating environment and data of each processor's core tasks are physically isolated, avoiding conflicts and uncertainties caused by concurrent access to private data, and guaranteeing the stability and security of the core algorithm.
[0042] While achieving physical isolation, in order to meet the data exchange requirements between processors, this invention divides the global shared memory block of the multi-core MCU into N shared memory partitions, and establishes a one-to-one allocation relationship with N processors.
[0043] In this invention, each processor has full read and write permissions to the shared memory partition it is allocated to, and can freely create, modify and delete data therein; while for shared memory partitions allocated to other processors, the processor only has read-only permissions.
[0044] In this way, a clear data publish-subscribe channel is built through asymmetric permissions, so that each processor, as a data publisher, writes the data it needs to share into its own shared memory partition, while other processors, as subscribers, can safely and conflict-free read this data, thereby fundamentally avoiding memory access conflicts and data consistency problems caused by multiple writes and multiple reads.
[0045] Step 102: For each of the N processors, create at least one data area within its allocated shared memory partition, and store metadata at the entry address of the first data area in the at least one data area.
[0046] The aforementioned metadata may include structural data and descriptive data used to describe the first data area.
[0047] In this invention, the first data area can be any data area among at least one data area.
[0048] In some embodiments of the present invention, in order to achieve structured data publishing, each processor may create at least one data area within a shared memory partition in which it has full read and write permissions.
[0049] In some embodiments of the present invention, the at least one data area is a logical area formed by declaring data types such as arrays and structures in the program, serving as a standard container for publishing data externally.
[0050] Specifically, metadata describing that data area can be stored at the entry address of each data area.
[0051] In some embodiments of the present invention, metadata may include structured data (e.g., what C language structure the data area is defined on) and descriptive data (e.g., the total byte size of the data area, its specific name in the application (e.g., the effective value of the grid voltage)).
[0052] In this way, by binding the data itself with its descriptive information, each data area becomes a self-interpreting data unit that can be correctly parsed by any processor, improving the system's flexibility and scalability.
[0053] Step 103: When the multi-core MCU is started, control N processors to broadcast and receive broadcast confirmation through the inter-processor communication broadcast mechanism, and after the broadcast of N processors is completed, data interaction is carried out through the inter-processor announcement communication mechanism.
[0054] In this invention, the above-mentioned multiprocessor inter-processor address book broadcasting mechanism may include: controlling each of the N processors to broadcast in turn according to a preset broadcasting order (e.g., from processor 1 to processor N) and a preset broadcasting method, controlling each of the N processors to record the broadcast content read, and confirming the broadcast reception.
[0055] In this invention, the above-mentioned inter-processor announcement communication mechanism may include: controlling each of the N processors to publish data in at least one data area within its allocated shared memory partition, and to read at least one data area within the shared memory partition allocated to other processors.
[0056] It is understandable that at the initial startup of a multi-core MCU, none of the N processors knows the specific memory address where the data areas created by other processors are located. Therefore, to solve the circular dependency problem of processors being unable to communicate due to unknown initial addresses, the inter-processor data interaction method for multi-core MCUs provided in this invention designs an inter-processor address book broadcasting mechanism.
[0057] Thus, after the multi-core MCU starts up, this inter-processor communication broadcasting mechanism can control N processors to perform an orderly, relay-style broadcasting and broadcast reception confirmation process. This allows each processor to inform all other processors of the entry addresses of all data areas within its shared memory partition, ultimately forming a complete data area address communication book within each processor.
[0058] Specifically, when a processor is broadcasting, it publishes a list of entry addresses for all its data areas. All other processors are responsible for listening in and recording the broadcast content (i.e., the address list) in their communication control blocks, and after recording, writing a broadcast reception acknowledgment signal into the communication control block. This method ensures the reliability and integrity of the broadcast.
[0059] In some embodiments of the present invention, after all N processors have completed address broadcasting, i.e., the data area address address directory has been constructed, the multi-core MCU system can enter the data interaction stage, at which point an inter-processor announcement communication mechanism can be adopted. Under this mechanism, any processor can write (i.e. publish) the latest data it needs to share to the corresponding data area in its own shared memory partition at any time. Any other processor that needs this data can obtain the required data from the target processor's shared memory partition at any time and directly through memory read operations, since it has already stored the complete address address directory locally.
[0060] In this way, the complex handshake and synchronization process is avoided, and efficient data sharing is achieved.
[0061] In some embodiments of the present invention, the method for the N processors to obtain the entry address of the data area of other processors from each other can follow the following definition: (1) The broadcast codes of N processors use binary bitmasks to confirm that a unique broadcast code corresponds to a unique processor. For example, the broadcast code of the fifth processor can be 0x00000010.
[0062] (2) The memory occupied by the IPC STS starts from the initial position. For the i-th processor, it can contain Mi data areas. The memory space of the first k+V+p+Mi×A will be strictly occupied. Where, 0<i≤N, k represents a memory space, which is used to represent the number of data area addresses Mi in this address broadcast. The content of k bits of memory is Mi; V represents a memory space, which is used to represent the total number of processors in the multi-core MCU. The N bits of memory space in V form the broadcast message confirmation flag of N processors; p represents the custom interval bit length. Mi×A represents a memory space, and A represents the entry address of each data area. It can be understood that since the data area header contains structural data and descriptive data, the broadcast of the data area does not need to be sorted.
[0063] Thus, through the automated address discovery process described above, all processors in the system can know what data they share and where that data is stored, laying the foundation for efficient data interaction in the future.
[0064] In some embodiments of the present invention, the above-mentioned inter-processor address book broadcasting mechanism can be implemented through the following functions: setting a preset storage medium; and performing specified encoding and encoding clearing operations on the preset storage medium.
[0065] The aforementioned preset storage medium can be IPC message memory (Inter-Processor Communication Magnetoresistive Random Access Memory, IPC MRAM) used to coordinate inter-processor communication.
[0066] In some embodiments of the present invention, the above-mentioned inter-processor announcement communication mechanism can be implemented through the following functions: setting read and write permissions for any of the N processors to a preset storage medium; and performing data reading and data writing on the preset storage medium.
[0067] In some embodiments of the present invention, for the inter-processor address book broadcasting mechanism, the aforementioned preset storage medium, i.e., the communication control block or IPC STS, can be understood as a public memory area dedicated to broadcast coordination. It is understood that by writing specific encoding (such as processor broadcast encoding) to the preset storage medium, the ownership of broadcast rights can be declared, broadcast content can be written, and the broadcast reception status can be determined; by clearing the encoding, broadcast rights can be released, broadcast content can be cleared, and the broadcast reception status can be reset.
[0068] In some embodiments of the present invention, the inter-processor announcement communication mechanism relies on the function of setting read and write permissions for any of the N processors to the shared memory partition, as well as the function of reading and writing data to the shared memory partition. It can be understood that the shared memory partition here can point to the shared memory partitions of each processor, thereby achieving orderly data publication and reading through the division of read and write permissions.
[0069] In some embodiments of the present invention, such as Figure 3 As shown, this inter-processor announcement communication mechanism can be implemented based on a preset storage medium accessible to all processors.
[0070] For example, the preset storage medium can be a specific memory region (such as global shared memory) or a set of hardware registers (functionally specialized IPC hardware registers).
[0071] In some embodiments of the present invention, the inter-processor address book broadcasting mechanism may include the function of specifying encoding and writing operations on the preset storage medium (i.e., the IPC SET function), and the function of clearing the encoding in the preset storage medium (i.e., the IPC ACK function mentioned above).
[0072] For example, suppose a processor wants to initiate a broadcast. It can write a specific code representing "I want to broadcast" to the medium through an encoding operation. Other processors can detect this event and respond by periodically reading the medium. After the broadcast is completed, the next broadcasting processor can restore the preset storage medium to its initial state through a clear operation.
[0073] Thus, this mechanism based on shared media and encoding / decoding provides a foundation for achieving complex inter-processor synchronization and communication.
[0074] In some embodiments of the present invention, in the above-described inter-processor address book broadcasting mechanism, each of the N processors has a unique broadcast code, which can be used for identification of the processor broadcasting.
[0075] In some embodiments of the present invention, the above-described inter-processor address book broadcasting mechanism may include a communication control block and a round-robin broadcasting method.
[0076] In some embodiments of the present invention, the communication control block can be a data structure defined in a global shared memory block, containing a broadcast encoding region, a metadata region, an address array region, and a status flag region.
[0077] In some embodiments of the present invention, the rotating broadcast method can be a broadcast method in which the currently broadcasting processor initiates the broadcast in a preset broadcast sequence, and the next processor to be broadcast confirms that the broadcast has been completed.
[0078] It should be noted that, to make the inter-processor address book broadcasting mechanism more orderly and reliable, each of the N processors is assigned a unique broadcast code, which is used as the identification of the current broadcasting processor during the broadcasting process. Furthermore, this inter-processor address book broadcasting mechanism can specifically consist of a communication control block and a round-robin broadcasting method. The communication control block can be a specific data structure defined in a global shared memory block, internally divided into a broadcast code area, a metadata area, an address array area, and a status flag area, serving as the central control board in the broadcasting process. The round-robin broadcasting method is a specific broadcast handover logic; that is, in a preset broadcast order, the next processor to be broadcasted must confirm that the current processor's broadcast has been completely received by all processors before initiating a handover and starting its own broadcast.
[0079] This ensures the synchronization and completeness of the broadcast process.
[0080] In some embodiments of the present invention, all of the above-mentioned N processors can have rotating read and write permissions to the communication control block.
[0081] In some embodiments of the present invention, the above-mentioned broadcast coding region may include the broadcast coding of the processor currently broadcasting.
[0082] In some embodiments of the present invention, the aforementioned metadata area may contain structural and descriptive data of the current broadcast content.
[0083] In some embodiments of the present invention, the above-mentioned address array region may contain the current broadcast content, which is the entry address of all data areas of the processor currently broadcasting.
[0084] In some embodiments of the present invention, the aforementioned status flag area may include an acknowledgment flag corresponding to each of the N processors, which can be used to indicate whether the broadcast of its corresponding processor has been received by other processors.
[0085] Specifically, the internal functions of the communication control block include: a broadcast encoding area, which stores the unique broadcast code of the processor currently broadcasting, to identify the source processor of the current broadcast to all processors; a metadata area, which stores descriptive information about the current broadcast content, such as the total number of data areas included in this broadcast; an address array area, which is the core of the communication control block, and stores a list of entry addresses for all data areas of the processor currently broadcasting; and a status flag area, which is an area containing N bits, each bit corresponding to a processor, used to indicate whether its corresponding processor has successfully received and recorded the broadcast content of the current round.
[0086] In this way, through the coordinated work of these four areas, the communication control block achieves precise control over the entire broadcast process.
[0087] In some embodiments of the present invention, if the broadcast code of the processor currently broadcasting is readable and its corresponding acknowledgment flag indicates that the current broadcast is ready, it can be determined that the current broadcast is ready.
[0088] In some embodiments of the present invention, if the acknowledgment flag corresponding to the currently broadcasting processor indicates that the current broadcast has been received by another processor, it can be determined that the current broadcast has ended.
[0089] Understandably, based on the structure of the aforementioned communication control block, the key states during the broadcast process can be clearly defined.
[0090] Specifically, the conditions for determining the broadcast ready state are as follows: when a processor (non-broadcast processor) detects that the broadcast coding area is readable (i.e., the IPC STS contains a valid broadcast code), and after querying the status flag area, it finds that its corresponding acknowledgment flag is incomplete (e.g., 0), it indicates that there is new broadcast content to be received, i.e., broadcast ready.
[0091] The condition for determining the end of the current round of broadcasting is as follows: For a processor that knows the current broadcast code and has determined itself to be the next processor to be broadcast according to the preset order, when it polls the status flag area, if it finds that the confirmation flag bits of all other processors (including itself) indicate that they have been received (e.g., all are 1), it means that the current broadcast content has been successfully received by all relevant parties, the current round of broadcasting task has officially ended, and it is ready to start a new round of broadcasting task.
[0092] Thus, the definition of these two conditions provides a clear basis for judging the start and end of a broadcast.
[0093] In some embodiments of the present invention, during the round-robin broadcasting process, the execution content of the first processor in each round of broadcasting may be: reading the broadcast encoding area to identify the processor currently broadcasting; reading the metadata area to identify the structural data and descriptive data corresponding to the current broadcast content; reading the address array area and writing the acknowledgment flag corresponding to the first processor in the status flag area to indicate that the first processor has finished receiving the current broadcast content.
[0094] The first processor can be any processor among the N processors, excluding the processor currently broadcasting.
[0095] Understandably, during the rotational broadcast process, the behavior of each non-broadcast processor is standardized.
[0096] For example, taking the first processor as an example, when the first processor is not the current broadcast processor, its execution mainly includes three steps. First, it can read the broadcast encoding area in the communication control block to identify which processor is currently broadcasting. Second, it can read the metadata area and address array area to obtain the number of data areas currently being broadcast and the specific list of entry addresses, and store these addresses in its own private memory. Finally, it can modify the acknowledgment flag bit corresponding to the first processor in the status flag area of the communication control block (for example, changing it from 0 to 1), thereby announcing to the broadcaster and other processors that it has completed receiving.
[0097] It should be noted that the above process applies to any of the N processors except the current broadcast processor.
[0098] In some embodiments of the present invention, the condition for determining the occurrence of rotation in the above-described rotating broadcast method is: the next processor to be broadcast in the preset broadcast order has been confirmed, and the status flag area shows that all processors have finished receiving the current broadcast content.
[0099] In other words, the necessary and sufficient condition for a rotation to occur is that, according to the preset broadcast order, the next processor to be broadcast after the current broadcast processor can only perform the rotation operation after confirming that the status flag area of the communication control block shows that all processors (including itself) have finished receiving the current broadcast content.
[0100] Specifically, assuming that processor g-1 is currently broadcasting, processor g can continuously monitor the status flag area until it finds that all N acknowledgment flag bits are 1. At this point, it will initiate an action (such as clearing the current broadcast code via IPC ACK) and then initiate its own broadcast event (via IPC SET), thus becoming the new broadcaster.
[0101] In this way, by adopting strict handover conditions, the risk of prematurely entering the next round of broadcasting due to incomplete reception is effectively avoided, ensuring the eventual consistency of the address address book across all processors.
[0102] In some embodiments of the present invention, each of the N processors may employ asynchronous operations when publishing data in at least one data area of its allocated shared memory partition or reading part or all of the data areas of other processors.
[0103] Understandably, once the inter-processor communication broadcast mechanism is complete, the multi-core MCU system can enter the inter-processor announcement communication mechanism. At this stage, when each of the N processors publishes data in its allocated shared memory partition or reads data from other processors, asynchronous operations can be used. This means that the data publisher (writer) does not need to wait for confirmation from the data receiver (reader); it can continue executing other tasks after the write operation is complete. Similarly, the data receiver can read data at any time according to the needs of its own algorithm without synchronizing with the publisher.
[0104] In this way, by operating asynchronously, the coupling between processors is minimized, and each processor can run at its own pace, thereby maximizing the parallel processing capability of the multi-core MCU. This is especially important for applications that require high real-time response (such as motor control and grid connection control in flywheel energy storage converters).
[0105] In some embodiments of the present invention, the above-mentioned multi-core MCU can be used as a controller for a flywheel energy storage converter.
[0106] In some embodiments of the present invention, in a flywheel energy storage system, the controller needs to handle multiple tasks simultaneously, such as high-frequency motor control, complex grid-connected power quality control, communication with the host computer, and system protection.
[0107] It should be noted that the flywheel energy storage converter includes a grid-connected converter and motor control. It uses an Alternating Current (AC)-Direct Current (DC)-AC converter and a controller to simultaneously connect to the grid connection point and the motor output. This improves the efficiency and control effect of the flywheel energy storage converter. To handle concurrent tasks with high real-time requirements, such as grid connection control, motor control, host computer communication, device communication, and protection communication, the multi-core MCU can utilize multiple processors working collaboratively. Since different processors handle different computing and communication tasks, high-speed, large-scale data exchange between multiple processors is inevitable. Specifically, the AC terminal of the flywheel energy storage converter can be connected to both the grid connection point and the motor terminal. The entire system uses an independent multi-core MCU system. The multi-core MCU can be an integrated chip containing multiple independently running processors. Each processor is equipped with a private memory block, and the multi-core MCU contains shared memory partitions that can be allocated to N processors.
[0108] Thus, by using the inter-processor data interaction method of the multi-core MCU provided by this invention, these tasks can be assigned to different processor cores for data interaction, ensuring that key data such as motor speed, grid voltage phase, and control commands are shared with low latency and high reliability between different processors (or tasks), thereby ensuring the efficient and stable operation of the entire flywheel energy storage system.
[0109] Each of the above-described method embodiments, or various possible implementations of each method embodiment, can be executed individually or in combination of any two or more. The specific implementation can be determined according to actual usage requirements, and the present invention does not impose any restrictions on this.
[0110] This invention also provides a multi-core MCU system that can be applied to the aforementioned inter-processor data interaction method for multi-core MCUs. For example... Figure 2 As shown, the multi-core MCU system includes N processors, private memory blocks corresponding to each of the N processors, and a globally shared memory block.
[0111] The aforementioned global shared memory block is divided into N shared memory partitions. Each shared memory partition is assigned to a processor, and the N shared memory partitions correspond one-to-one with the N processors. Each processor has full read and write permissions for the shared memory partitions it is assigned to, and only read-only permissions for the shared memory partitions assigned to other processors.
[0112] In this invention, each of the N processors is configured to: create at least one data area within a shared memory partition with full read and write permissions, and store metadata at the entry address of a first data area in the at least one data area, the metadata including structural data and descriptive data for describing the first data area, the first data area being any one of the at least one data areas.
[0113] In this invention, the aforementioned multi-core MCU system also includes an inter-processor address book broadcasting mechanism and an inter-processor announcement communication mechanism. N processors are configured to control the N processors to broadcast and receive broadcast confirmation through the inter-processor address book broadcasting mechanism, and to perform data interaction through the inter-processor announcement communication mechanism after the N processors have finished broadcasting.
[0114] In this invention, the inter-processor address book broadcasting mechanism includes: controlling each of the N processors to broadcast in turn according to a preset broadcasting order and a preset broadcasting method; controlling each of the N processors to record the broadcast content read and to confirm the broadcast reception.
[0115] In this invention, the inter-processor announcement communication mechanism includes: controlling each of the N processors to publish data in at least one data area within its allocated shared memory partition, and reading at least one data area within the shared memory partition allocated to other processors.
[0116] Thus, on the one hand, by allocating independent private memory blocks and shared memory partitions with clearly defined permissions (full read and write access for itself, read-only access for others) to each processor, the independence of each processor's core tasks and the security of its data are physically guaranteed. This avoids data conflicts and competition issues that may occur when multiple processors access data concurrently, laying the foundation for stable and efficient data interaction. On the other hand, by executing a multi-processor communication book broadcasting mechanism at the initial startup of the multi-core MCU, each processor can automatically and orderly broadcast and obtain the data area entry addresses of all other processors, forming a global data communication book. This achieves automatic discovery and synchronization of data locations without manual configuration, improving the system's scalability and maintainability. When processors or data areas in the system change, the broadcasting process can be re-executed to complete the update. Furthermore, after completing the address broadcasting, the system enters the multi-processor announcement communication mechanism stage. At this time, the data interaction between processors is simplified to direct memory read and write operations, i.e., one processor writes to its dedicated shared memory partition (publishes an announcement), and other processors directly read the partition as needed (view the announcement). This approach bypasses the complex IPC mechanisms based on traditional message queues or interrupts, reduces communication latency and system overhead, and enables high-speed, large-scale data exchange. This effectively solves the performance degradation problem caused by data interaction bottlenecks and avoids the phenomenon that the more processors there are, the slower the interaction becomes.
[0117] The following specific embodiments illustrate the inter-processor data interaction method and multi-core MCU system provided by the present invention.
[0118] Example 1 by Figure 2 Taking the multi-core MCU system shown as an example, the multi-core MCU system contains N processors, namely processor 1, processor 2, ..., processor N. Each processor in the multi-core MCU system is allocated an independent private memory block, which can only be accessed by its corresponding processor. Simultaneously, within the global shared memory block, each processor is assigned a dedicated shared memory partition, namely shared memory partition 1, shared memory partition 2, ..., shared memory partition N.
[0119] The permissions are set as follows: Processor 1 has read and write permissions to shared memory partition 1, but only read-only permissions to shared memory partitions 2 through N; similarly, processor 2 has read and write permissions to shared memory partition 2, but only read-only permissions to shared memory partition 1 and shared memory partitions 3 through N, and so on. In this way, the permission isolation enforced by hardware or the Memory Management Unit (MMU) ensures the orderliness and security of data interaction.
[0120] Based on the memory layout described above, each processor creates data structures within its dedicated shared memory partition.
[0121] For example, a processor can declare one or more global variables, arrays, or structures in its code and use specific compiler instructions or linker scripts to locate them in its own shared memory partition.
[0122] It is understandable that these located variables or structures constitute the data area.
[0123] For example, a processor can create a data area called "Motor Status" to store motor-related status information. Then, at the starting address of this data area, metadata describing the Motor Status is stored. This metadata can be a fixed structure containing fields such as data name, data area size, and data structure information. Thus, any other processor that obtains the entry address of this data area can read the metadata and determine the data name, data area size, and data structure information of that data area.
[0124] When the system starts up, it uses a multiprocessor address book broadcasting mechanism, such as... Figure 3 As shown, this mechanism can be composed of components such as IPC message memory (IPC MRAM, i.e., preset storage medium), IPC STS, IPC SET function and IPC ACK function.
[0125] First, assume that the first processor (e.g., processor 1) completes initialization first, such as... Figure 4 As shown, the first processor can prepare a list containing the entry addresses of all its data areas and their metadata, and write it to the metadata area and data address area of the IPC STS in the IPC message memory using the IPC SET function. Then, the first processor writes its own broadcast code to the broadcast encoding area of the IPC STS through the IPC SET function, and clears the status flag area of the IPC STS through the IPC ACK function, starting the broadcast for this round. The broadcast behavior is perceived by all other processors through the IPC STS.
[0126] Other processors (such as the g-th processor, where 2 ≤ g ≤ N) can enter a wait-and-respond loop after completing their own initialization. Figure 5As shown, the g-th processor can check the IPC STS by continuously reading. When it detects a broadcast event from the first processor and its own acknowledgment bit is "unacknowledged", it can read the data area address list of the first processor from the IPC message memory and store it in its own private memory block. After storage, it can write its own acknowledgment flag to the status flag area of the IPC STS through the IPC SET mechanism, indicating "I have received the broadcast from the first processor".
[0127] Once the first processor's broadcast is acknowledged by all other processors, it is the second processor's turn to broadcast.
[0128] It should be noted that before the g-th processor initiates its own broadcast, it can first check whether the broadcast of the g-1-th processor has been accepted and acknowledged by all members. Only after confirmation will the g-th processor write its data area address list into the IPC message memory and initiate an address book broadcast representing the "g-th processor broadcast".
[0129] Understandably, this process will proceed sequentially until the Nth processor completes its broadcast. Ultimately, after ordered round-robin broadcasting and recording, each processor in the system establishes a complete mapping table containing the entry addresses of the data areas shared by all other processors, thus achieving automatic address discovery.
[0130] Example 2 First, the multi-core MCU system can be booted by the first processor, which can then boot the remaining processors. After the first processor completes the boot instructions for all processors, it can broadcast addresses using the inter-processor communication broadcast mechanism. Subsequently, the remaining processors can boot, and after booting, they can also broadcast addresses using the inter-processor communication broadcast mechanism.
[0131] The inter-processor address book broadcasting mechanism of the first processor, such as Figure 4 As shown, during the broadcast process of the first processor, the following steps can be performed in sequence: Initialize the IPC STS and clear all bits; write the number of data area addresses that the first processor needs to broadcast, M1, into the k-bit memory space of the IPC MRAM (i.e., IPC message memory), and write the entry addresses of M1 data areas into the subsequent M1×A-bit memory space; use the IPC SET function to set bits to initiate the address book broadcast event of the first processor; clear the N-bit broadcast message confirmation flags (also called confirmation bits, the two have the same meaning and can be interchanged) of all processors, and officially start the broadcast.
[0132] After the above execution is completed, the first processor enters a while loop. The while loop can execute if-switch structures sequentially, which can refer to if condition judgments and switch branch judgments.
[0133] In the if-switch structure, it checks whether all other CPUs' data area entry addresses have been recorded. If yes, it exits the while loop. If no, it checks again, reading whether the first processor's broadcast message acknowledgment flag in the IPC MRAM is 0. If no, it skips the check. If yes, it means the first processor needs to receive broadcasts from other processors, so it enters the switch structure, reads the IPC STS, and determines that it is the broadcast code of the q-th processor, indicating that the q-th processor is currently broadcasting. q≠1. It executes sequentially: reads the metadata area, obtains the number Mq of data area addresses broadcast by the q-th processor, and records and marks the total Mq data area entry addresses of the GSRAM under the responsibility of the q-th processor.
[0134] Once all storage operations are complete, exit the while loop; otherwise, continue executing the while loop.
[0135] Furthermore, it is understandable that the processor at the top of the broadcast sequence does not need to confirm the completion of the broadcast, while other processors in the broadcast sequence do. Therefore, the inter-processor communication broadcast mechanism for processors not at the top of the broadcast sequence is as follows: Figure 5 As shown, when the g-th processor broadcasts the address book event, it enters a while loop, which executes the if structure and the if-switch structure sequentially.
[0136] Within the if structure, it checks if all other CPUs' data area entry addresses have been recorded. If yes, it exits the while loop. If no, it checks again to see if the current broadcast code belongs to the (g-1)th processor. If no, it means a non-g-1th processor is currently broadcasting, so it jumps to the step where the gth processor completes its reception. If yes, it means the g-1th processor is currently broadcasting, so it checks again to see if all processors' broadcast message acknowledgment flags are 1. If no, it means the g-1th processor is broadcasting and the broadcast is not yet complete, so it jumps to the step where the gth processor completes its reception. If yes, it checks if the g-1th processor has completed address broadcasting, and then executes the following in sequence: writes the number of data area addresses that the gth processor needs to broadcast, Mg, into the k-bit memory space of the IPC MRAM; writes the entry addresses of Mg data areas into the subsequent Mg×A memory space; clears the broadcast code shown in the current IPC STS using the IPC ACK function; sets the IPC SET bit to initiate the gth processor's broadcast event; clears the N-bit broadcast message acknowledgment flags of all processors, and officially starts the broadcast. In the if-switch structure for determining the broadcast message acknowledgment bit of the g-th processor, it checks whether the g-th processor has finished receiving the current broadcast, reads whether the broadcast message acknowledgment flag of the g-th processor in the IPC MRAM is 0. If not, it skips; if so, it enters the switch structure, reads the IPC STS, and determines that the current broadcast code is from the q-th processor, indicating that the q-th processor is currently broadcasting. q ≠ g. It executes sequentially: records and marks the entry addresses of a total of Mq data areas in the GSRAM under the responsibility of the q-th processor.
[0137] Once all storage operations are complete, exit the while loop; otherwise, continue executing the while loop.
[0138] It should be noted that the above while loop refers to the commonly used while loop structure in programming, which repeatedly executes the code as long as the condition is met, otherwise it stops; the above if-switch structure is a switch structure implemented with if statements, which determines the program's execution flow based on whether the given condition is true or false; the explanation of q, k, M, g, N, A, V can be found in the detailed description of step 103 above, and will not be repeated here.
[0139] The present invention also provides a readable storage medium storing a program or instructions that, when executed by a processor, implement the various processes of the above-described multi-core MCU inter-processor data interaction method embodiments and achieve the same technical effect. To avoid repetition, these will not be described again here.
[0140] The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk. The present invention also provides a chip, which includes a processor and a communication interface. The communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-described multi-core MCU inter-processor data interaction method embodiments, achieving the same technical effects. To avoid repetition, these will not be described again here.
[0141] It should be understood that the chip mentioned in this invention may also be referred to as a system-on-a-chip, system chip, chip system, or system-on-a-chip, etc.
[0142] This invention provides a computer program product, which is stored in a storage medium and executed by at least one processor to implement the various processes of the inter-processor data interaction method embodiment of the multi-core MCU described above, and can achieve the same technical effect. To avoid repetition, it will not be described again here.
[0143] It should be noted that, in this document, 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 that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of the present invention is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0144] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of the present invention.
[0145] The above content is only for illustrating the technical concept of the present invention and should not be construed as limiting the scope of protection of the present invention. Any modifications made to the technical solution based on the technical concept proposed in this invention shall fall within the scope of protection of the claims of this invention.
Claims
1. A method for inter-processor data interaction in a multi-core MCU, characterized in that, The multi-core MCU contains N processors, including: Each of the N processors is allocated an independent private memory block, and each processor is allocated a shared memory partition in the global shared memory block of the multi-core MCU. Each processor has full read and write permissions for its allocated shared memory partition, and only read-only permissions for the shared memory partitions allocated to other processors. Each of the N processors creates at least one data area within its allocated shared memory partition, and stores metadata at the entry address of the first data area in the at least one data area. The metadata includes structural data and descriptive data for describing the first data area, where the first data area is any one of the at least one data areas. When the multi-core MCU is started, the N processors are controlled to broadcast and receive broadcast confirmation through the inter-processor communication broadcast mechanism, and data interaction is carried out through the inter-processor announcement communication mechanism after the broadcast of the N processors is completed. The inter-processor address book broadcasting mechanism includes: controlling each of the N processors to broadcast in turn according to a preset broadcasting order and a preset broadcasting method; controlling each of the N processors to record the broadcast content read and to confirm the broadcast reception. The inter-processor announcement communication mechanism includes: controlling each of the N processors to publish data in at least one data area within its allocated shared memory partition, and to read at least one data area within the shared memory partition allocated to other processors; N is a positive integer.
2. The inter-processor data interaction method for a multi-core MCU according to claim 1, characterized in that, The inter-processor address book broadcasting mechanism is implemented through the following functions: The function to set the preset storage medium; The function of performing specified encoding and encoding clearing operations on the preset storage medium; The inter-processor announcement communication mechanism is implemented through the following functions: The function of setting read and write permissions for any of the N processors to the preset storage medium; The function of reading and writing data to the preset storage medium.
3. The inter-processor data interaction method for a multi-core MCU according to claim 1, characterized in that, In the multiprocessor inter-processor address book broadcasting mechanism, each of the N processors has a unique broadcast code, which is used for identification of the processor broadcasting. The inter-processor address book broadcasting mechanism includes a communication control block and a round-robin broadcasting method; The communication control block is a data structure stored in the global shared memory block, and the data structure includes a broadcast encoding area, a metadata area, an address array area, and a status flag area. The rotating broadcast method is a broadcasting method in which the currently broadcasting processor initiates the broadcast in the preset broadcasting sequence, and the next processor to be broadcast confirms that the broadcast has been completed.
4. The inter-processor data interaction method for a multi-core MCU according to claim 3, characterized in that, Each of the N processors has rotating read and write permissions to the communication control block; The broadcast encoding region contains the broadcast encoding of the processor currently broadcasting; The metadata area contains structural and descriptive data of the current broadcast content; The address array region contains the current broadcast content, which is the entry address of all data areas of the processor currently broadcasting; The status flag area includes an acknowledgment flag for each of the N processors, which indicates whether the broadcast of its corresponding processor has been received by other processors.
5. The inter-processor data interaction method for a multi-core MCU according to claim 4, characterized in that, If the broadcast code of the currently broadcasting processor is readable and its corresponding acknowledgment flag indicates that the current broadcast is ready; If the acknowledgment flag corresponding to the currently broadcasting processor indicates that the current broadcast has been received by another processor, the current broadcast is determined to have ended.
6. The inter-processor data interaction method for a multi-core MCU according to claim 5, characterized in that, During the round-robin broadcast process, the execution content of the first processor in each round of broadcasting is as follows: Read the broadcast encoding area to identify the processor currently broadcasting; Read the metadata area to identify the structured and descriptive data corresponding to the current broadcast content; Read the address array area and write the confirmation flag corresponding to the first processor into the status flag area to indicate that the first processor has finished receiving the current broadcast content; The first processor is any one of the N processors, excluding the processor currently broadcasting.
7. The inter-processor data interaction method for a multi-core MCU according to claim 5, characterized in that, In the rotating broadcast method, the condition for determining the rotation is: the next processor to be broadcast in the preset broadcast order confirms that the status flag area shows that all processors have finished receiving the current broadcast content.
8. The inter-processor data interaction method for a multi-core MCU according to any one of claims 1 to 7, characterized in that, Each of the N processors operates asynchronously when publishing data in at least one data area of its allocated shared memory partition or reading part or all of the data areas of other processors.
9. A multi-core MCU system, characterized in that, The multi-core MCU system includes N processors, private memory blocks corresponding to each of the N processors, and a globally shared memory block. The global shared memory block is divided into N shared memory partitions, each of which is allocated to a processor. The N shared memory partitions correspond one-to-one with the N processors. Each processor has full read and write permissions for the shared memory partitions it is allocated to, and only read-only permissions for the shared memory partitions allocated to other processors. Each of the N processors is configured to: create at least one data area within a shared memory partition with full read and write permissions, and store metadata at the entry address of a first data area in the at least one data area, the metadata including structural data and descriptive data for describing the first data area, the first data area being any one of the at least one data areas; The multi-core MCU system also includes an inter-processor address book broadcasting mechanism and an inter-processor announcement communication mechanism. The N processors are configured to control the broadcasting and broadcast reception confirmation of the N processors through the inter-processor address book broadcasting mechanism, and to perform data interaction through the inter-processor announcement communication mechanism after the broadcasting of the N processors is completed. The inter-processor address book broadcasting mechanism includes: controlling each of the N processors to broadcast in turn according to a preset broadcasting order and a preset broadcasting method; controlling each of the N processors to record the broadcast content read and to confirm the broadcast reception. The inter-processor announcement communication mechanism includes: controlling each of the N processors to publish data in at least one data area within its allocated shared memory partition, and to read at least one data area within the shared memory partition allocated to other processors; N is a positive integer.
10. A readable storage medium, characterized in that, The readable storage medium stores a program or instructions, which, when executed by a processor, implement the inter-processor data interaction method of a multi-core MCU as described in any one of claims 1 to 8.
Citation Information
Patent Citations
Inter-core data interaction method of multi-core processor
CN107590100A
Interrupt and shared storage method, system and device between AMP multi-core processors
CN115658569A
