Method for data sharing between multiple cores, system, apparatus, computer device, medium, and computer program product
By using a file system unmounting and mounting mechanism between the master and slave cores, real-time updates and consistent backups of data in multi-core systems are achieved, solving the problem of data sharing and backup in multi-core systems and improving system stability and performance.
Patent Information
- Application Number
- PCT/CN2025/140107
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2025-05-13
- Filing Date
- 2025-12-04
- Publication Date
- 2026-11-19
AI Technical Summary
In multi-core systems, existing technologies struggle to effectively achieve data sharing and backup, resulting in insufficient system stability and performance, as well as high complexity in hardware resource management.
By unloading and mounting the file system between the master and slave kernels in the file management system, and using a synchronization mechanism to ensure data sharing and backup, the requirements for memory allocation and release are reduced. The master/slave kernel mirror file system is used to save data, thereby achieving real-time data updates and consistency.
It simplifies the programming process, optimizes memory management, improves system stability and performance, reduces hardware resource consumption, enhances system functionality, and enables flexible data movement and transfer operations.
Smart Images

Figure CN2025140107_19112026_PF_FP_ABST
Abstract
Description
Multi-core data sharing methods, systems, devices, computer equipment, media, and computer program products
[0001] Cross-reference to related applications
[0002] This disclosure is based on Chinese Patent Application No. 202510614219.9, filed on May 13, 2025, entitled "Multi-core Inter-data Sharing Method, System, Apparatus, Computer Equipment and Medium", and claims priority to that Chinese Patent Application, the entire contents of which are incorporated herein by reference. Technical Field
[0003] This disclosure relates to, but is not limited to, the field of data sharing technology, and in particular to a method, system, apparatus, computer equipment, medium, and computer program product for data sharing among multiple cores. Background Technology
[0004] Multi-core processors improve the parallel processing capability and overall performance of a system by executing multiple tasks simultaneously. In a multi-core system, each core's task is relatively independent, but data exchange still occurs between cores. Summary of the Invention
[0005] This disclosure provides a method, system, apparatus, computer device, medium, and computer program product for data sharing among multiple cores.
[0006] This disclosure provides a method for data sharing between multiple cores. The method is applied to a file management system, which includes a primary core, a secondary core, a primary core partition, and a secondary core partition. The primary core partition includes a primary core partition and a secondary core partition, and the secondary core partition includes a secondary core partition and a secondary core partition. The method includes:
[0007] When file data is modified, unloading the file system from the slave partition from the slave kernel includes: unloading the slave kernel file system from the slave kernel primary partition from the slave kernel when file data is modified from the slave kernel, and unloading the master kernel mirror file system from the slave kernel secondary partition from the slave kernel when file data is modified from the master kernel, wherein the master kernel mirror file system is used to store the data in the master kernel file system before the data was modified.
[0008] The master kernel mounts the file system unloaded from the slave kernel to enable data sharing between the file system of the master kernel partition and the file system of the slave kernel partition. This includes: if the slave kernel unloads the slave kernel file system from the slave kernel master partition, then the master kernel mounts the slave kernel file system; if the slave kernel unloads the master kernel mirror file system from the slave kernel secondary partition, then the master kernel mounts the master kernel mirror file system to enable data sharing between the file system of the master kernel partition and the file system of the slave kernel partition.
[0009] In this embodiment, the multi-core data sharing method is applied to a file management system, which includes a master core, slave cores, a master core primary partition, a master core secondary partition, a slave core primary partition, and a slave core secondary partition. When a slave core modifies file data, it unmounts the slave core file system from its primary partition. When the master core modifies file data, it unmounts the master core mirror file system from its secondary partition. The master core mirror file system stores the data in the master core file system before the modification. If the slave core unmounts the slave core file system from its primary partition, the master core mounts the slave core file system. If the slave core unmounts the master core mirror file system from its secondary partition, the master core mounts the master core mirror file system, enabling data sharing between the file systems of the master core partition and the slave core partition. Because the file systems mounted by the master and slave cores are synchronized, both the master and slave cores store the latest data in each other's file systems. When data is lost in any core, it can be recovered from the other core through the synchronization mechanism, effectively providing data backup functionality. Data sharing between master and slave cores reduces the need for manual memory allocation and deallocation, simplifying the programming process, optimizing memory management, and improving system stability and performance. Furthermore, the data sharing mechanism makes file movement and transfer operations more convenient and flexible, reducing the complexity of inter-core data sharing and communication management, saving hardware resources, and enhancing the overall functionality of the system.
[0010] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0011] To more clearly illustrate the technical solutions of the embodiments of this disclosure, the accompanying drawings used in the embodiments of this disclosure will be described below.
[0012] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the specification, serve to illustrate the technical solutions of this disclosure.
[0013] Figure 1a is a schematic diagram of inter-core data sharing provided in an embodiment of this disclosure;
[0014] Figure 1b is a schematic diagram of allocating one or more contiguous address spaces in shared memory according to an embodiment of this disclosure;
[0015] Figure 2 is a flowchart illustrating the multi-core data sharing method provided in an embodiment of this disclosure;
[0016] Figure 3a is a schematic diagram of the process for replacing data from a kernel-imaged file system provided in an embodiment of this disclosure;
[0017] Figure 3b is a schematic diagram of the storage space provided in an embodiment of this disclosure;
[0018] Figure 3c is a schematic diagram of the primary and secondary partitions provided in an embodiment of this disclosure;
[0019] Figure 3d is a flowchart of data sharing in the case of modifying file data from the kernel, provided in an embodiment of this disclosure.
[0020] Figure 4a is a schematic diagram of the process for replacing data in the master kernel image file system provided in an embodiment of this disclosure;
[0021] Figure 4b is a flowchart of data sharing when the master kernel modifies file data according to an embodiment of this disclosure;
[0022] Figure 5a is a schematic diagram of the process for replacing data from the kernel private folder in the second file system according to an embodiment of this disclosure;
[0023] Figure 5b is a schematic diagram of the storage space provided in an embodiment of this disclosure;
[0024] Figure 5c is a schematic diagram of the file system provided in an embodiment of this disclosure;
[0025] Figure 6 is a schematic diagram of the process for replacing data in the main kernel private folder of the first file system according to an embodiment of this disclosure;
[0026] Figure 7 is a schematic diagram of a multi-core data sharing device provided in an embodiment of this disclosure;
[0027] Figure 8 is an internal structural diagram of a computer device provided in an embodiment of this disclosure. Detailed Implementation
[0028] Embodiments of this disclosure are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this disclosure, and should not be construed as limiting this disclosure.
[0029] With the continuous development of computing technology, multi-core processors have been widely used in computing devices. Multi-core systems integrate multiple independent processing cores within a single physical processor, enabling the processor to handle multiple tasks simultaneously, thereby significantly improving the system's parallel processing capabilities and overall performance. This architecture is particularly suitable for multitasking and data-parallel computing. In various fields such as desktop computers, servers, mobile devices, and embedded systems, the use of multi-core processors can effectively improve computing efficiency and response speed.
[0030] Multi-core processors typically employ a master / slave architecture, dividing the processor cores into master and slave cores based on their respective functions. The master core generally has a more complex structure and function, responsible for managing global resources, scheduling tasks, and booting slave cores. Slave cores can run independently, performing local task scheduling and management, and can also handle tasks assigned by the master core. In multi-core processors, depending on the architecture, each core can run the same or different operating systems.
[0031] Although each core has a relatively independent task, data interaction is still required between cores. This necessitates effective data sharing and communication mechanisms to ensure system coordination and efficiency.
[0032] In related technologies, Figure 1a is a schematic diagram of inter-core data sharing provided by an embodiment of this disclosure. As shown in Figure 1a, inter-core data sharing and communication typically rely on shared memory and are implemented through inter-core interrupts. For example, each core can run the same or different operating systems. For the transfer and sharing of file-type data, firstly, the file content is read from one core and written to a specified location in shared memory. Then, the target core is notified through an inter-core interrupt mechanism, and the latter reads the file content from shared memory, thereby completing the file transfer between multiple cores. This method enables data to be transferred between multiple cores, ensuring effective file sharing.
[0033] To reduce data anomalies or program crashes, the creation, reading, writing, and deletion of shared memory must be strictly managed. While this approach effectively utilizes shared memory and inter-core interrupts to ensure the accuracy and reliability of data transmission in multi-core systems, it also requires a high level of memory management and operational standards.
[0034] Common inter-core communication methods include IPC (Inter-Process Communication), RMPSG (Remote Memory Page Sharing or Remote Memory Access), and Mailbox. These methods can effectively achieve data transfer between cores. In practical applications, effective address management and operational specifications are key to achieving accurate communication. Shared memory is used for inter-core data transfer, requiring precise address partitioning and management. This process involves a deep understanding and manipulation of the underlying memory, making its implementation relatively complex. Developers typically perform detailed address calculations and partitioning of shared memory regions according to requirements, and then use inter-core interrupts to manage data exchange. For example, Figure 1b is a schematic diagram of allocating one or more contiguous address spaces in shared memory according to an embodiment of this disclosure. As shown in Figure 1b, one or more contiguous address spaces, i.e., fragments, can be allocated in shared memory and managed uniformly by the control core. When data communication is required, the control core uses inter-core interrupts in conjunction with semaphores or mutexes to complete read and write operations in different regions, thereby achieving data sharing and communication in a multi-core system.
[0035] Please refer to Figure 1a. In addition to internal shared memory, inter-core data sharing and communication can also be achieved through peripheral buses. For example, the master core and slave cores can communicate via serial ports, network ports, or other virtual interfaces. These peripheral interfaces provide another efficient method of inter-core communication.
[0036] Furthermore, mounting the same memory space as a file system to achieve shared technology faces numerous difficulties and uncertainties. This method is not only complex but also requires specific hardware and software support and carries certain risks. For example, in multi-core systems, data between cores is typically independent and lacks an automatic backup mechanism. If data is lost on one core, other cores cannot recover it.
[0037] Based on this, this disclosure provides a method for data sharing between multiple cores. This method is applied to a file management system, which includes a master core, slave cores, a master core primary partition, a master core secondary partition, a slave core primary partition, and a slave core secondary partition. When a slave core modifies file data, the slave core unmounts the slave core file system from its primary partition. When the master core modifies file data, the slave core unmounts the master core mirror file system from its secondary partition. The master core mirror file system is used to store data in the master core file system before the data was modified. If the slave core unmounts the slave core file system from its primary partition, the master core mounts the slave core file system. If the slave core unmounts the master core mirror file system from its secondary partition, the master core mounts the master core mirror file system, thus enabling data sharing between the file systems of the master core partition and the slave core partition. Because the file systems mounted by the master and slave cores are synchronized, both the master and slave cores store the latest data in each other's file systems. When data is lost in any core, it can be recovered from the other core through the synchronization mechanism, effectively providing a data backup function. Data sharing between master and slave cores reduces the need for manual memory allocation and deallocation, simplifying the programming process, optimizing memory management, and improving system stability and performance. Furthermore, the data sharing mechanism makes file movement and transfer operations more convenient and flexible, reducing the complexity of inter-core data sharing and communication management, saving hardware resources, and enhancing the overall functionality of the system.
[0038] This disclosure provides a method for data sharing among multiple cores. Figure 2 is a flowchart illustrating the method for data sharing among multiple cores provided in this disclosure. As shown in Figure 2, the method is applied to a file management system, which includes a master core, slave cores, a master core partition, and slave core partitions. The method may include the following steps:
[0039] S210. If file data is modified, unload the file system from the kernel partition.
[0040] S220: The master core mounts the file system unloaded from the slave core, enabling data sharing between the file system of the master core partition and the file system of the slave core partition.
[0041] For example, a file management system divides storage space into a primary kernel partition and a secondary kernel partition. The primary kernel has permissions to operate on the file system data within both the primary and secondary kernel partitions, including reading, modifying, and managing. The secondary kernel, however, can only operate on the file system data within its own partition and cannot directly interfere with the data in the primary kernel partition. Therefore, when file data is modified, the secondary kernel first unmounts the file system from that partition. The primary kernel then mounts the unmounted file system to achieve data sharing and synchronization between the primary and secondary kernel partitions. This process ensures that data across different partitions can be consistently updated between the primary and secondary kernels.
[0042] In some implementations, the master or slave core actively performs the data modification operation. In this case, it is possible to proactively determine whether the file data has been modified. In other implementations, the modification status can be determined by using third-party tools to detect the file data. In still other implementations, data synchronization is performed periodically, which can be executed automatically when a preset time arrives, without needing to check whether the data has been modified each time. This method assumes that the file data has been modified within the predetermined time, and therefore performs synchronization to ensure data consistency between the master and slave servers.
[0043] In some implementations, the file management system defines two predefined memory regions in shared memory (RAM): a master kernel partition and a slave kernel partition. The master kernel partition and slave kernel partition provide independent memory spaces for data storage and management, respectively. During system initialization, the starting addresses and sizes of these memory regions are pre-set and recorded. These settings ensure that memory region allocation does not conflict and allow the master and slave kernels to efficiently read and write data in shared memory. Furthermore, because the file system is based on shared memory, access speed is improved while reducing read / write demands on hard disks or solid-state drives, thereby extending their lifespan.
[0044] In the aforementioned multi-core data sharing method, this method is applied to a file management system. The file management system includes a master core, slave cores, a master core primary partition, a master core secondary partition, a slave core primary partition, and a slave core secondary partition. When a slave core modifies file data, it unmounts the slave core file system from its primary partition. When the master core modifies file data, it unmounts the master core mirror file system from its secondary partition. The master core mirror file system stores the data in the master core file system before the modification. If the slave core unmounts the slave core file system from its primary partition, the master core mounts the slave core file system. If the slave core unmounts the master core mirror file system from its secondary partition, the master core mounts the master core mirror file system, thus enabling data sharing between the file systems of the master and slave core partitions. Because the file systems mounted by the master and slave cores are synchronized, both the master and slave cores store the latest data in each other's file systems. When data is lost in any core, it can be recovered from the other core through the synchronization mechanism, effectively providing data backup functionality. Data sharing between master and slave cores reduces the need for manual memory allocation and deallocation, simplifying the programming process, optimizing memory management, and improving system stability and performance. Furthermore, the data sharing mechanism makes file movement and transfer operations more convenient and flexible, reducing the complexity of inter-core data sharing and communication management, saving hardware resources, and enhancing the overall functionality of the system.
[0045] In some implementations, the primary kernel partition includes a primary kernel partition and a secondary kernel partition, and the secondary kernel partition includes a primary kernel partition and a secondary kernel partition. The method may further include: when the secondary kernel modifies file data, the secondary kernel unmounts the secondary kernel file system from the secondary kernel primary partition, and then the primary kernel mounts the secondary kernel file system to enable data sharing between the file system of the primary kernel partition and the file system of the secondary kernel partition.
[0046] For example, a file management system divides storage space into a primary kernel partition and a secondary kernel partition. The primary kernel partition includes a primary kernel partition and a secondary kernel partition, while the secondary kernel partition includes a primary kernel partition and a secondary kernel partition. The primary kernel partition contains the primary kernel file system, the secondary kernel partition contains a mirrored file system, the primary kernel partition contains a secondary kernel file system, and the secondary kernel partition contains a mirrored file system. The primary kernel has permissions to operate on the data within the primary kernel partition, secondary kernel partition, primary kernel partition, and the file systems within the secondary kernel partitions, including reading, modifying, and managing. The secondary kernel can only operate on the data within the secondary kernel file system within its primary kernel partition and cannot directly interfere with the data in the primary kernel partition. When the secondary kernel modifies file data, the system needs to synchronize data between the primary and secondary kernels. The secondary kernel first stops all operations on its primary kernel partition to ensure data consistency during synchronization. Next, the secondary kernel unmounts the secondary kernel file system from its primary kernel partition. The primary kernel then mounts the secondary kernel file system to achieve data sharing and synchronization between the primary and secondary kernel partitions. This process ensures that data in different partitions can be consistently updated between the primary and secondary kernels.
[0047] In the above-mentioned multi-core data sharing method, the file moving and transfer operations become more convenient and flexible through the data sharing mechanism, reducing the complexity of inter-core data sharing and communication management, saving hardware resources, and enhancing the overall functionality of the system.
[0048] In some implementations, the primary kernel partition includes a primary kernel partition and a secondary kernel partition, and the secondary kernel partition includes a primary kernel partition and a secondary kernel partition. The method may further include: if the primary kernel modifies file data, the secondary kernel unmounts the primary kernel image file system from the secondary kernel partition, and then the primary kernel mounts the primary kernel image file system to enable data sharing between the file systems of the primary kernel partition and the secondary kernel partition. The primary kernel image file system is used to store the data in the primary kernel file system before the data was modified.
[0049] For example, when the master core modifies file data, the system needs to synchronize data between the master and slave cores. The master core sends a master-initiated synchronization request command to the slave core via an inter-core communication mechanism. Upon receiving the master-initiated synchronization request command, the slave core acknowledges the command. If synchronization is permitted, the slave core first halts all operations on its secondary partition to ensure data consistency during the synchronization process. Next, the slave core unmounts the master-initiated mirror file system from its secondary partition. The master core then mounts the master-initiated mirror file system to achieve data sharing and synchronization between the master and slave partitions. This process ensures that data across different partitions can be consistently updated between the master and slave cores.
[0050] In the above-mentioned multi-core data sharing method, the file moving and transfer operations become more convenient and flexible through the data sharing mechanism, reducing the complexity of inter-core data sharing and communication management, saving hardware resources, and enhancing the overall functionality of the system.
[0051] In some embodiments, Figure 3a is a schematic flowchart of replacing data in a slave kernel image file system provided by an embodiment of the present disclosure. As shown in Figure 3a, the primary kernel partition includes a primary kernel secondary partition, and the slave kernel partition includes a slave kernel primary partition. When file data is modified, the slave kernel unloading the file system from the slave kernel partition includes:
[0052] S310. When modifying file data in the slave kernel, the slave kernel unloads the slave kernel file system from the slave kernel's primary partition.
[0053] Accordingly, the primary kernel mounts the file system unmounted by the secondary kernel to enable data sharing between the file systems of the primary kernel partition and the secondary kernel partition, including:
[0054] S320: The master kernel mounts the slave kernel file system and uses the data in the slave kernel file system to replace the data in the slave kernel image file system in the master kernel's secondary partition.
[0055] The kernel mirror file system is used to store data in the kernel file system before it was modified.
[0056] For example, a file management system divides storage space into a primary kernel partition and a secondary kernel partition. Figure 3b is a schematic diagram of the storage space provided in an embodiment of this disclosure. As shown in Figure 3b, the primary kernel partition includes a primary kernel partition and a secondary kernel partition, and the secondary kernel partition includes a primary kernel partition and a secondary kernel partition. Figure 3c is a schematic diagram of the primary and secondary partitions provided in an embodiment of this disclosure. As shown in Figure 3c, the primary kernel partition contains the primary kernel file system, the secondary kernel partition contains the secondary kernel mirror file system, the primary kernel partition contains the secondary kernel file system, and the secondary kernel partition contains the primary kernel mirror file system. The primary kernel has the authority to operate on the data in the file systems within the primary kernel partition, primary kernel partition, secondary kernel partition, and secondary kernel partition, including reading, modifying, and managing. The secondary kernel can only operate on the data in the secondary kernel file system within the primary kernel partition and cannot directly interfere with the data in the primary kernel partition.
[0057] Figure 3d is a flowchart illustrating data sharing in the case of file data modification by the slave core according to an embodiment of this disclosure. As shown in Figure 3d, when the slave core modifies file data, for example, by modifying the data content in the slave file system within the slave core's primary partition, or by performing data addition or deletion operations, the system needs to synchronize data between the master and slave cores. The slave core first stops all operations on its primary partition to ensure data consistency during synchronization. Next, the slave core unmounts the slave file system from its primary partition. This operation ensures that all data in the file system is correctly saved and can be safely mounted before synchronization begins. After unmounting the file system, the slave core sends a master core synchronization request command to the master core through an inter-core communication mechanism. The master core synchronization request command may include necessary synchronization information to guide the master core in subsequent operations. Upon receiving the master core synchronization request command, the master core acknowledges and responds to the command, i.e., the master core sends an acknowledgment signal to the slave core to confirm that the master core synchronization request command has been successfully received. Next, the master core takes over the slave core's primary partition and mounts the slave file system to allow the master core to access the data in the slave file system within the slave core's primary partition for data update operations. After mounting, the master kernel replaces the data in the slave kernel file system on the master kernel's primary partition with the slave kernel's mirror file system on the master kernel's secondary partition, ensuring that the master kernel's data is synchronized and updated to the latest state. After the data replacement is complete, the master kernel unmounts the slave kernel file system, thereby releasing control of the slave kernel's primary partition. The master kernel sends a master kernel synchronization end command to the slave kernel, indicating that the synchronization process is complete, and returns control of the slave kernel's primary partition to the slave kernel. Upon receiving the synchronization end command, the slave kernel performs an acknowledgment operation and sends an acknowledgment message to the master kernel. Finally, the slave kernel regains control of the slave kernel's primary partition, remounts the slave kernel file system, and thus completes data sharing between the master and slave kernels.
[0058] In some implementations, since either the master or slave kernel actively performs the data modification operation, it can be directly determined whether the file data modification was performed by the master or slave kernel. In other implementations, by using third-party tools to detect the integrity and modification history of the file data, it can be determined whether the data has been modified, thereby determining whether the modification was performed by the master or slave kernel.
[0059] In the aforementioned multi-core data sharing method, when a slave core modifies file data, the slave core unmounts its slave file system from its primary partition. The primary core then mounts the slave file system and uses the data from the slave file system to replace the data in the slave mirror file system on the primary core's secondary partition. This achieves data synchronization and real-time updates, improving system flexibility, reliability, and performance. Simultaneously, it reduces system maintenance complexity and makes the collaboration between the slave and primary cores more efficient.
[0060] In some implementations, Figure 4a is a schematic flowchart of replacing data in the master kernel image file system provided by an embodiment of this disclosure. As shown in Figure 4a, the master kernel partition includes a master kernel primary partition, and the slave kernel partition includes a slave kernel secondary partition. When file data is modified, the slave kernel unloading the file system in the slave kernel partition includes:
[0061] S410. When the master kernel modifies file data, the slave kernel unloads the master kernel image file system from the slave kernel's secondary partition.
[0062] The kernel image file system is used to store the data in the kernel file system before the data was modified.
[0063] Accordingly, the primary kernel mounts the file system unmounted by the secondary kernel to enable data sharing between the file systems of the primary kernel partition and the secondary kernel partition, including:
[0064] S420 mounts a master kernel image file system on the master kernel, and replaces the data in the master kernel image file system with the data in the master kernel file system in which the file data in the master kernel's main partition has been modified.
[0065] For example, a file management system divides storage space into a primary kernel partition and a secondary kernel partition. Referring to Figure 3b, the primary kernel partition includes a primary kernel partition and a secondary kernel partition, while the secondary kernel partition includes a primary kernel partition and a secondary kernel partition. Referring to Figure 3c, the primary kernel partition contains the primary kernel file system, the secondary kernel partition contains the secondary kernel mirror file system, the primary kernel partition contains the secondary kernel file system, and the secondary kernel partition contains the primary kernel mirror file system. The primary kernel has permissions to operate on the data within the file systems of the primary kernel partition, primary kernel partition, secondary kernel partition, and secondary kernel partition, including reading, modifying, and managing. The secondary kernel, however, can only operate on the data within the secondary kernel file system of the secondary kernel partition and cannot directly interfere with the data in the primary kernel partition.
[0066] Figure 4b is a flowchart illustrating data sharing when the master core modifies file data according to an embodiment of this disclosure. As shown in Figure 4b, when the master core modifies file data, for example, by modifying the data content in the master core file system within the master core's primary partition, or by adding or deleting data, the system needs to synchronize data between the master and slave cores. The master core sends a master core active synchronization request command to the slave core through an inter-core communication mechanism. After receiving the master core active synchronization request command, the slave core confirms the command. If synchronization is allowed, the slave core first stops all operations on the slave core's secondary partition to ensure data consistency during the synchronization process. Next, the slave core unmounts the master core mirror file system from the slave core's secondary partition. This operation ensures that all data in the file system is correctly saved and can be safely mounted before synchronization begins. Then, the slave core responds by sending an acknowledgment signal to the master core to confirm that the synchronization request has been successfully received. The master core confirms and takes over the slave core's secondary partition, mounting the master core mirror file system to allow the master core to access the data in the master core mirror file system within the slave core's secondary partition for data update operations. After mounting, the master kernel replaces the data in the master kernel file system on the master kernel partition with the master kernel mirror file system in the slave kernel secondary partition, ensuring that the slave kernel's data is synchronized and updated to the latest state. After the data replacement is complete, the master kernel unmounts the master kernel mirror file system, thereby releasing control of the slave kernel secondary partition. The master kernel sends a master kernel active synchronization end command to the slave kernel, indicating that the synchronization process is complete, and returns control of the slave kernel secondary partition to the slave kernel. Upon receiving the synchronization end command, the slave kernel performs an acknowledgment operation and sends an acknowledgment message to the master kernel. Finally, the slave kernel regains control of the slave kernel secondary partition, remounts the master kernel mirror file system, and completes data sharing between the master and slave kernels.
[0067] In the aforementioned multi-core data sharing method, when the master core modifies file data, the slave core unmounts the master core's mirror file system from its secondary partition. The master core then mounts the master core's mirror file system, replacing the data in the master core's mirror file system with the data from the master core's primary partition that has been modified. This achieves data synchronization and real-time updates, improving system flexibility, reliability, and performance. Simultaneously, it reduces system maintenance complexity and makes the collaboration between the slave and master cores more efficient.
[0068] In some implementations, the primary kernel partition includes a primary kernel partition and a secondary kernel partition, and the secondary kernel partition includes a primary kernel partition and a secondary kernel partition. Before unloading the file system of the secondary kernel partition from the secondary kernel, the method may further include: initializing the primary kernel to mount the primary kernel file system in the primary kernel partition and the secondary kernel image file system in the secondary kernel partition.
[0069] For example, before modifying data or unmounting the file system from the slave partition, the primary kernel must first be initialized. When the primary kernel starts, it initializes to mount the primary kernel file system from its primary partition. In addition to the primary kernel file system, the primary kernel also needs to mount the slave kernel image file system from its secondary partition. This image file system can contain the programs and data required for the slave kernel to run, as well as possible configuration information.
[0070] In the above multi-core data sharing method, the master core is initialized to mount the master core file system in the master core's primary partition and the slave core mirror file system in the master core's secondary partition, thereby improving the system's flexibility and resource utilization efficiency.
[0071] In some implementations, the primary kernel partition includes a primary kernel partition and a secondary kernel partition, and the secondary kernel partition includes a primary kernel partition and a secondary kernel partition. Before unloading the file system of the secondary kernel partition from the secondary kernel, the method may further include: initializing the secondary kernel to mount the secondary kernel file system in the primary kernel partition and the primary kernel image file system in the secondary kernel partition.
[0072] For example, before modifying data or unmounting the file system from the slave partition, the slave kernel must first be initialized. When the slave kernel starts, it initializes to mount the slave file system from its primary partition. In addition to the slave file system, the slave kernel also needs to mount the master kernel image file system from its secondary partition. This master kernel image file system can contain the programs and data required for the master kernel to run, as well as possible configuration information.
[0073] In the above multi-core data sharing method, the slave core is initialized to mount the slave core file system in the slave core's primary partition and the primary core image file system in the slave core's secondary partition, thereby improving the system's flexibility and resource utilization efficiency.
[0074] In some implementations, the data in the master kernel file system constitutes the master kernel root file system, the data in the slave kernel mirror file system constitutes the slave kernel root file system, the data in the slave kernel file system constitutes the slave kernel root file system, and the data in the master kernel mirror file system constitutes the master kernel root file system.
[0075] For example, to support the collaborative work of the master and slave kernels, it is first necessary to create and configure root file systems for both the master and slave kernels. The master kernel root file system is created based on memory, such as RAM (Random Access Memory). This master kernel root file system contains all the files required by the master kernel, such as initialization files, the master kernel itself, and executable files and shared libraries (such as static and dynamic libraries) needed for external communication. Similarly, the slave kernel root file system is created based on memory, such as RAM. This slave kernel root file system includes all the files required by the slave kernel, such as initialization files, the slave kernel itself, and executable files and shared libraries (such as static and dynamic libraries) needed for external communication.
[0076] After the root file system is created, it is deployed to the main kernel system and managed by the main kernel. When the operating system boots, the main kernel places the created root file system into designated locations on the primary and secondary partitions of memory. It's important to note that the primary partition contains the root file system of its own kernel, while the secondary partition contains the root file systems of other kernels. This can be understood as placing the main kernel's root file system in the main kernel's primary partition (denoted as the main kernel file system), and placing it in the secondary partition of the secondary kernel (denoted as the main kernel image file system). Similarly, placing the secondary kernel's root file system in the secondary partition of the main kernel (denoted as the secondary kernel image file system), and placing it in the primary partition of the secondary kernel (denoted as the secondary kernel file system), is called the secondary kernel file system. After placement, the main kernel and secondary kernels can be initialized.
[0077] In the above multi-core data sharing method, the data in the master kernel file system constitutes the master kernel root file system, the data in the slave kernel image file system constitutes the slave kernel root file system, the data in the slave kernel file system constitutes the slave kernel root file system, and the data in the master kernel image file system constitutes the master kernel root file system, effectively providing data backup functionality.
[0078] In some implementations, Figure 5a is a schematic flowchart of replacing data in a kernel private folder within a second file system according to an embodiment of this disclosure. As shown in Figure 5a, when file data is modified, unloading the file system from the kernel partition includes:
[0079] S510. If file data is modified by the slave kernel, the first file system in the slave kernel partition is unloaded by the slave kernel.
[0080] The first file system includes a master kernel private folder and a slave kernel private folder. The master kernel private folder stores the files required by the master kernel, and the slave kernel private folder stores the files required by the slave kernel.
[0081] Accordingly, the primary kernel mounts the file system unmounted by the secondary kernel to enable data sharing between the file systems of the primary kernel partition and the secondary kernel partition, including:
[0082] S520: The main core mounts the first file system and uses the data in the kernel's private folder in the first file system to replace the data in the kernel's private folder in the second file system.
[0083] The second file system includes a private folder for the primary kernel and a private folder for the secondary kernel.
[0084] For example, Figure 5b is a schematic diagram of the storage space provided in an embodiment of this disclosure. As shown in Figure 5b, the file management system divides the storage space into a primary kernel partition and a secondary kernel partition. The primary kernel partition contains a second file system, and the secondary kernel partition contains a first file system. Figure 5c is a schematic diagram of the file system provided in an embodiment of this disclosure. As shown in Figure 5c, both the first file system and the second file system include a primary kernel private folder and a secondary kernel private folder. The primary kernel private folder stores primary kernel private operable files, such as primary kernel executable files and shared libraries (such as static libraries and dynamic libraries). The secondary kernel private folder stores secondary kernel private operable files, such as secondary kernel executable files and shared libraries (such as static libraries and dynamic libraries). The primary kernel has permissions to operate on the data in the private folders of the second file system within the primary kernel partition and the first file system within the secondary kernel partition, including reading, modifying, and managing. The secondary kernel has permissions to operate on the data in the secondary kernel private folders of the first file system within the secondary kernel partition.
[0085] When file data is modified by the slave kernel—for example, if the slave kernel modifies the data content of a slave kernel private folder within the first file system of the slave kernel partition, or performs data addition or deletion operations—the system needs to synchronize data between the master and slave kernels. The slave kernel first stops all operations on its partition to ensure data consistency during synchronization. Next, the slave kernel unmounts the first file system from the slave kernel partition. This operation ensures that all data in the file system is correctly saved and can be safely mounted before synchronization begins. After unmounting the file system, the slave kernel sends a master kernel synchronization request command to the master kernel via the inter-kernel communication mechanism. The master kernel synchronization request command can include necessary synchronization information to guide the master kernel in subsequent operations. Upon receiving the master kernel synchronization request command, the master kernel acknowledges and responds to the command, i.e., the master kernel sends an acknowledgment signal to the slave kernel to confirm that the synchronization request has been successfully received. Next, the master kernel takes over the slave kernel partition and mounts the first file system, allowing the master kernel to access the data in the master kernel's private folder and the slave kernel's private folder within the first file system for data update operations. After mounting, the master kernel replaces the data in the slave kernel's private folder in the first file system with the data in the slave kernel's private folder in the second file system of the master kernel partition, ensuring that the master kernel's data is synchronized and updated to the latest state. After the data replacement is complete, the master kernel unmounts the first file system, thereby releasing control of the slave kernel partition. The master kernel sends a master kernel synchronization end command to the slave kernel, indicating that the synchronization process is complete, and returns control of the slave kernel partition to the slave kernel. Upon receiving the synchronization end command, the slave kernel performs an acknowledgment operation and sends an acknowledgment message to the master kernel. Finally, the slave kernel regains control of the slave kernel partition, remounts the first file system, and completes data sharing between the master and slave kernels.
[0086] In the aforementioned multi-core data sharing method, when file data is modified by the slave core, the slave core unmounts the first file system from its partition, and the master core mounts the first file system. Data in the slave core's private folder within the first file system replaces the data in the slave core's private folder within the second file system, achieving data synchronization and real-time updates, thus improving system flexibility, reliability, and performance. Simultaneously, it reduces the complexity of system maintenance, making the collaboration between the slave and master cores more efficient.
[0087] In some implementations, Figure 6 is a flowchart illustrating the process of replacing data in the primary kernel private folder of the first file system according to an embodiment of this disclosure. As shown in Figure 6, when file data is modified, unloading the file system from the kernel partition includes:
[0088] S610. When the master kernel modifies file data, the slave kernel unloads the first file system from the slave kernel partition.
[0089] Accordingly, the primary kernel mounts the file system unmounted by the secondary kernel to enable data sharing between the file systems of the primary kernel partition and the secondary kernel partition, including:
[0090] S620: The main core mounts the first file system and uses the data in the main core's private folder in the second file system to replace the data in the main core's private folder in the first file system.
[0091] For example, if the master core modifies file data—such as by modifying data in a private folder within the master core's secondary file system on the master core partition, or by adding or deleting data—the system needs to synchronize data between the master and slave cores. The master core sends a master-initiated synchronization request command to the slave core via inter-core communication. Upon receiving the command, the slave core acknowledges it. If synchronization is permitted, the slave core first halts all operations on its partition to ensure data consistency during synchronization. Next, the slave core unmounts the first file system from its partition, ensuring all data is correctly saved and can be safely mounted before synchronization begins. Then, the slave core acknowledges by sending an confirmation signal to the master core, confirming successful reception of the synchronization request. The master core then takes over the slave partition, mounts the first file system, and allows the master core to access data in the master core's private folder within the first file system on the slave partition for data updates. After mounting, the master kernel replaces the data in its private folder within the second file system with the data in the master kernel's private folder within the first file system in the slave kernel partition, ensuring that the slave kernel's data is synchronized and updated to the latest state. After the data replacement is complete, the master kernel unmounts the first file system, thereby releasing control of the slave kernel partition. The master kernel sends a master kernel-initiated synchronization end command to the slave kernel, indicating that the synchronization process is complete, and returns control of the slave kernel partition to the slave kernel. Upon receiving the synchronization end command, the slave kernel performs an acknowledgment operation and sends an acknowledgment message to the master kernel. Finally, the slave kernel regains control of the slave kernel partition, remounts the first file system, and completes data sharing between the master and slave kernels.
[0092] In the aforementioned multi-core data sharing method, when the master core modifies file data, the slave core unmounts the first file system from its partition, the master core mounts the first file system, and replaces the data in the master core's private folder within the first file system with data from the master core's private folder within the second file system. This achieves data synchronization and real-time updates, improving system flexibility, reliability, and performance. Simultaneously, it reduces system maintenance complexity and makes the collaboration between the slave and master cores more efficient.
[0093] In some implementations, before unloading the first file system from the slave kernel partition, the method further includes: initializing the master kernel to mount the second file system from the master kernel partition.
[0094] For example, before modifying data or unmounting the first file system from the slave partition, the master kernel must first be initialized. When the master kernel starts, it initializes to mount the second file system from the master kernel partition.
[0095] In the above multi-core data sharing method, the master core is initialized to mount the second file system in the master core partition, thereby improving the system's flexibility and resource utilization efficiency.
[0096] In some implementations, file data modification includes: the primary kernel managing the file system of the primary kernel partition to determine if the primary kernel's file data has been modified; and the secondary kernel managing the file system of the secondary kernel partition to determine if the secondary kernel's file data has been modified.
[0097] For example, the primary kernel and secondary kernels each manage their respective file systems to monitor and determine whether file data has been modified. The primary kernel manages the file system of its partition and can promptly identify whether file data in the primary kernel partition has been changed, thus determining whether the primary kernel's file data has been modified. The secondary kernel manages the file system of its partition and can promptly identify whether file data in the secondary kernel partition has been changed, thus determining whether the secondary kernel's file data has been modified.
[0098] In some implementations, since either the master or slave kernel actively performs the data modification operation, it can be directly determined whether the file data modification was performed by the master or slave kernel. In other implementations, by using third-party tools to detect the integrity and modification history of the file data, it can be determined whether the data has been modified, thereby determining whether the modification was performed by the master or slave kernel.
[0099] In the aforementioned multi-core data sharing method, the master core manages the file system of its partition to determine if file data on the master core has been modified. The slave core manages the file system of its partition to determine if file data on the slave core has been modified, making data management more efficient and secure in complex multi-core environments.
[0100] In some implementations, the method further includes initializing the kernel to mount the first file system in the kernel partition before unloading the first file system from the kernel partition.
[0101] For example, before modifying data or unmounting the first file system from the slave partition, the slave kernel must first be initialized. When the slave kernel starts, it initializes to mount the first file system from the slave partition.
[0102] In the above multi-core data sharing method, the slave core is initialized to mount the first file system in the slave core partition, thereby improving the system's flexibility and resource utilization efficiency.
[0103] This disclosure provides a multi-core data sharing system, which includes a master core and slave cores, and is used to execute the method according to any one of the above.
[0104] Those skilled in the art will understand that, in the above-described method of the specific implementation, the order in which each step is written does not imply a strict execution order and does not constitute any limitation on the implementation process. The specific execution order of each step should be determined by its function and possible internal logic.
[0105] Based on the same inventive concept, this disclosure also provides an inter-core data sharing device corresponding to the inter-core data sharing method. Since the principle of the device in this disclosure for solving the problem is similar to the above-mentioned inter-core data sharing method in this disclosure, the implementation of the device can refer to the implementation of the method.
[0106] This disclosure provides a multi-core data sharing device 700. Figure 7 is a schematic diagram of the multi-core data sharing device provided in this disclosure. As shown in Figure 7, the device is applied to a file management system. The file management system includes a master core, a slave core, a master core partition, and a slave core partition. The master core partition includes a master core primary partition and a master core secondary partition. The slave core partition includes a slave core primary partition and a slave core secondary partition. The multi-core data sharing device 700 includes a slave core offloading part 710 and a data sharing part 720.
[0107] The offload portion 710 is configured to unload a file system from a slave partition when file data is modified, including: unloading a slave file system from a slave primary partition when file data is modified by the slave kernel, and unloading a master kernel mirror file system from a slave secondary partition when file data is modified by the master kernel, wherein the master kernel mirror file system is used to store data in the master kernel file system before the data was modified.
[0108] The data sharing section 720 is configured to mount a file system unloaded by the slave kernel on the master kernel, enabling data sharing between the file system of the master kernel partition and the file system of the slave kernel partition. This includes: if the slave kernel unloads the slave kernel file system from the slave kernel master partition, the master kernel mounts the slave kernel file system; if the slave kernel unloads the master kernel mirror file system from the slave kernel secondary partition, the master kernel mounts the master kernel mirror file system, thus enabling data sharing between the file system of the master kernel partition and the file system of the slave kernel partition.
[0109] In some implementations, the data sharing portion 720 is further configured to mount the slave kernel file system on the primary kernel, and use the data in the slave kernel file system to replace the data in the slave kernel mirror file system in the primary kernel secondary partition; wherein, the slave kernel mirror file system is used to store the data in the slave kernel file system before the data was modified.
[0110] In some implementations, the data sharing portion 720 is further configured to mount the master kernel image file system on the master kernel, and replace the data in the master kernel image file system with the data in the master kernel file system whose file data in the master kernel main partition has been modified.
[0111] In some embodiments, before unloading the file system of the slave partition from the slave kernel, the apparatus further includes:
[0112] The main kernel initialization section is configured to initialize the main kernel, and mount the main kernel file system in the main kernel primary partition and the slave kernel image file system in the main kernel secondary partition.
[0113] The kernel initialization section is configured to initialize the kernel, mounting the kernel file system in the kernel primary partition and the kernel image file system in the kernel secondary partition.
[0114] In some implementations, the data in the master kernel file system constitutes the master kernel root file system, the data in the slave kernel mirror file system constitutes the slave kernel root file system, the data in the slave kernel file system constitutes the slave kernel root file system, and the data in the master kernel mirror file system constitutes the master kernel root file system.
[0115] In some embodiments, the slave kernel unloading portion 710 is further configured to unload a first file system from the slave kernel partition; wherein the first file system includes a master kernel private folder and a slave kernel private folder, the master kernel private folder storing files required by the master kernel, and the slave kernel private folder storing files required by the slave kernel; correspondingly, the data sharing portion 720 is further configured to mount the first file system on the master kernel, and replace the data in the slave kernel private folder of the second file system with the data in the slave kernel private folder of the first file system; wherein the second file system includes a master kernel private folder and a slave kernel private folder.
[0116] In some implementations, the slave unloading portion 710 is further configured to unload the first file system in the slave partition when the master kernel modifies file data; correspondingly, the data sharing portion 720 is further configured to mount the first file system in the master kernel and replace the data in the master kernel private folder in the first file system with the data in the master kernel private folder in the second file system.
[0117] In some embodiments, prior to unloading the first file system from the kernel partition from the kernel, the apparatus further includes:
[0118] The main kernel initialization section is configured to initialize the main kernel and mount the second file system in the main kernel partition.
[0119] The kernel initialization section is configured to initialize the kernel and mount the first file system in the kernel partition.
[0120] In some implementations, the slave kernel unloading portion is further configured such that the master kernel manages the file system of the master kernel partition and determines that the file data of the master kernel has been modified; and the slave kernel manages the file system of the slave kernel partition and determines that the file data of the slave kernel has been modified.
[0121] For a detailed description of the inter-core data sharing device, please refer to the description of the inter-core data sharing method above.
[0122] In the embodiments disclosed herein and other embodiments, "part" can be a part of a circuit, a part of a processor, a part of a program or software, etc., and can also be a unit, a module or a non-modular one.
[0123] This disclosure provides a computer device, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the method steps described above.
[0124] This disclosure provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method in any of the above embodiments.
[0125] One embodiment of this specification provides a computer program product including instructions that, when executed by a processor of a computer device, enable the computer device to perform the method of any of the above embodiments.
[0126] In some embodiments, a computer device is provided, which may be a terminal, and its internal structure diagram may be as shown in Figure 8. The computer device includes a processor, memory, communication interface, display screen, and input device connected via a system bus. The processor of the computer device provides computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The communication interface of the computer device is used for wired or wireless communication with external terminals. Wireless communication can be achieved through Wi-Fi, carrier networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a multi-core data sharing method. The display screen of the computer device may be an LCD screen or an e-ink display screen. The input device of the computer device may be a touch layer covering the display screen, or buttons, a trackball, or a touchpad located on the casing of the computer device, or an external keyboard, touchpad, or mouse, etc.
[0127] Those skilled in the art will understand that the structure shown in FIG8 is merely a block diagram of a portion of the structure related to the scheme disclosed in this specification, and does not constitute a limitation on the computer device to which the scheme disclosed in this specification is applied. For example, the computer device may include more or fewer components than shown in the figure, or combine certain components, or have different component arrangements.
[0128] It should be noted that the logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device, and can be a volatile or non-volatile storage medium. More specific examples (a non-exhaustive list) of computer-readable media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). Furthermore, computer-readable media can even be paper or other suitable media on which programs can be printed, because programs can be obtained electronically, for example, by optically scanning the paper or other media, followed by editing, interpreting, or otherwise processing as necessary, and then stored in computer memory. Industrial applicability
[0129] This disclosure provides a method, system, apparatus, computer device, medium, and computer program product for data sharing between multiple cores. The method is applied to a file management system, which includes a master core, slave cores, a master core partition, and slave core partitions. The master core partition includes a master core primary partition and a master core secondary partition, and the slave core partition includes a slave core primary partition and a slave core secondary partition. The method includes: unloading a file system from the slave core partition when file data is modified, including: unloading the slave core file system from the slave core primary partition when file data is modified on the slave core, and unloading the slave core file system from the slave core primary partition when file data is modified on the master core. In this scenario, the primary kernel's mirror file system is unloaded from the secondary kernel partition, where the primary kernel's mirror file system stores data from the primary kernel's file system before modification. The primary kernel then mounts the unloaded file system to enable data sharing between the primary kernel partition's file system and the secondary kernel partition's file system. This includes: if the secondary kernel's file system is unloaded from the primary kernel partition, the primary kernel mounts the secondary kernel file system; if the secondary kernel's mirror file system is unloaded from the secondary kernel partition, the primary kernel mounts the primary kernel's mirror file system, enabling data sharing between the primary kernel partition's file system and the secondary kernel partition's file system. This solution not only simplifies the programming process but also optimizes memory management, improves system stability and performance, reduces the complexity of inter-core data sharing and communication management, saves hardware resources, and enhances the overall functionality of the system.
Claims
1. A method for data sharing among multiple cores, the method being applied to a file management system, the file management system comprising a primary core, a secondary core, a primary core partition, and a secondary core partition, the primary core partition comprising a primary core partition and a secondary core partition, the secondary core partition comprising a secondary core partition and a secondary core partition, the method comprising: When file data is modified, unloading the file system from the slave partition from the slave kernel includes: unloading the slave kernel file system from the slave kernel primary partition from the slave kernel when file data is modified from the slave kernel, and unloading the master kernel mirror file system from the slave kernel secondary partition from the slave kernel when file data is modified from the master kernel, wherein the master kernel mirror file system is used to store the data in the master kernel file system before the data was modified. The master kernel mounts the file system unloaded from the slave kernel to enable data sharing between the file system of the master kernel partition and the file system of the slave kernel partition. This includes: if the slave kernel unloads the slave kernel file system from the slave kernel master partition, then the master kernel mounts the slave kernel file system; if the slave kernel unloads the master kernel mirror file system from the slave kernel secondary partition, then the master kernel mounts the master kernel mirror file system to enable data sharing between the file system of the master kernel partition and the file system of the slave kernel partition.
2. The method of claim 1, wherein, The primary kernel mounts the secondary kernel file system to enable data sharing between the file system of the primary kernel partition and the file system of the secondary kernel partition, including: The master kernel mounts the slave kernel file system and uses the data in the slave kernel file system to replace the data in the slave kernel mirror file system in the master kernel secondary partition; wherein, the slave kernel mirror file system is used to store the data in the slave kernel file system before the data was modified.
3. The method of claim 1, wherein, The primary kernel mounts the primary kernel image file system to enable data sharing between the file system of the primary kernel partition and the file system of the secondary kernel partition, including: The main kernel mounts the main kernel image file system, and replaces the data in the main kernel image file system with the data in the main kernel file system whose file data in the main kernel's main partition has been modified.
4. The method of any of claims 1-3, wherein, Before unloading the file system of the slave partition from the slave kernel, the method further includes: The main kernel is initialized, and the main kernel file system in the main kernel's main partition and the slave kernel image file system in the main kernel's secondary partition are mounted. The slave kernel is initialized, and the slave kernel file system in the slave kernel primary partition and the primary kernel image file system in the slave kernel secondary partition are mounted.
5. The method of claim 4, wherein, The data in the master kernel file system constitutes the master kernel root file system, the data in the slave kernel image file system constitutes the slave kernel root file system, the data in the slave kernel file system constitutes the slave kernel root file system, and the data in the master kernel image file system constitutes the master kernel root file system.
6. The method of claim 1, wherein, The method of unloading the file system from the kernel partition when file data is modified also includes: When modifying file data in the slave kernel, the slave kernel unloads the first file system from the slave kernel partition; wherein, the first file system includes a master kernel private folder and a slave kernel private folder, the master kernel private folder stores the files required by the master kernel, and the slave kernel private folder stores the files required by the slave kernel; Correspondingly, the process of mounting the file system unmounted by the slave kernel on the master kernel, and enabling data sharing between the file system of the master kernel partition and the file system of the slave kernel partition, also includes: The master kernel mounts the first file system and replaces the data in the slave kernel's private folder in the second file system with the data in the slave kernel's private folder in the first file system; wherein, the second file system includes the master kernel's private folder and the slave kernel's private folder.
7. The method of claim 1, wherein, The method of unloading the file system from the kernel partition when file data is modified also includes: If the master kernel modifies file data, the slave kernel unloads the first file system from the slave kernel partition; Correspondingly, the process of mounting the file system unmounted by the slave kernel on the master kernel, and enabling data sharing between the file system of the master kernel partition and the file system of the slave kernel partition, also includes: The main kernel mounts the first file system and replaces the data in the main kernel's private folder in the first file system with the data in the main kernel's private folder in the second file system.
8. The method of claim 6, wherein, Before unloading the first file system from the kernel partition from the kernel, the method further includes: The main kernel is initialized, and the second file system in the main kernel partition is mounted. The process involves initializing the slave kernel and mounting the first file system in the slave kernel partition.
9. The method of claim 1, wherein, The method further includes: The main core manages the file system of the main core partition and determines that the file data of the main core has been modified; The slave kernel manages the file system of the slave kernel partition and determines that the file data of the slave kernel has been modified.
10. A multi-core data sharing system, the system comprising a master core and slave cores, the system being used to execute the method according to any one of claims 1-9.
11. A multi-core data sharing device, the device being applied to a file management system, the file management system comprising a primary core, a secondary core, a primary core partition, and a secondary core partition, the primary core partition comprising a primary core partition and a secondary core partition, the secondary core partition comprising a secondary core partition and a secondary core partition, the device comprising: The offloading section is configured to unload the file system in the off-core partition when the file data is modified, including: unloading the off-core file system in the off-core primary partition when the file data is modified by the off-core, and unloading the primary kernel mirror file system in the off-core secondary partition when the file data is modified by the primary kernel, wherein the primary kernel mirror file system is used to store the data in the primary kernel file system before the data was modified. In the data sharing section, the master kernel is configured to mount the file system unmounted by the slave kernel to perform data sharing between the file system of the master kernel partition and the file system of the slave kernel partition. This includes: if the slave kernel unmounts the slave kernel file system in the slave kernel master partition, then the master kernel mounts the slave kernel file system; if the slave kernel unmounts the master kernel mirror file system in the slave kernel secondary partition, then the master kernel mounts the master kernel mirror file system to perform data sharing between the file system of the master kernel partition and the file system of the slave kernel partition.
12. The apparatus of claim 11, wherein, The data sharing portion is further configured to mount the slave kernel file system on the primary kernel, and use the data in the slave kernel file system to replace the data in the slave kernel mirror file system in the primary kernel secondary partition; wherein, the slave kernel mirror file system is used to store the data in the slave kernel file system before the data was modified.
13. The apparatus of claim 11, wherein, The data sharing portion is also configured to mount the main kernel image file system on the main kernel, and replace the data in the main kernel image file system with the data in the main kernel file system whose file data in the main kernel main partition has been modified.
14. The apparatus of any of claims 11-13, wherein, Before unloading the file system of the slave partition from the slave kernel, the apparatus further includes: The main kernel initialization section is configured to initialize the main kernel, and mount the main kernel file system in the main kernel primary partition and the slave kernel image file system in the main kernel secondary partition. The kernel initialization section is configured to initialize the kernel, mounting the kernel file system in the kernel primary partition and the kernel image file system in the kernel secondary partition.
15. The apparatus of claim 14, wherein, The data in the master kernel file system constitutes the master kernel root file system, the data in the slave kernel image file system constitutes the slave kernel root file system, the data in the slave kernel file system constitutes the slave kernel root file system, and the data in the master kernel image file system constitutes the master kernel root file system.
16. The apparatus of claim 11, wherein, The slave kernel unloading section is further configured to unload the first file system from the slave kernel partition; wherein, the first file system includes a master kernel private folder and a slave kernel private folder, the master kernel private folder stores files required by the master kernel, and the slave kernel private folder stores files required by the slave kernel; correspondingly, the data sharing section is further configured to mount the first file system on the master kernel, and replace the data in the slave kernel private folder of the second file system with the data in the slave kernel private folder of the first file system; wherein, the second file system includes a master kernel private folder and a slave kernel private folder.
17. The apparatus of claim 16, wherein, The slave kernel unloading section is further configured to unload the first file system in the slave kernel partition when the master kernel modifies file data; correspondingly, the data sharing section is further configured to mount the first file system in the master kernel and replace the data in the master kernel private folder in the first file system with the data in the master kernel private folder in the second file system.
18. The apparatus of claim 16, wherein, Before unloading the first file system from the kernel partition from the kernel, the device further includes: The main kernel initialization section is configured to initialize the main kernel and mount the second file system in the main kernel partition. The kernel initialization section is configured to initialize the kernel and mount the first file system in the kernel partition.
19. The apparatus of claim 11, wherein, The offloading portion from the kernel is also configured to allow the master kernel to manage the file system of the master kernel partition and determine if the file data of the master kernel has been modified. The slave kernel manages the file system of the slave kernel partition and determines that the file data of the slave kernel has been modified.
20. A computer device comprising a memory and a processor, the memory storing a computer program, the processor executing the computer program to implement the method of any one of claims 1 to 9. 21.A computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the method of any one of claims 1 to 9. 22.A computer program product, comprising a computer program or instructions which, when run on an electronic device, cause the electronic device to perform the method of any one of claims 1 to 9.
