Shared memory management method and multi-core system

By configuring a shared memory management module in an embedded multi-core system, modular management of shared memory is achieved, solving the problems of insufficient Vring Buffer queue depth and memory resource shortage, improving data consistency and system flexibility, and conforming to the Autosar specification.

CN121455718APending Publication Date: 2026-02-03HUIZHOU DESAY SV AUTOMOTIVE
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511773596.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-28
Publication Date
2026-02-03

AI Technical Summary

Technical Problem

Existing shared memory communication solutions suffer from insufficient Vring Buffer queue depth and memory resource constraints on embedded multi-core platforms. Furthermore, the shared global data structure approach cannot effectively manage shared memory, resulting in an unclear software architecture that does not comply with the Autosar complex driver development specifications.

Method used

A shared memory management method is provided, which configures a shared memory management module through the master core and slave cores to implement initialization, read and write access interfaces, divides the Meta area, Block Table area and Block Data area, unifies the shared memory access interface, prevents data conflicts, and supports real-time and delayed notification mechanisms.

Benefits of technology

Modular management of shared memory was implemented, avoiding resource shortages, improving data consistency and reliability, conforming to the AUTSAR complex driver development specification, and enhancing the system's flexibility and real-time performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121455718A_ABST
    Figure CN121455718A_ABST
Patent Text Reader

Abstract

The invention provides a shared memory management method and a multi-core system. The multi-core system comprises a master core and a slave core and is provided with a shared memory management module, and the shared memory management module is provided with an initialization interface and a read-write access interface. The shared memory management method comprises the following steps: acquiring a configuration attribute of a shared data block from a local core through a main core, and calling an initialization interface according to the configuration attribute so as to execute an initialization operation on a shared memory through a shared memory management module; wherein the local core is a master core or a slave core for writing data; and after the initialization operation is completed, calling the read-write access interface through the master core or the slave core to access the shared data block address in the shared memory, and executing a corresponding shared data read-write operation. According to the application, the shared memory access interface is unified through the shared memory management module, the modular management of the shared memory is realized, the problem of resource shortage caused by unreasonable memory use is avoided, and meanwhile, an Autosar complex drive development specification is met.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of shared memory, in particular to a shared memory management method and a multi-core system. BACKGROUND

[0002] There are usually two existing shared memory communication schemes, namely virtio (virtual input / output device standby interface) mode and shared global data structure mode; however, in the virtio mode, the Vring Buffer (ring buffer) adopts a queue communication mechanism and the communication data unit size is fixed. For an embedded multi-core platform with tight shared memory resources, the Vring Buffer queue depth is not enough when implementing large data block communication, and in order to read the data in the vring buffer, a separate memory for data unit copying needs to be declared in the local memory, which aggravates the impact of memory resource shortage on software function implementation. The shared global data structure mode cannot effectively manage shared memory and cannot standardize the interface, which is not conducive to the modular management of shared memory by the software scheme, and the overall software scheme architecture is not clear, which does not comply with the Autosar complex drive development specification. SUMMARY

[0003] The present application provides a shared memory management method and a multi-core system which can achieve modular management of shared memory to solve the above technical problems.

[0004] Specifically, the present application provides a shared memory management method, a multi-core system including a master core and a slave core and being configured with a shared memory management module, the shared memory management module being provided with an initialization interface and a read-write access interface; the shared memory management method includes the following steps: obtaining configuration attributes of a shared data block from a local core by the master core, and calling the initialization interface according to the configuration attributes to perform an initialization operation on the shared memory by the shared memory management module; wherein the local core is the master core or the slave core for writing data; after the initialization operation is completed, the read-write access interface is called by the master core or the slave core to access the address of the shared data block in the shared memory and perform corresponding read-write shared data operations.

[0005] In the above technical solution, large data blocks can be directly read and written in the shared memory without considering the limitation of the VringBuffer queue, and the shared memory access interface is unified by the shared memory management module, which realizes the modular management of the shared memory and avoids the problem of resource shortage caused by unreasonable memory use. The present application not only can effectively manage the shared memory of an embedded multi-core system, but also complies with the Autosar complex drive development specification.

[0006] Further, before the master core acquires the configuration attributes of the shared data block from the local core, the data block length, read-write attribute and update notification function of the shared data block in the local core are pre-configured based on the identifier of the shared data block as the configuration attributes.

[0007] In the above technical solution, the configuration attributes provide a clear basis for subsequent shared memory initialization and data read-write operations, accurately initializing and managing the shared memory, improving the configurability and flexibility of the system, and adapting to various application scenarios.

[0008] Further, the initialization interface at least includes an initialization function interface, a formatting function interface and an initialization waiting function interface; the initialization operation performed on the shared memory by the shared memory management module includes: calling the initialization function interface by the master core according to the configuration attributes to perform the initialization operation on the shared memory by the shared memory management module; and calling the formatting function interface by the master core to perform the formatting operation on the shared memory by the shared memory management module; wherein the formatting operation includes dividing the shared memory into a Meta area, a Block Table area and a Block Data area.

[0009] In the above technical solution, the initialization provides necessary information and basis for subsequent formatting and data read-write operations, enabling the management of the shared memory to match specific business needs; the formatting operation enables structured management of the shared memory, with each part of the shared memory having a clear function and purpose through reasonable partitioning, improving the efficiency and accuracy of data read-write and facilitating efficient management of the shared memory.

[0010] Further, after the formatting operation is completed, the initialization completion flag bit is set in the Meta area by the shared memory management module; the initialization waiting function interface is called by the slave core to query the initialization completion flag bit in the Meta area and complete the shared memory initialization waiting operation.

[0011] In the above technical solution, the flag bit is set to provide a clear signal for the slave core to indicate that the shared memory has been initialized, and the slave core can determine whether to perform subsequent operations by querying the flag bit, avoiding erroneous operations due to incomplete initialization of the shared memory; the related calling operation of the slave core ensures that the slave core performs operations only after the shared memory is initialized, ensuring the operation sequence between the cores.

[0012] Further, the read-write access interface at least includes an obtaining read-write access permission interface, a releasing write permission interface and a main running function interface; and the performing the corresponding read-write shared data operation includes: calling the read-write access permission interface by the local core to obtain a shared data block address from the Block Data area, and performing a write shared data operation on the current shared data block based on the shared data block address.

[0013] In the above technical solution, through the control of the permission interface, the simultaneous write operation of multiple cores on one shared data block is prevented, data conflict and damage are avoided, safe access to the shared data block is realized, and the consistency and reliability of data are improved.

[0014] Further, after the write shared data operation is completed, the method further includes: calling the releasing write permission interface by the local core to release the write permission operation of the current shared data block by the shared memory management module.

[0015] In the above technical solution, through the releasing write permission operation, the utilization rate of the shared memory and the concurrency performance of the system are improved, and the subsequent read operation is guaranteed.

[0016] Further, after the releasing write permission operation of the current shared data block is completed, the method further includes: updating the write operation times of the current shared data block by the shared memory management module; calling the main running function interface by the remote core to query whether the write operation times and the read operation times of the current shared data block are consistent, if yes, performing an instant notification operation; otherwise, performing a delayed notification operation; wherein the remote core is a master core or a slave core for reading data.

[0017] In the above technical solution, by updating the write operation times, a basis for the remote core to judge whether the data is updated is provided, and the detection efficiency of data update is improved.

[0018] Further, the instant notification operation includes: sending a shared data block update operation notification to the remote core based on the inter-core communication interface by the shared memory management module; receiving the shared data block update operation notification by the remote core to trigger an instant update callback function; calling the read-write access permission interface based on the instant update callback function to obtain a shared data block address from the Block Data area, and performing a read shared data operation based on the shared data block address.

[0019] In the above technical solution, the instant notification mechanism can make the remote core obtain the latest data in time, reduce the delay of data update, and improve the real-time performance of the system.

[0020] Further, the delay notification operation comprises triggering a delay update callback function by the remote core, calling the read-write access permission interface based on the delay update callback function to obtain a shared data block address from the Block Data area, and performing a read shared data operation based on the shared data block address.

[0021] In the above technical solution, the delay notification mechanism can reduce unnecessary notifications and operations, reduce the system overhead, and improve the system performance in the case of infrequent data updates or low real-time requirements.

[0022] Based on the same concept, the application also provides a multi-core system comprising a master core and a slave core and configured with a shared memory management module to implement modular management of the shared memory by using the shared memory management method.

[0023] Compared with the prior art, the application has the following advantages: The application unifies the shared memory access interface through the shared memory management module, implements modular management of the shared memory, avoids resource shortage problems caused by unreasonable memory use, and meets the Autosar complex drive development specification. BRIEF DESCRIPTION OF DRAWINGS

[0024] Figure 1 A flowchart of the shared memory management method described in the application.

[0025] Figure 2 An initialization operation timing diagram described in the application.

[0026] Figure 3 A partitioning schematic diagram of the shared memory described in the application.

[0027] Figure 4 A partitioning schematic diagram of the shared memory described in the application.

[0028] Figure 5 An immediate notification operation timing diagram described in the application.

[0029] Figure 6 A delay notification operation timing diagram described in the application.

[0030] Figure 7 A verification result schematic diagram described in the application.

[0031] Figure 8 A framework diagram of the multi-core system described in the application. DETAILED DESCRIPTION

[0032] The application provides a shared memory management method and a multi-core system, which will be described in detail below with reference to specific embodiments and the accompanying drawings.

[0033] Reference will now be made to Figure 1 The application provides a shared memory management method. A multi-core system includes a master core and a slave core and is configured with a shared memory management module. The shared memory management module is provided with an initialization interface and a read-write access interface. The shared memory management method includes the following steps S100-S300.

[0034] In a feasible implementation, the read-write attribute, data block length and data block update notification function of the shared data block in the local core are pre-configured as configuration attributes. The shared memory management method flow is as follows: the master core obtains the configuration attributes of the shared data block from the local core (i.e. the master core or the slave core used for writing data), then calls an initialization function interface to perform initialization, further calls a formatting function interface to perform a formatting operation on the shared memory through the shared memory management module. The formatting operation is to divide the shared memory into three partitions, i.e. a Meta area, a Block Table area and a Block Data area. Further, the shared memory management module sets a flag bit in the Meta area to indicate that the shared data block has completed initialization. The slave core then calls the initialization function interface to query the flag bit and performs a shared memory initialization waiting operation through a call to an initialization waiting function interface. Thus, the initialization is completed.

[0035] Further, the local core obtains the shared data block address through the read-write access permission interface of the shared memory management module to perform the corresponding write shared data operation, then calls a release write permission interface to notify the shared memory management module to release the write permission operation of the current shared data block, and the shared memory management module updates the write operation number of the current shared data block. The remote core calls a master running function interface to query the read operation number and the write operation number, and determines whether they are consistent. If they are not consistent, a delay notification needs to be performed, i.e. a delay update callback function is triggered through the remote core, the read-write access permission interface is called based on the delay update callback function to obtain the shared data block address from the Block Data area, and the read shared data operation is performed based on the shared data block address. If the read operation number and the write operation number are consistent, an instant notification is performed, i.e. the shared memory management module sends a shared data block update operation notification to the remote core based on the inter-core communication interface. The remote core receives the shared data block update operation notification to trigger an instant update callback function, then calls the read-write access permission interface based on the instant update callback function to obtain the shared data block address from the Block Data area, and performs the read shared data operation based on the shared data block address. Thus, the read-write shared data operation is completed.

[0036] The specific implementation of the steps S100-S300 will be described in detail below.

[0037] Step S100: obtaining, by the master core, configuration attributes of the shared data block from the local core; wherein the local core is the master core or the slave core for writing data.

[0038] It should be noted that, from the perspective of shared memory initialization, the multi-core system is divided into a master core (real-time core) and a slave core (DSP core), and the master core first completes shared memory formatting, and the slave core (DSP) completes shared memory formatting and waits for operation; from the perspective of communication, the multi-core system is divided into a local core (writing data) and a remote core (reading data), and the local core and the remote core obtain the address of the shared data block through the read-write access interface provided by the shared memory management module (ShareMem module), and then complete the corresponding operation. In order to ensure the real-time performance of the remote core reading data, the local core can send an update message to the remote core through IPC (inter-core communication) after writing data, and the remote core can immediately read the updated shared data block, or the notification can be delayed.

[0039] When the real-time core performs a write operation, the real-time core acts as a local core, and at this time the DSP core acts as a remote core; conversely, when the DSP core performs a write operation, the DSP core acts as a local core, and at this time the real-time core acts as a remote core.

[0040] Further, before obtaining the configuration attributes of the shared data block from the local core by the master core, the data block length, read-write attributes, and update notification function of the shared data block in the local core are pre-configured based on the identifier of the shared data block as the configuration attributes.

[0041] In some embodiments, the read-write permission of the shared data block in the local core (master core or slave core), whether to enable the read-write notification function (i.e., the read-write attribute), define the data block length, and define the data block update callback function (i.e., the update notification function) are configured through BlockCfg_T; wherein the write update notification is usually enabled, and the read reply notification is usually not enabled; if a new shared data block needs to be added, a new BlockID can be added, and then the corresponding configuration attributes can be defined.

[0042] BlockCfg_T is a custom data type for encapsulating the configuration attributes of the shared data block in the local core, thereby facilitating unified management and configuration of the configuration attributes of the shared data block.

[0043] In the above technical solution, the configuration attributes provide a clear basis for subsequent shared memory initialization and data read-write operations, enabling accurate initialization and management of the shared memory, improving the configurability and flexibility of the system, and adapting to diverse application scenarios.

[0044] Step S200: calling an initialization interface according to the configuration attribute to perform an initialization operation on the shared memory through the shared memory management module.

[0045] The initialization interface includes at least an initialization function interface, a formatting function interface, and an initialization waiting function interface. The initialization operation on the shared memory through the shared memory management module includes: calling the initialization function interface by the master core according to the configuration attribute to perform an initialization operation on the shared memory through the shared memory management module; and calling the formatting function interface by the master core to perform a formatting operation on the shared memory through the shared memory management module. The formatting operation includes: dividing the shared memory into a Meta area, a Block Table area, and a Block Data area.

[0046] In some embodiments, referring to Figure 2 , the master core acquires the configuration attribute of the shared data block from the local core, calls the CtCdShareMemInit (i.e., the initialization function interface) to perform initialization, i.e., performs preliminary setting and preparation work on the ShareMem module according to the configuration attribute, such as parameter checking, memory allocation, etc., and then calls the CtCdShareMem_FormatShareMem (i.e., the formatting function interface). The ShareMem module will perform a formatting operation on the shared memory, i.e., perform three partition creation operations of the Meta area, the Block Table area, and the Block Data area (as shown in Figure 3 ).

[0047] Referring to Figure 4 , the Meta area is used to indicate the initialization state of the shared memory and record the real address of the Block Table area. The Block Table area includes data block length, multiple BlockIDs, and shared data block address (start address). The Block Data area includes multiple Block units, each of which includes Block Head and BlockContent. The Block Head is used to indicate the read-write operation times of the shared data block, and the BlockContent is used to store real data.

[0048] It should be noted that the ShareMem module can be integrated on the Autosar platform as a complex driver module.

[0049] In the technical solution, initialization provides necessary information and basis for subsequent formatting and data read / write operations, so that the management of shared memory can be matched with specific business requirements; through the formatting operation, the structured management of shared memory is realized, and through reasonable partitioning, each part of the shared memory has a clear function and purpose, improving the efficiency and accuracy of data read / write and facilitating efficient management of shared memory.

[0050] Further, after the formatting operation is completed, the shared memory management module sets an initialization completion flag bit in the Meta area, and the slave core calls the initialization function interface to query the initialization completion flag bit in the Meta area and call an initialization waiting function interface to complete the shared memory initialization waiting operation.

[0051] In some embodiments, referring to Figure 2 , the ShareMem module marks in the Meta area that the shared memory has completed initialization, i.e., the initialization completion flag bit is set, and then the slave core calls CtCdShareMemInit to query the Meta area shared data initialization operation flag bit and calls CtCdShareMem_WaitShareMemInit (i.e., the initialization waiting function interface) to complete the waiting shared memory initialization operation.

[0052] In the technical solution, the flag bit is set to provide a clear signal to the slave core to indicate that the shared memory has been initialized, and the slave core can determine whether subsequent operations can be performed by querying the flag bit, thereby avoiding erroneous operations due to incomplete shared memory initialization; the related calling operation of the slave core ensures that the slave core performs operations only after the shared memory is initialized, thereby ensuring the operation sequence between the cores.

[0053] Step S300: After the initialization operation is completed, the read / write access interface is called by the master core or the slave core to access the shared data block address in the shared memory and perform corresponding read / write shared data operations.

[0054] The read / write access interface includes at least a read / write access permission interface, a write permission release interface, and a master running function interface; and the corresponding read / write shared data operation includes: the read / write access permission interface is called by the local core to obtain the shared data block address from the Block Data area, and based on the shared data block address, a write shared data operation is performed on the current shared data block.

[0055] In some embodiments, referring to Figure 2 and 5, the local core calls Rte_Call_CtCdShareMem_GetBlockData (i.e., the read-write access permission interface) to obtain a shared data block address from the Block Data area, and then completes the corresponding write operation.

[0056] The return value of Rte_Call_CtCdShareMem_GetBlockData is SHARE_MEM_OK (indicating that the write operation is successful) or an error code.

[0057] In the above technical solution, through the control of the permission interface, the simultaneous write operation of multiple cores on a shared data block is prevented, data conflicts and damage are avoided, safe access to the shared data block is achieved, and the consistency and reliability of the data are improved.

[0058] Further, after the write shared data operation is completed, the write permission interface is called by the local core to release the write permission of the current shared data block through the shared memory management module.

[0059] In some embodiments, as shown in Figure 5 , after the write operation is completed, the ShareMem module is notified to release the write operation of the shared data block, that is, Rte_Call_CtCdShareMem_ReleaseBlockData (i.e., the release write permission interface) is called.

[0060] In the above technical solution, through the release write permission operation, the utilization rate of the shared memory and the concurrency performance of the system are improved, and at the same time, the subsequent read operation is guaranteed.

[0061] Further, after the write permission of the current shared data block is released, the write operation number of the current shared data block is updated by the shared memory management module, and the main function interface is called by the remote core to query whether the write operation number and the read operation number of the current shared data block are consistent, if they are consistent, an instant notification operation is performed, otherwise, a delayed notification operation is performed, wherein the remote core is a master core or a slave core for reading data.

[0062] In some embodiments, as shown in Figure 6 , the ShareMem module updates the write operation number of the current shared data block, and the remote core calls CtCdShareMem_MainFunction (i.e., the main function interface) to query whether the read number and the write number are consistent, if they are not consistent, a delayed notification remote core is executed, otherwise, an instant notification is executed.

[0063] In the technical solution, the number of write operation times is updated to provide a basis for the remote core to determine whether the data is updated, thereby improving the detection efficiency of data update.

[0064] Further, the instant notification operation includes: sending a shared data block update operation notification to the remote core based on the inter-core communication interface by the shared memory management module; receiving the shared data block update operation notification by the remote core to trigger an instant update callback function; calling the read-write access permission interface based on the instant update callback function to obtain a shared data block address from the Block Data area, and performing a read shared data operation based on the shared data block address.

[0065] In some embodiments, referring to Figure 5 , the ShareMem module sends a shared data block update operation notification to the remote core through the IPC (inter-core communication) interface that the shared data block is updated, and the remote core triggers an instant update callback function after receiving the IPC message. The remote core obtains the address of the updated shared data block through the ShareMem module access interface, and then performs subsequent read operations.

[0066] In the technical solution, the instant notification mechanism can enable the remote core to obtain the latest data in time, reduce the delay of data update, and improve the real-time performance of the system.

[0067] Further, referring to Figure 6 , the delay notification operation includes: triggering a delay update callback function by the remote core, calling the read-write access permission interface based on the delay update callback function to obtain a shared data block address from the Block Data area, and performing a read shared data operation based on the shared data block address.

[0068] The read operation after the delay notification of the remote core is similar to the instant notification, except that the triggered function is different.

[0069] In the technical solution, the delay notification mechanism can reduce unnecessary notifications and operations and reduce the system overhead and improve the system performance when the data update is not frequent or the real-time requirement is not high.

[0070] In summary, in the shared memory management method, large data blocks can be directly read and written in the shared memory without considering the limitation of the Vring Buffer queue. The shared memory access interface is unified by the shared memory management module, the modular management of the shared memory is realized, and the problem of resource shortage caused by unreasonable memory usage is avoided. The application not only realizes effective management of the shared memory of the embedded multi-core system, but also conforms to the Autosar complex driving development specification.

[0071] Further, the shared memory management method described in the present application is verified, and a shared data segment of 164 kb is divided from the shared memory, as shown in Table 1. Figure 7 As shown, 129.488 kb is used, and the usage rate is 78.956%.

[0072] Based on the same concept, please refer to Figure 8 The present application also provides a multi-core system, which comprises a master core and a slave core, and is configured with a shared memory management module to realize modular management of the shared memory by using the shared memory management method.

[0073] In some embodiments, the above-described shared memory management method is used to realize effective management of the shared memory of an embedded multi-core real-time system, which distinguishes between a master core and a slave core, the master core is responsible for formatting operation of the shared memory, and the slave core waits for the master core to complete the formatting operation of the shared memory, while distinguishing between a local core and a remote core, the local core completes shared data read-write operation through an interface provided by the shared memory management module, and notifies the remote core of shared data block update through an IPC (inter-processor communication) message, the remote core acquires the shared data block update value through polling or inter-processor communication message notification, and performs subsequent related shared data processing operation, through which the shared data access interface of the multi-core real-time system can be effectively standardized, the shared memory modular management is realized, and the Autosar complex device driving development standard is met.

[0074] Although the example embodiments have been described herein with reference to the accompanying drawings, it should be understood that the above-described example embodiments are merely exemplary, and are not intended to limit the scope of the present application. Those of ordinary skill in the art can make various changes and modifications without departing from the scope and spirit of the present application. All these changes and modifications are intended to be included within the scope of the present application as claimed in the appended claims.

[0075] Those of ordinary skill in the art can realize that the units and algorithm steps of the examples described in conjunction with the embodiments disclosed herein can be realized in electronic hardware, or in a combination of computer software and electronic hardware. Whether the functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Those of ordinary skill in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0076] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other manners. For example, the embodiments of the device described above are merely schematic. For example, the division of the units is only a logical function division. There can be another division manner for the actual implementation. For example, a plurality of units or components can be combined or integrated into another device, or some features can be ignored or not executed. In addition, the displayed or discussed mutual couplings between different units, or the displayed or discussed direct couplings between different units, can be implemented by using some interfaces. The indirect couplings or direct couplings between different units, or the mutual couplings between different units, can be implemented in electronic, mechanical or other forms.

[0077] The various component embodiments of the present application can be implemented in hardware, or as software modules running on one or more processors, or in combination thereof. Those skilled in the art will appreciate that some or all of the functions of some of the modules according to the embodiments of the present application can be implemented in practice using a microprocessor or a digital signal processor (DSP). The present application can also be implemented as a program (for example, a computer program and a computer program product) for performing some or all of the methods described herein. Such a program implementing the present application can be stored on a computer readable medium, or can be in the form of one or more signals. Such signals can be downloaded from an Internet website, or provided on a carrier signal, or in any other form.

[0078] It should be noted that, in the present document, the terms such as first and second are merely used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. Moreover, the terms "include", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such a process, method, article or device. Without more limitations, the element defined by the statement "including a" does not exclude the presence of additional identical elements in the process, method, article or device including the element.

[0079] Although the present application is described in conjunction with the specific embodiments described above, it is obvious that many alternatives, modifications and variations will become apparent to those skilled in the art from the foregoing description. Accordingly, all such alternatives, modifications and variations are intended to be included within the spirit and scope of the appended claims.

Claims

1. A shared memory management method, characterized in that, The multi-core system includes a master core and slave cores, and is configured with a shared memory management module. The shared memory management module provides an initialization interface and a read / write access interface. The shared memory management method includes the following steps: The configuration attributes of the shared data block are obtained from the local core through the master core; where the local core is either the master core or the slave core used for writing data; The initialization interface is invoked according to the configuration attributes to perform initialization operations on the shared memory through the shared memory management module; After initialization is complete, the read / write access interface is called by the master or slave core to access the address of the shared data block in the shared memory and perform the corresponding read / write shared data operation.

2. The shared memory management method according to claim 1, characterized in that, Before obtaining the configuration properties of the shared data block from the local kernel via the primary kernel, the following is included: The shared data block's identifier is used to pre-configure the data block length, read / write attributes, and update notification functionality on the local kernel as the configuration attributes.

3. The shared memory management method according to claim 2, characterized in that, The initialization interface includes at least an initialization function interface, a formatting function interface, and an initialization wait function interface; the initialization operation performed on the shared memory through the shared memory management module includes: The main core calls the initialization function interface according to the configuration attributes to perform initialization operations on the shared memory through the shared memory management module; In addition, the main core calls the formatting function interface to perform a formatting operation on the shared memory through the shared memory management module; wherein the formatting operation includes: dividing the shared memory into a Meta area, a BlockTable area, and a Block Data area.

4. The shared memory management method according to claim 3, characterized in that, After the formatting operation is complete, it includes: The shared memory management module sets the initialization completion flag in the Meta area; The initialization function interface is invoked from the kernel to query the initialization completion flag in the Meta area, and the initialization wait function interface is invoked to complete the shared memory initialization wait operation.

5. The shared memory management method according to claim 1, characterized in that, The read / write access interface includes at least an interface for obtaining read / write access permissions, an interface for releasing write permissions, and a main execution function interface; the execution of the corresponding read / write shared data operation includes: The local kernel calls the read / write access permission interface to obtain the address of the shared data block from the Block Data area, and performs a write shared data operation on the current shared data block based on the shared data block address.

6. The shared memory management method according to claim 5, characterized in that, After the write-to-shared-data operation is completed, it includes: The write permission release interface is invoked through the local kernel to release the write permission operation of the current shared data block through the shared memory management module.

7. The shared memory management method according to claim 6, characterized in that, After the write permission operation for the current shared data block is completed, the following steps are included: The write operation count of the current shared data block is updated through the shared memory management module; The remote core calls the main running function interface to check whether the number of write operations and read operations of the current shared data block are consistent. If they are consistent, an immediate notification operation is performed; otherwise, a delayed notification operation is performed. Among them, the remote core is the master core or slave core used for reading data.

8. The shared memory management method according to claim 7, characterized in that, The instant notification operation includes: The shared memory management module sends a shared data block update operation notification to the remote core via the inter-core communication interface. The shared data block update operation notification is received via a remote core to trigger an immediate update callback function; The read / write access permission interface is called based on the real-time update callback function to obtain the shared data block address from the Block Data area, and a read shared data operation is performed based on the shared data block address.

9. The shared memory management method according to claim 7, characterized in that, The delayed notification operation includes: The delayed update callback function is triggered by the remote core. Based on the delayed update callback function, the read / write access permission interface is called to obtain the shared data block address from the Block Data area, and a read shared data operation is performed based on the shared data block address.

10. A multi-core system, characterized in that, The multi-core system includes a master core and slave cores, and is configured with a shared memory management module to implement modular management of shared memory using the shared memory management method as described in any one of claims 1-9.