Memory calling method, electronic device and storage medium

By applying and distributing memory information in advance during the application of electronic equipment, the system performance deterioration of frequent memory applications is solved, and the operating efficiency of the equipment is improved.

CN118445056BActive Publication Date: 2025-01-28SHANGHAI GLORY SMART TECH DEV CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202311192607.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-09-14
Publication Date
2025-01-28
Estimated Expiration
2043-09-14

AI Technical Summary

Technical Problem

When users use applications on electronic devices, the system performance deteriorates due to frequent memory applications.

Method used

By running the first process of operation, you can apply to the operating system in advance to the operating system and allocate memory information for the second process after the first process, so as to avoid frequent memory applications.

Benefits of technology

Effectively avoid the deterioration of system performance, improve the operating efficiency of electronic equipment, and reduce the occupation of processor resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118445056B_ABST
    Figure CN118445056B_ABST
Patent Text Reader

Abstract

The present application provides a memory calling method, electronic device and storage medium. In response to the user's operation on the application program, when the first process corresponding to the operation is run, the memory information corresponding to the operation is applied to the operating system; when the second process corresponding to the operation is run, the memory information corresponding to the operation is allocated to the second process, and the start time of the second process is after the end time of the first process; based on the memory information of the second process, the data of the second process is written into the memory space corresponding to the memory information of the second process. In this way, the problem of system performance deterioration caused by frequent memory application during the operation of multi-process applications is avoided.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a memory calling method, an electronic device and a storage medium. Background Art

[0002] The hardware resources of electronic devices, such as memory, are usually managed by an operating system (OS). Many applications in electronic devices use memory in a large amount and in an instantaneous manner.

[0003] Currently, when a user uses an application on an electronic device, the application will request memory information from the operating system to run the application. Usually, multiple processes need to be run during the running of the application. When running each process, the application needs to request the memory information corresponding to the process from the operating system, so as to write back data based on the memory information corresponding to each process.

[0004] Because before starting each process, the application needs to apply to the operating system for the memory information corresponding to the process. When running multi-process applications, the application needs to frequently apply for memory, which consumes a certain amount of time and computing resources, thereby causing system performance to deteriorate. Summary of the invention

[0005] The present application provides a memory calling method, electronic device and storage medium, which are intended to solve the problem of system performance deterioration when users use applications.

[0006] In order to achieve the above objectives, this application adopts the following technical solutions:

[0007] First aspect: The present application provides a memory calling method, which responds to the user's operation on the application program, and when running the first process corresponding to the operation, applies to the operating system for memory information corresponding to the operation; when running the second process corresponding to the operation, in the memory information corresponding to the operation, memory information is allocated to the second process, and the start running time of the second process is after the end running time of the first process; based on the memory information of the second process, the data of the second process is written into the memory space corresponding to the memory information of the second process.

[0008] In the present application, when running the first process, the memory information corresponding to the operation can be applied to the operating system to reserve memory space in advance for running each process corresponding to the application. There is no need to apply for the memory information corresponding to the second process in real time when running the second process, thereby avoiding frequent memory applications and thus avoiding the deterioration of system performance.

[0009] In a possible implementation, the memory information corresponding to the operation is the physical memory information corresponding to the operation. When running at least one second process corresponding to the operation, memory information is allocated to the second process in the memory information corresponding to the operation, including: when running at least one second process corresponding to the operation, physical memory information is allocated to the second process in the physical memory information corresponding to the operation to obtain the physical memory information of the second process; the physical memory information of the second process is mapped with the logical memory information to obtain the logical memory information of the second process; based on the memory information of the second process, the data of the second process is written into the memory space corresponding to the memory information of the second process, including: based on the logical memory information of the second process, the data of the second process is written into the memory space corresponding to the logical memory information of the second process. Thus, when running the second process, the corresponding physical memory information can be directly allocated to the second process from the physical memory information corresponding to the operation, which saves the time and computing resources required for real-time memory application and improves the performance of the system.

[0010] In one possible implementation, in response to a user's operation on an application, when a first process corresponding to the operation is running, memory information corresponding to the operation is requested from the operating system, including: in response to a user's operation on an application, when a first process corresponding to the operation is running, memory information corresponding to multiple second processes corresponding to the operation is requested from the operating system, or in response to a user's operation on an application, when a first process corresponding to the operation is running, the sum of memory information corresponding to each second process corresponding to the operation is requested from the operating system.

[0011] In one possible implementation, the step of determining the memory information corresponding to the operation includes: the operating system estimates the memory space occupied by the process corresponding to the operation, and determines the size of the memory space corresponding to the operation; based on the size of the memory space corresponding to the operation, determines the memory information corresponding to the operation, thereby facilitating the subsequent writing of corresponding data directly based on the memory information corresponding to the operation.

[0012] In one possible implementation, the operating system estimates the memory space occupied by the process corresponding to the completed operation and determines the size of the memory space corresponding to the operation, including: the operating system estimates the memory space occupied by the process corresponding to the completed operation and determines the size of the peak memory corresponding to the operation; based on the size of the peak memory, determine the size of the memory space corresponding to the operation.

[0013] In a possible implementation, in response to a user's operation on an application, when the first process corresponding to the operation is run, the memory information corresponding to the operation is requested from the operating system, including: in response to a user's operation on an application, when the first process corresponding to the operation is run, the memory information corresponding to the operation is requested from the operating system, and the first sub-memory information corresponding to the operation is obtained by the operating system by cleaning up anonymous file pages in the system; traversing the processes running in the system, and cleaning up processes with a priority lower than a threshold according to the priority of the processes, and obtaining the second sub-memory information corresponding to the operation; based on the first sub-memory information and the second sub-memory information, the memory information corresponding to the operation is obtained. Thus, even if the remaining memory in the system is insufficient to complete the process corresponding to the operation when the user operates the application, based on the method provided in the present application, memory cleaning and other links that require the operating system to perform a large amount of calculations, that is, anonymous file page swapping, low memory recovery, etc., can be completed in advance in the early light load stage, so as to avoid subsequent processes competing for processor resources when performing heavy calculations, resulting in performance degradation.

[0014] In one possible implementation, in response to a user's operation on an application, when running a first process corresponding to the operation, applying to the operating system for memory information corresponding to the operation includes: in response to a user's operation on an application, when running a first process corresponding to the operation, applying to the operating system for memory information corresponding to the instruction operation through a memory reservation interface, and the memory reservation interface is used to provide a memory space of a corresponding size for the operation.

[0015] In a possible implementation, after writing the data of the second process into the memory space corresponding to the memory information of the second process based on the memory information of the second process, the method further includes: releasing the memory space corresponding to the memory information of the second process.

[0016] In the second aspect, the present application provides an electronic device, the electronic device comprising: a processor and a memory;

[0017] The memory is used to store program code and transmit the program code to the processor;

[0018] The processor is used to execute the steps of the memory calling method as described above according to the instructions in the program code.

[0019] A third aspect: The present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of a memory calling method as described above are implemented. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 A schematic diagram of the first existing memory call provided in an embodiment of the present application;

[0021] Figure 2 A schematic diagram of a second existing memory call provided in an embodiment of the present application;

[0022] Figure 3 A schematic diagram of a memory call scenario provided in an embodiment of the present application;

[0023] Figure 4 A schematic diagram of a memory calling method provided in an embodiment of the present application;

[0024] Figure 5 A memory allocation diagram provided for an embodiment of the present application;

[0025] Figure 6 Another memory allocation schematic diagram provided for an embodiment of the present application;

[0026] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;

[0027] Figure 8 This is a software structure block diagram of the electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0028] The terms "first", "second", "third", etc. in the specification, claims and drawings of this application are used to distinguish different objects rather than to limit a specific order.

[0029] In the embodiments of the present application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in the embodiments of the present application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0030] In order to make the description of the following embodiments clear and concise, a brief introduction to the related technology is first given:

[0031] Physical memory, also known as main memory or random access memory (RAM), is a hardware device used to store data and instructions in electronic devices. Physical memory is divided into many fixed-size memory blocks, called physical memory pages. The size of physical memory plays an important role in the performance and function of electronic devices. It can provide space for the operating system to use. The operating system needs a part of physical memory to store its own code and data, as well as to manage various resources and tasks of the electronic device. By using physical memory, the operating system can manage the resources of the electronic device more efficiently and allocate and release memory when needed. This memory management method enables multiple programs to run simultaneously in electronic devices, and the memory size required for each program can be dynamically adjusted.

[0032] Logical memory is a basic component of memory in the hardware of electronic devices. It is used to store the calculations and operations of the processor (CPU) and other hardware devices. Corresponding to physical memory, logical memory is virtual memory running in the operating system kernel. Its main function is to reorganize physical memory and allocate an independent virtual memory address space to each process. In each process, the virtual memory address is unique. Logical memory can map virtual addresses to physical addresses to facilitate the reading and processing of instructions. In the operating system, logical memory also has functions such as memory management, process scheduling, and cache management.

[0033] Currently, when a user uses an application on an electronic device, the application will request memory information from the operating system to run the application. Usually, multiple processes need to be run during the running of the application. When running each process, the application needs to request the memory information corresponding to the process from the operating system, so as to write back data based on the memory information corresponding to each process.

[0034] Many applications installed in electronic devices use memory in large quantities and instantaneously, such as the camera application, which is one of the common applications in electronic devices. In this case, when the user uses the application, the performance of the electronic device may be reduced during the process of calling the memory.

[0035] First, when users use applications, they are involved in the running of multiple processes, which will occupy a certain amount of memory space and processor resources. Before each process starts running, the application needs to apply to the operating system for the memory information corresponding to the process, and memory application will consume a certain amount of time and computing resources. Such frequent memory application will cause system performance to deteriorate.

[0036] On the second hand, when the electronic device is under heavy load, it is difficult for the operating system to provide memory that meets the needs of the application in a short time. When the currently available memory cannot meet the needs of the application, the operating system will recycle the memory to meet the memory needs of the application. In the process of memory recycling by the operating system, it is necessary to traverse all file pages stored in the electronic device and clean up some file pages according to certain rules. If the current memory is still insufficient to meet the memory needs of the application after the file page cleaning is completed, the operating system will traverse all processes in the electronic device and kill the relevant processes according to the killing rules to save enough memory for the application. Because the operating system needs to clean up the file pages and kill at least one process in the process when recycling memory, and both processes will consume considerable computing resources of the operating system. Therefore, when the application runs to a process with large memory consumption, a conflict between high computing demand and low memory may occur, that is, while the application itself needs to consume a large amount of computing resources, due to insufficient memory, it needs to occupy additional large computing resources in the process of memory recycling, thereby causing the deterioration of system performance.

[0037] Based on this, the present application provides a memory calling method, an electronic device and a storage medium, which, based on the user's operation on the application, in the process corresponding to the operation, at the stage with a lighter load, applies to the operating system for the memory information corresponding to the operation, so as to reserve the required memory information for the subsequent operation of the second process corresponding to the operation. Therefore, in the subsequent stage with a heavier load, the corresponding process can be run based on the corresponding memory information from the reserved memory information, thereby completing the process corresponding to the operation. Avoid the need to occupy additional processor resources for memory information recovery due to insufficient memory information in the stage with a heavier load. The memory information calling method, electronic device and storage medium provided in the present application can effectively improve the operating efficiency of the electronic device and avoid the deterioration of the foreground application performance due to insufficient memory information.

[0038] Generally, electronic devices use two methods to call memory. Method 1 is to establish a mapping relationship between logical memory and physical memory when writing memory to complete data write back. Method 2 is to establish a mapping relationship between logical memory and physical memory when applying for memory, so that data can be written back faster when writing memory. Figure 1-Figure 2 , introduces the memory usage methods of current electronic devices, including Figure 1 The first existing memory call schematic diagram provided in the embodiment of the present application is as follows: Figure 2 A second existing memory call schematic diagram provided for an embodiment of the present application.

[0039] Method 1: If Figure 1As shown, when a user starts an application (Application, APP) of an electronic device, the application can request memory from the operating system by calling a dynamic memory allocation function (Memory Allocation, Malloc). The Malloc function is used to request a continuous memory block area of ​​a specified size and return the address of the allocated memory area. Usually, when the specific location of the memory is unknown, the dynamic memory allocation function can be called to allocate the memory required by the application to the application.

[0040] After receiving the memory request sent by the application, the operating system returns the corresponding logical address space to the application. On this basis, when the application needs to write memory, the application will call the write function (Write) to complete the data writing by establishing a mapping relationship between logical memory and physical memory.

[0041] Specifically, when the application calls the write function (Write) to establish the mapping relationship between the logical memory and the physical memory, the operating system will determine whether there are free physical pages in the current system. If there are free physical pages, it means that there is memory space for the application to use, and the mapping relationship between the logical memory and the physical memory can be directly established to complete the data write back.

[0042] If there are no free physical pages in the current system, it is necessary to apply for physical memory pages. For example, a page fault interrupt can be triggered to apply for physical memory pages from the operating system. After issuing the application for physical memory pages, the operating system will determine whether there are enough physical memory pages in the system for the application to use.

[0043] If there is a large enough physical memory page in the system for the application to use, a mapping relationship between the logical memory and the physical memory is established. If there is no large enough physical memory page in the system, the operating system will clean up the file page to save a certain amount of memory space for the current higher priority application.

[0044] For example, in the process of cleaning file pages, anonymous pages can be reclaimed first. This part is mainly file cache. The operating system will traverse all file pages and clean up some file pages according to certain rules to save a certain amount of memory space.

[0045] After cleaning the file pages, the operating system will again determine whether the currently available memory space meets the needs of the application. If the memory space saved by cleaning the file pages can meet the needs of the application, a mapping relationship between logical memory and physical memory can be established to complete data writeback.

[0046] If the currently available memory space still cannot meet the needs of the application after the file pages are cleaned up, the operating system will provide enough memory space for the application by killing the process.

[0047] Specifically, the operating system will check and kill each process from low to high priority until the saved memory space can meet the needs of the application. The operating system will then establish a mapping relationship between logical memory and physical memory to complete data writeback.

[0048] Method 2: If Figure 2 As shown, when a user starts an application (Application, APP) of an electronic device, the application can apply for memory from the operating system by calling the ion_alloc function.

[0049] Different from the above method 1, when the application calls the ion_alloc function to apply for memory from the operating system, the operating system will map the logical address space to the physical address space.

[0050] Specifically, the process of the operating system mapping the logical address space to the physical address space is the same as in the above method 1, that is, first determine whether the system has physical memory pages. If there are no physical memory pages, the operating system can save enough memory space to meet the application's memory needs by applying for physical memory pages, cleaning file pages, and killing processes. If the currently available memory space can meet the needs of the application, the operating system can map the logical address space to the physical address space.

[0051] In this case, when the subsequent application writes memory by calling the write function, the data can be written back faster because the mapping between the logical address space and the physical address space has been completed when applying for the memory.

[0052] Due to the particularity of media data, the physical memory used is usually large, and it is accompanied by a large amount of calculation when used. Therefore, using ION memory will provide a better performance experience in most scenarios.

[0053] In order to improve the operating efficiency of the system, the present application may adopt a method of first completing the mapping between the logical address space and the physical address space, and then continuing the subsequent data writing back. Figure 1 and Figure 2It can be seen that applying for enough physical memory pages from the system is the biggest interference factor in performance fluctuations during algorithm processing, especially in overloaded or complex scenarios. The operating system needs to traverse all file pages and all processes to complete memory cleanup and recovery. It even needs to complete process killing before it can provide enough physical memory pages for applications to use. This has a huge impact on the performance of the entire electronic device.

[0054] In the embodiment of the present application, a certain physical memory page is applied for in advance and reserved for use by the application program during the lightly loaded operation phase. Thus, the operating system does not need to execute algorithms related to applying for physical memory pages during the heavily loaded operation phase, which can effectively improve the performance of the electronic device, increase the system's operating speed, and enhance the user's experience.

[0055] Taking the camera application commonly used in electronic devices as an example, operations such as starting the camera and shooting are operations with long links, long running times, and clear processes. For example, Figure 3 As shown, the figure is a schematic diagram of a memory call scenario provided in an embodiment of the present application.

[0056] The user clicks the icon corresponding to the camera application on the menu interface of the electronic device to start the camera. In response to the user clicking the icon corresponding to the camera application, the electronic device can start the camera application by running various processes corresponding to the operation.

[0057] In order to complete the task of starting the camera, the electronic device needs to run the start camera process corresponding to the start camera task, where the start camera process is composed of various processes. For example, the open camera process (Open Camera) is the process that needs to be run at the beginning of the start camera process. After running the open camera process, parameter configuration (configurestream) and initialization algorithm (InitAlgo) and other processes need to be performed.

[0058] Generally, the initial stage of the camera startup process requires less computing power from the processor than the subsequent stages of the camera startup process. In order to avoid the need for memory recovery when requesting corresponding memory from the operating system in the subsequent process of running the various processes in the camera startup process, the memory demand of each process is met. In the present application, the process with lower computing power demand from the processor in the camera startup process is utilized. For example, in the camera opening process corresponding to the initial stage of the camera startup process, a memory request instruction is sent to the operating system to reserve a physical memory page of a specified size for the various processes in the camera startup process in advance, so that the physical memory page of the corresponding size can be directly called when running each process later, saving the time required for real-time application of memory information, and avoiding the occurrence of processor resource shortage and system performance deterioration caused by insufficient memory space and the need for memory recovery.

[0059] like Figure 3 As shown, when running the parameter configuration process, the memory information corresponding to the parameter configuration process can be called from the reserved memory information to perform parameter configuration; when running the initialization algorithm process, the memory information corresponding to the initialization algorithm process can be called from the reserved memory information to perform the initialization algorithm.

[0060] Combine the following Figure 4 Introduce the memory calling method provided by the embodiment of the present application. Figure 4 A schematic diagram of a memory calling method provided in an embodiment of the present application.

[0061] S101. In response to a user's operation on an application program, the electronic device starts to run a process corresponding to the operation.

[0062] Specifically, taking the application as a camera application as an example, the user's operation on the application may be to start the camera operation, take a photo operation, and image processing operation. When the electronic device responds to the user's start camera operation, take a photo operation, or image processing operation, in order to realize the start of the camera, take a photo, and image processing, etc., it is necessary to run the process corresponding to each operation, for example, the start camera operation corresponds to the start camera process, the photo operation corresponds to the photo process, and the image processing operation corresponds to the image processing process. The processes corresponding to the start camera operation, the photo operation, and the image processing operation are different, but they are all operations with long links, long running time, and clear processes.

[0063] Exemplarily, when the user starts the camera operation, the camera start process corresponding to the camera start operation may consist of a camera start process, a parameter configuration process, and an initialization algorithm process. Specifically, the camera application calls the OpenCamera method in response to the user's camera start operation. After running the camera start process, data configuration is performed, that is, the camera application may call the Configure Stream function to perform parameter configuration. After completing the parameter configuration, the camera application calls the Initialization Algorithm function to run the Initialization Algorithm process.

[0064] The memory resources required for each operation performed by the user on the application program can be estimated or obtained through induction and summary. Furthermore, in the embodiment of the present application, the physical memory corresponding to the operation can be determined based on the user's operation on the application program, that is, the physical memory required to complete the task corresponding to the operation can be determined.

[0065] Exemplarily, the memory resources required for different operations may be different. For example, when a user clicks on the icon of a camera application to start the camera, the task corresponding to the operation is to start the camera task. In response to the operation of clicking on the icon of the camera application, the electronic device can determine that the first physical memory page needs to be occupied to complete the task of starting the camera. When the user clicks on the photo button to take a photo after opening the camera application, the operation of clicking on the photo button corresponds to the photo task. In response to the operation of clicking on the photo button, the electronic device can determine that the second physical memory page needs to be occupied to complete the photo task. Among them, the size of the first physical memory page is different from the size of the second physical memory page, and the first physical memory page is only used to run the process corresponding to the task of starting the camera, and the second physical memory page is only used to run the process corresponding to the photo task.

[0066] Specifically, in an embodiment provided by the present application, the physical memory pages required to complete the task corresponding to the operation can be determined by pre-estimation or summary, and the operation and the information of the required physical memory pages can be saved in the system. Thus, when the user performs the operation, the electronic device can directly obtain the information of the physical memory pages required for the operation from the system according to the operation, so that the electronic device can apply for the corresponding physical memory pages from the operating system according to the physical memory page information.

[0067] In another embodiment provided in the present application, in order to reduce the occupancy of memory space, the physical memory page corresponding to the operation can be determined in real time according to the user's operation, and then the corresponding physical memory page is requested from the operating system to reserve the corresponding physical memory page for running the process corresponding to the operation.

[0068] In the process of determining the physical memory page corresponding to the operation based on the user's operation on the application, the peak power corresponding to the operation can be determined first, and then the physical memory page that can actually be reserved for the operation can be determined based on the peak power.

[0069] Specifically, when a user operates an application, the electronic device can obtain the peak memory information corresponding to the operation based on the operation, that is, obtain the maximum memory required for the electronic device to complete the task corresponding to the operation. Based on the peak memory information, the memory size that needs to be applied to the operating system can be determined. Among them, the memory size applied to the operating system can be equal to the peak memory size, or slightly smaller than the peak memory size, so as to better utilize the memory space and improve the operating efficiency of the system.

[0070] In an embodiment provided by the present application, the peak memory information corresponding to each operation can be determined by pre-estimation or summary and saved in the system. When the user performs an operation, the electronic device can directly obtain the peak memory information corresponding to the operation from the system according to the operation, thereby enabling the electronic device to obtain the peak memory information corresponding to the operation more quickly.

[0071] Since the total memory space in the system is limited, when a user performs an operation, in order to complete the task corresponding to the operation in the limited memory space, the electronic device can, after obtaining the peak memory information corresponding to the operation, determine the size of the physical memory page that needs to be applied to the operating system based on the peak memory information corresponding to the operation and the total memory space, so as to improve the utilization of the memory space without affecting the efficiency of task completion.

[0072] In another embodiment provided in the present application, in order to reduce the occupancy of memory space, the peak memory information corresponding to the operation can be determined in real time according to the user's operation, and then based on the peak memory information, the corresponding physical memory page is applied to the operating system to reserve the corresponding physical memory page for running the process corresponding to the operation.

[0073] S102: When the electronic device is running a first process corresponding to an operation, the electronic device sends a memory request instruction to the operating system.

[0074] Among them, the memory application instruction is used to apply to the operating system for the physical memory information corresponding to the operation. That is, the electronic device can determine the physical memory size required to complete the task corresponding to the operation according to the user's operation, and then apply to the operating system in advance for the physical memory information corresponding to the operation, so as to save the time of applying to the operating system for the physical memory information corresponding to each process in real time when running each process later, and avoid the problem that the physical memory is insufficient in the process of running a certain process later, and the memory needs to be released by memory recycling or other methods that require additional processor resources, and the corresponding process is run after the memory is released to obtain sufficient memory space, which leads to problems such as system performance deterioration and low task operation efficiency.

[0075] Specifically, when the user performs an operation on the application, the electronic device responds to the operation and starts running the process corresponding to the operation. When running the first process in the process, a memory request instruction can be sent to the operating system. Among them, the first process can be a process corresponding to the process, which has a lower demand for processor computing power. Exemplarily, the first process can be a process in the initial running stage of the process. Because in general, at the very beginning of the process corresponding to each operation, the demand for processor computing power is often small, that is, the processor resources required are small. This stage can be used to send a memory request instruction to the operating system of the electronic device to apply for the physical memory information corresponding to the operation, and to reserve a specific size of physical memory in advance for running the process corresponding to the operation.

[0076] Specifically, taking the camera startup operation as an example, the first process in the camera startup process may be the camera opening process (Open Camera). Since the camera opening process is at the very beginning of the camera startup process and has low processor computing power requirements, after the user starts the camera operation on the camera application, the electronic device may send a memory request instruction to the operating system during the camera opening process phase to request and reserve the physical memory information required to complete the camera startup process.

[0077] In an embodiment of the present application, the operating system can respond to a memory request instruction through a memory reservation interface provided by the operating system. Exemplarily, the memory reservation interface can be a private interface for providing a physical memory page of a corresponding size for the operation corresponding to the memory request instruction. The physical memory page can be specified to be provided to a specified application to run a specified process.

[0078] In an embodiment of the present application, when a memory request instruction is sent to the operating system to request a physical memory page that needs to be reserved, insufficient memory space may occur, that is, the current remaining available memory space is smaller than the memory space requested by the memory request instruction.

[0079] In this case, memory recycling and other processes that require the operating system to perform a lot of calculations can be performed in the early light load stage to provide sufficient memory space while avoiding subsequent processes from competing for processor resources when performing heavy calculations, thereby avoiding the phenomenon of system performance deterioration.

[0080] Specifically, in response to the user's operation on the application, when the first process corresponding to the operation is running, the memory information corresponding to the operation is applied to the operating system to obtain the first sub-memory information corresponding to the operation. The processes running in the system are traversed, and according to the priority of the process, the processes with a priority lower than a threshold are cleared to obtain the second sub-memory information corresponding to the operation. Based on the first sub-memory information and the second sub-memory information, the memory information corresponding to the operation is obtained.

[0081] The first sub-memory information is obtained by the operating system by cleaning up anonymous file pages in the system. That is, when there is no large enough physical memory page in the system to reserve for operation in advance, the operating system will clean up the file page to save a certain amount of memory space for the current application with higher priority.

[0082] For example, in the process of cleaning file pages, anonymous pages can be reclaimed first. This part is mainly file cache. The operating system will traverse all file pages and clean up some file pages according to certain rules to save a certain amount of memory space.

[0083] After the file pages are cleaned up, the operating system will again determine whether the currently available memory space meets the needs of the application. If the memory space saved by cleaning up the file pages can meet the needs of the application, a physical memory page of the corresponding size can be reserved for the operation from the saved memory space.

[0084] If the currently available memory space still cannot meet the needs of the application after the file pages are cleaned up, the operating system will provide enough memory space for the application by killing the process.

[0085] Specifically, the operating system will check and kill each process from low to high priority until the saved memory space can meet the needs of the application. The operating system can reserve a physical memory page of the corresponding size for the operation from the saved memory space.

[0086] In this application, anonymous file page swapping (kSwap), low memory recycling (LMK) and other links that require the operating system to perform a lot of calculations are completed in advance in the early light load stage to avoid subsequent processes competing for processor resources when performing heavy calculations, causing performance degradation.

[0087] After applying for the physical memory page corresponding to the memory application instruction, when the second process in the flow is running, S103 can be executed to apply for the corresponding physical memory page for the second process in the reserved physical memory page.

[0088] The second process may be a process that needs to apply for memory in the process corresponding to the operation, and the start time of the second process is after the end time of the first process. That is, during the operation of the first process, the operating system will apply for the corresponding physical memory page, and when the first process ends, the operating system has provided the process with a physical memory page of the corresponding size. In this case, when the second process starts to run, the physical memory information required by the second process can be called from the reserved physical memory page.

[0089] In the embodiment of the present application, the process corresponding to the operation may include at least one second process. For example, taking the camera start operation as an example, the camera start process corresponding to the camera start operation may include at least two second processes, namely, a parameter configuration process and an initialization algorithm process, such as Figure 3 As shown, when the parameter configuration process is running, the corresponding physical memory pages can be allocated to the parameter configuration process in the reserved physical memory pages, and when the initialization algorithm process is running, the corresponding physical memory pages can be allocated to the initialization algorithm process in the remaining reserved physical memory pages.

[0090] In the embodiment provided in the present application, the reserved physical memory pages can be based on the complete process corresponding to the operation, and physical memory pages of a specified size are directly reserved for the process, that is, in response to the user's operation on the application, when running the first process corresponding to the operation, the sum of the memory information corresponding to each second process corresponding to the operation is applied to the operating system.

[0091] In this case, when each second process is run, a physical memory page of a corresponding size can be dynamically and in real time allocated to each second process from the physical memory page of the specified size. Figure 5 As shown, the figure is a memory allocation schematic diagram provided in an embodiment of the present application, in which physical memory information a required by second process a is allocated to second process a in physical memory page A, and physical memory information b required by second process b is allocated to second process b in the remaining physical memory page A.

[0092] In another embodiment provided by the present application, the reserved physical memory page may be based on each process in the complete process corresponding to the operation. That is, a physical memory page of a specified size is reserved in advance for each process in the process. Specifically, in response to the user's operation on the application, when the first process corresponding to the operation is running, the operating system is requested for memory information corresponding to multiple second processes corresponding to the operation.

[0093] In this case, when each second process is run, a physical memory page of a corresponding size can be directly called from the physical memory page of the specified size. Figure 6 As shown, this figure is another schematic diagram of memory allocation provided by an embodiment of the present application. When running to the second process a, the physical memory information a required by the second process a is directly called from the physical memory page A; when running to the second process b, the physical memory information b required by the second process b is directly called from the physical memory page A. In this way, the operating efficiency of the system can be further improved, and the corresponding process of the operation can be completed.

[0094] According to the mapping relationship between the logical memory information and the physical memory information of the second process, the logical memory information of the second process can be obtained. Specifically, after allocating physical memory information of corresponding size to each second process from the reserved physical memory page, the logical memory information of the second process can be obtained according to the mapping relationship between the logical memory information and the physical memory information of the second process. Thus, after obtaining the logical memory information of each second process, the data of the second process can be written into the memory space corresponding to the memory information of the second process based on the logical memory information of each second process.

[0095] In one possible implementation, based on the memory information of the second process, after the data of the second process is written into the memory space corresponding to the memory information of the second process, the memory space corresponding to the memory information of the second process can be released so that the system has enough memory space for other processes.

[0096] In summary, the present application provides a memory calling method, which responds to the user's operation on the application program, and when running the first process corresponding to the operation, applies to the operating system for the memory information corresponding to the operation; when running the second process corresponding to the operation, allocates memory information to the second process in the memory information corresponding to the operation, and the start time of the second process is after the end time of the first process; based on the memory information of the second process, writes the data of the second process into the memory space corresponding to the memory information of the second process. In this way, the problem of system performance deterioration caused by frequent memory requests during the operation of multi-process applications is avoided.

[0097] At the same time, since the corresponding physical memory pages are reserved in advance from the system, that is, the application for physical memory pages is completed in the early light load stage, when the process that needs to do heavy calculations is run subsequently, the corresponding size of memory can be directly allocated from the reserved physical memory. There is no situation where when running the process that needs heavy calculations in the later stage, due to insufficient memory space, additional processor resources need to be occupied for memory cleanup and other operations. This can improve the system's operating efficiency and avoid performance deterioration due to competition for processor resources when processes are doing heavy calculations.

[0098] In this application, even if the remaining memory in the system is insufficient to complete the process corresponding to the operation when the user operates the application, based on the method provided in this application, memory cleaning and other links that require the operating system to perform a large amount of calculations can be completed in advance in the early light load stage, that is, anonymous file page swapping (kSwap), low memory recycling (LMK), etc., to avoid subsequent processes competing for processor resources when performing heavy calculations, resulting in performance deterioration.

[0099] In some embodiments, the electronic device may be a mobile phone, a tablet computer, a desktop, a laptop, a notebook computer, an ultra-mobile personal computer (UMPC), a handheld computer, a netbook, a personal digital assistant (PDA), a wearable electronic device, a smart watch, etc. The present application does not impose any special restrictions on the specific form of the above electronic devices. In this embodiment, the structure of the electronic device may be as follows: Figure 7 As shown, Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.

[0100] like Figure 7 As shown, the electronic device may include a processor 110, an external memory interface 120, an internal memory 121, a sensor module 130, a button 140, a motor 141, a camera 142, and a display screen 143, etc. The sensor module 130 may include a pressure sensor 130A, a gyroscope sensor 130B, a fingerprint sensor 130C, a touch sensor 130D, etc.

[0101] It is to be understood that the structure illustrated in this embodiment does not constitute a specific limitation on the electronic device. In other embodiments, the electronic device may include more or fewer components than shown in the figure, or combine some components, or split some components, or arrange the components differently. The components shown in the figure may be implemented in hardware, software, or a combination of software and hardware.

[0102] The processor 110 may include one or more processing units, for example: the processor 110 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Among them, different processing units may be independent devices or integrated into one or more processors. For example, in the present application, the processor 110 may respond to the user's operation on the application program, and when running the first process corresponding to the operation, apply to the operating system for memory information corresponding to the operation; when running the second process corresponding to the operation, in the memory information corresponding to the operation, allocate memory information for the second process, and the start running time of the second process is after the end running time of the first process; based on the memory information of the second process, write the data of the second process into the memory space corresponding to the memory information of the second process.

[0103] The controller can be the nerve center and command center of the electronic device. The controller can generate operation control signals according to the instruction operation code and timing signal to complete the control of fetching and executing instructions.

[0104] The processor 110 may also be provided with a memory for storing instructions and data. In some embodiments, the memory in the processor 110 is a cache memory. The memory may store instructions or data that the processor 110 has just used or cyclically used. If the processor 110 needs to use the instruction or data again, it may be directly called from the memory. This avoids repeated access, reduces the waiting time of the processor 110, and thus improves the efficiency of the system.

[0105] In some embodiments, the processor 110 may include one or more interfaces. The interface may include an inter-integrated circuit (I2C) interface, an inter-integrated circuit sound (I2S) interface, a pulse code modulation (PCM) interface, a universal asynchronous receiver / transmitter (UART) interface, a mobile industry processor interface (MIPI), a general-purpose input / output (GPIO) interface, a subscriber identity module (SIM) interface, and / or a universal serial bus (USB) interface, etc.

[0106] The I2C interface is a bidirectional synchronous serial bus, including a serial data line (SDA) and a serial clock line (SCL). In some embodiments, the processor 110 may include multiple groups of I2C buses. The processor 110 may be coupled to the touch sensor 130D, the charger, the flash, the camera 142, etc. through different I2C bus interfaces. For example, the processor 110 may be coupled to the touch sensor 130D through the I2C interface, so that the processor 110 communicates with the touch sensor 130D through the I2C bus interface to realize the touch function of the electronic device.

[0107] The MIPI interface can be used to connect the processor 110 with peripheral devices such as the display screen 143 and the camera 142. The MIPI interface includes a camera serial interface (CSI), a display serial interface (DSI), etc. In some embodiments, the processor 110 and the camera 142 communicate via the CSI interface to realize the shooting function of the electronic device. The processor 110 and the display screen 143 communicate via the DSI interface to realize the display function of the electronic device.

[0108] The GPIO interface can be configured by software. The GPIO interface can be configured as a control signal or as a data signal. In some embodiments, the GPIO interface can be used to connect the processor 110 with the camera 142, the display 143, the sensor module 130, etc. The GPIO interface can also be configured as an I2C interface, an I2S interface, a MIPI interface, etc.

[0109] It is understandable that the interface connection relationship between the modules illustrated in this embodiment is only a schematic illustration and does not constitute a structural limitation of the electronic device. In other embodiments of the present application, the electronic device may also adopt different interface connection methods in the above embodiments, or a combination of multiple interface connection methods.

[0110] The electronic device implements the display function through a GPU, a display screen 143, and an application processor. The GPU is a microprocessor for image processing, which connects the display screen 143 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering. The processor 110 may include one or more GPUs that execute program instructions to generate or change display information.

[0111] The display screen 143 is used to display images, videos, etc. The display screen 143 includes a display panel. The display panel can be a liquid crystal display (LCD), an organic light-emitting diode (OLED), an active-matrix organic light-emitting diode or an active-matrix organic light-emitting diode (AMOLED), a flexible light-emitting diode (FLED), Miniled, MicroLed, Micro-oled, a quantum dot light-emitting diode (QLED), etc. In some embodiments, the electronic device may include 1 or N display screens 143, where N is a positive integer greater than 1.

[0112] A series of graphical user interfaces (GUIs) can be displayed on the display screen 143 of the electronic device, and these GUIs are the main screens of the electronic device. Generally speaking, the size of the display screen 143 of the electronic device is fixed, and only limited controls can be displayed on the display screen 143 of the electronic device. A control is a GUI element, which is a software component included in an application program, and controls all data processed by the application program and interactive operations on the data. Users can interact with the control through direct manipulation to read or edit relevant information of the application program. Generally speaking, a control can include visual interface elements such as icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, widgets, etc.

[0113] The electronic device can realize the shooting function through ISP, camera 142, video codec, GPU, display screen 143 and application processor.

[0114] The ISP is used to process the data fed back by the camera 142. For example, when taking a photo, the shutter is opened, and the light is transmitted to the camera photosensitive element through the lens. The light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing and converts it into an image visible to the naked eye. The ISP can also perform algorithm optimization on the noise, brightness, and skin color of the image. The ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, the ISP can be set in the camera 142.

[0115] The camera 142 is used to capture still images or videos. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then passes the electrical signal to the ISP to be converted into a digital image signal. The ISP outputs the digital image signal to the DSP for processing. The DSP converts the digital image signal into an image signal in a standard RGB, YUV or other format. In some embodiments, the electronic device may include 1 or N cameras 142, where N is a positive integer greater than 1.

[0116] Digital signal processors are used to process digital signals. In addition to processing digital image signals, they can also process other digital signals. For example, when an electronic device selects a frequency point, a digital signal processor is used to perform Fourier transform on the frequency point energy.

[0117] Video codecs are used to compress or decompress digital videos. Electronic devices can support one or more video codecs. In this way, electronic devices can play or record videos in multiple coding formats, such as Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, etc.

[0118] NPU is a neural network (NN) computing processor. By drawing on the structure of biological neural networks, such as the transmission mode between neurons in the human brain, it can quickly process input information and continuously self-learn. NPU can realize applications such as intelligent cognition of electronic devices, such as image recognition, face recognition, voice recognition, text understanding, etc.

[0119] The external memory interface 120 can be used to connect an external memory card, such as a Micro SD card, to expand the storage capacity of the electronic device. The external memory card communicates with the processor 110 through the external memory interface 120 to implement a data storage function. For example, files such as music and videos can be stored in the external memory card.

[0120] The internal memory 121 may be used to store computer executable program codes, wherein the executable program codes include instructions. The processor 110 executes the instructions stored in the internal memory 121 to perform various functional applications and data processing of the electronic device.

[0121] The internal memory 121 may include a program storage area and a data storage area. The program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc. The data storage area may store data created during the use of the electronic device (such as audio data, a phone book, etc.), etc. In addition, the internal memory 121 may include a high-speed random access memory, and may also include a non-volatile memory, such as at least one disk storage device, a flash memory device, a universal flash storage (UFS), etc. The processor 110 executes various functional applications and data processing of the electronic device by running instructions stored in the internal memory 121 and / or instructions stored in a memory provided in the processor.

[0122] The pressure sensor 130A is used to sense the pressure signal and can convert the pressure signal into an electrical signal. In some embodiments, the pressure sensor 130A can be set on the display screen 143. There are many types of pressure sensors 130A, such as resistive pressure sensors, inductive pressure sensors, capacitive pressure sensors, etc. The capacitive pressure sensor can be a parallel plate including at least two conductive materials. When a force acts on the pressure sensor 130A, the capacitance between the electrodes changes. The electronic device determines the intensity of the pressure based on the change in capacitance. When a touch operation acts on the display screen 143, the electronic device detects the touch operation intensity according to the pressure sensor 130A. The electronic device can also calculate the touch position according to the detection signal of the pressure sensor 130A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities can correspond to different operation instructions. For example: when a touch operation with a touch operation intensity less than the first pressure threshold acts on the short message application icon, an instruction to view the short message is executed. When a touch operation with a touch operation intensity greater than or equal to the first pressure threshold acts on the short message application icon, an instruction to create a new short message is executed.

[0123] The gyro sensor 130B can be used to determine the motion posture of the electronic device. In some embodiments, the angular velocity of the electronic device around three axes (i.e., x, y, and z axes) can be determined by the gyro sensor 130B. The gyro sensor 130B can be used for anti-shake shooting. For example, when the shutter is pressed, the gyro sensor 130B detects the angle of the electronic device shaking, calculates the distance that the lens module needs to compensate based on the angle, and allows the lens to offset the shaking of the electronic device through reverse movement to achieve anti-shake. The gyro sensor 130B can also be used for navigation and somatosensory game scenes.

[0124] The fingerprint sensor 130C is used to collect fingerprints. The electronic device can use the collected fingerprint characteristics to achieve fingerprint unlocking, access application locks, fingerprint photography, fingerprint call answering, etc.

[0125] The touch sensor 130D is also called a "touch control device". The touch sensor 130D can be set on the display screen 143, and the touch sensor 130D and the display screen 143 form a touch screen, also called a "touch control screen". The touch sensor 130D is used to detect touch operations acting on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to the touch operation can be provided through the display screen 143. In other embodiments, the touch sensor 130D can also be set on the surface of the electronic device, which is different from the position of the display screen 143.

[0126] The key 140 includes a power key, a volume key, etc. The key 140 can be a mechanical key or a touch key. The electronic device can receive key input and generate key signal input related to user settings and function control of the electronic device.

[0127] Motor 141 can generate vibration prompts. Motor 141 can be used for incoming call vibration prompts, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, audio playback, etc.) can correspond to different vibration feedback effects. For touch operations acting on different areas of the display screen 143, motor 141 can also correspond to different vibration feedback effects. Different application scenarios (for example: time reminders, receiving messages, alarm clocks, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.

[0128] In addition, an operating system is running on the above components, such as the iOS operating system developed by Apple, the Android open source operating system developed by Google, and the Windows operating system developed by Microsoft. Application programs can be installed and run on the operating system.

[0129] The operating system of the electronic device may adopt a layered architecture, an event-driven architecture, a micro-core architecture, a micro-service architecture, or a cloud architecture. The embodiment of the present application takes the Android system of the layered architecture as an example to exemplify the software structure of the electronic device.

[0130] Figure 8 It is a software structure block diagram of the electronic device according to an embodiment of the present application.

[0131] The layered architecture divides the software into several layers, each with clear roles and division of labor. The layers communicate with each other through software interfaces. In some embodiments, the Android system is divided into four layers, from top to bottom: the application layer, the application framework layer, the Android runtime and system library, and the kernel layer.

[0132] The application layer can include a series of application packages. Figure 8 As shown, the application package may include applications such as camera, gallery, etc.

[0133] The application framework layer provides application programming interface (API) and programming framework for the applications in the application layer. The application framework layer includes some predefined functions. Figure 8 As shown, the application framework layer may include a window manager, a content provider, a view system, a resource manager, a memory application module, etc.

[0134] The window manager is used to manage window programs. The window manager can obtain the display screen size, determine whether there is a status bar, lock the screen, capture the screen, etc.

[0135] Content providers are used to store and retrieve data and make it accessible to applications. The data may include video, images, audio, etc.

[0136] The view system includes visual controls, such as controls for displaying text, controls for displaying images, etc. The view system can be used to build applications. A display interface can be composed of one or more views. For example, a display interface including a text notification icon can include a view for displaying text and a view for displaying images.

[0137] The resource manager provides various resources for applications, such as localized strings, icons, images, layout files, video files, etc.

[0138] The memory application module is used to apply for corresponding memory from the operating system for the application.

[0139] Android Runtime includes core libraries and virtual machines. Android runtime is responsible for scheduling and management of the Android system.

[0140] The core library consists of two parts: one part is the function that needs to be called by the Java language, and the other part is the Android core library.

[0141] The application layer and the application framework layer run in a virtual machine. The virtual machine executes the Java files of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object life cycle management, stack management, thread management, security and exception management, and garbage collection.

[0142] The system library may include multiple functional modules, such as surface manager, media library, 3D graphics processing library (such as OpenGL ES), 2D graphics engine (such as SGL), etc.

[0143] The surface manager is used to manage the display subsystem and provide the fusion of 2D and 3D layers for multiple applications.

[0144] The media library supports playback and recording of a variety of commonly used audio and video formats, as well as static image files, etc. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.

[0145] The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.

[0146] A 2D graphics engine is a drawing engine for 2D drawings.

[0147] The kernel layer is the layer between hardware and software. The kernel layer contains at least display driver, camera driver, and sensor driver.

[0148] It should be noted that although the embodiments of the present application are described using the Android system as an example, its basic principles are also applicable to electronic devices based on operating systems such as iOS and Windows.

[0149] The above is only a specific implementation of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application should be included in the protection scope of the present application. Therefore, the protection scope of the present application should be based on the protection scope of the claims.

Claims

1. A memory calling method, characterized in that: include: In response to a user operation on an application program, when a first process corresponding to the operation is run, applying to an operating system for memory information corresponding to the operation; When running at least one second process corresponding to the operation, in the physical memory information corresponding to the operation, physical memory information is allocated to the second process, and physical memory information of the second process is obtained; Mapping the physical memory information of the second process with the logical memory information to obtain the logical memory information of the second process; The start time of the second process is after the end time of the first process; Based on the logical memory information of the second process, the data of the second process is written into the memory space corresponding to the logical memory information of the second process.

2. The method according to claim 1, characterized in that In response to the user's operation on the application, when running the first process corresponding to the operation, applying to the operating system for memory information corresponding to the operation includes: In response to a user's operation on an application, when a first process corresponding to the operation is running, applying to an operating system for memory information corresponding to a plurality of second processes corresponding to the operation, or, In response to a user operation on an application program, when a first process corresponding to the operation is run, a request is made to an operating system for the sum of memory information corresponding to each second process corresponding to the operation.

3. The method according to claim 1, characterized in that The step of determining the memory information corresponding to the operation includes: The operating system estimates the memory space occupied by the process corresponding to the operation, and determines the size of the memory space corresponding to the operation; Memory information corresponding to the operation is determined according to the size of the memory space corresponding to the operation.

4. The method according to claim 3, characterized in that The operating system estimates the memory space occupied by the process corresponding to the operation to determine the size of the memory space corresponding to the operation, including: The operating system estimates the memory space occupied by the process corresponding to the operation, and determines the size of the peak memory corresponding to the operation; The size of the memory space corresponding to the operation is determined according to the size of the peak memory.

5. The method according to claim 1, characterized in that In response to the user's operation on the application, when running the first process corresponding to the operation, applying to the operating system for memory information corresponding to the operation includes: In response to a user's operation on an application program, when a first process corresponding to the operation is run, an application is made to an operating system for memory information corresponding to the operation, and first sub-memory information corresponding to the operation is obtained, where the first sub-memory information is obtained by the operating system by cleaning up anonymous file pages in the system; Traversing the processes running in the system, clearing the processes whose priorities are lower than a threshold according to the priorities of the processes, and obtaining the second sub-memory information corresponding to the operation; Based on the first sub-memory information and the second sub-memory information, memory information corresponding to the operation is obtained.

6. The method according to claim 1, characterized in that In response to the user's operation on the application, when running the first process corresponding to the operation, applying to the operating system for memory information corresponding to the operation includes: In response to the user's operation on the application, when running the first process corresponding to the operation, the memory information corresponding to the operation is requested from the operating system through the memory reservation interface, and the memory reservation interface is used to provide a memory space of a corresponding size for the operation.

7. The method according to any one of claims 1 to 6, characterized in that: After writing the data of the second process into the memory space corresponding to the logical memory information of the second process based on the logical memory information of the second process, the method further includes: The memory space corresponding to the memory information of the second process is released.

8. An electronic device, characterized in that: The electronic device comprises: a processor and a memory; The memory is used to store program code and transmit the program code to the processor; The processor is used to execute the steps of a memory calling method as described in any one of claims 1-7 according to the instructions in the program code.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of a memory calling method as described in any one of claims 1 to 7 are implemented.

Citation Information

Patent Citations

  • Memory allocation method, device and system

    CN115344507A

  • Memory space management method and memory space management device

    CN115543600A