CN115878915A - Page access method, device, storage medium and computer equipment - Google Patents
Page access method, device, storage medium and computer equipment Download PDFInfo
- Publication number
- CN115878915A CN115878915A CN202111155672.6A CN202111155672A CN115878915A CN 115878915 A CN115878915 A CN 115878915A CN 202111155672 A CN202111155672 A CN 202111155672A CN 115878915 A CN115878915 A CN 115878915A
- Authority
- CN
- China
- Prior art keywords
- page
- access
- system memory
- stored
- memory
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Landscapes
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The application discloses a page access method, a page access device, a storage medium and computer equipment, wherein the method comprises the following steps: acquiring at least one page with historical access times larger than or equal to a time threshold value from a page access record, and determining the at least one page as at least one access page needing to be locked and stored by a system memory; loading at least one access page into a system memory, and storing at least one access page lock in the system memory; acquiring a page access instruction carrying an access address; and accessing a target access page corresponding to the access address in the system memory. By the aid of the method and the device, page access efficiency is improved.
Description
Technical Field
The present application relates to the field of computer technologies, and in particular, to a page access method, an apparatus, a storage medium, and a computer device.
Background
In the existing page access method, a specific location of a file to which an access page belongs is determined in a file memory, where the file memory may generally be a non-volatile memory such as a disk (disk), and then the file to which the access page belongs is loaded into a system memory, so that a terminal device can stably access the access page, and the system memory may generally be a volatile memory such as a Double Data random access memory (DDR) Synchronous Dynamic Random Access Memory (SDRAM). Due to the limited capacity of the system memory, the terminal device can regularly recover the files in the system memory, so that the terminal device frequently loads and recovers the files.
Disclosure of Invention
The application provides a page access method, a page access device, a storage medium and computer equipment, which can solve the technical problem of how to improve the page access efficiency.
In a first aspect, an embodiment of the present application provides a page access method, where the method includes:
acquiring at least one page with historical access times larger than or equal to a time threshold value from a page access record, and determining the at least one page as at least one access page needing to be locked and stored by a system memory;
loading at least one access page to a system memory, and storing at least one access page lock in the system memory;
acquiring a page access instruction carrying an access address;
and accessing a target access page corresponding to the access address in the system memory.
In a second aspect, an embodiment of the present application provides a page access apparatus, including:
the determining module is used for acquiring at least one page with the historical access times larger than or equal to a time threshold value from the page access record, and determining the at least one page as at least one access page needing to be locked and stored by a system memory;
the locking module is used for loading at least one access page to the system memory and storing at least one access page in the system memory in a locking mode;
the acquisition module is used for acquiring a page access instruction carrying an access address;
and the access module is used for accessing the target access page corresponding to the access address in the system memory.
In a third aspect, an embodiment of the present application provides a storage medium, where a computer program is stored, where the computer program is adapted to be loaded by a processor and to perform the steps of the above method.
In a fourth aspect, embodiments of the present application provide a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor executes the computer program to implement the steps of the method described above.
In the embodiment of the application, at least one page with the historical access times larger than or equal to the time threshold is obtained from the page access record, then the at least one page is determined as the at least one access page needing to be locked and stored by the system memory, the at least one access page is loaded to the system memory, the at least one access page is locked and stored in the system memory, and after a page access instruction carrying an access address is obtained, a target access page corresponding to the access address can be directly accessed in the system memory, so that the situation that files to which frequently-accessed access pages belong are continuously loaded to the system memory and continuously released from the system memory is avoided, the process that the files to which frequently-accessed pages belong are obtained from the file memory first and then the files to which the access pages belong are loaded to the system memory is pertinently reduced, and the page access efficiency is improved.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the embodiments or the prior art descriptions will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a system architecture diagram of page access provided in an embodiment of the present application;
fig. 2 is a schematic flowchart of a page access method according to an embodiment of the present application;
fig. 3 is a schematic flowchart of a page access method provided in an embodiment of the present application;
fig. 4 is a schematic flowchart of a page access method provided in an embodiment of the present application;
fig. 5 is a schematic flowchart of a process of acquiring an access page according to an embodiment of the present application;
fig. 6 is a schematic flowchart of a page access method according to an embodiment of the present application;
fig. 7 is a schematic flowchart of a page access method according to an embodiment of the present application;
fig. 8 is a schematic flowchart of a page storage method according to an embodiment of the present application;
fig. 9 is a schematic flowchart of a page access method according to an embodiment of the present application;
fig. 10 is a schematic structural diagram of a page access apparatus according to an embodiment of the present application;
fig. 11 is a schematic structural diagram of an electronic device according to an embodiment of the present application;
FIG. 12 is a schematic structural diagram of an operating system and a user space provided in an embodiment of the present application;
FIG. 13 is an architectural diagram of the android operating system of FIG. 11;
FIG. 14 is an architectural diagram of the IOS operating system of FIG. 11. .
Detailed Description
In order to make the features and advantages of the present application more obvious and understandable, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The following description refers to the accompanying drawings in which the same numbers in different drawings represent the same or similar elements unless otherwise indicated. The implementations described in the following exemplary examples do not represent all implementations consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the application, as detailed in the appended claims. The flow diagrams depicted in the figures are merely exemplary and need not be performed in the order of the steps shown. For example, some steps are parallel, and there is no strict logical relationship between them, so the actual execution order is variable. In addition, the terms "first", "second", "third", "fourth", "fifth", "sixth", "seventh", "eighth" are for purposes of distinction only and should not be construed as limiting the present disclosure.
In the existing page access method, a specific position of a file to which an access page belongs in a file memory (generally, a non-volatile memory such as a disk, which has the characteristic of stable storage) is determined, and then the file to which the access page belongs is loaded into a system memory (generally, a volatile memory such as a DDR, an SDRAM, which has the characteristic of high access speed) so that a terminal device can stably access the access page. Due to the limited capacity of the system memory, the terminal device can regularly recover the files in the system memory, so that the terminal device frequently loads and recovers the files.
In order to better improve the access efficiency of pages in a document, please refer to fig. 1, which is a system architecture diagram for page access provided by an embodiment of the present application.
As shown in fig. 1, the system architecture may include a file storage 10 and a system memory 20 disposed in the page access apparatus 1, wherein at least one page 30 is stored in the file storage 10.
The page access apparatus 1 may be various electronic devices including, but not limited to, a smart watch, a smart phone, a tablet computer, a laptop portable computer, a desktop computer, and the like, and is not particularly limited herein. The file storage 10 may be a non-volatile memory such as a magnetic disk, and the system memory 20 may be a random access memory such as a double rate synchronous dynamic random access memory (ddr sdram) or a synchronous dynamic random access memory (sdram), that is, a volatile memory.
The page 30 is a basic storage unit in the file memory 10, and when the storage management method of the page access device 1 is a basic paging storage management method, the file stored in the file memory 10 is divided into a plurality of equal-sized pieces, called pages or pages, and each page is numbered, starting from 0, such as page 0, page 1, and the like.
The page access device 1 can access any page 30 stored in the file storage 10, and can load the accessed page 30 into the system memory 20. The page access apparatus 1 may lock any page 30 to be stored in the system memory 20.
It should be understood that the numbers of terminal devices, file stores, system memory, and pages in fig. 1 are merely illustrative, and any number of terminal devices, file stores, system memory, and pages may be used, as desired.
The page access method provided by the embodiment of the present application will be described in detail below with reference to fig. 2 to 8.
Referring to fig. 2, a schematic flow chart of a page access method is provided in an embodiment of the present application. As shown in fig. 2, the method may include the following steps S101 to S102.
S101, at least one page with historical access times larger than or equal to a time threshold value is obtained from a page access record, and the at least one page is determined to be at least one access page needing to be stored in a system memory in a locking mode.
Specifically, the page access record refers to a page identifier, access time, an access user identifier, a file to which the page identifier belongs, and the like of an accessed page, which are recorded when the terminal device accesses the page. It will be appreciated that each page access process will generate a page access record.
The processor obtains a page access record, then counts historical access times of each page recorded in the page access record based on the page access record, then compares the historical access times of each page with a time threshold value in sequence to obtain at least one page with the historical access times being greater than or equal to the time threshold value, and then determines the at least one page as at least one access page needing to be locked and stored by a system memory. The page refers to a page in a file stored in a file memory of the terminal device, one file is composed of at least one page, and at least one file is stored in the file memory.
Optionally, the at least one access page that needs to be stored in the system memory in a locked manner may be obtained by a manufacturer of the terminal device based on a large amount of user usage data measurement and calculation, and the at least one access page that needs to be stored in the system memory in a locked manner is directly marked in a related process or a storage of the terminal device, and when the access page is stored in a locked manner, the marked access page is directly obtained.
Optionally, the at least one access page to be locked and stored by the system memory may be a lock page that is set by a user based on a lock page setting interface of the terminal device, and it may be understood that the setting interface of the lock page may include a page identifier, a page usage, a folder to which the page belongs, page access times, and the like, and when the user triggers a page lock instruction based on the lock page setting interface, the page identifier corresponding to the page lock instruction is an access page to be locked and stored by the system memory.
S102, loading at least one access page to the system memory, and storing at least one access page in the system memory in a locking mode.
Specifically, at least one access page that is locked and stored in the system memory is not recycled by the memory management module of the terminal device, that is, the locked access page is not released from the system memory. The time threshold is a judgment basis for judging whether each access page needs to be locked and stored in the system memory, specifically, if the historical access time of the page is greater than or equal to the time threshold, it is judged that the page is frequently accessed by the terminal device and needs to be locked in the system memory; and if the historical access times of the page are less than the time threshold value, judging that the page cannot be frequently accessed by the terminal equipment and does not need to be locked in the system memory.
The processor acquires at least one access page, loads the at least one access page into the system memory, and locks and stores the access page needing to be locked and stored by the system memory in the system memory through a locking function. Optionally, the locking function may be an mlock () function, where the mlock () function is a function for implementing an mlock (memory locking) mechanism, and the mlock mechanism is a mechanism for implementing memory locking by a kernel, and is used to lock part or all of a virtual memory used by a process to a physical memory.
Optionally, after determining the at least one access page that needs to be stored in the system memory in a locked manner, the processor may obtain a physical address of each access page in the at least one access page in the file memory, then search for each corresponding access page in the file memory based on each physical address, and access each corresponding access page.
Optionally, when detecting a start instruction of the terminal device, the processor starts the terminal device, determines at least one access page that needs to be stored in the system memory in a locked manner, and then executes the access, load, and locked storage processes, so that in the start process of the terminal device, the at least one access page that needs to be stored in the system memory in a locked manner is stored in the system memory in a locked manner.
S103, acquiring a page access instruction carrying an access address;
specifically, the access address carried by the page access instruction may be a virtual address, and is specifically used to find a target access page consistent with the access address in the system memory. It should be noted that, all processors of the terminal device perform related operations such as searching, obtaining, modifying, and the like on a page based on a virtual address of the page, and the processor may calculate the virtual address of the page according to a file name of a file to which the page belongs and an offset of the page in the file to which the page belongs.
The page access instruction may be a page access instruction of the system application and the third-party application, or a page access instruction triggered by the user based on the display interface of the terminal device, which is not limited herein.
And S104, accessing a target access page corresponding to the access address in the system memory.
Specifically, the processor searches for a target access page corresponding to an access address in a system memory based on a page access instruction carrying the access address, and accesses the target access page when the target access page corresponding to the access address is found, where it is noted that, in the system memory, one access page is locked and stored in a position corresponding to the access address.
In the embodiment of the application, at least one page with the historical access times larger than or equal to the time threshold is obtained from the page access record, then the at least one page is determined as the at least one access page needing to be locked and stored by the system memory, the at least one access page is loaded to the system memory, the at least one access page is locked and stored in the system memory, and after a page access instruction carrying an access address is obtained, a target access page corresponding to the access address can be directly accessed in the system memory, so that the situation that files to which frequently-accessed access pages belong are continuously loaded to the system memory and continuously released from the system memory is avoided, the process that the files to which frequently-accessed pages belong are obtained from the file memory first and then the files to which the access pages belong are loaded to the system memory is pertinently reduced, and the page access efficiency is improved. Meanwhile, the file to which the frequently accessed access page belongs is prevented from being directly locked and stored, the condition that the memory space of the system memory is wasted is avoided, and the utilization rate of the system memory is improved.
Referring to fig. 3, a schematic flow chart of a page access method according to an embodiment of the present application is provided. As shown in fig. 3, the method may include the following steps S201 to S205.
S201, obtaining page access records in a preset time interval, and obtaining historical access times of each page in the page access records.
Specifically, the terminal device may update the access page locked in the system memory periodically, and it is understood that, in order to ensure the use effect of the terminal device, the update period is generally long, that is, the preset time interval may be three months or half a year.
When the processor receives and updates the access page needing to be locked and stored by the system memory, the processor can obtain the page access record in the preset time interval, and then count the historical access times of each page in the page access record based on the obtained page access record.
S202, at least one page with the historical access times larger than or equal to the time threshold value is obtained, and the at least one page is determined to be at least one access page needing to be stored in a locking mode in the system memory.
Specifically, the processor compares the historical access times of the pages in sequence with a time threshold, and if the historical access times of the currently compared pages are greater than or equal to the time threshold, the currently compared pages are determined as the access pages needing to be locked and stored by the system memory.
S203, loading at least one access page to the system memory, and locking and storing the at least one access page in the system memory;
for details, refer to step S102, which is not described herein again.
S204, acquiring a page access instruction carrying an access address.
Specifically, refer to step S103, which is not described herein again.
And S205, accessing a target access page corresponding to the access address in the system memory.
Specifically, refer to step S104, which is not described herein again.
Optionally, the terminal device may directly store an identification model for identifying an access page that needs to be locked and stored by the system memory, the processor inputs the obtained page access record into the identification model, and the identification model may screen out, based on the access time, the access time period to which the access time belongs, the access user, and the like, an access page in the current time period, which is currently used by the user or needs to be locked and stored by the system memory, and then output page information of the access page that needs to be locked and stored by the system memory, so that the terminal device accesses the corresponding access page in the file memory based on the output page information, and then loads the access page to the system memory and locks and stores the access page in the system memory.
In the embodiment of the application, the access page needing to be locked and stored by the system memory is determined by obtaining the page access record in the preset time interval and then based on the page access record, so that the access page needing to be locked and stored by the system memory is updated, the latest page access requirement of the terminal system is met, the occupation of the system memory when the access page locked and stored by the system memory is not the page frequently accessed by the user is avoided, and the utilization rate of the system memory is improved.
Referring to fig. 4, a schematic flow chart of a page access method according to an embodiment of the present application is provided. As shown in fig. 4, the method may include the following steps S301 to S305.
S301, acquiring a page access record corresponding to the user identifier, and acquiring historical access times of each page in the page access record.
Specifically, the terminal device may lock the access page stored in the system memory in a customized manner for the user of the terminal device, and it may be understood that different applications, frequently accessed files, familiar operations, and the like of different users are different, and the terminal device collects page access records of different users.
When receiving and updating an access page needing to be locked and stored by a system memory, or when the number of records of a page access record corresponding to a current user meets a record threshold value, a processor acquires the page access record corresponding to a user identifier stored in a memory, and then counts the historical access times of each page in the page access record based on the acquired page access record.
S302, at least one page with the historical access times larger than or equal to the time threshold is obtained, and the at least one page is determined to be at least one access page needing to be stored in a system memory in a locking mode.
Specifically, the processor compares the historical access times of the pages in sequence with a time threshold, and if the historical access times of the currently compared pages are greater than or equal to the time threshold, the currently compared pages are determined as the access pages needing to be locked and stored by the system memory.
S303, loading the at least one access page into the system memory, and storing the at least one access page in the system memory in a locked manner.
Specifically, refer to step S102, which is not described herein again.
S304, acquiring a page access instruction carrying the access address.
Specifically, refer to step S103, which is not described herein again.
S305, accessing a target access page corresponding to the access address in the system memory.
Specifically, refer to step S104, which is not described herein again.
In the implementation of the application, the page access record corresponding to the user identifier is obtained, and the access page needing to be locked and stored by the system memory is determined based on the page access record, so that the access page needing to be locked and stored by the system memory by the current user is updated, the page access requirement of the current user is met, the effect of customizing the access page needing to be locked and stored by the system memory by the user is achieved, and the page access efficiency is improved when the user operates the terminal device.
Referring to fig. 5, a schematic flowchart of acquiring an access page is provided in an embodiment of the present application. As shown in fig. 5, the method may include the following steps S401 to S403.
S401, at least one page with historical access times larger than or equal to a time threshold value is obtained.
Specifically, after the processor acquires the historical access times of each page based on the page access record, the processor sequentially compares the historical access times of each page with the time threshold to determine the page with the historical access times greater than or equal to the time threshold in each page corresponding to the page access record.
S402, if the number of the at least one page is larger than the number threshold, sorting the at least one page according to the historical access times.
Specifically, the number threshold is an upper limit of the number of pages of the page that can be locked and stored by the system memory, and it can be understood that, because the space of the system memory is limited, if the page that is locked and stored by the system memory exceeds the number threshold, the memory space of the system memory occupied by the page that is locked and stored is larger than the optimal memory space occupied by the page that is locked and stored, at this time, if the processor accesses pages other than the page that is locked and stored, the page access speed of the processor will be seriously affected, and even the terminal device cannot execute its page access instruction due to the system memory being full, so that the terminal device does not respond for a long time, and further the system is halted or is shut down urgently.
It should be noted that the optimal memory space usage refers to an upper limit of a space of a memory space of a system memory occupied by the locked and stored page, and when the system memory occupied by the locked and stored page is too large, a system operation condition of the terminal device is seriously affected.
The processor counts the number of pages of which the historical access times are greater than or equal to the time threshold, then compares the counted number of pages with the number threshold, and if the number of pages is greater than the number threshold, compares the historical access times of the pages of which the historical access times are greater than or equal to the time threshold one by one to obtain the magnitude sequence of the historical access times of the pages of which the historical access times are greater than or equal to the time threshold.
S403, determining a target page with a number threshold in at least one page based on the sorting result, and determining the target page as at least one access page needing to be locked and stored by a system memory; the historical access times of the target pages are all larger than the historical access times of other pages except the target pages in at least one page.
Specifically, access pages which need to be locked and stored by the system memory are sequentially determined based on a sorting result, illustratively, if pages with the historical access times larger than or equal to a time threshold are sorted according to the descending order of the historical access times, traversal is started from the first page of the sorting result, if the current traversal times is smaller than or equal to a number threshold, the currently traversed page is determined as a target page which needs to be locked and stored by the system memory, and the traversal process is ended until the current traversal times is larger than the number threshold, so that at least one access page which needs to be locked and stored by the system memory is obtained, namely all the target pages are used as at least one access page which needs to be locked and stored by the system memory.
It will be understood that pages having historical accesses greater than or equal to the threshold number include target pages that are determined to require storage locked by system memory, and other pages that are not determined to require storage locked by system memory.
In the embodiment of the application, the upper limit of the number of the pages of the access page which can be locked and stored by the system memory is set, so that the situations of blocking, halting or crash and restart of the operating system caused by the fact that the access page which is locked and stored by the system memory occupies too large system memory are avoided, the safe use of the terminal equipment is ensured, and the terminal equipment can smoothly access the pages, so that the access efficiency of the pages is improved.
Referring to fig. 6, a schematic flow chart of a page access method according to an embodiment of the present application is provided. As shown in fig. 6, the method may include the following steps S501 to S506.
S601, at least one page with historical access times larger than or equal to a time threshold value is obtained from the page access record, and the at least one page is determined to be at least one access page needing to be stored in a system memory in a locking mode.
Specifically, refer to step S101, which is not described herein again.
S502, acquiring physical addresses respectively corresponding to at least one access page in the file memory.
Specifically, the terminal device may obtain, based on the mapping relationship between the virtual address and the physical address of the access page, the physical address corresponding to each access page that needs to be stored in the system memory in a locked manner.
It should be noted that, the terminal device stores a page address mapping table, where the table records a mapping relationship between a virtual address and a physical address of an access page. The page address mapping table may be set in the terminal device when a manufacturer of the terminal device leaves a factory; or can be added into the terminal equipment in the process of installing the third-party application; in the page access process, the relevant address obtained in the page access process may also be added to the inside of the terminal device, which is not limited herein.
S503, at least one access page is accessed in the file memory based on the physical address.
The processor sequentially addresses in the file memory based on the physical address corresponding to each access page in the at least one access page to determine the specific position of the access page in the file memory, and then accesses the access page needing to be locked and stored by the system memory after finding the specific position of the access page.
S504, at least one access page is loaded to the system memory.
Specifically, the processor loads at least one accessed page accessed to the system memory, and then locks and stores the accessed page needing to be locked and stored by the system memory in the system memory through the locking function. Optionally, the locking function may be an mlock () function, where the mlock () function is a function for implementing an mlock (memory locking) mechanism, and the mlock mechanism is a mechanism for implementing memory locking by a kernel, and is used to lock part or all of a virtual memory used by a process to a physical memory.
Optionally, when detecting a start instruction of the terminal device, the processor starts the terminal device, determines at least one access page that needs to be stored in the system memory in a locked manner, and then executes the processes of accessing, loading, and storing in a locked manner, so that in the start process of the terminal device, the at least one access page that needs to be stored in the system memory in a locked manner is stored in the system memory in a locked manner.
And S505, acquiring a page access instruction carrying an access address.
Specifically, refer to step S103, which is not described herein again.
S506, accessing a target access page corresponding to the access address in the system memory.
Specifically, refer to step S104, which is not described herein again.
In the embodiment of the application, a physical address corresponding to an access page is obtained to access the page located on the physical address on a file memory, and then the access page with the historical access frequency greater than or equal to a frequency threshold value is locked and stored in a system memory, so that a file to which the frequently-accessed access page belongs is prevented from being continuously loaded to the system memory and continuously released from the system memory, and therefore the process that the file to which the frequently-accessed access page belongs is obtained from the file memory first and then loaded to the system memory is pertinently reduced, and the page access efficiency is improved; meanwhile, the file to which the frequently accessed access page belongs is prevented from being directly locked and stored, the condition that the memory space of the system memory is wasted is avoided, and the utilization rate of the system memory is improved.
Referring to fig. 7, a schematic flow chart of a page access method according to an embodiment of the present application is provided. As shown in fig. 7, the method may include the following steps S601 to S604.
S601, at least one page with historical access times larger than or equal to a time threshold value is obtained from the page access record, and the at least one page is determined to be at least one access page needing to be stored in a system memory in a locking mode.
Specifically, refer to step S101, which is not described herein again.
S602, loading at least one access page to the system memory, and storing at least one access page in the system memory in a locked mode.
For details, refer to step S102, which is not described herein again.
S603, acquiring a page access instruction carrying an access address.
Specifically, refer to step S103, which is not described herein again.
And S604, accessing a target access page corresponding to the access address in the system memory.
Specifically, refer to step S104, which is not described herein again.
And S605, if the target access page corresponding to the access address does not exist in the system memory, acquiring a target physical address corresponding to the access address.
Specifically, if a target access page corresponding to the access address does not exist in the system memory, specifically, the target access page corresponding to the access address cannot be searched for by using the access address in the page access instruction, and therefore the target access page corresponding to the access address cannot be found, the processor searches for the target virtual address consistent with the access address in the page address mapping table.
And after finding the target virtual address consistent with the access address, the processor acquires a target physical address corresponding to the target continuous set address. Optionally, if there is no target virtual address consistent with the access address, the specific location of the accessed page in the file memory may be determined based on the file name and the offset of the page in the page access instruction, or a page access error may be directly reported, which is not limited herein.
And S606, accessing a target access page corresponding to the target physical address in the file memory.
Specifically, after the processor acquires the target physical address corresponding to the access address, the processor directly accesses the target access page corresponding to the target physical address in the file memory. Optionally, since the access speed of the system memory is relatively high and the processor may continuously access the target access page, the target access page may be loaded into the system memory after the target access page corresponding to the target physical address is accessed, so as to improve the page access speed.
In the embodiment of the application, the target access page corresponding to the access address is obtained in the file memory through the page address mapping table, so that when the access page corresponding to the virtual address does not exist in the system memory, the corresponding access page is obtained in the file memory through the page address mapping table, the situation that the access page corresponding to the access address cannot be obtained when the access page which is locked and stored in the system memory is released by mistake due to a system error is avoided, meanwhile, the situation that the access page corresponding to the access address cannot be obtained after other pages which are not locked and stored in the system memory are recycled to the system memory is avoided, and the success rate of page access is ensured.
Fig. 8 is a schematic flowchart of a page storage method according to an embodiment of the present disclosure. As shown in fig. 8, the method may include the following steps S11 to S17.
S11, acquiring access data;
when an update instruction for updating a page locked and stored in the system memory is received, an access record corresponding to the update instruction can be acquired in the file memory. For example, if the update instruction is to update the system memory periodically, the obtained access record is an access record in the time interval of two updates; and if the updating instruction is to update the system memory for the current user, the obtained access record is the access record generated by the current user.
S12, identifying an mlock page;
and inputting the acquired access records into an identification model, and identifying each mlock page needing to be locked and stored by the system memory by the identification model based on the access records. For example, the recognition model counts the number of access times of each access page, determines a certain number of access pages with the largest number of access times based on the number of access times, obtains each mlock page with high frequency access, and then executes S14.
S13, receiving an mlock page set by a user;
and the user self-defines and selects the mlock page needing to be locked and stored by the system memory based on the currently displayed mlock page setting interface of the terminal device, wherein the mlock page setting interface displays all files in the file storage, all pages of each file are displayed in the file folding directory, and then S14 is executed.
S14, acquiring a physical address of the mlock page;
the method comprises the steps of obtaining a page address mapping table stored in a file memory, searching an address mapping relation of each mlock page on the page address mapping table, and obtaining a physical address of each mlock page in the file memory based on the found address mapping relation.
S15, whether the system is started or not is judged;
if the operating system of the terminal device is being started, S16 is executed.
S16, accessing an mlock page;
based on each physical address, an mlock page at each physical address is accessed in the file memory.
S17, locking a memory mlock page;
and loading each accessed mlock page into the system memory, and locking and storing each mlock page in the system memory.
Referring to fig. 9, a schematic flow chart of a page access method according to an embodiment of the present application is provided. As shown in fig. 9, the method may include the following steps S21 to S26.
S21, receiving a page access instruction;
and receiving a page access instruction generated by each application program of the terminal equipment, or receiving a page access instruction generated by the terminal equipment based on the system running condition.
S22, acquiring a page access address;
and acquiring a page access address carried on the page access instruction, wherein the access address is a virtual address of the page in a system memory.
S23, whether an access page corresponding to the page access address exists in the system memory or not is judged;
and searching whether an access page corresponding to the page access address exists in a system memory. If yes, executing S24; if not, S25 is executed.
S24, accessing an access page in a system memory;
and accessing the access page corresponding to the page access address in the system memory.
S25, acquiring a physical address of the access page;
the method comprises the steps of obtaining a page address mapping table stored in a file memory, searching an address mapping relation of an access page on the page address mapping table, and obtaining a physical address of the access page in the file memory based on the found address mapping relation.
S26, accessing an access page in the file memory;
based on the physical address, an access page at the physical address is accessed in the file memory.
The page access device provided by the embodiment of the present application will be described in detail with reference to fig. 10. It should be noted that, the page access apparatus shown in fig. 10 is used for executing the method of the embodiment shown in fig. 2 to fig. 9 of the present application, and for convenience of description, only the portion related to the embodiment of the present application is shown, and details of the specific technology are not disclosed, please refer to the embodiment shown in fig. 2 to fig. 9 of the present application.
Referring to fig. 10, a schematic structural diagram of a page access apparatus is provided in an embodiment of the present application. As shown in fig. 10, the page access apparatus 1 according to the embodiment of the present application may include: a determination module 101, a locking module 102, an acquisition module 103, and an access module 104.
The determining module 101 is configured to obtain at least one page with a historical access frequency greater than or equal to a frequency threshold value from a page access record, and determine the at least one page as at least one access page that needs to be locked and stored by a system memory;
a locking module 102, configured to load the at least one access page into the system memory, and store the at least one access page in the system memory in a locked manner;
an obtaining module 103, configured to obtain a page access instruction carrying an access address;
an accessing module 104, configured to access, in the system memory, a target access page corresponding to the access address.
In the embodiment of the application, at least one page with the historical access frequency larger than or equal to the frequency threshold is obtained in the page access record, then the at least one page is determined as the at least one access page needing to be stored in the system memory in a locked mode, the at least one access page is loaded to the system memory, the at least one access page is stored in the system memory in a locked mode, and after a page access instruction carrying an access address is obtained, a target access page corresponding to the access address can be directly accessed in the system memory, so that the situation that files to which the frequently-accessed access pages belong are loaded to the system memory and released from the system memory continuously is avoided, the process that the files to which the frequently-accessed pages belong are obtained from the file memory first and then the files to which the frequently-accessed pages belong are loaded to the system memory is reduced in a targeted manner, and the page access efficiency is improved.
Optionally, the determining module 101 is specifically configured to:
acquiring page access records in a preset time interval, and acquiring historical access times of each page in the page access records;
and acquiring at least one page with the historical access times larger than or equal to a time threshold value, and determining the at least one page as at least one access page needing to be locked and stored by the system memory.
Optionally, the determining module 101 is specifically configured to:
acquiring a page access record corresponding to the user identifier, and acquiring the historical access times of each page in the page access record;
and acquiring at least one page with the historical access times larger than or equal to a time threshold value, and determining the at least one page as at least one access page needing to be locked and stored by the system memory.
Optionally, the determining module 101 is specifically configured to:
acquiring at least one page with historical access times larger than or equal to a time threshold;
if the number of the pages of at least one page is larger than the number threshold, sequencing the at least one page according to the historical access times;
determining a target page with a number threshold in at least one page based on the sorting result, and determining the target page as at least one access page needing to be locked and stored by a system memory;
the historical access times of the target pages are all larger than the historical access times of other pages except the target pages in at least one page.
Optionally, the locking module 102 is specifically configured to:
acquiring physical addresses respectively corresponding to at least one access page in a file memory;
accessing at least one access page in the file memory based on the physical address;
and loading at least one access page to the system memory.
Optionally, the access module 104 is further configured to:
if the target access page corresponding to the access address does not exist in the system memory, acquiring a target physical address corresponding to the access address;
and accessing a target access page corresponding to the target physical address in the file memory.
An embodiment of the present application further provides a storage medium, where the storage medium may store multiple program instructions, where the program instructions are suitable for being loaded by a processor and being executed in the method steps in the embodiments shown in fig. 2 to fig. 8, and a specific execution process may refer to specific descriptions of the embodiments shown in fig. 2 to fig. 8, which is not described herein again.
The present application further provides a computer program product, where at least one instruction is stored, and the at least one instruction is loaded by the processor and executes the page access method according to the embodiment shown in fig. 2 to 9, where a specific execution process may refer to specific descriptions of the embodiment shown in fig. 2 to 9, and is not described herein again.
Referring to fig. 11, a block diagram of an electronic device according to an exemplary embodiment of the present application is shown. The electronic device in the present application may comprise one or more of the following components: a processor 110, a memory 120, an input device 130, an output device 140, and a bus 150. The processor 110, memory 120, input device 130, and output device 140 may be connected by a bus 150.
The Memory 120 may include a Random Access Memory (RAM) or a read-only Memory (ROM). Optionally, the memory 120 includes a non-transitory computer-readable medium. The memory 120 may be used to store instructions, programs, code sets, or instruction sets. The memory 120 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playing function, an image playing function, etc.), instructions for implementing various method embodiments described below, and the like, and the operating system may be an Android (Android) system, including a system based on Android system depth development, an IOS system developed by apple, including a system based on IOS system depth development, or other systems. The data storage area may also store data created by the electronic device during use, such as phone books, audio and video data, chat log data, and the like.
Referring to fig. 12, the memory 120 may be divided into an operating system space, where an operating system is run, and a user space, where native and third-party applications are run. In order to ensure that different third-party application programs can achieve a better operation effect, the operating system allocates corresponding system resources for the different third-party application programs. However, the requirements of different application scenarios in the same third-party application program on system resources are different, for example, in a local resource loading scenario, the third-party application program has a higher requirement on the disk reading speed; in the animation rendering scene, the third-party application program has a high requirement on the performance of the GPU. The operating system and the third-party application program are independent from each other, and the operating system cannot sense the current application scene of the third-party application program in time, so that the operating system cannot perform targeted system resource adaptation according to the specific application scene of the third-party application program.
In order to enable the operating system to distinguish a specific application scenario of the third-party application program, data communication between the third-party application program and the operating system needs to be opened, so that the operating system can acquire current scenario information of the third-party application program at any time, and further perform targeted system resource adaptation based on the current scenario.
Taking an operating system as an Android system as an example, programs and data stored in the memory 120 are as shown in fig. 13, and a Linux kernel layer 320, a system runtime library layer 340, an application framework layer 360, and an application layer 380 may be stored in the memory 120, where the Linux kernel layer 320, the system runtime library layer 340, and the application framework layer 360 belong to an operating system space, and the application layer 380 belongs to a user space. The Linux kernel layer 320 provides underlying drivers for various hardware of the electronic device, such as a display driver, an audio driver, a camera driver, a bluetooth driver, a Wi-Fi driver, power management, and the like. The system runtime library layer 340 provides main feature support for the Android system through some C/C + + libraries. For example, the SQLite library provides support for a database, the OpenGL/ES library provides support for 3D drawing, the Webkit library provides support for a browser kernel, and the like. Also provided in the system runtime library layer 340 is an Android runtime library (Android runtime), which mainly provides some core libraries capable of allowing developers to write Android applications using the Java language. The application framework layer 360 provides various APIs that may be used when constructing an application, and developers may also use these APIs to construct their own applications, such as activity management, window management, view management, notification management, content provider, package management, call management, resource management, and location management. At least one application program runs in the application layer 380, and the application programs may be native application programs carried by the operating system, such as a contact program, a short message program, a clock program, a camera application, and the like; or a third-party application developed by a third-party developer, such as a game application, an instant messaging program, a photo beautification program, a wallpaper setting program, and the like.
Taking an operating system as an IOS system as an example, programs and data stored in the memory 120 are shown in fig. 14, and the IOS system includes: a Core operating system Layer 420 (Core OS Layer), a Core Services Layer 440 (Core Services Layer), a Media Layer 460 (Media Layer), and a touchable Layer 480 (Cocoa Touch Layer). The kernel os layer 420 includes an os kernel, drivers, and underlying program frameworks that provide more hardware-like functionality for use by program frameworks located in the kernel services layer 440. The core services layer 440 provides system services and/or program frameworks, such as a Foundation framework, an account framework, an advertisement framework, a data storage framework, a network connection framework, a geographic location framework, a motion framework, and so forth, as required by the application. The media layer 460 provides audiovisual related interfaces for applications, such as graphics image related interfaces, audio technology related interfaces, video technology related interfaces, audio video transmission technology wireless playback (AirPlay) interfaces, and the like. Touchable layer 480 provides various common interface-related frameworks for application development, and touchable layer 480 is responsible for user touch interaction operations on the electronic device. Such as a local notification service, a remote push service, an advertising framework, a game tool framework, a messaging User Interface (UI) framework, a User Interface UIKit framework, a map framework, and so forth.
In the framework illustrated in FIG. 14, the framework associated with most applications includes, but is not limited to: a base framework in the core services layer 440 and a UIKit framework in the touchable layer 480. The base framework provides many basic object classes and data types, provides the most basic system services for all applications, and is UI independent. While the class provided by the UIKit framework is a base UI class library for creating touch-based user interfaces, iOS applications can provide UIs based on the UIKit framework, so it provides an infrastructure for applications for building user interfaces, drawing, processing and user interaction events, responding to gestures, and so on.
The Android system can be referred to as a mode and a principle for realizing data communication between the third-party application program and the operating system in the IOS system, and details are not repeated herein.
The input device 130 is used for receiving input instructions or data, and the input device 130 includes, but is not limited to, a keyboard, a mouse, a camera, a microphone, or a touch device. The output device 140 is used for outputting instructions or data, and the output device 140 includes, but is not limited to, a display device, a speaker, and the like. In one example, the input device 130 and the output device 140 may be combined, and the input device 130 and the output device 140 are touch display screens for receiving touch operations of a user on or near the touch display screens by using any suitable object such as a finger, a touch pen, and the like, and displaying user interfaces of various applications. Touch displays are typically provided on the front panel of an electronic device. The touch display screen may be designed as a full-face screen, a curved screen, or a profiled screen. The touch display screen can also be designed to be a combination of a full-face screen and a curved-face screen, and a combination of a special-shaped screen and a curved-face screen, which is not limited in the embodiment of the present application.
In addition, those skilled in the art will appreciate that the configurations of the electronic devices illustrated in the above-described figures do not constitute limitations on the electronic devices, which may include more or fewer components than illustrated, or some components may be combined, or a different arrangement of components. For example, the electronic device further includes a radio frequency circuit, an input unit, a sensor, an audio circuit, a Wi-Fi module, a power supply, a bluetooth module, and other components, which are not described herein again.
In the embodiment of the present application, the main body of execution of each step may be the electronic device described above. Optionally, the execution subject of each step is an operating system of the electronic device. The operating system may be an android system, an IOS system, or another operating system, which is not limited in this embodiment of the present application.
The electronic device of the embodiment of the application can also be provided with a display device, and the display device can be various devices capable of realizing a display function, for example: a cathode ray tube display (CR), a light-emitting diode display (LED), an electronic ink screen, a Liquid Crystal Display (LCD), a Plasma Display Panel (PDP), and the like. A user may utilize a display device on the electronic device 101 to view information such as displayed text, images, video, and the like. The electronic device may be a smartphone, a tablet computer, a gaming device, an AR (Augmented Reality) device, an automobile, a data storage device, an audio playback device, a video playback device, a notebook, a desktop computing device, a wearable device such as an electronic watch, an electronic glasses, an electronic helmet, an electronic bracelet, an electronic necklace, an electronic garment, or the like.
In the electronic device shown in fig. 11, the processor 110 may be configured to call the play control state detection application stored in the memory 120, and specifically perform the following operations:
the processor 110 may be configured to invoke a page access procedure stored in the memory 120, and specifically perform the following operations:
acquiring at least one page with historical access times larger than or equal to a time threshold value from a page access record, and determining the at least one page as at least one access page needing to be locked and stored by a system memory;
loading at least one access page into a system memory, and storing at least one access page lock in the system memory;
acquiring a page access instruction carrying an access address;
and accessing a target access page corresponding to the access address in the system memory.
Optionally, when the processor 110 obtains at least one page whose historical access times are greater than or equal to the time threshold from the page access record and determines that the at least one page is at least one access page that needs to be locked and stored by the system memory, the following operations are specifically performed:
acquiring page access records in a preset time interval, and acquiring historical access times of each page in the page access records;
and acquiring at least one page with the historical access times larger than or equal to a time threshold value, and determining the at least one page as at least one access page needing to be locked and stored by the system memory.
Optionally, when the processor 110 obtains at least one page whose historical access times are greater than or equal to the time threshold from the page access record and determines that the at least one page is at least one access page that needs to be locked and stored by the system memory, the following operations are specifically performed:
acquiring a page access record corresponding to the user identifier, and acquiring the historical access times of each page in the page access record;
and acquiring at least one page with the historical access times larger than or equal to a time threshold value, and determining the at least one page as at least one access page needing to be locked and stored by a system memory.
Optionally, when the processor 110 executes at least one page whose acquired historical access times are greater than or equal to the time threshold and determines that the at least one page is at least one access page that needs to be stored in a system memory in a locked manner, the following operations are specifically executed:
acquiring at least one page with historical access times larger than or equal to a time threshold;
if the number of the pages of at least one page is larger than the number threshold, sequencing the at least one page according to the historical access times;
determining a target page with a number threshold in at least one page based on the sorting result, and determining the target page as at least one access page needing to be locked and stored by a system memory;
the historical access times of the target pages are all larger than the historical access times of other pages except the target pages in at least one page.
Optionally, when the processor 110 loads at least one access page to the system memory, the following operations are specifically performed:
acquiring physical addresses respectively corresponding to at least one access page in a file memory;
accessing at least one access page in the file memory based on the physical address;
and loading at least one access page to the system memory.
Optionally, after the processor 110 executes the page access instruction carrying the access address, the following operations are further executed:
if the target access page corresponding to the access address does not exist in the system memory, acquiring a target physical address corresponding to the access address;
and accessing a target access page corresponding to the target physical address in the file memory.
In the embodiment of the application, at least one page with the historical access times larger than or equal to the time threshold is obtained from the page access record, then the at least one page is determined as the at least one access page needing to be locked and stored by the system memory, the at least one access page is loaded to the system memory, the at least one access page is locked and stored in the system memory, and after a page access instruction carrying an access address is obtained, a target access page corresponding to the access address can be directly accessed in the system memory, so that the situation that files to which frequently-accessed access pages belong are continuously loaded to the system memory and continuously released from the system memory is avoided, the process that the files to which frequently-accessed pages belong are obtained from the file memory first and then the files to which the access pages belong are loaded to the system memory is pertinently reduced, and the page access efficiency is improved. Meanwhile, the file to which the frequently accessed access page belongs is prevented from being directly locked and stored, the condition that the memory space of the system memory is wasted is avoided, and the utilization rate of the system memory is improved.
It should be noted that, for the sake of simplicity, the above-mentioned method embodiments are described as a series of acts or combinations, but those skilled in the art should understand that the present application is not limited by the described order of acts, as some steps may be performed in other orders or simultaneously according to the present application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In view of the above description of the page access method, the page access apparatus, the storage medium and the device provided in the present application, those skilled in the art will recognize that there are variations in the embodiments and applications of the page access method, the page access apparatus, the storage medium and the device provided in the present application.
Claims (9)
1. A method for page access, the method comprising:
acquiring at least one page with historical access times larger than or equal to a time threshold value from a page access record, and determining the at least one page as at least one access page needing to be locked and stored by a system memory;
loading the at least one access page to the system memory, and storing the at least one access page in the system memory in a locking manner;
acquiring a page access instruction carrying an access address;
and accessing a target access page corresponding to the access address in the system memory.
2. The method according to claim 1, wherein the obtaining at least one page with a historical access number greater than or equal to a number threshold in a page access record, and determining the at least one page as at least one access page needing to be stored by the system memory lock, comprises:
acquiring page access records in a preset time interval, and acquiring historical access times of each page in the page access records;
and acquiring at least one page with the historical access times larger than or equal to a time threshold value, and determining the at least one page as at least one access page needing to be locked and stored by the system memory.
3. The method according to claim 1, wherein the obtaining at least one page with a historical access number greater than or equal to a number threshold in a page access record, and determining the at least one page as at least one access page needing to be stored by the system memory lock, comprises:
acquiring a page access record corresponding to a user identifier, and acquiring historical access times of each page in the page access record;
and acquiring at least one page with the historical access times larger than or equal to a time threshold value, and determining the at least one page as at least one access page needing to be locked and stored by the system memory.
4. The method according to claim 2 or 3, wherein the obtaining at least one page with the historical access times greater than or equal to a time threshold value, and determining the at least one page as at least one access page needing to be locked and stored by the system memory comprises:
acquiring at least one page with historical access times larger than or equal to a time threshold;
if the page number of the at least one page is larger than a number threshold, sequencing the at least one page according to the historical access times;
determining a target page of the number threshold in the at least one page based on a sorting result, and determining the target page as at least one access page needing to be locked and stored by the system memory;
and the historical access times of the target page are all larger than the historical access times of other pages except the target page in the at least one page.
5. The method of claim 1, wherein loading the at least one access page to the system memory comprises:
acquiring physical addresses respectively corresponding to the at least one access page in a file memory;
accessing the at least one access page in a file memory based on the physical address;
and loading the at least one access page to the system memory.
6. The method of claim 1, wherein after the obtaining the page access instruction carrying the access address, the method further comprises:
if the target access page corresponding to the access address does not exist in the system memory, acquiring a target physical address corresponding to the access address;
and accessing a target access page corresponding to the target physical address in a file memory.
7. A page access apparatus, comprising:
the determining module is used for acquiring at least one page with historical access times larger than or equal to a time threshold value from a page access record, and determining the at least one page as at least one access page needing to be locked and stored by a system memory;
the locking module is used for loading the at least one access page to the system memory and storing the at least one access page in the system memory in a locking mode;
the acquisition module is used for acquiring a page access instruction carrying an access address;
and the access module is used for accessing the target access page corresponding to the access address in the system memory.
8. A storage medium on which a computer program is stored, the computer program, when executed by a processor, implementing the page access method of any one of claims 1 to 6.
9. A computer device, comprising: a processor and a memory; wherein the memory stores a computer program adapted to be loaded by the processor and to perform the steps of the page access method according to any of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111155672.6A CN115878915A (en) | 2021-09-29 | 2021-09-29 | Page access method, device, storage medium and computer equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111155672.6A CN115878915A (en) | 2021-09-29 | 2021-09-29 | Page access method, device, storage medium and computer equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115878915A true CN115878915A (en) | 2023-03-31 |
Family
ID=85756548
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111155672.6A Pending CN115878915A (en) | 2021-09-29 | 2021-09-29 | Page access method, device, storage medium and computer equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115878915A (en) |
-
2021
- 2021-09-29 CN CN202111155672.6A patent/CN115878915A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108089786B (en) | User interface display method, device, equipment and storage medium | |
CN108710513B (en) | Application program starting method and device, storage medium and terminal | |
US9448694B2 (en) | Graphical user interface for navigating applications | |
US10599336B2 (en) | Method of displaying content and electronic device adapted to the same | |
WO2014030901A1 (en) | Application execution method and mobile terminal | |
US11061558B2 (en) | Touch operation response method and device | |
TW201606631A (en) | Context menu utilizing a context indicator and floating menu bar | |
EP4130994A1 (en) | Remote assistance method and apparatus, and storage medium and terminal | |
CN109388309B (en) | Menu display method, device, terminal and storage medium | |
US11455075B2 (en) | Display method when application is exited and terminal | |
CN107608550B (en) | Touch operation response method and device | |
CN110442267B (en) | Touch operation response method and device, mobile terminal and storage medium | |
CN113268212A (en) | Screen projection method and device, storage medium and electronic equipment | |
WO2019047226A1 (en) | Touch operation response method and device | |
CN111857531A (en) | Mobile terminal and file display method thereof | |
CN111857480B (en) | Icon alignment method and device, storage medium and electronic equipment | |
CN114186527A (en) | Method and device for realizing automatic wiring of integrated circuit independent of grid point | |
CN117555459A (en) | Application group processing method and device, storage medium and electronic equipment | |
CN111913614B (en) | Multi-picture display control method and device, storage medium and display | |
CN111324398A (en) | Recent content processing method, device, terminal and storage medium | |
WO2022242419A1 (en) | Partition creation method and apparatus, and storage medium and computer device | |
CN113568748B (en) | Application process processing method and device, storage medium and electronic equipment | |
CN113450762B (en) | Text reading method, text reading device, terminal and storage medium | |
CN115878915A (en) | Page access method, device, storage medium and computer equipment | |
CN112612633A (en) | Inter-process communication method, device, storage medium and terminal |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |