Cross-hardware domain shared memory management method, device, chip and electronic device

By dynamically managing shared memory channels in the system-on-chip, the problem of low memory utilization between multiple hardware domains is solved and more efficient memory management is achieved.

CN118409883BActive Publication Date: 2024-10-25BEIJING SEMIDRIVE TECHNOLOGY LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410840513.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-06-26
Publication Date
2024-10-25
Estimated Expiration
2044-06-26

AI Technical Summary

Technical Problem

In system-level chips, data interaction between multiple hardware domains requires shared memory. However, static allocation of shared memory in the existing technology results in low memory utilization, inability to effectively utilize memory space, and low management efficiency.

Method used

The first operating system receives the memory management request of the second operating system, performs identity verification, and manages the shared memory channel according to the response message to dynamically establish and release the shared memory channel and avoid the defects of static allocation.

Benefits of technology

It improves memory utilization and management efficiency, can flexibly allocate and release shared memory according to actual needs, and avoids the problem of low memory utilization caused by reserving memory for each application scenario.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118409883B_ABST
    Figure CN118409883B_ABST
Patent Text Reader

Abstract

The present application provides a cross-hardware domain shared memory management method, device, chip and electronic device; comprising: a first operating system receives a first memory management request sent by a second operating system through an inter-core communication channel; the first memory management request is triggered based on a first application running on the second operating system, and the first memory management request is used to apply for establishing a shared memory channel with at least one third operating system, or to apply for releasing a shared memory channel with at least one third operating system; after the first operating system authenticates the second operating system based on the first memory management request and passes the authentication, the first operating system sends a second memory management request to all third operating systems based on the first memory management request; the first operating system manages the shared memory channel according to the received memory management response message; in this way, the shared memory can be managed efficiently.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of storage technology, and in particular to a shared memory management method, device, chip and electronic device across hardware domains. Background Art

[0002] System on Chip (SoC) can be composed of multiple single-core processors or multi-core processors. System on chip can include multiple hardware domains, each hardware domain runs an operating system, and there is a need for data interaction between the operating systems. Data interaction needs to rely on inter-domain shared memory. The trouble is that there may be multiple applications in each operating system that have cross-domain communication needs: when the application starts or has communication needs, it is necessary to apply for shared memory; when the application exits or has no communication needs, it is necessary to release the shared memory. If the shared memory is not managed, it is necessary to reserve the shared memory required for communication in advance for each application that needs cross-domain communication. Obviously, this will significantly increase the usage of cross-domain shared memory, and in embedded devices, memory capacity is an expensive device. Therefore, how to effectively use the memory space and efficiently manage the shared memory is an urgent problem to be solved. Summary of the invention

[0003] The embodiments of the present application provide a cross-hardware domain shared memory management method, device, chip and electronic device, which can effectively utilize memory space and efficiently manage shared memory.

[0004] The technical solution of the embodiment of the present application is implemented as follows:

[0005] In a first aspect, an embodiment of the present application provides a cross-hardware domain shared memory management method, comprising: a first operating system receives a first memory management request sent by a second operating system through an inter-core communication channel; the first memory management request is triggered based on a first application running on the second operating system, and the first memory management request is used to apply for establishing a shared memory channel with at least one third operating system, or to apply for releasing a shared memory channel with at least one of the third operating systems;

[0006] The first operating system authenticates the second operating system based on the first memory management request;

[0007] In response to the second operating system passing the identity authentication, the first operating system sending a second memory management request to all the third operating systems based on the first memory management request;

[0008] The first operating system manages the shared memory channel according to the received memory management response message;

[0009] The memory management response message is sent by the third operating system based on the second memory management request; each operating system is configured to run on a hardware domain of the system-level chip.

[0010] In some optional embodiments, the first operating system authenticates the second operating system based on the first memory management request, including at least one of the following:

[0011] The first operating system confirms whether the first application has access rights to the shared memory channel;

[0012] The first operating system confirms whether the second operating system has access rights to the shared memory channel;

[0013] The access permission includes at least one of a read permission and a write permission.

[0014] In some optional embodiments, the first memory management request is used to apply for establishing a shared memory channel with at least one third operating system, and the first operating system manages the shared memory channel according to the received memory management response message, including:

[0015] If the memory management response message is used to indicate that the third operating system confirms to establish the shared memory channel, the first operating system establishes a shared memory channel between the second operating system and the third operating system.

[0016] In some optional embodiments, the first operating system manages the shared memory channel according to the received memory management response message, including:

[0017] The first operating system stores information of the shared memory channel;

[0018] And / or, the first operating system sends a channel establishment success message to the second operating system and all the third operating systems.

[0019] In some optional embodiments, the first memory management request is used to apply for releasing a shared memory channel with at least one of the third operating systems, and the first operating system manages the shared memory channel according to the received memory management response message, including:

[0020] If the memory management response message is used to indicate that all the third operating systems confirm the release of the shared memory channel, the first operating system releases the shared memory channel of the second operating system and all the third operating systems.

[0021] In some optional embodiments, the first operating system manages the shared memory channel according to the received memory management response message, including:

[0022] The first operating system sends a channel release success message to the second operating system and all the third operating systems.

[0023] In some optional embodiments, when the first operating system establishes a shared memory channel with multiple third operating systems, each third operating system has different access rights to the shared memory channel.

[0024] In a second aspect, an embodiment of the present application provides a cross-hardware domain shared memory management device, the device comprising: a receiving module, used to receive a first memory management request sent by a second operating system through an inter-core communication channel; the first memory management request is triggered based on a first application running on the second operating system, and the first memory management request is used to apply to establish a shared memory channel with at least one third operating system, or to apply to release a shared memory channel with at least one of the third operating systems;

[0025] a verification module, configured to authenticate the second operating system based on the first memory management request;

[0026] a sending module, configured to send a second memory management request to all the third operating systems based on the first memory management request in response to the second operating system passing the identity authentication;

[0027] A management module, used for managing the shared memory channel according to the received memory management response message;

[0028] The memory management response message is sent by the third operating system based on the second memory management request; each operating system is configured to run on a hardware domain of the system-level chip.

[0029] In a third aspect, an embodiment of the present application provides a chip, the chip comprising:

[0030] processor, memory, and bus;

[0031] The memory stores executable instructions;

[0032] The processor communicates with the memory via the bus, and when the processor executes the executable instructions stored in the memory, the above-mentioned cross-hardware domain shared memory management method is implemented.

[0033] In a fourth aspect, an embodiment of the present application provides a component on a transportation device, wherein the component includes a chip, and the chip can implement the above-mentioned shared memory management method across hardware domains.

[0034] In a fifth aspect, an embodiment of the present application provides an electronic device, wherein the electronic device includes a chip, and the chip can implement the above-mentioned shared memory management method across hardware domains.

[0035] The cross-hardware domain shared memory management method provided by the embodiment of the present application includes: a first operating system receives a first memory management request sent by a second operating system through an inter-core communication channel; the first memory management request is triggered based on a first application running on the second operating system, and the first memory management request is used to apply for establishing a shared memory channel with at least one third operating system, or for applying for releasing a shared memory channel with at least one third operating system; the first operating system authenticates the second operating system based on the first memory management request; if the second operating system authentication is passed, the first operating system sends a second memory management request to all third operating systems based on the first memory management request; the first operating system manages the shared memory channel according to the received memory management response message; wherein each operating system is configured to run on a hardware domain of the system-level chip. The embodiment of the present application implements the management of the cross-hardware domain shared memory channel through the third operating system, which facilitates the secondary development of the software for the cross-hardware domain shared memory channel management in the third operating system. In the embodiment of the present application, the third operating system performs unified and flexible dynamic management of the shared memory of multiple hardware domains, which can avoid the problem of low memory utilization caused by reserving shared memory for each application scenario in the prior art. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 It is a processing flow diagram of a cross-hardware domain shared memory management method provided by an embodiment of the present application;

[0037] Figure 2 It is a schematic diagram of a processing flow of cross-hardware domain shared memory initialization provided by an embodiment of the present application;

[0038] Figure 3 It is a schematic diagram of a processing flow of a shared memory query across hardware domains provided by an embodiment of the present application;

[0039] Figure 4 It is a schematic diagram of the processing flow of a shared memory event monitoring callback across hardware domains provided in an embodiment of the present application;

[0040] Figure 5 It is a detailed processing flow diagram of a cross-hardware domain shared memory management method provided by an embodiment of the present application;

[0041] Figure 6 It is another detailed processing flow diagram of the cross-hardware domain shared memory management method provided in an embodiment of the present application;

[0042] Figure 7 It is a system framework diagram of a cross-hardware domain shared memory management method provided by an embodiment of the present application;

[0043] Figure 8 It is a schematic diagram of the composition structure of a cross-hardware domain shared memory management device provided in an embodiment of the present application;

[0044] Fig. 9 It is a schematic diagram of the structure of the chip provided in the embodiment of the present application. DETAILED DESCRIPTION

[0045] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described in detail below in conjunction with the accompanying drawings. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of this application.

[0046] In the following description, reference is made to “some embodiments”, which describe a subset of all possible embodiments, but it can be understood that “some embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0047] In the following description, the terms "first\second" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second" can be interchanged with a specific order or sequence where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.

[0048] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0049] It should be understood that in the various embodiments of the present application, the size of the serial number of each implementation process does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0050] Before further describing the embodiments of the present application in detail, the nouns and terms involved in the embodiments of the present application are explained. The nouns and terms involved in the embodiments of the present application are subject to the following interpretations.

[0051] 1) In the embodiments of the present application, the SoC chip may be a multi-core heterogeneous chip, which refers to a chip that integrates two or more processor cores in a single chip, and each processor core can act as an independent processor to independently run the instructions stored in the memory corresponding to the processor core. Multi-core heterogeneous chips can bring more combined advantages in performance, cost, power consumption, size, etc. Different architectures perform their respective functions and each plays the unique advantages of the original architecture.

[0052] The multi-core heterogeneous chip in the embodiment of the present application can be applied to transportation equipment, including but not limited to balancing vehicles, cars, buses, subways, trains, and airplanes.

[0053] 2) Hardware domain is a set of hardware collections, which may include hardware resources such as processor cores, interrupt controllers, clock controllers and memories. The number of processor cores in the hardware collection can be one or more. One hardware domain runs one operating system, and different hardware domains can run different operating systems.

[0054] The intellectual property (IP) cores in each hardware domain are divided into large cores and small cores. Large cores are suitable for running high-performance operating systems, while small cores are suitable for running low-performance, fast and more secure operating systems. Information is transmitted between different hardware domains through inter-core communication channels.

[0055] 3) Inter-core communication: There is a need for information communication between different hardware domains. The communication method between hardware domains is called inter-core communication. Inter-core communication has more advantages than communication between chips. For example, it does not need to transmit data outside the chip, which greatly improves the security and speed of data transmission. There are many forms of inter-core communication, such as the Mailbox mechanism suitable for transmitting instructions and the shared memory mechanism suitable for sharing data.

[0056] Mailbox is a mechanism or data structure used for communication between different processing cores. It can be used to pass messages and trigger events between different processors, cores or hardware modules.

[0057] Mailbox can be viewed as a shared, bidirectional communication interface that contains one or more registers for storing messages or control information. The sender can write messages into the registers of the Mailbox, and the receiver can read these messages and process them accordingly. That is, the sender can control the receiver or instruct the receiver to perform corresponding operations by writing messages or control information into the registers of the Mailbox.

[0058] In semiconductor chips, Mailbox is often used for communication between processors, such as between multi-core processors, SoCs, or multiple independent functional modules. Through the Mailbox mechanism, different processing units can work together, share data, synchronize operations, and trigger events, thereby achieving more efficient system collaboration and resource sharing.

[0059] It should be noted that the implementation of Mailbox may vary depending on the chip architecture, communication protocol or design requirements, but in general, it exists to achieve reliable and efficient communication and data exchange between processing units.

[0060] 4) Shared memory is a mechanism for sharing data between multiple processes (processes can run in different processors), allowing different processes to access the same memory area, thereby achieving fast data transfer and sharing. Shared memory can be set outside the chip or inside the chip.

[0061] In the related art, static memory allocation is usually used to allocate shared memory for two operating systems. Statically allocated memory refers to reserving a fixed size of memory space for sharing between two operating systems. One disadvantage of statically allocated shared memory is that if the base address of the shared memory needs to be modified or the size of the shared memory needs to be changed, the layout of the shared memory needs to be adjusted. At this time, the operating system needs to be recompiled, and even the applications that rely on absolute addresses need to be recompiled. Whether it is recompiling the operating system or recompiling the application, it is very inefficient for the management of shared memory. When statically allocating shared memory, it is necessary to define shared memory for each application that communicates across operating systems, and the memory required by the application cannot be defined according to the actual concurrent scenario. Therefore, another disadvantage of statically allocating shared memory is that the memory space cannot be effectively utilized.

[0062] The cross-hardware domain shared memory management method provided by the embodiment of the present application can at least solve the above problems.

[0063] A schematic diagram of a processing flow of a cross-hardware domain shared memory management method provided in an embodiment of the present application is as follows: Figure 1 As shown, at least the following steps are included:

[0064] Step S101: A first operating system receives a first memory management request sent by a second operating system through an inter-core communication channel.

[0065] In some embodiments, the first operating system is configured to run on a hardware domain of the SoC. In some embodiments, the first memory management request is triggered based on a first application running on the second operating system. The first memory management request is used to apply for establishing a shared memory channel with at least one third operating system, or to apply for releasing a shared memory channel with at least one third operating system.

[0066] Taking a smart car as an example, the SoC corresponding to the cockpit of the smart car includes at least three operating systems, namely the operating system corresponding to the central control (IVI) of the smart car, the operating system corresponding to the instrument (Cluster) of the smart car, and any operating system with shared memory management permissions. The second operating system may be the operating system corresponding to the central control, the third operating system may be the operating system corresponding to the instrument, and the first operating system is an operating system with shared memory management permissions. The first application may be a navigation application running on the operating system corresponding to the central control (the second operating system). The navigation application needs to perform screen projection operations on the operating system corresponding to the instrument (the third operating system). Therefore, the second operating system sends a first memory management request to the first operating system to request the establishment of a shared memory between the second operating system and the third operating system. The shared memory is used to share the navigation application data between the second operating system and the third operating system.

[0067] The above description uses the third operating system as an example of the operating system corresponding to the instrument. In actual applications, there can be multiple third operating systems, and the second operating system can establish a shared memory channel with multiple third operating systems. If a shared memory channel is established between the second operating system and the third operating system, the second operating system and the third operating system have access rights (read rights and / or write rights) to the data in the shared memory channel. Correspondingly, the first memory management request can request different third operating systems to have different access rights to the shared memory channel, such as one third operating system has read rights to the data in the shared memory channel, another third operating system has write rights to the data in the shared memory channel, and another third operating system has both read and write rights to the data in the shared memory channel.

[0068] As an example, if the second operating system and the third operating system have established a shared memory channel, the first memory management request can also be used to request the release of the shared memory channel between the second operating system and the third operating system. If the shared memory channel between the second operating system and the third operating system is released, the third operating system does not have access rights (read rights and / or write rights) to the data in the shared memory channel, or the second operating system and the third operating system cannot communicate through the shared memory channel.

[0069] In some embodiments, the first memory management request may include an identifier for characterizing the identity of the second operating system and an identifier for characterizing the identity of the third operating system. As an example, the first operating system can confirm that the second operating system is the operating system corresponding to the central control based on the identifier characterizing the identity of the second operating system, and the first operating system can confirm that the third operating system is the operating system corresponding to the instrument based on the identifier characterizing the identity of the third operating system.

[0070] Step S102: The first operating system authenticates the second operating system based on the first memory management request.

[0071] In some embodiments, the first operating system may authenticate the second operating system based on an identifier carried in the first memory management request and used to characterize the identity of the second operating system, so as to determine whether the second operating system has access rights to the shared memory.

[0072] In other embodiments, the first operating system may authenticate the second operating system based on an identifier carried in the first memory management request and used to characterize the identity of the second operating system to determine whether the first application running on the second operating system has access rights to the shared memory.

[0073] The access permission includes at least one of a read permission and a write permission.

[0074] In some embodiments, the permissions of each operating system of the SoC for shared memory can be stored in a register within the SoC. After receiving the first memory management request, the first operating system searches the register for whether the second operating system has the permission to apply for establishing a shared memory channel through the identifier representing the identity of the second operating system carried in the first memory management request; if the search result is yes, the second operating system identity authentication is passed.

[0075] Step S103: in response to the second operating system passing the identity authentication, the first operating system sends a second memory management request to all the third operating systems based on the first memory management request.

[0076] In some embodiments, if the second operating system identity authentication is passed, the first operating system determines the third operating system based on the information carried in the first memory management request, and the number of the third operating systems can be one or more. Afterwards, the first operating system sends a second memory management request to all the determined third operating systems. The second memory management request is used to request to establish a shared memory channel with the second operating system, or the second memory management request is used to request to release the shared memory channel between the third operating system and the second operating system.

[0077] Step S104: the first operating system manages the shared memory channel according to the received memory management response message.

[0078] In some embodiments, the first operating system receives a memory management response message sent by the third operating system in response to the second memory management request, wherein the memory management response message may be an agreement to establish a shared memory channel with the second operating system, or an agreement to release the shared memory channel with the second operating system, or an agreement to disagree to release the shared memory channel with the second operating system.

[0079] In some embodiments, if the memory management response message indicates that it agrees to establish a shared memory channel with the second operating system, the first operating system authenticates the third operating system, and after the third operating system is authenticated, the first operating system establishes a shared memory channel between the second operating system and the third operating system. The specific process of the first operating system authenticating the third operating system is as follows: the first operating system receives the interrupt number sent by the third operating system, and the first operating system searches for the operating system corresponding to the interrupt number in the cache; if the operating system corresponding to the interrupt number is found to be the third operating system, the first operating system authenticates the third operating system.

[0080] In some embodiments, if the shared memory channel between the second operating system and the third operating system is successfully established, the first operating system may store the information of the shared memory channel; the first operating system may also send a channel establishment success message to the second operating system and all the third operating systems. The information of the shared memory channel may include one or more of the following: the real physical address of the shared memory channel, the name of the shared memory channel, the size of the shared memory channel, and the identification number of the shared memory channel.

[0081] In some embodiments, after receiving the second memory management request message sent by the first operating system, the third operating system authenticates the first operating system; if the authentication is successful, the first operating system determines that the third operating system agrees to establish a shared memory channel with the second operating system, or agrees to release the shared memory channel with the second operating system. If the authentication fails, the first operating system determines that the third operating system does not agree to establish a shared memory channel with the second operating system, or does not agree to release the shared memory channel with the second operating system. Specifically, the third operating system can confirm whether to allow the establishment of a shared memory channel with the second operating system based on a pre-stored mapping table; wherein the mapping table includes a correspondence between operating systems that can establish a shared memory channel, and operating systems with a corresponding relationship can establish a shared memory channel.

[0082] In other embodiments, if all the third operating systems confirm to release the shared memory channel, the first operating system releases the shared memory channel of the second operating system and all the third operating systems. If any one or more third operating systems disagree to release the shared memory channel, the first operating system does not release the shared memory channel.

[0083] In some embodiments, if the shared memory channel between the second operating system and the third operating system is released successfully, the first operating system sends a channel release success message to the second operating system and all the third operating systems.

[0084] In an embodiment of the present application, any one or more applications running on the second operating system can trigger the second operating system to send a first memory management request to the first operating system, and the first memory management request can request the first operating system to establish a shared memory channel between the second operating system and one or more third operating systems. The first operating system establishes a shared memory channel or releases a shared memory channel according to the request of the second operating system, thereby realizing dynamic management of shared memory of multiple hardware domains (establishing a shared memory channel or releasing a shared memory channel), and avoiding the problem of low memory space utilization caused by static memory allocation. The cross-hardware domain shared memory management method provided in an embodiment of the present application can flexibly establish a shared memory channel or release a shared memory channel according to the request of the second operating system, without recompiling the operating system or application, thereby improving the management efficiency of shared memory.

[0085] Above Figure 1 The process of shared memory management (shared memory application or shared memory release) across hardware domains is shown. Before the shared memory application or shared memory release across hardware domains, the shared memory can also be initialized. The processing flow of shared memory initialization provided by the embodiment of the present application is as follows: Figure 2 As shown, at least the following steps are included:

[0086] Step S201: The second operating system sends a shared memory initialization request to the first operating system.

[0087] In some embodiments, the second operating system may call the shm_init function to initiate a shared memory initialization request to the first operating system.

[0088] In some embodiments, the second operating system runs on a cross-domain memory management service front end (Cross Domain Share Memory Front end, CDSHMF), and an application runs on the second operating system, and the application may also be referred to as a calling end.

[0089] Step S202: The first operating system completes its own initialization and connects the reserved memory to the memory management system according to the shared memory configuration information.

[0090] In some embodiments, the first operating system for managing the shared memory runs on a cross-domain memory management service back end (Cross Domain Share Memory Back end, CDSHMB).

[0091] In some embodiments, the reserved memory is a memory reserved according to a maximum concurrent scenario of the SoC, and the memory in the memory management system is a shared memory.

[0092] Step S203: The first operating system sends a shared memory initialization result to the second operating system.

[0093] Above Figure 1 The following figure shows the shared memory management (shared memory application or shared memory release) process across hardware domains. Figure 2 The processing flow of cross-hardware domain shared memory initialization is shown. The embodiment of the present application can also query the cross-hardware domain shared memory. The processing flow of cross-hardware domain shared memory query provided by the embodiment of the present application is as follows: Figure 3 As shown, at least the following steps are included:

[0094] Step S301: The calling end sends a shared memory query request to the second operating system.

[0095] In some embodiments, the calling end may call the shm_query function to initiate a shared memory query request to the second operating system.

[0096] In some embodiments, the second operating system runs on a cross-domain memory management service front end (Cross Domain Share Memory Front end, CDSHMF), and an application runs on the second operating system, and the application may also be referred to as a calling end.

[0097] Step S302: the second operating system queries whether there is a registered CID, and if so, determines the corresponding shared memory channel information.

[0098] CID is the shared memory channel identification (Channel Identification).

[0099] Step S303: The second operating system sends the shared memory query result to the calling end.

[0100] In some embodiments, the second operating system returns a shared memory query result (shm_query operation result) to the caller, and the shared memory query result includes at least the shared memory channel information corresponding to the registered CID. The shared memory channel information includes at least one or more of the real physical address of the shared memory channel, the name of the shared memory channel, the size of the shared memory channel, and the identification number of the shared memory channel.

[0101] The processing flow of the cross-hardware domain shared memory event monitoring callback provided by the embodiment of the present application is as follows: Figure 4 As shown, at least the following steps are included:

[0102] Step S401: The calling end sends a shared memory event monitoring callback request to the second operating system.

[0103] In some embodiments, the calling end may call the shm_notify function to initiate a shared memory event monitoring callback request to the second operating system.

[0104] In some embodiments, the second operating system runs on a cross-domain memory management service front end (Cross Domain Share Memory Front end, CDSHMF), and an application runs on the second operating system, and the application may also be referred to as a calling end.

[0105] Step S402: The second operating system registers a callback triggering event to the second operating system.

[0106] In some embodiments, the second operating system registers a callback function to register a callback triggering event to the second operating system.

[0107] Step S403: The second operating system sends a shared memory event monitoring callback result to the calling end.

[0108] The following is a detailed description of the cross-hardware domain shared memory management method provided in an embodiment of the present application.

[0109] For the scenario of shared memory application, a detailed processing flow of a cross-hardware domain shared memory management method provided in an embodiment of the present application is as follows: Figure 5 As shown, at least the following steps are included:

[0110] Step S501: the calling end 1 sends a shared memory allocation request to the cross-domain memory management service front end 1.

[0111] In some embodiments, the calling end 1 is an application program running on a second operating system.

[0112] In some embodiments, the calling end 1 calls the shm_alloc function to send a shared memory allocation request to the cross-domain memory management service front end 1 , and the second operating system runs on the cross-domain memory management service front end 1 .

[0113] Step S502: the cross-domain memory management service front end 1 sends a shared memory allocation request to the cross-domain memory management service back end.

[0114] In some embodiments, a first operating system runs on the cross-domain memory management service backend. The process of the cross-domain memory management service frontend 1 sending a shared memory allocation request to the cross-domain memory management service backend is the process of the first operating system receiving the first memory management request sent by the second operating system.

[0115] In the embodiment of the present application, the process of the first operating system receiving the first memory management request sent by the second operating system is as follows: Figure 1 The specific process of step S101 shown is the same and will not be repeated here.

[0116] Step S503: the cross-domain memory management service backend performs identity authentication on the cross-domain memory management service frontend 1.

[0117] In some embodiments, the process of the cross-domain memory management service backend performing identity authentication on the cross-domain memory management service front end 1 is the process of the first operating system performing identity authentication on the second operating system.

[0118] In the embodiment of the present application, the process of the first operating system performing identity authentication on the second operating system is as follows: Figure 1 The specific process of step S102 shown is the same and will not be repeated here.

[0119] Step S504: the cross-domain memory management service backend sends a second memory management request to the cross-domain memory management service frontend 2.

[0120] In some embodiments, the process of the cross-domain memory management service backend sending the second memory management request to the cross-domain memory management service front end 2 is the process of the first operating system sending the second memory management request to all the third operating systems.

[0121] In the embodiment of the present application, the process of the first operating system sending the second memory management request to all the third operating systems is as follows: Figure 1 The specific process of step S103 shown is the same and will not be repeated here.

[0122] Step S505: the cross-domain memory management service front end 2 performs identity authentication on the cross-domain memory management service back end.

[0123] Step S506 , the cross-domain memory management service front end 2 confirms whether to allow the establishment of a shared memory channel with the cross-domain memory management service front end 1 .

[0124] In some embodiments, the cross-domain memory management service front end 2 can confirm whether to allow the establishment of a shared memory channel with the cross-domain memory management service front end 1 according to a pre-stored mapping table. The mapping table includes the corresponding relationship between the operating systems (or cross-domain memory management service front ends) that can establish a shared memory channel, and the operating systems (or cross-domain memory management service front ends) with the corresponding relationship can establish a shared memory channel.

[0125] Step S507: the cross-domain memory management service front end 2 feeds back a confirmation result to the cross-domain memory management service back end.

[0126] In some embodiments, the confirmation result is used to indicate that the cross-domain memory management service front end 2 is allowed to establish a shared memory channel with the cross-domain memory management service front end 1 .

[0127] Step S508: the cross-domain memory management service backend performs identity authentication on the cross-domain memory management service frontend 2.

[0128] Step S509: the cross-domain memory management service backend allocates a shared memory channel and stores the shared memory information in the shared memory management system.

[0129] In some embodiments, the shared memory information includes at least one or more of the following: an identifier of the cross-domain memory management service front end 1, an identifier of the cross-domain memory management service front end 2, a real physical address of the shared memory channel, a name of the shared memory channel, a size of the shared memory channel, and an identification number of the shared memory channel.

[0130] Step S510: the cross-domain memory management service backend sends shared memory information to the cross-domain memory management service frontend 1 and the cross-domain memory management service frontend 2 respectively.

[0131] In step S511, the cross-domain memory management service front end 1 and the cross-domain memory management service front end 2 respectively authenticate the cross-domain memory management service back end and store the shared memory information.

[0132] Step S512 , the cross-domain memory management service front end 1 calls the registered callback function and feeds back the operation result of the shared memory allocation application to the calling end 1 corresponding to the cross-domain memory management service front end 1 .

[0133] Step S513 , the cross-domain memory management service front end 2 sends a channel event establishment notification to the calling end 2 corresponding to the cross-domain memory management service front end 2 .

[0134] In some embodiments, the channel event establishment notification is used to notify the calling end 2 corresponding to the cross-domain memory management service front end 2 to establish a shared memory channel with the calling end 1 corresponding to the cross-domain memory management service front end 1.

[0135] After executing step S513, the calling end 2 corresponding to the cross-domain memory management service front end 2 executes the callback function.

[0136] In some embodiments, the calling end 2 corresponding to the cross-domain memory management service front end 2 executes a callback function to enable the calling end 2 corresponding to the cross-domain memory management service front end 2 and the calling end 1 corresponding to the cross-domain memory management service front end 1 to share data or transfer data in a shared memory channel.

[0137] For the scenario of shared memory release, another detailed processing flow of the cross-hardware domain shared memory management method provided by the embodiment of the present application is as follows: Figure 6 As shown, at least the following steps are included:

[0138] Step S601: the calling end 1 sends a shared memory release request to the cross-domain memory management service front end 1.

[0139] In some embodiments, the calling end 1 is an application program running on a second operating system.

[0140] In some embodiments, the calling end 1 calls the shm_free function to send a shared memory release request to the cross-domain memory management service front end 1 , and the second operating system runs on the cross-domain memory management service front end 1 .

[0141] Step S602: the cross-domain memory management service front end 1 sends a shared memory release request to the cross-domain memory management service back end.

[0142] In some embodiments, a first operating system runs on the cross-domain memory management service backend. The process of the cross-domain memory management service frontend 1 sending a shared memory release request to the cross-domain memory management service backend is the process of the first operating system receiving the first memory management request sent by the second operating system.

[0143] In the embodiment of the present application, the process of the first operating system receiving the first memory management request sent by the second operating system is as follows: Figure 1 The specific process of step S101 shown is the same and will not be repeated here.

[0144] Step S603: the cross-domain memory management service backend performs identity authentication on the cross-domain memory management service frontend 1.

[0145] In some embodiments, the process of the cross-domain memory management service backend performing identity authentication on the cross-domain memory management service front end 1 is the process of the first operating system performing identity authentication on the second operating system.

[0146] In the embodiment of the present application, the process of the first operating system performing identity authentication on the second operating system is as follows: Figure 1 The specific process of step S102 shown is the same and will not be repeated here.

[0147] Step S604: the cross-domain memory management service backend verifies the identity of the caller 1 and determines whether the caller 1 has the authority to initiate a shared memory release request.

[0148] In some embodiments, the cross-domain memory management service backend determines whether the calling end 1 has the authority to initiate a shared memory release request based on the stored index record. Among them, the index record may record one or more of the following information: the identifier of the cross-domain memory management service frontend 1, the identifier of the cross-domain memory management service frontend 2, the CID, the real physical address of the shared memory channel, the name of the shared memory channel, the size of the shared memory channel, and the identification number of the shared memory channel. Specifically, the cross-domain memory management service backend searches for the cross-domain memory management service frontend associated with the CID based on the stored index record, and the cross-domain memory management service frontend associated with the CID has the authority to initiate a shared memory release request.

[0149] Step S605, if the cross-domain memory management service backend passes the identity authentication of the caller 1, the cross-domain memory management service backend confirms whether all cross-domain memory management service front ends associated with the shared memory channel are allowed to release the shared memory channel.

[0150] In some embodiments, the cross-domain memory management service backend may send a shared memory release request to all cross-domain memory management service frontends associated with the shared memory channel. If all cross-domain memory management service frontends associated with the shared memory channel agree to release the shared memory channel, the cross-domain memory management service backend releases the shared memory channel. If any cross-domain memory management service frontend associated with the shared memory channel disagrees to release the shared memory channel, the cross-domain memory management service backend does not release the shared memory channel.

[0151] Step S606: the cross-domain memory management service backend sends a shared memory release success message to the cross-domain memory management service frontend 1 and the cross-domain memory management service frontend 2 respectively.

[0152] Step S607 , the cross-domain memory management service front end 1 cancels the information of the shared memory channel and sends a shared memory release result to the calling end 1 .

[0153] Step S608: the cross-domain memory management service front end 2 sends a shared memory release notification to the calling end 2.

[0154] Step S609: the calling end 2 executes the callback function.

[0155] In some embodiments, the callback function is executed by calling terminal 2 so that the application program registered with the shared memory is informed that the shared memory has been released.

[0156] The system framework diagram of the cross-hardware domain shared memory management method provided by the embodiment of the present invention is as follows: Figure 7 As shown, the cross-hardware domain shared memory management method is applied to SoC, and SoC includes a cross-domain memory management service front end 1, a cross-domain memory management service front end 2 and a cross-domain memory management service back end. Among them, the cross-domain memory management service front end 1 is located in the second hardware domain, and the second hardware domain runs a second operating system, an application 1 and a client 1, and the cross-domain memory management service front end 2 is located in the third hardware domain, and the third hardware domain runs a third operating system, an application 2, an application 3 and a client 2, and the cross-domain memory management service back end is located in the first hardware domain, and the first hardware domain runs a first operating system and a server. The cross-domain memory management service back end is used to manage the shared memory channels between each hardware domain, and the management of the shared memory channels across hardware domains is realized through the first operating system, which is convenient for secondary development of the software on the SoC. In the embodiment of the present application, the shared memory is the memory reserved according to the maximum concurrent scenario of the SoC, and the shared memory of multiple hardware domains is flexibly and uniformly managed by the third operating system, and the shared memory channel is applied for according to the memory size required by the application, so as to avoid the problem of low memory utilization caused by reserving shared memory for each application scenario in the prior art.

[0157] The embodiment of the present application further provides a cross-hardware domain shared memory management device, on which a first operating system is running. The composition structure diagram of the cross-hardware domain shared memory management device is as follows: Figure 8 As shown, including:

[0158] A receiving module 801 is configured to receive a first memory management request sent by a second operating system through an inter-core communication channel; the first memory management request is triggered based on a first application running on the second operating system, and the first memory management request is used to apply to establish a shared memory channel with at least one third operating system, or to apply to release a shared memory channel with at least one third operating system;

[0159] A verification module 802, configured to authenticate the second operating system based on the first memory management request;

[0160] A sending module 803 is configured to send a second memory management request to all the third operating systems based on the first memory management request in response to the second operating system passing the identity authentication;

[0161] A management module 804, configured to manage the shared memory channel according to the received memory management response message;

[0162] The memory management response message is sent by the third operating system based on the second memory management request; each operating system is configured to run on a hardware domain of the system-level chip.

[0163] In some embodiments, the verification module 802 is used to confirm whether the first application has access rights to the shared memory channel;

[0164] confirming whether the second operating system has access rights to the shared memory channel;

[0165] The access permission includes at least one of a read permission and a write permission.

[0166] In some embodiments, the first memory management request is used to apply for establishing a shared memory channel with at least one third operating system. If the memory management response message is used to indicate that the third operating system confirms to establish the shared memory channel, the management module 804 is used to establish a shared memory channel between the second operating system and the third operating system.

[0167] In some embodiments, the management module 804 is used to store the information of the shared memory channel; and / or send a channel establishment success message to the second operating system and all the third operating systems.

[0168] In some embodiments, the first memory management request is used to apply for the release of a shared memory channel with at least one of the third operating systems. If the memory management response message is used to indicate that all of the third operating systems confirm the release of the shared memory channel, the management module 804 is used to release the shared memory channel between the second operating system and all of the third operating systems.

[0169] In some embodiments, the management module 804 is used for the first operating system to send a channel release success message to the second operating system and all the third operating systems.

[0170] In some embodiments, when the first operating system establishes a shared memory channel with multiple third operating systems, each third operating system has different access rights to the shared memory channel.

[0171] The present application also provides a chip, a schematic diagram of the structure of the chip, such as Fig. 9As shown, the chip includes: a processor 410, a memory 450 and a bus 440; the various modules in the chip are coupled together through the bus 440. It can be understood that the bus 440 is used to realize the connection and communication between these modules. In addition to the data bus, the bus 440 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, Fig. 9 Various buses are labeled as bus 440.

[0172] The processor 410 has signal processing capability, such as a general-purpose processor, a digital signal processor (DSP), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware models, etc., wherein the general-purpose processor may be a microprocessor or any conventional processor, etc.

[0173] The memory 450 stores executable instructions for implementing the cross-hardware domain shared memory management method provided in the embodiment of the present application. The cross-hardware domain shared memory management method can be implemented by Figure 8 The receiving module 801, the verification module 802, the sending module 803 and the management module 804 in the cross-hardware domain shared memory management device shown are implemented; the memory 450 can be removable, non-removable or a combination thereof. Exemplary hardware devices include solid-state memory, hard disk drive, optical disk drive, etc. The memory 450 optionally includes one or more storage devices that are physically far away from the processor 410.

[0174] In some embodiments, memory 450 is capable of storing data to support various operations, examples of which include programs, modules, and data structures, or a subset or superset thereof.

[0175] In some embodiments, the chip may further include:

[0176] Operating system 451, including system programs for processing various basic system services and performing hardware-related tasks, such as a framework layer, a core library layer, a driver layer, etc., for implementing various basic services and processing hardware-based tasks;

[0177] The network communication module 452 is used to reach other computing devices via one or more (wired or wireless) network interfaces 420. Exemplary network interfaces 420 include: Bluetooth, Wireless Authentication (WiFi), and Universal Serial Bus (USB).

[0178] An embodiment of the present application also provides a component on a traffic device, wherein the component includes a chip, and the chip is capable of executing the above-mentioned shared memory management method across hardware domains in the vehicle.

[0179] In some optional embodiments, the components may be components at the circuit board level, components at the automotive electrical system level, or components of an automotive assembly. As an example, the components may be the engine, chassis, body, and electrical and electronic equipment of the vehicle. The electrical and electronic equipment of the vehicle may include headlights for lighting, management equipment for controlling the engine, central control equipment for receiving broadcasts, navigation, listening to music, entertainment, etc.

[0180] The embodiment of the present application also provides an electronic device, the electronic device includes a chip, the chip can execute the above-mentioned cross-hardware domain shared memory management method. The chip can be a multi-core heterogeneous chip, and the electronic device can be a transportation device, including but not limited to a balance car, a car, a bus, a train or an airplane.

[0181] The embodiment of the present application provides a computer-readable storage medium storing executable instructions, wherein the executable instructions are stored. When the executable instructions are executed by a processor, the processor will be triggered to execute the cross-hardware domain shared memory management method provided by the embodiment of the present application, for example, Figures 1 to 6 The memory management method shown.

[0182] In some embodiments, the computer-readable storage medium may be a ferroelectric random access memory (FRAM), a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a flash memory, a magnetic surface memory, an optical disk, or a CD-ROM; or it may be various devices including one or any combination of the above memories.

[0183] In some embodiments, executable instructions may be in the form of a program, software, software module, script or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, model, subroutine or other unit suitable for use in a computing environment.

[0184] By way of example, executable instructions may be deployed to be executed on one computing device, or on multiple computing devices located at one site, or on multiple computing devices distributed across multiple sites and interconnected by a communication network.

[0185] An embodiment of the present application provides a computer program product, which includes a computer program / instruction. When the computer program / instruction is executed by a processor, the cross-hardware domain shared memory management method described in the present application is implemented.

[0186] The above are only embodiments of the present application and are not intended to limit the protection scope of the present application. Any modifications, equivalent substitutions and improvements made within the spirit and scope of the present application are included in the protection scope of the present application.

Claims

1. A shared memory management method across hardware domains, It is characterized in that The method comprises: The first operating system receives a first memory management request sent by the second operating system through an inter-core communication channel; the first memory management request is triggered based on a first application running on the second operating system, and the first memory management request is used to apply for establishing a shared memory channel with at least one third operating system, or to apply for releasing a shared memory channel with at least one third operating system; The first operating system authenticates the second operating system based on the first memory management request; In response to the second operating system passing the identity authentication, the first operating system sending a second memory management request to all the third operating systems based on the first memory management request; The first operating system manages the shared memory channel according to the received memory management response message; The memory management response message is sent by the third operating system based on the second memory management request; each operating system is configured to run on a hardware domain of the system-level chip.

2. The method according to claim 1, It is characterized in that The first operating system authenticating the second operating system based on the first memory management request includes at least one of the following: The first operating system confirms whether the first application has access rights to the shared memory channel; The first operating system confirms whether the second operating system has access rights to the shared memory channel; The access permission includes at least one of a read permission and a write permission.

3. The method according to claim 1, It is characterized in that The first memory management request is used to apply for establishing a shared memory channel with at least one third operating system, and the first operating system manages the shared memory channel according to the received memory management response message, including: If the memory management response message is used to indicate that the third operating system confirms to establish the shared memory channel, the first operating system establishes a shared memory channel between the second operating system and the third operating system.

4. The method according to claim 3, It is characterized in that The first operating system manages the shared memory channel according to the received memory management response message, further comprising: The first operating system stores information of the shared memory channel; And / or, the first operating system sends a channel establishment success message to the second operating system and all the third operating systems.

5. The method according to claim 1, It is characterized in that The first memory management request is used to apply for releasing a shared memory channel with at least one of the third operating systems, and the first operating system manages the shared memory channel according to the received memory management response message, including: If the memory management response message is used to indicate that all the third operating systems confirm the release of the shared memory channel, the first operating system releases the shared memory channel of the second operating system and all the third operating systems.

6. The method according to claim 5, It is characterized in that The first operating system manages the shared memory channel according to the received memory management response message, further comprising: The first operating system sends a channel release success message to the second operating system and all the third operating systems.

7. The method according to any one of claims 1 to 6, It is characterized in that When the first operating system establishes a shared memory channel with the plurality of third operating systems, each third operating system has different access rights to the shared memory channel.

8. A cross-hardware domain shared memory management device, It is characterized in that A first operating system is running on the device, and the device includes: a receiving module, configured to receive a first memory management request sent by a second operating system through an inter-core communication channel; the first memory management request is triggered based on a first application running on the second operating system, and the first memory management request is used to apply for establishing a shared memory channel with at least one third operating system, or to apply for releasing a shared memory channel with at least one third operating system; a verification module, configured to authenticate the second operating system based on the first memory management request; a sending module, configured to send a second memory management request to all the third operating systems based on the first memory management request in response to the second operating system passing the identity authentication; A management module, used for managing the shared memory channel according to the received memory management response message; The memory management response message is sent by the third operating system based on the second memory management request; each operating system is configured to run on a hardware domain of the system-level chip.

9. A chip, It is characterized in that The chip includes: a processor, a memory and a bus; The memory stores executable instructions; The processor communicates with the memory via the bus, and when the processor executes the executable instructions stored in the memory, the cross-hardware domain shared memory management method described in any one of claims 1 to 7 is implemented.

10. A component of a traffic device, It is characterized in that The component includes a chip, and the chip can implement the cross-hardware domain shared memory management method described in any one of claims 1 to 7.

11. An electronic device, It is characterized in that The electronic device comprises a chip, and the chip can implement the cross-hardware domain shared memory management method as described in any one of claims 1 to 7.