A memory scheduling method, device, storage medium and electronic equipment

By calculating priority scores and cross-operating system memory scheduling, the problem of low integrated circuit memory resource utilization is solved, and dynamic allocation and efficient utilization of memory resources are realized.

CN122387670APending Publication Date: 2026-07-14XG TECHNOLOGIES PTE LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610525537.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-04-20
Publication Date
2026-07-14

AI Technical Summary

Technical Problem

Integrated circuits cannot dynamically adjust memory according to the actual operating status of each operating system, resulting in low memory resource utilization and situations where a single operating system has insufficient memory while other operating systems have idle spare memory.

Method used

By calculating the priority score of the first operating system, and when the score is higher than the scheduling scores of other operating systems, the spare memory of other operating systems is scheduled to the first operating system, dynamic memory scheduling across operating systems is achieved.

Benefits of technology

It improves the utilization rate of integrated circuit memory, avoids the situation where a single operating system is short of memory while the spare memory of other operating systems is idle, and realizes memory access during the collaborative operation of multiple operating systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122387670A_ABST
    Figure CN122387670A_ABST
Patent Text Reader

Abstract

A memory scheduling method and device, a storage medium and an electronic device are disclosed, which are applied to an integrated circuit running a plurality of operating systems with different functional safety levels. A memory scheduling request is generated in response to a first operating system running a first task when the memory remaining amount is less than the memory demand amount. The priority score of the first task is calculated, and when the priority score is greater than the scheduling score of a second operating system with a different functional safety level, at least part of the standby memory of the second operating system is scheduled to the first operating system. The disclosed embodiments can realize cross-operating system dynamic memory scheduling, flexibly allocate memory according to the actual task running demand and memory usage state of each operating system, and make scheduling decisions according to the comparison of the priority score and the scheduling score, thereby avoiding the situation that the memory of a single operating system is insufficient while the standby memory of another operating system is idle, and effectively improving the memory utilization of the integrated circuit.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of integrated circuit memory scheduling technology, and in particular to a memory scheduling method, apparatus, storage medium and electronic device. Background Technology

[0002] In the application scenario of intelligent vehicle cockpit-driver integration, the integrated circuits of intelligent vehicles can run multiple operating systems simultaneously to achieve different driving functions. Memory is the core hardware resource for operating system operation, and each operating system needs to run system tasks such as program loading, data storage, and resource scheduling through memory.

[0003] Integrated circuits commonly use hard isolation to allocate fixed-size memory for different operating systems. However, this memory allocation method strictly restricts memory allocation and use to the operating system, preventing integrated circuits from dynamically adjusting memory according to the actual operating status of each operating system, thus reducing memory resource utilization. Summary of the Invention

[0004] To address the aforementioned technical problems, this disclosure provides a memory scheduling method, apparatus, storage medium, and electronic device to solve the problem that integrated circuits cannot dynamically adjust memory according to the actual operating status of each operating system, thereby reducing memory resource utilization.

[0005] The first aspect of this disclosure provides a memory scheduling method applied to an integrated circuit for running multiple operating systems with different functional safety levels. The method includes: in response to a memory scheduling request generated by a first operating system while running a first task, calculating a priority score for the first task, wherein the memory scheduling request is generated by the first operating system when the available memory is less than the memory requirement of the first task; and in response to the priority score of the first task being greater than a pre-allocated scheduling score by a second operating system, scheduling at least a portion of the spare memory of the second operating system to the first operating system.

[0006] A second aspect of this disclosure provides a memory scheduling device for use in an integrated circuit, the integrated circuit being used to run multiple operating systems with different functional safety levels, the device comprising: The calculation module is used to calculate the priority score of the first task in response to a memory scheduling request generated by the first operating system when running the first task, wherein the memory scheduling request is generated by the first operating system when the available memory is less than the memory requirement of the first task; the scheduling module is used to schedule at least a portion of the spare memory of the second operating system to the first operating system in response to the priority score of the first task being greater than the scheduling score pre-allocated by the second operating system.

[0007] A third aspect of this disclosure provides a computer-readable storage medium storing a computer program for executing the memory scheduling method provided in the first aspect of this disclosure.

[0008] A fourth aspect of this disclosure provides an electronic device including a processor; a memory for storing processor-executable instructions; the processor being configured to read executable instructions from the memory and execute the instructions to implement the memory scheduling method provided in the first aspect of this disclosure.

[0009] A fifth aspect of this disclosure provides a computer program product that, when an instruction processor in the computer program product is executed, performs the memory scheduling method provided in the first aspect of this disclosure.

[0010] This disclosure provides a memory scheduling method, apparatus, storage medium, and electronic device applied to an integrated circuit running multiple operating systems with different functional safety levels. By responding to a memory scheduling request generated when a first operating system is running a first task and its available memory is less than the required memory, the method calculates a priority score for the first task. If this priority score is greater than a pre-allocated scheduling score by a second operating system with a different functional safety level, at least a portion of the second operating system's spare memory is scheduled to the first operating system. This disclosure enables dynamic memory scheduling across operating systems, flexibly allocating memory according to the actual task execution requirements and memory usage status of each operating system. Scheduling decisions are made based on a comparison of priority scores and scheduling scores, avoiding situations where one operating system has insufficient memory while another has idle spare memory, effectively improving the memory utilization rate of the integrated circuit. Attached Figure Description

[0011] Figure 1 This is an integrated circuit architecture diagram provided in an exemplary embodiment of the present disclosure; Figure 2 This is a flowchart illustrating an exemplary embodiment of the memory scheduling method provided in this disclosure; Figure 3 This is a flowchart illustrating step S210 provided in an exemplary embodiment of this disclosure; Figure 4 This is a flowchart illustrating step S212 provided in an exemplary embodiment of this disclosure; Figure 5 This is a schematic flowchart of step S2122 provided in an exemplary embodiment of this disclosure; Figure 6 This is a flowchart illustrating step S220 provided in an exemplary embodiment of this disclosure; Figure 7 This is another schematic flowchart of step S220 provided in an exemplary embodiment of this disclosure; Figure 8 This is a flowchart illustrating step S222 provided in an exemplary embodiment of this disclosure; Figure 9 This is a schematic diagram of a process for reclaiming scheduled spare memory provided in an exemplary embodiment of this disclosure; Figure 10 This is a flowchart illustrating step S223 provided in an exemplary embodiment of this disclosure; Figure 11 This is a structural diagram of a memory scheduling device provided in an exemplary embodiment of the present disclosure; Figure 12 This is a structural diagram of an electronic device provided in an exemplary embodiment of this disclosure. Detailed Implementation

[0012] To explain this disclosure, exemplary embodiments of the disclosure will now be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the disclosure, and not all of them. It should be understood that the disclosure is not limited to exemplary embodiments.

[0013] It should be noted that, unless otherwise specifically stated, the relative arrangement, numerical expressions, and values ​​of the components and steps set forth in these embodiments do not limit the scope of this disclosure.

[0014] Application Overview With the rapid development of intelligent vehicle cockpit-driver integration technology, in-vehicle integrated circuits need to run multiple operating systems with different functional safety levels simultaneously to support the operation of in-vehicle functions such as autonomous driving, intelligent cockpits, and instrument panels. Memory, as a core hardware resource of integrated circuits, directly determines the execution efficiency of program loading, data storage, and resource scheduling of the operating system, and is a key foundation for ensuring the stable operation, functional safety, and smooth interaction of the in-vehicle system.

[0015] The vehicle-mounted integrated circuit adopts a fixed memory allocation method, which allocates independent memory spaces for different operating systems. Each operating system can freely use the memory resources of its own memory space to run the system tasks corresponding to the operating system.

[0016] Because different system tasks have different memory requirements, if most of the operating system's memory has been allocated to other tasks while an operating system is running a system task, the operating system's remaining memory may be less than the memory requirements of the system task, resulting in the operating system's memory space being unable to meet the memory requirements of the system task.

[0017] However, this memory partitioning method strictly limits memory allocation and use to the operating system. Integrated circuits cannot dynamically adjust memory according to the actual operating status of each operating system. Even if other operating systems outside the system have spare memory that meets the system's task requirements and is in an idle state, they cannot schedule some of the idle spare memory to be used by that operating system, resulting in low memory resource utilization of integrated circuits.

[0018] Exemplary System Figure 1 This is an integrated circuit architecture diagram provided by an exemplary embodiment of the present disclosure. The integrated circuit 100 in this disclosure can be an automotive integrated circuit used to run an in-vehicle system for a smart car. The integrated circuit 100 may include multiple hardware units, which include multiple processors and a memory. The multiple processors correspond to multiple functional domains, and different functional domains can run independent operating systems through their respective processors. The operating systems can then execute corresponding system tasks within their respective functional domains to achieve different in-vehicle functions.

[0019] like Figure 1 As shown, multiple functional domains may include security domain 110, performance domain 120, entertainment domain 130, and other functional domains not shown. Integrated circuit 100 can execute system tasks within a functional domain through the corresponding operating system. For example, integrated circuit 100 can run high-security level system tasks related to security domain 110 through an instrument operating system; integrated circuit 100 can execute high-performance level system tasks related to performance domain 120 through an autonomous driving operating system; and integrated circuit 100 can execute multimedia entertainment system tasks related to entertainment domain 130 through an intelligent cockpit operating system.

[0020] It should be noted that the correspondence between functional domains and operating systems in the above-disclosed embodiments is only an illustrative example. In practical applications, the division of functional domains and their mapping relationship with the operating system can be flexibly configured according to the specific design requirements and application scenarios of the integrated circuit 100, and is not limited to the above example.

[0021] Different operating systems have different security levels. Figure 1 Taking the operating systems that the integrated circuits shown can run as an example, the instrument operating system has the highest functional safety level, followed by the autonomous driving operating system, and the intelligent cockpit operating system has the lowest functional safety level. It should be noted that the functional safety levels of the operating systems in the above-disclosed embodiments are merely illustrative examples. In practical applications, the functional safety levels of different operating systems can be flexibly configured according to the application scenario and are not limited to the above examples.

[0022] For example, the integrated circuit 100 can also be configured with a dedicated communication domain according to actual functional requirements, and use the corresponding communication operating system to handle various vehicle communication tasks, such as vehicle network data interaction and Bluetooth connection management.

[0023] Each functional domain's operating system has a pre-defined memory region. These memory regions are pre-defined by the integrated circuit 100 according to the memory requirements of each functional domain, ensuring that the basic tasks of each functional domain can run stably.

[0024] Each operating system's corresponding memory region is physically isolated at the hardware level to ensure that memory access from different functional domains does not interfere with each other, thus improving security between operating systems. Under this architecture, each operating system can perform operations such as memory allocation, reclamation, and address mapping within the memory region for easier memory management.

[0025] The operating system can send a memory scheduling request to request free spare memory from other operating systems. Based on the memory scheduling request, integrated circuit 100 can determine the free spare memory of other operating systems for memory scheduling, thereby enabling the operating system to obtain the required memory from other operating systems and improving the memory utilization efficiency of integrated circuit 100.

[0026] Exemplary methods Figure 2 This is a schematic flowchart illustrating a memory scheduling method provided in an exemplary embodiment of this disclosure. Embodiments of this disclosure can be applied to electronic devices, wherein the electronic device may include an integrated circuit, and the memory scheduling method is executed through the integrated circuit. The memory scheduling method provided in the embodiments of this disclosure will be described in detail below, using the integrated circuit as the execution entity.

[0027] like Figure 2 As shown, the memory scheduling method provided in this embodiment includes the following steps: S210: In response to a memory scheduling request generated by the first operating system while running the first task, calculate the priority score of the first task.

[0028] The first operating system is any one of the multiple operating systems that an integrated circuit can run. The first task is the system task that the first operating system currently needs to execute, which can be initiated and executed through user input control commands or through a task scheduling mechanism triggered internally by the first operating system.

[0029] A memory scheduling request is generated by the first operating system when its available memory is less than the memory requirement of the first task. It is used to request memory from other operating systems besides the first operating system. During the execution of the first task, the first operating system can monitor its available memory. If the available memory is greater than or equal to the memory requirement of the first task, the first operating system can run the first task normally using the memory allocated to it. Conversely, if the available memory is less than the memory requirement of the first task, the first operating system cannot run the first task, thus generating a memory scheduling request and calculating the priority score of the first task.

[0030] Priority scores are used to evaluate the priority of system tasks in scheduling memory. The higher the priority score, the higher the priority of system tasks in scheduling memory, so that when multiple operating systems have memory scheduling needs at the same time, memory resources are allocated to system tasks with high priority scores first.

[0031] S220: In response to the priority score of the first task being greater than the scheduling score pre-assigned to the second operating system, at least a portion of the spare memory of the second operating system is scheduled to the first operating system.

[0032] In some examples, the functional safety level of the second operating system differs from that of the first operating system, where the functional safety level of the second operating system may be higher or lower than that of the first operating system.

[0033] The scheduling score is a threshold that an integrated circuit pre-sets for each operating system. It measures how easily the operating system's memory is scheduled when faced with memory scheduling requests from other operating systems.

[0034] In some examples, the scheduling score can be set by taking into account factors such as the functional safety level of the operating system and the importance of the currently running task. Operating systems with higher functional safety levels can be assigned higher scheduling scores. Thus, only when the priority score of a system task requesting scheduled memory is higher than the scheduling score of the high-safety-level operating system can spare memory be scheduled from that high-safety-level operating system, thereby maximizing the stable operation of the high-safety-level operating system's own tasks.

[0035] In some examples, each operating system's memory may include private memory and spare memory. Private memory is a fixed amount of memory pre-allocated by the integrated circuit for the operating system and does not participate in any memory scheduling. Spare memory is a scheduleable memory resource reserved by the operating system outside of private memory based on its own operational status. The size of the spare memory can be dynamically adjusted by the operating system based on its historical memory usage, current task load, and preset memory reservation policies. For example, when the second operating system detects that its currently running tasks have low memory requirements and there are no tasks with high memory requirements planned in the near future, it can appropriately increase the proportion of its spare memory; conversely, if the second operating system predicts that a task with high memory requirements will start soon, it can reduce the spare memory to ensure the smooth execution of its own tasks.

[0036] In some examples, for operating systems with high functional safety levels, the integrated circuit may not allocate spare memory within the operating system's memory. For instance, continuing the previous example, for the dashboard operating system with the highest functional safety level, the integrated circuit does not allocate spare memory for the dashboard operating system; that is, the dashboard operating system's memory is entirely private memory and does not participate in any memory scheduling. In this way, the memory corresponding to the high-functional-safety-level operating system will not be allocated to other operating systems, thereby ensuring that the high-functional-safety-level operating system maintains the highest scheduling priority.

[0037] It should be noted that, like private memory, spare memory is protected by hardware isolation mechanisms. Before it is scheduled, only the second operating system has the right to access and manage spare memory.

[0038] When the priority score of the first task is greater than the scheduling score of the second operating system, the integrated circuit sends a memory scheduling instruction to the second operating system. Upon receiving the instruction, the second operating system allocates at least a portion of its spare memory to the first operating system. For example, if the first operating system is a smart cockpit operating system and the second operating system is a smart driving operating system, and the memory reserves of the first operating system are insufficient to meet the memory requirements of its currently running high-priority entertainment task, if the priority score of the entertainment task is higher than the scheduling score of the smart driving operating system, and the smart driving operating system has sufficient spare memory, then the integrated circuit can allocate a portion of the smart driving operating system's spare memory to the smart cockpit operating system.

[0039] The method provided in this disclosure calculates a first task priority score in response to a memory scheduling request, and schedules spare memory of the second operating system when the priority score is higher than the scheduling score of the second operating system at different functional safety levels, thereby achieving dynamic memory allocation across operating systems with different functional safety levels. In this way, when the operating system's memory is insufficient but other operating systems have available spare memory, the spare memory of other operating systems can be scheduled to run the first task within this operating system, realizing memory access during multi-operating system collaborative operation and significantly improving the memory resource utilization of the integrated circuit.

[0040] Figure 3 This is a flowchart illustrating step S210 provided in an exemplary embodiment of the present disclosure.

[0041] like Figure 3 As shown above, in the above Figure 2 Based on the illustrated embodiment, step S210 may include the following steps: S211: In response to a memory scheduling request generated by the first operating system when running the first task, obtain the task type of the first task, the real-time memory status of the first operating system, and the operating status of the device where the integrated circuit is located.

[0042] Task type is used to represent the functional attributes of system tasks. It can include different types such as system core tasks, user interaction tasks, driving tasks, background computing tasks, and multimedia entertainment tasks. Different task types have different security levels, importance, and memory requirements.

[0043] The real-time memory status of the first operating system includes parameters such as the amount of memory currently used, the amount of memory remaining (i.e., memory balance), and the memory usage growth rate. These parameters can reflect the current memory usage of the first operating system.

[0044] The device containing integrated circuits is a hardware entity that installs or uses integrated circuits and uses them as its core operating mechanism. In the context of automotive applications, this device is a smart car. The device's operating status can include the vehicle's current driving mode, such as autonomous driving mode or manual driving mode; driving status, such as driving status or parking status; key sensor data, such as image data collected by cameras or monitoring data collected by radar; and network connection status, among other information.

[0045] After the first operating system generates a memory scheduling request, it can respond to the memory scheduling request by obtaining information such as the task type of the first task, the real-time memory status of the first operating system, and the operating status of the device where the integrated circuit is located, so as to evaluate the priority of the first task.

[0046] S212: Calculate the priority score of the first task based on the task type of the first task, the real-time memory status of the first operating system, and the operating status of the device where the integrated circuit is located.

[0047] In some examples, the integrated circuit can use a pre-created scoring system to calculate the priority score of the first task based on the task type of the first task, the real-time memory state of the first operating system, and the operating state of the device in which the integrated circuit is located.

[0048] The scoring system can be a multi-dimensional weighted calculation model, where the task type of the first task, the real-time memory state of the first operating system, and the operating state of the device containing the integrated circuit each correspond to a dimension of information. The scoring system can set corresponding scoring weights and rules for each dimension of information, thereby obtaining the score value corresponding to each dimension of information according to the scoring rules, and then weighting and summing the score values ​​according to the scoring weights corresponding to each dimension of information to calculate the priority score of the first task.

[0049] The method provided in this disclosure calculates a priority score from multiple dimensions, including the task type of the first task, the real-time memory status of the first operating system, and the operating status of the device where the integrated circuit is located. This makes the priority score more closely match the actual memory requirements of the task and the system operating scenario, thereby improving the accuracy and rationality of triggering memory scheduling based on the priority score.

[0050] Figure 4 This is a flowchart illustrating step S212 provided in an exemplary embodiment of the present disclosure.

[0051] like Figure 4 As shown above, in the above Figure 3 Based on the illustrated embodiment, step S212 may include the following steps: S2121: Determine the static score of the first task based on the memory bandwidth requirements and latency sensitivity corresponding to the task type.

[0052] Memory bandwidth requirements represent the amount of data transfer needed by a system task per unit of time, typically measured in MB / s or GB / s. Different task types have different memory bandwidth requirements. For example, within the same operating system, a smart cockpit operating system can run video decoding and text processing tasks. Video decoding requires real-time processing of large amounts of image data, thus demanding more memory bandwidth than text processing.

[0053] Latency sensitivity is used to represent the response speed of a system task to memory access. A higher latency sensitivity indicates a lower tolerance for latency in memory operations during task execution. Conversely, a lower latency sensitivity indicates a higher tolerance for latency in memory operations during task execution. For example, in an automotive scenario, after a smart car activates its autonomous driving function, the autonomous driving operating system runs a real-time environmental perception task. This task perceives information about the surrounding environment while the vehicle is in autonomous driving mode. If there is even a slight delay in memory access response, it may lead to untimely handling of sudden road conditions, causing safety risks. Therefore, the real-time environmental perception task can be set to high latency sensitivity.

[0054] The latency sensitivity setting can be related to the safety level of the system task. For example, autonomous driving functions have the highest safety level and should ensure the fastest possible response to guarantee passenger safety during driving; therefore, a relatively high latency sensitivity can be set. For in-vehicle entertainment functions, the safety level is relatively low, and they can respond at only the basic speed; therefore, a relatively low latency sensitivity can be set.

[0055] Static scores are used to represent the impact of a system task’s memory bandwidth requirements and latency sensitivity on its priority. The static score for each system task can be a fixed value.

[0056] The integrated circuit can pre-allocate fixed memory bandwidth requirements and latency sensitivity for each system task according to the task type of each system task, and create a mapping table between memory bandwidth requirements, latency sensitivity and static score. Thus, when the integrated circuit responds to a memory scheduling request sent by the first operating system, it can determine the static score of the first task in the mapping table according to the memory bandwidth requirements and latency sensitivity of the first task.

[0057] S2122: Calculate the dynamic score of the first task based on the real-time memory status of the first operating system.

[0058] In some examples, dynamic scores are used to represent the dynamic impact of the real-time memory state of the first operating system on the priority of system tasks, and the dynamic scores are adjusted in real time as system memory usage changes.

[0059] For example, when the memory remaining of the first operating system is less than a preset memory remaining threshold, memory resources are relatively scarce. In this case, for system tasks with memory requirements that are relatively large compared to the memory remaining, the dynamic score will be increased accordingly to prioritize memory allocation for system tasks. When the memory remaining is greater than or equal to the preset memory remaining threshold, it indicates that there is sufficient memory remaining, and the dynamic score will be decreased accordingly, thus relying more on the static score to evaluate the priority of system tasks.

[0060] For example, if the first operating system has only 10% of the total memory available and the memory usage growth rate is high, then the first operating system is in a memory-scarce state, which will correspondingly increase the dynamic score of the first task. Conversely, if the first operating system has 60% of the total memory available and the memory usage growth rate is slow, then the first operating system is in a memory-stable state, which will correspondingly decrease the dynamic score of the first task.

[0061] S2123: Based on the operating status of the device containing the integrated circuit, calculate the predicted behavior score using a preset behavior prediction model.

[0062] Integrated circuits can acquire operational data of the device in its current operating state and use this data as input to calculate the predicted behavior score of the device using a behavior prediction model.

[0063] Predictive behavior scores are used to represent the memory requirements of multiple operating systems over a preset timeframe. Taking an in-vehicle scenario as an example, if the intelligent vehicle containing the integrated circuit is operating in autonomous driving mode and traveling on a highway, the integrated circuit can acquire operational data such as the vehicle's current speed, lane information, navigation route planning, and sensor data from the surrounding environment.

[0064] By inputting the running data into a preset behavior prediction model, the system tasks that the autonomous driving operating system may run within 5 minutes are predicted. For example, the autonomous driving operating system may launch tasks that require a large amount of memory, such as map navigation, real-time environmental perception, and risk decision calculation. In this way, the memory requirements of the system tasks that the autonomous driving operating system may run are evaluated, and a higher predicted behavior score is generated.

[0065] For example, in a scenario where the intelligent vehicle containing the integrated circuit is in a parked state, the autonomous driving operating system will not run driving-related system tasks. At this time, the operating data acquired by the integrated circuit includes the usage of the intelligent cockpit operating system, etc. The behavior prediction model will predict that the memory requirement of the autonomous driving operating system will be low within a preset time period in the future, thereby generating a low predicted behavior score.

[0066] In this way, integrated circuits can combine the actual operating scenarios of the device to predict the memory demand trends of different operating systems in advance, thereby improving the accuracy of computing priority scoring.

[0067] S2124: Perform a weighted summation of the static score, dynamic score, and predicted behavior score to obtain the priority score for the first task.

[0068] In some examples, the integrated circuit can assign different weight values ​​to static scores, dynamic scores, and predicted behavior scores. These weight values ​​represent the relative importance of the corresponding score to the priority score. For instance, in an automotive scenario, considering safety factors, the weight of the static score can be set to the highest, such as 0.5; the dynamic score weight is next, such as 0.3; and the predicted behavior score weight can be set to 0.2. Depending on different application scenarios and system requirements, the integrated circuit can flexibly adjust the weight values. This disclosure does not impose specific limitations on the numerical values ​​of the weight values.

[0069] After obtaining the static score, dynamic score, and predicted behavior score, the integrated circuit multiplies each score by its corresponding weight value, and then adds the product results to obtain the priority score of the first task.

[0070] The method provided in this disclosure calculates a priority score by weighted summation of static scores, dynamic scores, and predicted behavior scores. The static score matches the inherent memory bandwidth and latency sensitivity requirements of the task, the dynamic score reflects the real-time memory status, and the predicted behavior score predicts future memory needs. This weighted summation of multi-dimensional scores improves the accuracy of priority score calculation, provides data support for subsequent memory scheduling, and enhances the rationality of memory scheduling.

[0071] Figure 5 This is a flowchart illustrating step S2122 provided in an exemplary embodiment of this disclosure.

[0072] like Figure 5 As shown above, in the above Figure 4 Based on the illustrated embodiment, step S2122 may include the following steps: S21221: Based on the real-time memory status of the first operating system, determine the memory balance, number of memory fragments, memory reclamation frequency, and memory page replacement frequency of the first operating system.

[0073] In some examples, the integrated circuit can obtain memory state parameters of the first operating system based on the memory state of the first operating system. Memory state parameters can include real-time memory status, determining the first operating system's memory availability, memory fragmentation, memory reclamation frequency, and memory page replacement frequency.

[0074] Memory availability indicates the amount of memory the operating system can currently allocate to new tasks or expand existing tasks. Memory fragmentation indicates the number of fragmented, unused memory blocks in the operating system's memory that cannot be effectively utilized. A higher fragmentation rate means that even with sufficient total memory availability, memory allocation may fail due to insufficient contiguous memory space. Memory reclamation frequency indicates the number of times the operating system performs memory reclamation operations per unit of time, such as releasing unused memory pages. A high memory reclamation frequency indicates high memory pressure on the operating system, requiring frequent memory reclamation to maintain basic operation. Memory page replacement frequency indicates the number of times the operating system swaps temporarily unused memory pages from memory to external storage (such as hard drives) or back from external storage to memory per unit of time. A high memory page replacement frequency indicates high memory pressure on the operating system.

[0075] S21222: Perform a weighted summation of memory availability, memory fragmentation count, memory reclamation frequency, and memory page replacement frequency to obtain the dynamic score for the first task.

[0076] In some examples, the integrated circuit can assign dynamic credit weights to the memory availability, memory fragmentation, memory reclamation frequency, and memory page replacement frequency of the first operating system. These dynamic credit weights represent the degree of influence of different memory state parameters on the dynamic score. For example, memory availability is negatively correlated with the dynamic score; the larger the memory availability, the lower the dynamic score. The number of memory fragments is positively correlated with the dynamic score; the more fragments, the higher the dynamic score. Memory reclamation frequency is positively correlated with the dynamic score; the higher the reclamation frequency, the higher the dynamic score. Similarly, memory page replacement frequency is positively correlated with the dynamic score; the higher the replacement frequency, the higher the dynamic score.

[0077] The integrated circuit calculates the dynamic score of the first task by weighted summation of each memory state parameter and the corresponding dynamic credit weight, making the calculation of the dynamic score more accurate and thus providing a more dynamic basis for priority scoring that is closer to the actual operation.

[0078] The method provided in this disclosure calculates a dynamic score by considering memory availability, memory fragmentation, memory reclamation frequency, and memory page replacement frequency. This accurately quantifies the memory pressure state of the first operating system, making the calculated dynamic score more consistent with the actual memory operation of the first operating system and improving the accuracy of priority score calculation.

[0079] Figure 6 This is a flowchart illustrating step S220 provided in an exemplary embodiment of the present disclosure.

[0080] like Figure 6 As shown, based on the above embodiments, step S220 may include the following steps: S221: In response to the priority score of the first task being greater than the scheduling score pre-allocated to the second operating system, obtain the usage status of the spare memory of the second operating system.

[0081] In some examples, when the priority score of the first task exceeds the preset scheduling score of the second operating system, the integrated circuit needs to determine whether the spare memory of the second operating system is available to meet the memory requirements of the first task. The integrated circuit can obtain the usage status of the spare memory of the second operating system in real time by communicating with it. The usage status of the spare memory includes self-used status, scheduled status, and idle status.

[0082] The "self-used" state indicates that the spare memory of the second operating system is currently occupied by the system tasks of the second operating system itself. For example, if the memory requirements of the system tasks currently running in the second operating system exceed the private memory of the second operating system, the second operating system needs to further utilize its spare memory to ensure that the current system tasks can run normally. In this case, the usage state of the spare memory of the second operating system is the "self-used" state.

[0083] The scheduled state indicates that the spare memory of the second operating system has been scheduled by the integrated circuit to be used by other operating systems. For example, in the previous memory scheduling process, the task priority score of the third operating system was higher, and the integrated circuit has allocated part of the spare memory of the second operating system to the third operating system. At this time, the usage status of this part of the spare memory is the scheduled state.

[0084] The idle state indicates that the spare memory of the second operating system is neither occupied by its own operating system tasks nor scheduled to other operating systems, and is in a state that can be allocated at any time.

[0085] S222: In response to the usage state being idle, at least a portion of the spare memory of the second operating system is scheduled to the first operating system.

[0086] When the integrated circuit determines that the spare memory of the second operating system is idle, it initiates a memory allocation process. First, the integrated circuit calculates the memory difference required by the first operating system to run the first task, based on the memory requirements of the first task and the available memory of the first operating system. Then, based on this memory difference, it allocates a memory block of the appropriate size from the second operating system. For example, if the first task requires 500MB of memory and the first operating system has 200MB of available memory, the integrated circuit needs to allocate a contiguous 300MB memory block from the second operating system's spare memory and allocate it to the first operating system so that the first operating system can run the first task based on the allocated memory.

[0087] After completing memory scheduling, the integrated circuit will also synchronize memory allocation information with the second operating system, enabling the second operating system to switch the usage status of its own spare memory from idle to scheduled, thereby improving the timeliness of memory usage status updates.

[0088] The method provided in this disclosure obtains the usage status of the spare memory of the second operating system, determines the usage of the spare memory of the second operating system, and then schedules part of the spare memory of the second operating system to the first operating system when the usage status is idle, thereby reducing the risk of scheduling conflicts between the operating systems.

[0089] Figure 7 This is another flowchart illustrating step S220 provided in an exemplary embodiment of this disclosure.

[0090] like Figure 7 As shown, in Figure 6 Based on the illustrated embodiment, after step S221, the following steps may also be included: S223: In response to the usage state being either self-use or scheduled, reject the memory scheduling request generated by the first operating system while running the first task.

[0091] When the integrated circuit determines that the spare memory of the second operating system is in a self-use state or a scheduled state, it means that the second operating system has already used the spare memory for the operation of its own system tasks or has scheduled it to other operating systems. If the spare memory continues to be scheduled at this time, it may affect the stability of the second operating system itself or cause other operating systems that have been allocated memory to experience insufficient memory resources.

[0092] Therefore, the integrated circuit will directly reject the memory scheduling request from the first operating system and return a memory scheduling failure response message to the first operating system, in order to indicate that the first operating system cannot obtain additional memory resources from the second operating system at present.

[0093] At the same time, the integrated circuit records relevant information about this memory scheduling request, including the request time, the priority score of the first task, and the usage status of the spare memory of the second operating system, so as to optimize and adjust the memory scheduling strategy in the future. For example, in the subsequent memory scheduling process, the historical scheduling records are taken into account to more reasonably assess the memory requirements and available spare memory of each operating system, thereby improving the overall efficiency and reliability of memory scheduling.

[0094] The method provided in this disclosure, which rejects scheduling requests when the spare memory of the second operating system is in a self-use or scheduled state, can protect the memory usage security of the second operating system or other operating systems that have been allocated memory, prevent memory scheduling from interfering with the normal operation of system tasks of other operating systems, and improve the rationality of memory coordination among operating systems.

[0095] Figure 8 This is a flowchart illustrating step S222 provided in an exemplary embodiment of this disclosure.

[0096] like Figure 8 As shown, in Figure 6 Based on the illustrated embodiment, step S222 may include the following steps: S2221: In response to the usage state being idle, remove the address mapping state between the second operating system and at least a portion of the spare memory.

[0097] When the integrated circuit determines that the spare memory of the second operating system is in an idle state, it can use a hot-swapping method to schedule at least a portion of the spare memory of the second operating system.

[0098] The integrated circuit sends an address mapping release instruction to the second operating system. This instruction temporarily releases the address mapping between the second operating system and at least a portion of the spare memory. The address mapping state can include the mapping relationship between the virtual addresses and physical addresses of memory.

[0099] Upon receiving the instruction, the second operating system will temporarily unmap the virtual address to physical address corresponding to this spare memory in its memory page table, thereby temporarily releasing the right to use this spare memory.

[0100] S2222: Establish an address mapping state between at least a portion of the spare memory and the first operating system.

[0101] After the second operating system removes the address mapping of the spare memory that needs to be scheduled, the integrated circuit establishes a temporary address mapping state between the first operating system and this part of the spare memory. Specifically, the integrated circuit allocates a new virtual address to the spare memory from the second operating system according to the memory requirements of the first operating system, and writes the correspondence between the virtual address and the physical address of this part of the spare memory into the memory page table of the first operating system to establish a temporary address mapping state between the first operating system and this part of the spare memory.

[0102] S2223: Based on the address mapping state between at least a portion of the spare memory and the first operating system, schedule at least a portion of the spare memory of the second operating system to the first operating system.

[0103] In some examples, the first operating system can update its memory page table based on the temporary address mapping state between the spare memory from the second operating system and the first operating system, thereby scheduling at least a portion of the spare memory from the second operating system to the first operating system, making the spare memory from the second operating system effective in the first operating system. In this way, the first operating system can normally access and use the spare memory from the second operating system through the virtual addresses in the temporary address mapping state, achieving safe and efficient migration of spare memory between different operating systems and ensuring the accuracy of data and the effectiveness of access during memory scheduling.

[0104] The method provided in this disclosure enables flexible scheduling of spare memory by hot-plugging and re-establishing the address mapping state, without the need for complex hardware adjustments, thereby reducing the execution cost of memory scheduling and improving the execution efficiency and reliability of cross-operating system memory scheduling.

[0105] Figure 9 This is a schematic diagram of a process for reclaiming scheduled spare memory provided in an exemplary embodiment of this disclosure.

[0106] like Figure 9 As shown, in Figure 6 Based on the illustrated embodiment, after step S222, the following steps may also be included: S223: In response to the fact that the memory availability of the second operating system is less than the memory requirement of the second task currently running on the second operating system, or in response to the completion of the first task, the spare memory scheduled to the first operating system is scheduled back to the second operating system.

[0107] In some examples, after the second operating system allocates some spare memory to the first operating system, it can run the corresponding system tasks normally based on its corresponding private memory. When the spare memory of the second operating system is less than the memory requirement of the second task currently running on the second operating system, it means that the private memory of the second operating system itself cannot meet the running requirements of the second task. At this time, the integrated circuit needs to prioritize the stable operation of the second operating system and reallocate the spare memory previously allocated to the first operating system back to the second operating system.

[0108] In some examples, the integrated circuit first sends a memory reclamation command to the first operating system, informing it that the spare memory from the second operating system needs to be released. Upon receiving the command, the first operating system can initialize the spare memory from the second operating system; for example, it can back up the relevant data of the first task stored in the spare memory and migrate it to another storage area of ​​the first operating system. Then, it clears all data from the spare memory from the second operating system and schedules the spare memory from the second operating system (i.e., the spare memory scheduled to the first operating system) back to the second operating system.

[0109] In another example, after the first operating system finishes executing the first task, the first operating system can automatically initialize the spare memory from the second operating system and schedule this spare memory back to the second operating system, so that the spare memory of the second operating system can be reclaimed and reused in a timely manner, realizing the recycling of memory resources and improving memory utilization efficiency.

[0110] The method provided in this disclosure can reclaim the spare memory scheduled to the first operating system when the second operating system is short of memory or when the first task ends, thereby realizing the cyclic reuse of memory resources, avoiding the first operating system from occupying the spare memory of the second operating system for a long time, which would lead to resource waste, dynamically balancing the memory needs of each operating system, and improving the memory utilization efficiency of integrated circuits.

[0111] Figure 10 This is a flowchart illustrating step S223 provided in an exemplary embodiment of this disclosure.

[0112] like Figure 10 As shown, in Figure 9 Based on the illustrated embodiment, step S223 may include the following steps: S2231: Release the address mapping state between the first operating system and the spare memory scheduled to the first operating system.

[0113] The integrated circuit sends an address mapping release instruction to the first operating system, releasing the temporary address mapping between the first operating system and the spare memory scheduled to the first operating system. Upon receiving the instruction, the first operating system releases the mapping relationship between the virtual address and physical address corresponding to the spare memory scheduled to the first operating system in its memory page table, thereby releasing the right to use the spare memory scheduled to the first operating system.

[0114] S2232: Establish the address mapping state between the spare memory scheduled to the first operating system and the second operating system.

[0115] After the first operating system removes the temporary address mapping from the spare memory scheduled to the first operating system, the integrated circuit restores the address mapping between the second operating system and the spare memory scheduled to the first operating system. Specifically, the integrated circuit re-establishes the mapping relationship between the physical address of the spare memory scheduled to the first operating system and the original virtual address in the memory page table of the second operating system, and writes this mapping relationship into the memory page table of the second operating system, thereby restoring the second operating system's access rights to this part of the spare memory.

[0116] S2233: Based on the address mapping status between the spare memory scheduled to the first operating system and the second operating system, schedule the spare memory scheduled to the first operating system back to the second operating system.

[0117] The second operating system can update its own memory page table based on the address mapping status between the spare memory scheduled to the first operating system and the second operating system. This allows the spare memory scheduled to the first operating system to become effective again in the second operating system. In this way, the second operating system can access and use it normally through the virtual address in the address mapping status, complete the reclamation and scheduling of spare memory from the first operating system to the second operating system, and ensure that the second operating system can obtain sufficient memory resources in a timely manner when needed to ensure the stable operation of its own tasks.

[0118] The method provided in this disclosure completes memory reclamation scheduling by releasing the temporary address mapping state between the spare memory of the first operating system and the second operating system, and restoring the address mapping state between the second operating system and the scheduled memory. This ensures that the second operating system can reuse and reclaim memory normally, and improves the closed-loop integrity of dynamic memory resource scheduling.

[0119] Exemplary device Figure 11 This is a structural diagram of a memory scheduling device provided in an exemplary embodiment of the present disclosure.

[0120] See Figure 11 The memory scheduling device 1100 includes a computing module 1110 and a scheduling module 1120. The memory scheduling device 1100 can be used to implement the corresponding method embodiments of this disclosure.

[0121] In some examples, the calculation module 1110 is used to calculate a priority score for the first task in response to a memory scheduling request generated by the first operating system while running the first task, wherein the memory scheduling request is generated by the first operating system when the available memory is less than the memory requirement of the first task. The scheduling module 1120 is used to schedule at least a portion of the spare memory of the second operating system to the first operating system in response to the first task's priority score being greater than a pre-allocated scheduling score by the second operating system.

[0122] In some examples, the calculation module 1110 is used to respond to a memory scheduling request generated by the first operating system when running the first task, to obtain the task type of the first task, the real-time memory state of the first operating system, and the running state of the device where the integrated circuit is located; and to calculate the priority score of the first task based on the task type of the first task, the real-time memory state of the first operating system, and the running state of the device where the integrated circuit is located.

[0123] In some examples, the calculation module 1110 is used to determine the static score of the first task based on the memory bandwidth requirements and latency sensitivity corresponding to the task type; calculate the dynamic score of the first task based on the real-time memory status of the first operating system; calculate the predicted behavior score based on the operating status of the device where the integrated circuit is located using a preset behavior prediction model, the predicted behavior score being used to represent the memory requirements of multiple operating systems in the future within a preset time period; and perform a weighted summation of the static score, dynamic score, and predicted behavior score to obtain the priority score of the first task.

[0124] In some examples, the calculation module 1110 is used to determine the memory availability, number of memory fragments, memory reclamation frequency, and memory page replacement frequency of the first operating system based on the real-time memory status of the first operating system; and to perform a weighted summation of the memory availability, number of memory fragments, memory reclamation frequency, and memory page replacement frequency to obtain a dynamic score for the first task.

[0125] In some examples, the scheduling module 1120 is used to obtain the usage status of the spare memory of the second operating system in response to the priority score of the first task being greater than the scheduling score pre-assigned to the second operating system, wherein the usage status includes a self-use status, a scheduled status, and an idle status; and in response to the usage status being an idle status, to schedule at least a portion of the spare memory of the second operating system to the first operating system.

[0126] In some examples, the scheduling module 1120 is also configured to reject memory scheduling requests generated by the first operating system while running the first task in response to a usage state that is either in an unused state or a scheduled state.

[0127] In some examples, the scheduling module 1120 is used to, in response to an idle state, release the address mapping state between the second operating system and at least a portion of the spare memory; establish an address mapping state between at least a portion of the spare memory and the first operating system; and, based on the address mapping state between at least a portion of the spare memory and the first operating system, schedule at least a portion of the spare memory of the second operating system to the first operating system.

[0128] In some examples, the scheduling module 1120 is also configured to schedule the spare memory scheduled to the first operating system back to the second operating system in response to the second operating system having less memory availability than the memory requirement of the second task currently running on the second operating system, or in response to the completion of the first task.

[0129] In some examples, the scheduling module 1120 is used to unmap the address mapping between the first operating system and the spare memory scheduled to the first operating system; establish the address mapping between the spare memory scheduled to the first operating system and the second operating system; and based on the address mapping between the spare memory scheduled to the first operating system and the second operating system, schedule the spare memory scheduled to the first operating system back to the second operating system.

[0130] The beneficial technical effects corresponding to the exemplary embodiments of this device can be found in the corresponding beneficial technical effects of the exemplary method section above, and will not be repeated here.

[0131] Exemplary electronic devices Figure 12 A structural diagram of an electronic device provided in this disclosure includes at least one processor 1201 and a memory 1202.

[0132] The processor 1201 may be a central processing unit (CPU) or other form of processing unit with data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device 1200 to perform desired functions.

[0133] The memory 1202 may include one or more computer program products, which may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. Volatile memory may include, for example, random access memory (RAM) and / or cache memory. Non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium, and the processor 1201 may execute one or more computer program instructions to implement the memory scheduling methods and / or other desired functions of the various embodiments of this disclosure described above.

[0134] In one example, the electronic device 1200 may also include an input device 1203 and an output device 1204, which are interconnected via a bus system and / or other forms of connection mechanism (not shown).

[0135] The input device 1203 may also include, for example, a keyboard, a mouse, etc.

[0136] The output device 1204 can output various information to the outside, including, for example, a display, a speaker, a printer, a communication network and its connected remote output devices.

[0137] Of course, for the sake of simplicity, Figure 12 Only some of the components of the electronic device 1200 relevant to this disclosure are shown, omitting components such as buses, input / output interfaces, etc. In addition, the electronic device 1200 may include any other suitable components depending on the specific application.

[0138] Exemplary computer program products and computer-readable storage media In addition to the methods and apparatus described above, embodiments of this disclosure may also provide a computer program product, including computer program instructions that, when executed by a processor, cause the processor to perform the steps of the memory scheduling methods of the various embodiments of this disclosure described in the "Exemplary Methods" section above.

[0139] Computer program products can be written in any combination of one or more programming languages ​​to perform the operations of embodiments of this disclosure. The programming languages ​​include object-oriented programming languages ​​such as Java and C++, as well as conventional procedural programming languages ​​such as C or similar languages. The program code can be executed entirely on a user's computing device, partially on a user's computing device, as a standalone software package, partially on a user's computing device, partially on a remote computing device, or entirely on a remote computing device or server.

[0140] Furthermore, embodiments of this disclosure may also be computer-readable storage media storing computer program instructions thereon, which, when executed by a processor, cause the processor to perform the steps of the memory scheduling methods of the various embodiments of this disclosure described in the "Exemplary Methods" section above.

[0141] Computer-readable storage media may take the form of any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may include, but is not limited to, systems, apparatuses, or devices that are electrical, magnetic, optical, electromagnetic, infrared, or semiconductor, or any combination thereof. More specific examples (a non-exhaustive list) of readable storage media include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0142] The basic principles of this disclosure have been described above with reference to specific embodiments. However, the advantages, benefits, and effects mentioned in this disclosure are merely examples and not limitations, and should not be considered as essential features of each embodiment of this disclosure. Furthermore, the specific details disclosed above are for illustrative and facilitative purposes only, and are not limitations. These details do not limit the scope of this disclosure to the necessity of employing the aforementioned specific details for implementation.

[0143] Various modifications and variations can be made to this disclosure without departing from the spirit and scope of this application. Therefore, if such modifications and variations fall within the scope of the claims of this disclosure and their equivalents, this disclosure is also intended to include such modifications and variations.

Claims

1. A memory scheduling method applied to an integrated circuit, the integrated circuit being used to run multiple operating systems with different functional safety levels, the method comprising: In response to a memory scheduling request generated by the first operating system while running a first task, a priority score for the first task is calculated, wherein the memory scheduling request is generated by the first operating system when the available memory is less than the memory requirement of the first task; In response to the priority score of the first task being greater than the scheduling score pre-assigned to the second operating system, at least a portion of the spare memory of the second operating system is scheduled to the first operating system.

2. The method according to claim 1, wherein, The step of calculating the priority score of the first task in response to a memory scheduling request generated by the first operating system while running the first task includes: In response to a memory scheduling request generated by the first operating system when running the first task, the task type of the first task, the real-time memory status of the first operating system, and the operating status of the device where the integrated circuit is located are obtained. The priority score of the first task is calculated based on the task type of the first task, the real-time memory status of the first operating system, and the operating status of the device where the integrated circuit is located.

3. The method according to claim 2, wherein, The calculation of the priority score for the first task based on the task type of the first task, the real-time memory state of the first operating system, and the operating state of the device where the integrated circuit is located includes: Based on the memory bandwidth requirements and latency sensitivity corresponding to the task type, determine the static score of the first task; The dynamic score of the first task is calculated based on the real-time memory status of the first operating system. Based on the operating status of the device where the integrated circuit is located, a predicted behavior score is calculated using a preset behavior prediction model. The predicted behavior score is used to represent the memory requirements of the multiple operating systems within a preset future time period. The priority score of the first task is obtained by performing a weighted summation on the static score, the dynamic score, and the predicted behavior score.

4. The method according to claim 3, wherein, The calculation of the dynamic score of the first task based on the real-time memory status of the first operating system includes: Based on the real-time memory status of the first operating system, determine the memory balance, number of memory fragments, memory reclamation frequency, and memory page replacement frequency of the first operating system. A weighted summation is performed on the remaining memory, the number of memory fragments, the memory reclamation frequency, and the memory page replacement frequency to obtain the dynamic score of the first task.

5. The method according to any one of claims 1-4, wherein, The step of allocating at least a portion of the spare memory of the second operating system to the first operating system in response to the priority score of the first task being greater than the pre-allocated scheduling score of the second operating system includes: In response to the priority score of the first task being greater than the scheduling score pre-allocated to the second operating system, the usage status of the spare memory of the second operating system is obtained, wherein the usage status includes self-use status, scheduled status and idle status. In response to the usage state being the idle state, at least a portion of the spare memory of the second operating system is scheduled to the first operating system.

6. The method according to claim 5, wherein, After responding to the priority score of the first task being greater than the pre-allocated scheduling score of the second operating system, and obtaining the usage status of the spare memory of the second operating system, the process further includes: In response to the usage state being either the self-use state or the scheduled state, the memory scheduling request generated by the first operating system when running the first task is rejected.

7. The method according to claim 5, wherein, The step of scheduling at least a portion of the spare memory of the second operating system to the first operating system in response to the usage state being the idle state includes: In response to the usage state being the idle state, the address mapping state between the second operating system and at least a portion of the spare memory is released; Establish an address mapping state between at least a portion of the spare memory and the first operating system; Based on the address mapping status between the at least portion of the spare memory and the first operating system, at least a portion of the spare memory of the second operating system is scheduled to the first operating system.

8. The method according to claim 5, wherein, After responding to the usage state being the idle state and allocating at least a portion of the spare memory of the second operating system to the first operating system, the method further includes: In response to the second operating system having less available memory than the memory requirement of the second task currently running on the second operating system, or in response to the first task finishing execution, the spare memory scheduled to the first operating system is scheduled back to the second operating system.

9. The method according to claim 8, wherein, The step of scheduling the spare memory allocated to the first operating system back to the second operating system includes: Release the address mapping between the first operating system and the spare memory scheduled to the first operating system; Establish the address mapping state between the spare memory scheduled to the first operating system and the second operating system; Based on the address mapping status between the spare memory scheduled to the first operating system and the second operating system, the spare memory scheduled to the first operating system is scheduled back to the second operating system.

10. A memory scheduling device applied to an integrated circuit, the integrated circuit being used to run multiple operating systems with different functional safety levels, the device comprising: A calculation module is used to calculate the priority score of the first task in response to a memory scheduling request generated by the first operating system when running the first task, wherein the memory scheduling request is generated by the first operating system when the available memory is less than the memory requirement of the first task. The scheduling module is configured to schedule at least a portion of the spare memory of the second operating system to the first operating system in response to the priority score of the first task being greater than the scheduling score pre-allocated to the second operating system.

11. A computer-readable storage medium storing a computer program for performing the memory scheduling method according to any one of claims 1-9.

12. An electronic device, comprising: processor; Memory used to store processor-executable instructions; A processor for reading executable instructions from memory and executing the instructions to implement the memory scheduling method according to any one of claims 1-9.