WO2012113206A1 - 移动终端中请求页面调度方法、控制器以及移动终端 - Google Patents

移动终端中请求页面调度方法、控制器以及移动终端 Download PDF

Info

Publication number
WO2012113206A1
WO2012113206A1 PCT/CN2011/078422 CN2011078422W WO2012113206A1 WO 2012113206 A1 WO2012113206 A1 WO 2012113206A1 CN 2011078422 W CN2011078422 W CN 2011078422W WO 2012113206 A1 WO2012113206 A1 WO 2012113206A1
Authority
WO
WIPO (PCT)
Prior art keywords
mobile terminal
memory
file
controller
external
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.)
Ceased
Application number
PCT/CN2011/078422
Other languages
English (en)
French (fr)
Inventor
柴益鹏
贾明军
师延山
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Spreadtrum Communications Shanghai Co Ltd
Original Assignee
Spreadtrum Communications Shanghai Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Spreadtrum Communications Shanghai Co Ltd filed Critical Spreadtrum Communications Shanghai Co Ltd
Priority to US13/698,337 priority Critical patent/US9471584B2/en
Priority to EP11859503.2A priority patent/EP2746953A4/en
Priority to PCT/CN2011/078422 priority patent/WO2012113206A1/zh
Priority to CN201180005383.6A priority patent/CN102792296B/zh
Publication of WO2012113206A1 publication Critical patent/WO2012113206A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • G06F16/174Redundancy elimination performed by the file system
    • G06F16/1744Redundancy elimination performed by the file system using compression, e.g. sparse files
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/11File system administration, e.g. details of archiving or snapshots
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/17Details of further file system functions
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/04Protocols for data compression, e.g. ROHC
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/25Using a specific main memory architecture
    • G06F2212/251Local memory within processor subsystem
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/25Using a specific main memory architecture
    • G06F2212/253Centralized memory
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/40Specific encoding of data in memory or cache
    • G06F2212/401Compressed data

Definitions

  • the present invention relates to the field of communications technologies, and in particular, to a request page scheduling method, a controller, and a mobile terminal in a mobile terminal.
  • the virtual storage mechanism is used on the mobile terminal, thereby increasing the visible size of the main memory or the random access memory (RAM) of the main memory. That is, the RAM is backed up by a storage area called auxiliary storage or secondary storage on a nonvolatile storage device such as a hard disk, a USB, or a flash (flash memory).
  • auxiliary storage or secondary storage on a nonvolatile storage device such as a hard disk, a USB, or a flash (flash memory).
  • flash memory flash memory
  • the virtual address space is typically divided into page frames and can be accessed by a processor.
  • the Memory Management Unit provides a translation mechanism that translates virtual addresses issued by processes running in the processor into physical pages of instructions or data required by the process.
  • FIG. 1 is a schematic structural diagram of a conventional mobile terminal.
  • the mobile terminal 1 includes a controller 10 connected via a bus 13, an external auxiliary memory 11, and a memory 12 external to the controller 10 of the mobile terminal.
  • the controller 10 further includes a central processing unit 101, a direct access access controller 102, a memory management unit 103, and an internal memory 104 connected to each other via a bus 13.
  • the direct access access controller 102 can access an instruction required by a process stored in the internal memory 104 or a physical page of data; and when the internal memory 104 is missing a run When the physical page is required, the central processing unit 101 will transfer from the external auxiliary memory 11 into the physical page of the internal memory 104 and form a mapping with the virtual page.
  • the memory management unit 103 provides a conversion mechanism to convert a virtual address issued by a process running in the central processing unit 101 into a physical page of instructions or data required by the process.
  • part of the program instructions and data in the external auxiliary memory 11 are stored in a compressed file format.
  • the central processing unit 101 needs to read these compressed files, it first needs to be decompressed by a decoding program (not shown) provided outside the controller 10.
  • the decompressed files are generally stored in the external memory 12.
  • the program instructions and data saved in the decompressed file are obtained by mapping and converting the virtual address provided by the memory management unit 103 with the physical address of the external memory 12, and based on the decompressed file. Continue the program to run.
  • the decompression rate of the decoding program disposed outside the controller 10 is generally slow, and the file decompressed by the decoding program for the compressed file is not stored in the memory inside the controller. This causes a waste of internal memory resources and also reduces the rate at which the central processor runs the decompressed files.
  • the problem solved by the present invention is to improve the rate at which the mobile terminal decodes the compressed file and improve the processing efficiency of requesting page scheduling in the mobile terminal.
  • an embodiment of the present invention provides a method for requesting page scheduling in a mobile terminal, including: determining, when a mobile terminal needs to compress a file, a storage location of the compressed file outside a controller of the mobile terminal; Decoding unit inside the controller of the mobile terminal decompresses the compressed file at the storage location, and stores the decompressed file in a designated memory, where the specified memory includes the controller inside the mobile terminal And a memory external to the controller of the mobile terminal; the mobile terminal continues to operate based on the decompressed file.
  • the storage location of the compressed file outside the controller of the mobile terminal includes a storage location of the compressed file on the external secondary storage or a storage location after the compressed file is transferred from the external secondary storage to the external storage.
  • the running, by the mobile terminal, the compressed file includes: the controller of the mobile terminal generates a prefetch error or a data abnormality during operation.
  • determining the storage location of the compressed file outside the controller of the mobile terminal includes: determining an instruction address when the prefetch error occurs or a data address when generating a data abnormality; determining, based on the compressed file index table, The compressed file corresponding to the instruction address or the data address is stored in the external auxiliary memory and determines the storage length of the compressed file.
  • the method further includes: moving the compressed file from an external auxiliary storage to a memory external to the controller of the mobile terminal, based on a storage address and a storage length of the compressed file in a memory external to the controller of the mobile terminal A storage location of the compressed file outside the controller of the mobile terminal is determined.
  • the method further includes: mapping an address of the instruction that generates the prefetch error or a data address of the data abnormality to a memory address of the decompressed file storage.
  • the memory of the decompressed file is determined by means of page frame alignment.
  • the method further includes: when the mobile terminal needs to compress the file, the mobile terminal enters an abnormal processing mode; and when the mobile terminal continues to run based on the decompressed file, switching to before entering the abnormal processing mode Work mode and status.
  • the compressed file is included in an image file stored in an external auxiliary memory; the image file further includes an uncompressed file.
  • the method further includes: when the mobile terminal runs an uncompressed file that is not stored in the controller of the mobile terminal, the controller of the mobile terminal operates based on the uncompressed file stored in the external auxiliary storage; or The uncompressed file is moved from the external auxiliary storage to a memory external to the controller of the mobile terminal, the controller of the mobile terminal operating based on an uncompressed file in a memory external to the controller of the mobile terminal.
  • the image file includes instructions and constants in the program and initialized variables in the program.
  • the method further includes: the mobile terminal running an uncompressed file to initialize the running environment.
  • the uncompressed file is stored on the NAND flash memory; the mobile terminal running the uncompressed file includes: copying the uncompressed file stored in the NAND flash memory to a memory external to the controller of the mobile terminal, and running the An uncompressed file on the memory external to the controller of the mobile terminal.
  • the uncompressed file is stored on the NOR flash memory; and the running, by the mobile terminal based on the uncompressed file, includes: running an uncompressed file stored on the NOR flash memory.
  • An embodiment of the present invention provides a controller, including: a central processing unit, a direct access access controller, a memory management unit, an internal memory, and a decoding unit connected through a bus; wherein the decoding unit is configured to externally assist The compressed file stored by the memory is decompressed and stored in a designated memory, wherein the specified memory includes a memory external to the controller and/or a memory internal to the controller.
  • An embodiment of the present invention further provides a mobile terminal, including a controller connected through a bus of the mobile terminal, an external auxiliary storage, and a memory external to the controller of the mobile terminal;
  • the controller includes: a central processor connected by a bus of the mobile terminal, a direct access access controller, a memory management unit, an internal memory, and a decoding unit; wherein the decoding unit is configured to store the external auxiliary memory
  • the compressed file is decompressed and stored in a designated memory, wherein the specified memory includes a memory external to the controller of the mobile terminal and/or a memory internal to the controller of the mobile terminal.
  • the external auxiliary storage stores an uncompressed file and a compressed file, wherein the compressed file and the uncompressed file include instructions and constants in the program, initialized variables in the program, and uninitialized variables in the program.
  • the external auxiliary storage stores an uncompressed file and a compressed file, where the uncompressed file includes instructions and constants in the program, initialized variables in the program, and uninitialized variables in the program; the compressed file includes a program. The instructions and constants in .
  • the external auxiliary storage comprises: any one of a flash memory, a hard disk, an optical disk, and a USB flash drive.
  • the central processor is adapted to run an uncompressed file in the external auxiliary storage or an uncompressed file that is moved from the external auxiliary storage to a memory external to the controller of the mobile terminal.
  • the technical solution of the present invention has the following beneficial effects:
  • a compressed file stored outside the controller of the mobile terminal is decompressed by a decoding unit inside the controller of the mobile terminal, and then The mobile terminal continues to run based on the decompressed file.
  • the technical solution improves the rate at which the mobile terminal decodes the compressed file. Thereby improving the processing efficiency of requesting page scheduling in the mobile terminal.
  • the memory when the decompressed file is stored in the designated memory, the memory includes a memory inside the controller of the mobile terminal and/or a memory external to the controller of the mobile terminal, so that The partially decompressed file is stored in the internal memory by using the storage space resource of the memory inside the controller of the mobile terminal, thereby further improving the processing efficiency of requesting page scheduling in the mobile terminal.
  • FIG. 1 is a schematic structural diagram of a mobile terminal of the prior art
  • FIG. 2 is a schematic structural view of a specific embodiment of a controller of the present invention.
  • FIG. 3 is a schematic structural diagram of a specific embodiment of a mobile terminal according to the present invention.
  • FIG. 4 is a schematic flowchart of a specific implementation manner of a request page scheduling method according to the present invention
  • FIG. 5 is a schematic structural diagram of a specific embodiment of a compressed file package according to the present invention.
  • the inventor has found that during the processing of the existing mobile terminal running program, the decoding rate of the decoding program external to the controller of the mobile terminal is usually slow, and the file decompressed by the decoding program is not stored.
  • the memory inside the controller causes waste of memory in the memory of the controller of the mobile terminal, and also reduces the speed of the central processor running the decompressed file.
  • the inventor has researched and provided a mobile terminal.
  • the method for requesting paging and the mobile terminal, the technical solution of the present invention improves the rate at which the mobile terminal decodes the compressed file, and fully utilizes the storage space resource of the memory inside the controller of the mobile terminal, and stores the partial decompression in the internal memory.
  • the latter file improves the processing efficiency of requesting page scheduling in the mobile terminal.
  • FIG. 3 is a schematic structural diagram of a specific embodiment of a mobile terminal according to an embodiment of the present invention.
  • the mobile terminal 2 includes a controller 20 connected through a bus 23 of the mobile terminal, an external auxiliary memory 21, and a memory 22 external to the controller 20 of the mobile terminal; wherein the controller 20 includes: The central processing unit 201, the direct access access controller 202, the memory management unit 203, the internal memory 204, and the decoding unit 205 are connected to the bus 23 of the terminal.
  • the central processor 201 is adapted to operate the external auxiliary memory 21 when the instructions or data required for the central processor 201 to operate are the memory 204 stored in the controller 20 of the mobile terminal.
  • the uncompressed file in or the uncompressed file in the memory 22 that is moved from the external auxiliary memory 21 to the outside of the controller 20 of the mobile terminal.
  • the central processing unit 201 may find a corresponding mapping and conversion between a virtual address provided by the memory management unit 203 and a physical address of the external auxiliary storage 21 or the memory 22 of the mobile terminal 20 of the mobile terminal. Uncompressed file.
  • the files in the external auxiliary storage 21 are stored in the form of an image file (Image file), which refers to a binary file saved in the external auxiliary storage 21.
  • the image file includes an uncompressed file and an uncompressed file, wherein the compressed file and the uncompressed file include an instruction and a constant (RO) in the program, an initialized variable (RW) in the program, and an uninitialized variable (ZI) in the program;
  • the uncompressed file includes an instruction and a constant (RO) in the program, an initialized variable (RW) in the program, and an uninitialized variable (ZI) in the program;
  • the compressed file includes an instruction and a constant (RO) in the program,
  • the instructions and constants (RO) in the program may include resource data required for the software interface display, such as images, menus, text, etc., as well as other compressible portions of the program instructions.
  • the instructions and constants (RO) in the program will accomplish at least the following two tasks: 1) moving the initialized variable (RW) in the program from the external auxiliary memory 21 to the mobile terminal In the memory 204 inside the controller 20; 2) clearing the area of the internal memory 204 where the uninitialized variable (ZI) is located in the program, since the uninitialized variable (ZI) in the program is not in the image file, Therefore, the program needs to clear the corresponding internal memory 204 area according to the ZI address and size given by the compiler (not shown).
  • the functions of the uncompressed files in the external auxiliary storage 21 mainly include: 1) initializing the basic environment required for the system to operate; 2) placing program instructions and data that cannot be run using the request paging technology; 3) running the use request Some program instructions and data necessary for paging technology.
  • the external auxiliary storage 21 may include any one of a flash memory, a hard disk, an optical disk, and a USB flash drive. In practical applications, the external auxiliary storage 21 may further include other non-volatile storage devices. Give a brief description.
  • the external auxiliary storage 21 is described by taking a flash memory as an example.
  • flash memory includes two types, NAND memory and NOR memory.
  • NOR flash and NAND flash have significant differences in addressing modes.
  • NAND flash reads data, it specifies the block address, page address, and column address, where the column address is the start in the page address being read. Address.
  • the NAND flash reads the data into the page buffer each time, and then the input address in the input/output line (I/O) is addressed in the buffer, mainly through the The stated address specifies the role of the starting address.
  • I/O input/output line
  • NAND flash operates in a page-based unit. Writing data is also first buffered in the page buffer, specifically by first writing data and program instructions to the page buffer, and then writing the data along with the program instructions to the page. Therefore, for NAND flash, each time a byte is rewritten, the entire page needs to be rewritten, and if there is an unerased portion of the page, it cannot be programmed, and the page must be cleared before writing. Therefore, the role of the NAND page buffer is to ensure that the NAND flash reads/writes on a page-by-page basis, so buffering is required.
  • the NOR flash memory operates on a byte-based basis and can be written and read in bytes, but the erase is performed on a sector-by-sector basis.
  • controller 20 of the mobile terminal and the memory 22 external to the controller 20 of the mobile terminal may be integrated in the same chip; or the controller 20 of the mobile terminal itself may be A chip, and the controller 20 external memory 22 of the mobile terminal is external to the chip.
  • the logical relationship between the controller 20 of the mobile terminal and the memory 204 inside the controller 20 of the mobile terminal and the external memory 22 is not affected.
  • the decoding unit 205 is disposed inside the controller 20 in hardware form. Specifically, when performing the request paging, the decoding unit 205 is configured to decompress the compressed file stored by the external auxiliary storage 21 and store the data in the specified memory, where the memory includes the controller 20 of the mobile terminal. An external memory 22 and/or a memory 204 internal to the controller 20 of the mobile terminal. Specifically, a specific implementation manner of requesting page scheduling according to an embodiment of the present invention will be described in detail in FIG.
  • the memory 22 external to the controller 20 of the mobile terminal may be a random access memory (RAM), and the uncompressed file includes a initialized variable (RW) and a program in the program when the program is running.
  • the uninitialized variable (ZI) is in two parts.
  • the random access memory (RAM) can also store instructions and constants in the program in the uncompressed file. (RO).
  • the random access memory (RAM) must store the instructions and constants (RO) in the program in the uncompressed file, and the program instructions in the compressed file required to run the program. And data.
  • the controller 20 includes: a central processing unit 201 connected through a bus 23, a direct access access controller 202, a memory management unit 203, an internal memory 204, and a decoding unit 205.
  • the decoding unit 205 is configured to decompress a compressed file stored by an external auxiliary memory (not shown) and store the data in a designated memory, wherein the specified memory includes a memory (not shown) external to the controller 20 and/or Or the memory 204 inside the controller 20.
  • the controller 20 may be separately formed into a chip.
  • the chip passes through the bus 23 of the mobile terminal 2 and the external auxiliary memory 21 and an external memory. 22 phase connection.
  • FIG. 4 is a schematic flow chart of a specific implementation manner of a request page scheduling method according to the present invention.
  • the request page scheduling method includes:
  • Step S1 When the mobile terminal needs to compress the file, determine a storage location of the compressed file outside the controller of the mobile terminal.
  • the storage location of the compressed file outside the controller of the mobile terminal includes: a storage location of the compressed file on the external auxiliary storage or a transfer of the compressed file from the external auxiliary storage to the external storage. storage location.
  • the external auxiliary storage is exemplified by a flash memory.
  • a storage location of the compressed file outside the controller of the mobile terminal refers to a storage location of the compressed file in the NOR flash memory;
  • the external auxiliary storage is a NAND flash memory
  • the storage location of the compressed file outside the controller of the mobile terminal refers to a storage location after the compressed file is transferred from the external secondary storage to the external storage.
  • the compressed file is included in an image file stored in an external auxiliary memory, and the image file further includes an uncompressed file.
  • the image file includes instructions and constants in the program and initialized variables in the program.
  • the operation of the mobile terminal to compress the file includes: the controller of the mobile terminal generates a Prefetch Fault or a Data Abort at runtime.
  • the prefetch error means that when the central processing unit goes to an access address read instruction, it is found that the memory management unit does not perform actual physical memory address mapping on the access address; the data abnormality refers to when the central processor goes One Address mapping.
  • the determining that the compressed file is stored outside the controller of the mobile terminal is different according to different external auxiliary storages, and the specific implementation manner thereof is also different.
  • the flash memory is taken as an example.
  • the flash memory is a NOR flash memory, the following steps are included:
  • the mobile terminal when the mobile terminal needs to compress the file, the mobile terminal enters an abnormal processing mode.
  • the central processor When entering the exception handling mode, the central processor will automatically save some program instructions and data when the exception is generated to some registers that can be accessed in the exception handling mode, including the address of the instruction when the error is prefetched or generated. The data address when the data is abnormal.
  • the storage address of the compressed file corresponding to the instruction address or the data address is determined and the storage length of the compressed file is determined.
  • the compressed file index table may refer to a schematic structural diagram of a compressed file package according to an embodiment of the present invention as shown in FIG. 5.
  • a compressed file index list is established, and each index address in the index list directly points to a corresponding compressed data file, and the index address is a compressed data file (Compress Data).
  • the absolute location of File where the index address is the instruction address or data address. For example, index address 0 points to compressed data file 0, index address 1 points to compressed data file 1, index address 2 points to compressed data file 2, index address 3 points to compressed data file 3, index address 4 points to compressed data file 4, and so on. .
  • each compressed data file is 4 kbytes, and the length after compression is different. Then, if it is necessary to find the third 4k byte compressed data file, it is necessary to find the address in the compressed file corresponding to the index address 2 in the index list, and then read from the address until the index address 3 is specified.
  • the compressed content corresponding to the third 4k byte can be obtained by the position before the address.
  • the compressed file index table is not limited to the above manner.
  • the index list includes multiple index units, wherein each index unit not only identifies the absolute address of the corresponding compressed data file, but also identifies the length of the compressed data file; for example, each index unit in the index list only The length of the corresponding compressed data file is identified; for example, each index unit of the index list is not distributed at the head of the compressed file package, but is distributed at the head of each compressed data file.
  • the flash memory is a NAND flash memory
  • the read speed is slower than the NOR memory
  • it needs to be Moving the compressed file to a memory external to the controller of the mobile terminal thus further comprising the steps of: moving the compressed file to a memory external to the controller of the mobile terminal, based on the control of the compressed file at the mobile terminal
  • the storage address and the storage length in the memory external to the device determine the storage location of the compressed file outside the controller of the mobile terminal.
  • the flash memory is a NOR flash memory
  • the implementation of the foregoing steps may also be adopted, that is, the compressed file stored in the NOR flash memory is also first moved to the memory outside the mobile terminal, and then based on the The storage address and the storage length of the compressed file in the memory external to the mobile terminal determine the storage location of the compressed file outside the controller of the mobile terminal.
  • Step S2 the decoding unit inside the controller of the mobile terminal decompresses the compressed file at the storage location, and stores the decompressed file in a designated memory, where the specified memory includes the mobile terminal The internal memory of the controller and/or the memory external to the controller of the mobile terminal.
  • the memory of the decompressed file may be determined in a manner of page frame alignment.
  • the storage address is in the NOR flash memory; and when the external auxiliary storage is a NAND flash memory, the storage address is located at the mobile terminal. In the memory outside the controller.
  • the central processor then allocates the storage address and the storage length of the compressed data file, and the storage address and the storage length of the memory for storing the decompressed data aligned in the page frame to the decoding unit.
  • the central processing unit restarts the decoding unit inside the controller of the mobile terminal, so that the decoding unit automatically decompresses the found corresponding stored compressed content into the specified memory, wherein the specified memory includes A memory internal to the controller of the mobile terminal and/or a memory external to the controller of the mobile terminal.
  • the buffer memory of the page frame (Page Frame) used for requesting paging scheduling is associated with the reading speed of the flash memory and the decoding speed of the decoding unit. Since the compression of program instructions and data is compressed in units of blocks in a compressed file, even if only one instruction in the running block must first decompress the entire compressed file of the entire block, it can be run.
  • the size of each program code and data used for compression is at least one page frame size for request scheduling.
  • the compression ratio of the integrated program instructions and data, the decoding speed of the decoding unit, and the size of the page frame used for paging request is usually 4 KB (kilobytes) or 1 KB, which is equivalent to To execute an instruction, you must decode 4KB or 1KB of data. in other words, If the mobile terminal does not have the buffer memory for storing the decompressed file, but only runs the program by decompressing the file each time a new program instruction is executed, the mobile terminal wastes the need to frequently decompress the file. A lot of computing power.
  • the decompression frequency of the compressed file is reduced during the operation of the mobile terminal.
  • the larger the buffer memory is the lower the frequency at which the mobile terminal needs to decompress new program code and data, so that the flash memory (including NAND flash and NOR flash) and the controller of the mobile terminal are internal.
  • the decoding unit has lower requirements for reading data and decompressing speed.
  • the data buffer memory used to store the previously decompressed data is smaller, the program code and data need to be decompressed more frequently, which will decompress the decoding unit and flash memory (including NAND flash memory and NOR flash) requires a higher data read speed.
  • the performance of the mobile terminal is not the same as that of the request paging technology.
  • the running performance is only reduced by 10%-20%; thus, in the case where the read rate of the flash memory is high (for example, NOR flash memory) and the decompression rate of the decoding unit is also high, the internal memory of the controller of the mobile terminal can be selected.
  • the buffer memory is stored as a decompressed data frame; and in the case where the read rate of the flash memory is slow (for example, NAND flash memory) and the decoding rate of the decoding unit is also slow, the memory external to the controller of the mobile terminal can be used as a solution.
  • the compressed data frame stores the buffer memory.
  • Step S3 The mobile terminal continues to run based on the decompressed file.
  • the mobile terminal when the mobile terminal continues to run based on the decompressed file, the mobile terminal will switch to an operation mode and a state before entering the abnormal processing mode.
  • the working mode before the abnormal processing mode is the normal working mode, and the state restarts the running of the program from the address when the prefetch error or the data abnormality is generated.
  • the method before the mobile terminal continues to run based on the decompressed file, the method further includes: mapping the data address of the instruction address or the data abnormality that generates the prefetch error to the memory address of the decompressed file storage.
  • the method further includes the step of: the mobile terminal running the uncompressed file to initialize the operating environment.
  • the program instructions and data in the uncompressed file enable the operating system in the mobile terminal to establish a basic operating environment, for example, a process that enables the system to operate normally, and each device in the mobile terminal is configured according to the system. Work, data is read and displayed, etc.
  • the uncompressed file is stored on the NAND flash memory; the mobile terminal operating based on the uncompressed file includes: copying the uncompressed file stored in the NAND flash memory to a memory external to the controller of the mobile terminal, and running the mobile An uncompressed file on the external memory of the terminal's controller.
  • the uncompressed file is stored on the NOR flash memory; the mobile terminal operating based on the uncompressed file comprises: directly running an uncompressed file stored on the NOR flash memory.
  • the mobile terminal continues to run the program, in the process, when the mobile terminal runs, it needs to be uncompressed inside the controller of the mobile terminal.
  • the controller of the mobile terminal operates based on the uncompressed file stored in the external auxiliary storage.
  • the external auxiliary storage may be a NOR flash memory, a mapping and conversion mechanism between a virtual address provided by a memory management unit inside the controller of the mobile terminal and a physical address of the external auxiliary storage, the movement
  • the central processor inside the controller of the terminal can run uncompressed files stored in the external auxiliary storage.
  • the controller of the mobile terminal moves the uncompressed file from the external auxiliary storage to a memory external to a controller of the mobile terminal, the controller of the mobile terminal being based on a memory external to the controller of the mobile terminal Uncompressed files run.
  • the external auxiliary storage may be a NAND flash memory. Since the read rate of the NAND flash memory is slower than the NOR flash memory, the uncompressed file needs to be moved from the NAND flash memory to the outside of the controller of the mobile terminal.
  • the memory, and then the central processor internal to the controller of the mobile terminal can run uncompressed files stored in a memory external to the controller of the mobile terminal.
  • the technical solution of the present invention improves the rate at which the mobile terminal decodes the compressed file.
  • the memory space of the memory inside the controller of the mobile terminal can be fully utilized, and the decompressed memory is stored in the internal memory.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Memory System Of A Hierarchy Structure (AREA)
  • Memory System (AREA)

Abstract

一种移动终端中请求页面调度方法、控制器以及移动终端,其中请求页面调度方法包括:在移动终端运行需要压缩文件时,确定所述压缩文件在移动终端的控制器外部的存储位置;所述移动终端的控制器内部的解码单元对所述存储位置上的压缩文件进行解压缩,将解压缩后的文件存储于指定的存储器,其中所述指定的存储器包括所述移动终端的控制器内部的存储器和/或所述移动终端的控制器外部的存储器;所述移动终端基于所述解压缩后的文件继续运行。本技术方案提高了移动终端解码压缩文件的速率,在此基础上还可以充分利用移动终端的控制器内部的存储器的存储空间资源,在内部的存储器中存储解压缩后的文件,提高移动终端中请求页面调度的处理效率。

Description

移动终端中请求页面调度方法、 控制器以及移动终端
技术领域
本发明涉及通信技术领域, 特别涉及一种移动终端中请求页面调度方法、 控制器以及移动终端。
背景技术
随着移动终端的普及, 为了给用户提供更多的服务,移动终端上应用程序 的数量也不断增加, 另外用户在使用移动终端时经常同时运行多个应用程序, 从而增大了移动终端的内存处理指令和数据的负担。
目前, 移动终端上使用了虚拟存储的机制, 并借此增加主存 (Main Memory )或主存 4诸器的随机存取存 4诸器 ( Random Access Memory , RAM ) 的可见尺寸。 也就是利用在硬盘、 USB、 Flash (闪存)等非易失性存储装置上 被称为辅助存储器或二级存储器的存储区来备份 RAM。 这相当于在实际物理 存在的 RAM之外, 引入了虚拟地址空间。 虚拟地址空间通常被分成页面帧, 并且能够由处理器( Processor )进行访问。 内存管理单元 ( Memory Management Unit, MMU )提供了一种转换机制, 将处理器中运行的进程发出的虚拟地址 转换成进程所要求的指令或数据的物理页面。 当操作系统缺乏物理页面时, 系 统所要求的指令或数据会从存储装置中调入主存的物理页面中,并与虚拟页面 之间形成映射。 而如果被替换物理页面曾经被修改, 则该页面会被保存。 这一 技术最初来自于 UNIX, 被称为请求页面调度 ( Demand Paging )。
如图 1所示的是现有的一种移动终端的结构示意图。 参考图 1 , 所述移动 终端 1包括通过总线 13相连接的控制器 10、 外部辅助存储器 11 以及移动终 端的控制器 10外部的存储器 12。 其中所述控制器 10还包括通过总线 13相互 连接的中央处理器 101、 直接存取访问控制器 102、 内存管理单元 103以及内 部的存储器 104。
具体地, 当所述中央处理器 101运行程序(通常程序中包含多个进程)时, 通过所述直接存取访问控制器 102可以访问所述内部的存储器 104内存储的进 程所要求的指令或数据的物理页面;而当所述内部的存储器 104内缺失运行程 序所需要的物理页面时, 所述中央处理器 101将从所述外部辅助存储器 11中 调入内部的存储器 104的物理页面中, 并与虚拟页面之间形成映射。具体是通 过所述内存管理单元 103提供转换机制,将中央处理器 101中运行的进程发出 的虚拟地址转换成进程所要求的指令或数据的物理页面。
进一步地, 为了节省外部辅助存储器 11的存储空间, 在所述外部辅助存 储器 11 中部分程序指令和数据是以压缩文件格式存储的。 当中央处理器 101 需要读取这些压缩文件时, 首先需要通过设置于所述控制器 10外部的解码程 序 (图未示)将其解压缩, 解压缩后的文件一般存储于外部的存储器 12中; 然后, 通过所述内存管理单元 103提供的虚拟地址与所述外部的存储器 12的 物理地址映射和转换获取解压缩后的文件中保存的程序指令和数据,并基于所 述解压缩后的文件继续程序运行。
根据上述移动终端运行程序的处理过程, 由于设置于所述控制器 10外部 的解码程序的解压缩速率通常较慢,而且通过解码程序对压缩文件解压缩后的 文件没有存储于控制器内部的存储器,从而造成内部的存储器的资源浪费,也 降低了中央处理器运行解压缩后的文件的速率。
更多关于请求页面调度的方法可以参考公开号为 US7617381B2的美国专 利申请文件: 嵌入式系统的请求页面调度方法 ( Demand paging apparatus and method for embedded system ), 但同样没有解决上述问题。
发明内容
本发明解决的问题是提高移动终端解码压缩文件的速率,提高移动终端中 请求页面调度的处理效率。
为解决上述问题,本发明实施例提供了一种移动终端中请求页面调度的方 法, 包括: 在移动终端运行需要压缩文件时, 确定所述压缩文件在移动终端的 控制器外部的存储位置;所述移动终端的控制器内部的解码单元对所述存储位 置上的压缩文件进行解压缩,将解压缩后的文件存储于指定的存储器, 其中所 述指定的存储器包括所述移动终端的控制器内部的存储器和 /或所述移动终端 的控制器外部的存储器; 所述移动终端基于所述解压缩后的文件继续运行。
可选地,所述压缩文件在移动终端的控制器外部的存储位置包括压缩文件 在外部辅助存储器上的存储位置或者将压缩文件自外部辅助存储器转移到外 部的存储器后的存储位置。 可选地, 所述移动终端运行需要压缩文件包括: 所述移动终端的控制器在 运行时产生预取错误或者数据异常。
可选地, 所述确定所述压缩文件在移动终端的控制器外部的存储位置包 括: 确定所述发生预取错误时的指令地址或者产生数据异常时的数据地址;基 于压缩文件索引表,确定与所述指令地址或者数据地址相对应的压缩文件在外 部辅助存储器的存储地址并确定所述压缩文件的存储长度。
可选地,还包括: 将所述压缩文件从外部辅助存储器移动到所述移动终端 的控制器外部的存储器,基于所述压缩文件在移动终端的控制器外部的存储器 中的存储地址和存储长度确定所述述压缩文件在移动终端的控制器外部的存 储位置。
可选地, 在所述移动终端基于所述解压缩后的文件继续运行前, 还包括: 将产生预取错误的指令地址或者数据异常的数据地址映射到解压缩的文件存 储的存储器地址。
可选地, 采用页面帧对齐的方式确定解压缩后的文件的存储器。
可选地, 还包括: 在移动终端运行需要压缩文件时, 所述移动终端进入异 常处理模式; 在所述移动终端基于所述解压缩后的文件继续运行时,切换到进 入异常处理模式前的工作模式和状态。
可选地, 所述压缩文件包括在外部辅助存储器存储的映像文件中; 所述映 像文件中还包括未压缩文件。
可选地,还包括: 在移动终端运行需要未存储在移动终端的控制器内部的 未压缩文件时,所述移动终端的控制器基于外部辅助存储器中存储的未压缩文 件运行;或者将所述未压缩文件从所述外部辅助存储器移动到移动终端的控制 器外部的存储器,所述移动终端的控制器基于所述移动终端的控制器外部的存 储器中的未压缩文件运行。
可选地, 所述映像文件中包括程序中的指令和常量和程序中已初始化变 量。
可选地, 还包括: 移动终端运行未压缩文件, 以初始化运行环境。
可选地, 所述未压缩文件存储于 NAND闪存上; 所述移动终端运行未压 缩文件包括: 将存储于 NAND闪存的未压缩文件复制到所述移动终端的控制 器外部的存储器, 运行所述移动终端的控制器外部的存储器上的未压缩文件。 可选地, 所述未压缩文件存储于 NOR闪存上; 所述移动终端基于未压缩 文件运行包括: 运行存储于所述 NOR闪存上的未压缩文件。
本发明实施例提供了一种控制器, 包括: 通过总线相连接的中央处理器、 直接存取访问控制器、 内存管理单元、 内部的存储器以及解码单元; 其中所述 解码单元用于将外部辅助存储器存储的压缩文件解压缩后存储于指定的存储 器, 其中所述指定的存储器包括所述控制器外部的存储器和 /或所述控制器内 部的存储器。
本发明实施例还提供了一种移动终端,包括通过移动终端的总线相连接的 控制器、 外部辅助存储器以及移动终端的控制器外部的存储器;
所述控制器包括: 通过移动终端的总线相连接的中央处理器、直接存取访 问控制器、 内存管理单元、 内部的存储器以及解码单元; 其中所述解码单元用 于将所述外部辅助存储器存储的压缩文件解压缩后存储于指定的存储器,其中 所述指定的存储器包括所述移动终端的控制器外部的存储器和 /或所述移动终 端的控制器内部的存储器。
可选地, 所述外部辅助存储器中存储有未压缩文件和压缩文件, 其中所述 压缩文件和未压缩文件包括程序中的指令和常量、程序中已初始化变量以及程 序中未初始化变量。
可选地, 所述外部辅助存储器中存储有未压缩文件和压缩文件, 所述未压 缩文件包括程序中的指令和常量、程序中已初始化变量以及程序中未初始化变 量; 所述压缩文件包括程序中的指令和常量。
可选地, 所述外部辅助存储器包括: 闪存、 硬盘、 光盘、 USB 闪存盘中 任意一种。
可选地,所述中央处理器适于运行外部辅助存储器中的未压缩文件或者运 行自所述外部辅助存储器移动到所述移动终端的控制器外部的存储器中的未 压缩文件。
与现有技术相比, 本发明技术方案具有以下有益效果: 在移动终端中, 通 过移动终端的控制器内部的解码单元对存储于所述移动终端的控制器外部的 压缩文件进行解压缩,然后,所述移动终端基于所述解压缩后的文件继续运行。 本技术方案提高了移动终端解码压缩文件的速率。从而提高移动终端中请求页 面调度的处理效率。 在此基础上,在将解压缩后的文件存储于指定的存储器时, 所述存储器包 括所述移动终端的控制器内部的存储器和 /或所述移动终端的控制器外部的存 储器,从而可以充分利用移动终端的控制器内部的存储器的存储空间资源,在 内部的存储器中存储部分解压缩后的文件,进一步提高移动终端中请求页面调 度的处理效率。
附图说明
图 1是现有技术的一种移动终端的结构示意图;
图 2是本发明的一种控制器的具体实施例的结构示意图;
图 3是本发明的一种移动终端的具体实施例的结构示意图;
图 4是本发明的一种请求页面调度方法的具体实施方式的流程示意图; 图 5是本发明的一种压缩文件包的具体实施例的结构示意图。
具体实施方式
发明人发现在现有的移动终端运行程序的处理过程中,由于设置于移动终 端的控制器外部的解码程序的解压缩速率通常较慢,而且通过解码程序对压缩 文件解压缩后的文件没有存储于控制器内部的存储器,从而造成移动终端的控 制器内部的存储器的资源浪费,也降低了中央处理器运行解压缩后的文件的速 针对上述问题,发明人经过研究,提供了一种移动终端中请求页面调度的 方法和移动终端, 本发明的技术方案提高了移动终端解码压缩文件的速率, 并 充分利用移动终端的控制器内部的存储器的存储空间资源,在内部的存储器中 存储部分解压缩后的文件, 提高移动终端中请求页面调度的处理效率。
为使本发明的上述目的、特征和优点能够更为明显易懂, 下面结合附图对 本发明的具体实施方式做详细的说明。
如图 3 所示的是本发明实施例的一种移动终端的具体实施例的结构示意 图。 参考图 3 , 所述移动终端 2包括通过移动终端的总线 23相连接的控制器 20、 外部辅助存储器 21以及移动终端的控制器 20外部的存储器 22; 其中, 所述控制器 20包括: 通过移动终端的总线 23相连接的中央处理器 201、 直接 存取访问控制器 202、内存管理单元 203、内部的存储器 204以及解码单元 205。
在所述中央处理器 201 运行所需的指令或数据为存储在移动终端的控制 器 20内部的存储器 204时, 所述中央处理器 201适于运行外部辅助存储器 21 中的未压缩文件或者运行自所述外部辅助存储器 21移动到所述移动终端的控 制器 20外部的存储器 22中的未压缩文件。具体地, 所述中央处理器 201可以 通过所述内存管理单元 203提供的虚拟地址与所述外部辅助存储器 21或者所 述移动终端的控制器 20外部的存储器 22的物理地址的映射和转换找到相应的 未压缩文件。
所述外部辅助存储器 21 中的文件是以映像文件 (Image文件) 的形式存 储的, 所述映像文件是指保存到所述外部辅助存储器 21中的二进制文件。 所 述映像文件包括未压缩文件和压缩文件,其中所述压缩文件和未压缩文件包括 程序中的指令和常量(RO )、 程序中已初始化变量(RW ) 以及程序中未初始 化变量(ZI ); 或者所述未压缩文件包括程序中的指令和常量(RO )、 程序中 已初始化变量(RW ) 以及程序中未初始化变量(ZI ); 所述压缩文件包括程序 中的指令和常量(RO ), 例如, 所述程序中的指令和常量(RO ) 可以包括软 件界面显示所需要的资源数据, 如图像、 菜单、 文本等, 以及其他可压缩的部 分程序指令。
在程序执行过程中, 所述程序中的指令和常量(RO )将完成至少以下两 个任务: 1 )将程序中已初始化变量(RW )从所述外部辅助存储器 21中移动 到所述移动终端的控制器 20内部的存储器 204中; 2 )将所述程序中未初始化 变量(ZI )所在的内部的存储器 204的区域全部清零, 由于程序中未初始化变 量(ZI ) 不在所述映像文件中, 所以需要程序根据编译器 (未示出)给出的 ZI地址及大小来将相应的内部的存储器 204区域清零。
所述外部辅助存储器 21中的未压缩文件的作用主要包括: 1 )初始化系统 运行所需的基本环境; 2 )放置不能够使用请求页面调度技术进行运行的程序 指令和数据; 3 )运行使用请求页面调度技术所必需的一些程序指令和数据。
进一步地, 所述外部辅助存储器 21可以包括闪存、 硬盘、 光盘、 USB闪 存盘中任意一种, 在实际应用中, 所述外部辅助存储器 21还可以包括其他非 易失性存储装置, 在此不予赘述。
在本实施例中, 所述外部辅助存储器 21 以闪存为例进行描述。 通常闪存 包括两种类型, 分别是 NAND内存和 NOR内存。 本领域技术人员可以理解, NOR闪存和 NAND闪存在寻址方式上有明显的区别。 NAND闪存每次读取数 据时都是指定块地址、 页地址、 列地址, 其中列地址就是所读页地址内的起始 地址。 NAND 闪存在读取数据时, 每次都是先将数据读入页緩冲区内, 再由 输入 /输出线(I/O ) 中的输入地址在緩冲区内寻址, 主要是通过所述列地址指 定起始地址的作用。
进一步地, NAND 闪存是以页为基本单位操作的。 写入数据也是首先在 页面緩冲区内緩冲, 具体是首先将数据和程序指令写入页面緩冲区,再将数据 和程序指令一起写入页内。 因此, 对于 NAND闪存, 每次改写一个字节, 都 需要重写整个页, 而且如果页内有未擦除的部分, 则无法编程, 在写入前必须 保证页内清空。 因此设置 NAND页緩冲区的作用就是保证 NAND闪存按页为 单位进行读 /写操作, 因此需要緩冲。 而 NOR闪存则是以字节为基本单位操作 的, 可以字节写、 读, 但擦除是按照扇区为单位进行操作的。
需要说明的是, 所述移动终端的控制器 20 和所述移动终端的控制器 20 外部的存储器 22可以是集成在同一块芯片内的; 或者也可以是所述移动终端 的控制器 20自身为一块芯片, 而所述移动终端的控制器 20外部存储器 22在 该芯片外部。 但是针对这两种封装方式, 并不影响所述移动终端的控制器 20 和所述移动终端的控制器 20内部的存储器 204以及外部的存储器 22之间的逻 辑关系。
与现有技术不同的是, 本发明实施例中,解码单元 205是以硬件形式设置 于所述控制器 20的内部。具体地,在执行请求页面调度时,所述解码单元 205 用于将所述外部辅助存储器 21 存储的压缩文件解压缩后存储于指定的存储 器, 其中所述存储器包括所述移动终端的控制器 20外部的存储器 22和 /或所 述移动终端的控制器 20 内部的存储器 204。 具体地, 本发明实施例所述请求 页面调度的具体实施方式将在图 4中作详细描述。
在本实施例中,所述移动终端的控制器 20外部的存储器 22可以是随机存 取存储器 ( Random Access Memory , RAM ), 程序运行时未压缩文件中包括 程序中已初始化变量(RW )和程序中未初始化变量(ZI ) 两部分。 针对不同 的所述外部辅助存储器 21 , 同样以闪存为例, 当所述外部辅助存储器 21 是 NOR 闪存时, 随机存取存储器(RAM )中还可以存储未压缩文件中的程序中 的指令和常量( RO )。 而当所述外部辅助存储器 21是 NAND闪存时, 随机存 取存储器(RAM ) 中则必须存储未压缩文件中的程序中的指令和常量(RO ), 以及运行程序所需的压缩文件中程序指令和数据。 根据图 2所示的一种移动终端的具体实施例的结构示意图,本发明实施例 还提供的一种控制器的具体实施例的结构示意图。 参考图 2, 所述控制器 20 包括: 通过总线 23相连接的中央处理器 201、 直接存取访问控制器 202、 内存 管理单元 203、 内部的存储器 204以及解码单元 205。 其中所述解码单元 205 用于将外部辅助存储器(未示出)存储的压缩文件解压缩后存储于指定的存储 器, 其中所述指定的存储器包括控制器 20外部的存储器(未示出 )和 /或控制 器 20内部的存储器 204。
需要说明的是, 在实际应用中, 所述控制器 20可以单独做成一块芯片, 在移动终端 2中, 该芯片通过所述移动终端 2的总线 23与所述外部辅助存储 器 21和外部的存储器 22相连接。
如图 4 所示的是本发明的一种请求页面调度方法的具体实施方式的流程 示意图。 参考图 4, 所述请求页面调度方法包括:
步骤 S1 : 在移动终端运行需要压缩文件时, 确定所述压缩文件在移动终 端的控制器外部的存储位置。
具体地,在本实施例中, 所述压缩文件在移动终端的控制器外部的存储位 置包括:压缩文件在外部辅助存储器上的存储位置或者将压缩文件自外部辅助 存储器转移到外部的存储器后的存储位置。
其中所述外部辅助存储器以闪存为例, 具体地, 当所述外部辅助存储器是 NOR 闪存时, 所述压缩文件在移动终端的控制器外部的存储位置是指压缩文 件在 NOR闪存的存储位置; 当所述外部辅助存储器是 NAND闪存时, 所述压 缩文件在移动终端的控制器外部的存储位置是指将压缩文件自外部辅助存储 器转移到外部的存储器后的存储位置。
进一步地, 所述压缩文件包括在外部辅助存储器存储的映像文件中, 所述 映像文件中还包括未压缩文件。所述映像文件中包括程序中的指令和常量和程 序中已初始化变量。
所述移动终端运行需要压缩文件包括:所述移动终端的控制器在运行时产 生预取错误(Prefetch Fault )或者数据异常(Data Abort )。 其中, 所述预取错 误是指当中央处理器去一个访问地址读取指令时,发现内存管理单元对所述访 问地址没有做实际物理内存地址映射;所述数据异常是指当中央处理器去一个 地址映射。
进一步地,所述确定所述压缩文件在移动终端的控制器外部的存储位置根 据不同的外部辅助存储器, 其具体实现方式也不相同。 具体地, 同样以闪存为 例, 当所述闪存为 NOR闪存时, 包括如下步骤:
1 )确定所述发生预取错误时的指令地址或者产生数据异常时的数据地址。 在本实施例中, 当移动终端运行需要压缩文件时, 所述移动终端进入异常处理 模式。进入异常处理模式时, 中央处理器会自动将产生异常时的一些程序指令 和数据保存到在所述异常处理模式下可以访问到的一些寄存器内,这其中包含 预取错误时的指令地址或者产生数据异常时的数据地址。
2 )基于压缩文件索引表, 确定与所述指令地址或者数据地址相对应的压 缩文件的存储地址并确定所述压缩文件的存储长度。
具体地,所述压缩文件索引表可以参考如图 5所示的本发明实施例的一种 压缩文件包的结构示意图。 如图 5所示, 在所述压缩文件包的头部, 建立一个 压缩文件索引列表, 该索引列表中每个索引地址直接指向对应的压缩数据文 件, 所述索引地址即压缩数据文件(Compress Data File )的绝对位置, 其中所 述索引地址即所述指令地址或者数据地址。例如, 索引地址 0指向压缩数据文 件 0、 索引地址 1指向压缩数据文件 1、 索引地址 2指向压缩数据文件 2、 索 引地址 3指向压缩数据文件 3、 索引地址 4指向压缩数据文件 4, 依此类推。 进一步地, 在本实施例中, 假设每个压缩数据文件的长度是 4k字节, 压缩后 长度不一。 那么如果需要查找第 3个 4k字节的压缩数据文件, 则需在该索引 列表中寻找到索引地址 2所对应的压缩文件中的地址,再读取从该地址开始一 直到索引地址 3所指定地址之前的位置, 即可获得所述第 3个 4k字节对应的 压缩后的内容。
需要说明的是,在实际应用中,所述压缩文件索引表并不局限于上述方式。 例如, 索引列表中包含多个索引单元, 其中每个索引单元都不仅仅标识了对应 压缩数据文件的绝对地址, 还标识了压缩数据文件的长度; 又例如, 索引列表 中的每个索引单元仅仅标识了所对应的压缩数据文件的长度; 再例如, 索引列 表的每个索引单元不是分布在所述压缩文件包的头部,而是分布在每个压缩数 据文件的头部。
而当所述闪存是 NAND闪存时, 由于其读取速度慢于 NOR内存, 需要先 将所述压缩文件移动到移动终端的控制器外部的存储器, 因此还包括如下步 骤: 将所述压缩文件移动到所述移动终端的控制器外部的存储器,基于所述压 缩文件在移动终端的控制器外部的存储器中的存储地址和存储长度确定所述 压缩文件在移动终端的控制器外部的存储位置。
需要说明的是, 上文中当所述闪存是 NOR闪存时, 也可以采用上述步骤 的实现方式, 即也将存储于 NOR闪存的压缩文件先移动到所述移动终端外部 的存储器,然后基于所述压缩文件在移动终端外部的存储器中的存储地址和存 储长度确定所述压缩文件在移动终端的控制器外部的存储位置。
步骤 S2, 所述移动终端的控制器内部的解码单元对所述存储位置上的压 缩文件进行解压缩,将解压缩后的文件存储于指定的存储器, 其中所述指定的 存储器包括所述移动终端的控制器内部的存储器和 /或所述移动终端的控制器 外部的存储器。
具体地, 在本实施例中, 例如, 可以采用页面帧对齐的方式确定解压缩后 的文件的存储器。根据上述步骤 S1可以看出, 当所述外部辅助存储器是 NOR 闪存时, 所述存储地址是在 NOR闪存中; 而当所述外部辅助存储器是 NAND 闪存时, 所述存储地址则位于移动终端的控制器外部的存储器中。 然后, 中央 处理器再将压缩数据文件的存储地址和存储长度,以及按照页面帧对齐的用来 存放解压缩后的数据的存储器的存储地址和存储长度等信息配置给解码单元。 最后, 中央处理器再启动移动终端的控制器内部的解码单元, 这样所述解码单 元就会自动将查找到的对应存储的压缩内容直接解压缩到了指定的存储器中, 其中所述指定的存储器包括移动终端的控制器内部的存储器和 /或移动终端的 控制器外部的存储器。
进一步地, 用于请求页面调度使用的页面帧( Page Frame )的緩冲内存与 所述闪存的读取速度以及所述解码单元的解码速度是有关联的。由于在压缩文 件中,程序指令和数据的压缩是以块为单位进行压缩的, 这样就造成即便只是 运行块中的一条指令也必须先将整个块的压缩文件全部解压缩出来后才能够 运行,而每个用于压缩的程序代码和数据的大小至少为一个请求调度的页面帧 大小。 因此, 综合程序指令和数据的压缩比、 解码单元的解码速度以及请求页 面调度使用的页面帧的大小, 通常选择用于压缩的块的大小为 4KB (千字节) 或 1KB, 这就相当于执行一条指令就必须解码 4KB或者 1KB数据。换句话说, 如果移动终端中不存在存放解压缩文件的緩冲内存,而只是在每次执行新的程 序指令时来解压缩文件的方式来运行程序,那么移动终端就会因为需要频繁的 解压缩文件而浪费大量的运算能力。
因此, 如果在移动终端中使用一些内存空间(緩冲内存)存放先前已经解 压缩过的文件 (或者说程序代码和数据), 那么移动终端在运行过程中, 压缩 文件的解压缩频率就会降低, 并且增加的这种緩冲内存越大,移动终端运行时 需要解压缩新的程序代码和数据的频率就会越低,这样对于闪存(包括 NAND 闪存和 NOR闪存)和移动终端的控制器内部的解码单元在读取数据和解压缩 速度上的要求就越低。反之如果用于存放先前已经解压缩过的数据緩冲内存越 小的话,程序代码和数据需要解压缩的频率就会越高, 这样就会对解码单元的 解压缩速度以及闪存(包括 NAND闪存和 NOR闪存 )的数据读取速度就要求 越高。 具体地, 在实际应用中, 通常在保持 64个解压缩数据帧緩冲内存的前 提下, 如果解压缩出一帧数据不超过 40微秒, 移动终端的运行性能比同不采 用请求页面调度技术的运行性能只下降 10%-20%; 因而在闪存的读取速率较 高(例如 NOR闪存)、 同时解码单元的解压缩速率也较高的情况下, 可选择移 动终端的控制器内部的存储器作为解压缩数据帧存放緩冲内存;而在闪存的读 取速率较慢(例如 NAND闪存)、 同时解码单元的解码速率也较慢的情况下, 可以使用移动终端的控制器外部的存储器作为解压缩数据帧存放緩冲内存。
步骤 S3: 所述移动终端基于所述解压缩后的文件继续运行。
具体地, 本实施例中,在所述移动终端基于所述解压缩后的文件继续运行 时, 所述移动终端将切换到进入异常处理模式前的工作模式和状态。其中所述 异常处理模式前的工作模式即为正常工作模式,所述状态为从产生预取错误或 者数据异常时的地址重新开始运行程序。进一步地, 在所述移动终端基于所述 解压缩后的文件继续运行前,还包括: 将产生预取错误的指令地址或者数据异 常的数据地址映射到解压缩的文件存储的存储器地址。
进一步地, 在上述步骤 S1之前还包括步骤: 移动终端运行未压缩文件, 以初始化运行环境。 其中, 所述未压缩文件中的程序指令和数据, 使移动终端 中的操作系统建立起了基本的运行环境,例如使得系统得以正常运行的进程的 建立, 移动终端中各设备按系统的配置正常工作, 数据被正常读取并显示等。 进一步地, 根据不同的闪存, 该步骤的实施方式不同, 具体如下: 例如, 所述未压缩文件存储于 NAND闪存上; 所述移动终端基于未压缩 文件运行包括: 将存储于 NAND闪存的未压缩文件复制到所述移动终端的控 制器外部的存储器, 运行所述移动终端的控制器外部的存储器上的未压缩文 件。 例如, 所述未压缩文件存储于 NOR闪存上; 所述移动终端基于未压缩文 件运行包括: 直接运行存储于所述 NOR闪存上的未压缩文件。
更进一步地,在所述移动终端完成初始化并建立基本的运行环境后,移动 终端将继续运行程序,在此过程中, 当所述移动终端运行需要未存储在移动终 端的控制器内部的未压缩文件时,所述移动终端的控制器基于外部辅助存储器 中存储的未压缩文件运行。 具体地, 例如, 所述外部辅助存储器可以是 NOR 闪存,通过所述移动终端的控制器内部的内存管理单元提供的虚拟地址和外部 辅助存储器的物理地址之间的映射和转换机制,所述移动终端的控制器内部的 中央处理器可以运行外部辅助存储器中存储的未压缩文件。
所述移动终端的控制器将所述未压缩文件从所述外部辅助存储器移动到 移动终端的控制器外部的存储器,所述移动终端的控制器基于所述移动终端的 控制器外部的存储器中的未压缩文件运行。 具体地, 例如, 所述外部辅助存储 器可以是 NAND闪存, 由于 NAND闪存的读取速率慢于 NOR闪存, 因此需 要先将所述未压缩文件从所述 NAND闪存中移动到移动终端的控制器外部的 存储器,然后所述移动终端的控制器内部的中央处理器可以运行存储于所述移 动终端的控制器外部的存储器中的未压缩文件。
综上所述, 本发明的技术方案提高了移动终端解码压缩文件的速率,在此 基础上还可以充分利用移动终端的控制器内部的存储器的存储空间资源,在内 部的存储器中存储解压缩后的文件, 提高移动终端中请求页面调度的处理效 本发明虽然已以较佳实施例公开如上,但其并不是用来限定本发明,任何 本领域技术人员在不脱离本发明的精神和范围内,都可以利用上述揭示的方法 和技术内容对本发明技术方案做出可能的变动和修改, 因此, 凡是未脱离本发 改、 等同变化及修饰, 均属于本发明技术方案的保护范围。

Claims

权 利 要 求
1、 一种移动终端中请求页面调度的方法, 其特征在于, 包括:
在移动终端运行需要压缩文件时,确定所述压缩文件在移动终端的控制器 外部的存储位置;
所述移动终端的控制器内部的解码单元对所述存储位置上的压缩文件进 行解压缩, 将解压缩后的文件存储于指定的存储器, 其中所述指定的存储器包 括所述移动终端的控制器内部的存储器和 /或所述移动终端的控制器外部的存 储器;
所述移动终端基于所述解压缩后的文件继续运行。
2、根据权利要求 1所述的移动终端中请求页面调度的方法, 其特征在于, 所述压缩文件在移动终端的控制器外部的存储位置包括压缩文件在外部辅助 存储器上的存储位置或者将压缩文件自外部辅助存储器转移到外部的存储器 后的存储位置。
3、根据权利要求 2所述的移动终端中请求页面调度的方法, 其特征在于, 所述移动终端运行需要压缩文件包括:所述移动终端的控制器在运行时产生预 取错误或者数据异常。
4、根据权利要求 3所述的移动终端中请求页面调度的方法, 其特征在于, 所述确定所述压缩文件在移动终端的控制器外部的存储位置包括:
确定所述发生预取错误时的指令地址或者产生数据异常时的数据地址; 基于压缩文件索引表,确定与所述指令地址或者数据地址相对应的压缩文 件在外部辅助存储器的存储地址并确定所述压缩文件的存储长度。
5、根据权利要求 4所述的移动终端中请求页面调度的方法, 其特征在于, 还包括:将所述压缩文件从外部辅助存储器移动到所述移动终端的控制器外部 的存储器,基于所述压缩文件在移动终端的控制器外部的存储器中的存储地址 和存储长度确定所述压缩文件在移动终端的控制器外部的存储位置。
6、根据权利要求 3所述的移动终端中请求页面调度的方法, 其特征在于, 在所述移动终端基于所述解压缩后的文件继续运行前,还包括: 将产生预取错 误的指令地址或者数据异常的数据地址映射到解压缩的文件存储的存储器地 址。
7、根据权利要求 1所述的移动终端中请求页面调度的方法, 其特征在于, 采用页面帧对齐的方式确定解压缩后的文件的存储器。
8、根据权利要求 1所述的移动终端中请求页面调度的方法, 其特征在于, 还包括: 在移动终端运行需要压缩文件时, 所述移动终端进入异常处理模式; 在所述移动终端基于所述解压缩后的文件继续运行时,切换到进入异常处理模 式前的工作模式和状态。
9、根据权利要求 2所述的移动终端中请求页面调度的方法, 其特征在于, 所述压缩文件包括在外部辅助存储器存储的映像文件中;所述映像文件中还包 括未压缩文件。
10、根据权利要求 9所述的移动终端中请求页面调度的方法,其特征在于, 还包括: 在移动终端运行需要未存储在移动终端的控制器内部的未压缩文件 时, 所述移动终端的控制器基于外部辅助存储器中存储的未压缩文件运行; 或 者将所述未压缩文件从所述外部辅助存储器移动到移动终端的控制器外部的 存储器,所述移动终端的控制器基于所述移动终端的控制器外部的存储器中的 未压缩文件运行。
11、根据权利要求 9所述的移动终端中请求页面调度的方法,其特征在于, 所述映像文件中包括程序中的指令和常量和程序中已初始化变量。
12、根据权利要求 1所述的移动终端中请求页面调度的方法,其特征在于, 还包括: 移动终端运行未压缩文件, 以初始化运行环境。
13、 根据权利要求 12所述的移动终端中请求页面调度的方法, 其特征在 于, 所述未压缩文件存储于 NAND闪存上; 所述移动终端运行未压缩文件包 括:
将存储于 NAND闪存的未压缩文件复制到所述移动终端的控制器外部的 存储器, 运行所述移动终端的控制器外部的存储器上的未压缩文件。
14、 根据权利要求 12所述的移动终端中请求页面调度的方法, 其特征在 于, 所述未压缩文件存储于 NOR闪存上; 所述移动终端基于未压缩文件运行 包括:
运行存储于所述 NOR闪存上的未压缩文件。
15、 一种控制器, 其特征在于, 包括: 通过总线相连接的中央处理器、 直 接存取访问控制器、 内存管理单元、 内部的存储器以及解码单元; 其中所述解 码单元用于将外部辅助存储器存储的压缩文件解压缩后存储于指定的存储器, 其中所述指定的存储器包括所述控制器外部的存储器和 /或所述控制器内部的 存储器。
16、 一种移动终端, 包括通过移动终端的总线相连接的控制器、 外部辅助 存储器以及移动终端的控制器外部的存储器; 其特征在于,
所述控制器包括: 通过移动终端的总线相连接的中央处理器、直接存取访 问控制器、 内存管理单元、 内部的存储器以及解码单元; 其中所述解码单元用 于将所述外部辅助存储器存储的压缩文件解压缩后存储于指定的存储器,其中 所述指定的存储器包括所述移动终端的控制器外部的存储器和 /或所述移动终 端的控制器内部的存储器。
17、 根据权利要求 16所述的移动终端, 其特征在于, 所述外部辅助存储 器中存储有未压缩文件和压缩文件,其中所述压缩文件和未压缩文件包括程序 中的指令和常量、 程序中已初始化变量以及程序中未初始化变量。
18、 根据权利要求 16所述的移动终端, 其特征在于, 所述外部辅助存储 器中存储有未压缩文件和压缩文件, 所述未压缩文件包括程序中的指令和常 量、程序中已初始化变量以及程序中未初始化变量; 所述压缩文件包括程序中 的指令和常量。
19、 根据权利要求 16所述的移动终端, 其特征在于, 所述外部辅助存储 器包括: 闪存、 硬盘、 光盘、 USB闪存盘中任意一种。
20、 根据权利要求 16所述的移动终端, 其特征在于, 所述中央处理器适 于运行外部辅助存储器中的未压缩文件或者运行自所述外部辅助存储器移动 到所述移动终端的控制器外部的存储器中的未压缩文件。
PCT/CN2011/078422 2011-08-15 2011-08-15 移动终端中请求页面调度方法、控制器以及移动终端 Ceased WO2012113206A1 (zh)

Priority Applications (4)

Application Number Priority Date Filing Date Title
US13/698,337 US9471584B2 (en) 2011-08-15 2011-08-15 Demand paging method for mobile terminal, controller and mobile terminal
EP11859503.2A EP2746953A4 (en) 2011-08-15 2011-08-15 REQUIRED DEVICE FOR A MOBILE TERMINAL, CONTROL, AND MOBILE TERMINAL
PCT/CN2011/078422 WO2012113206A1 (zh) 2011-08-15 2011-08-15 移动终端中请求页面调度方法、控制器以及移动终端
CN201180005383.6A CN102792296B (zh) 2011-08-15 2011-08-15 移动终端中请求页面调度方法、控制器以及移动终端

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2011/078422 WO2012113206A1 (zh) 2011-08-15 2011-08-15 移动终端中请求页面调度方法、控制器以及移动终端

Publications (1)

Publication Number Publication Date
WO2012113206A1 true WO2012113206A1 (zh) 2012-08-30

Family

ID=46720106

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2011/078422 Ceased WO2012113206A1 (zh) 2011-08-15 2011-08-15 移动终端中请求页面调度方法、控制器以及移动终端

Country Status (4)

Country Link
US (1) US9471584B2 (zh)
EP (1) EP2746953A4 (zh)
CN (1) CN102792296B (zh)
WO (1) WO2012113206A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9471584B2 (en) 2011-08-15 2016-10-18 Spreadtrum Communications (Shanghai) Co., Ltd. Demand paging method for mobile terminal, controller and mobile terminal

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE112016000726B4 (de) * 2015-02-13 2024-08-01 Google LLC (n.d.Ges.d. Staates Delaware) Transparente hardwareunterstützte speicherdekompression
WO2017128032A1 (zh) 2016-01-26 2017-08-03 华为技术有限公司 一种数据处理方法以及数据处理设备
CN109254954B (zh) * 2018-09-13 2020-06-09 政采云有限公司 文件处理方法和装置、计算设备及存储介质
CN117957527A (zh) * 2022-08-30 2024-04-30 晶晨半导体(上海)股份有限公司 内存管理方法及模块、芯片、电子设备和存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020118307A1 (en) * 2001-02-28 2002-08-29 Lee Kyung Mee Method for controlling memory in digital system
CN1902603A (zh) * 2003-12-29 2007-01-24 英特尔公司 用于在压缩数据内包括提示信息的机制
CN101146191A (zh) * 2007-10-15 2008-03-19 晨星半导体股份有限公司 应用于嵌入式系统的数据处理方法
US20080291496A1 (en) * 2007-05-25 2008-11-27 Kyocera Mita Image Forming Apparatus
US7617381B2 (en) 2005-12-27 2009-11-10 Kim Hyo-Jun Demand paging apparatus and method for embedded system

Family Cites Families (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6349375B1 (en) * 1994-02-02 2002-02-19 Compaq Computer Corporation Compression of data in read only storage and embedded systems
US5940871A (en) * 1996-10-28 1999-08-17 International Business Machines Corporation Computer system and method for selectively decompressing operating system ROM image code using a page fault
US6195107B1 (en) 1998-05-29 2001-02-27 Cisco Technology, Inc. Method and system for utilizing virtual memory in an embedded system
JP2004193686A (ja) * 2002-12-06 2004-07-08 Nec Access Technica Ltd カメラ付き携帯端末
TWI220959B (en) * 2003-06-05 2004-09-11 Carry Computer Eng Co Ltd Storage device with optimized compression management mechanism
US20050132161A1 (en) * 2003-12-15 2005-06-16 Nokia Corporation Creation of virtual memory space in a memory
CN100395704C (zh) * 2005-08-27 2008-06-18 海信集团有限公司 一种在Nand Flash存储器中直接建立只读文件系统的方法
US7512767B2 (en) * 2006-01-04 2009-03-31 Sony Ericsson Mobile Communications Ab Data compression method for supporting virtual memory management in a demand paging system
TW200820261A (en) * 2006-09-08 2008-05-01 Samsung Electronics Co Ltd Fusion memory device and method
KR20080046345A (ko) * 2006-11-22 2008-05-27 삼성전자주식회사 휴대용 단말기의 메모리 절약 장치 및 방법
EP1939751A1 (en) * 2006-12-22 2008-07-02 Telefonaktiebolaget LM Ericsson (publ) Storing compressed data
EP2746953A4 (en) 2011-08-15 2014-08-20 Spreadtrum Comm Shanghai Co REQUIRED DEVICE FOR A MOBILE TERMINAL, CONTROL, AND MOBILE TERMINAL

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20020118307A1 (en) * 2001-02-28 2002-08-29 Lee Kyung Mee Method for controlling memory in digital system
CN1902603A (zh) * 2003-12-29 2007-01-24 英特尔公司 用于在压缩数据内包括提示信息的机制
US7617381B2 (en) 2005-12-27 2009-11-10 Kim Hyo-Jun Demand paging apparatus and method for embedded system
US20080291496A1 (en) * 2007-05-25 2008-11-27 Kyocera Mita Image Forming Apparatus
CN101146191A (zh) * 2007-10-15 2008-03-19 晨星半导体股份有限公司 应用于嵌入式系统的数据处理方法

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
See also references of EP2746953A4 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9471584B2 (en) 2011-08-15 2016-10-18 Spreadtrum Communications (Shanghai) Co., Ltd. Demand paging method for mobile terminal, controller and mobile terminal

Also Published As

Publication number Publication date
US20130212077A1 (en) 2013-08-15
EP2746953A1 (en) 2014-06-25
US9471584B2 (en) 2016-10-18
CN102792296A (zh) 2012-11-21
CN102792296B (zh) 2016-10-26
EP2746953A4 (en) 2014-08-20

Similar Documents

Publication Publication Date Title
CN100394405C (zh) 用于变化内存压缩机器的方法和装置
JP6069031B2 (ja) 計算機及びメモリ管理方法
EP3103009A1 (en) Flash memory compression
JP2003157170A (ja) プログラムバイナリをデコードおよび実行する方法
EP3278229B1 (en) Compressed pages having data and compression metadata
CN110291510A (zh) 流转换后备缓冲器
CN111863076B (zh) 具有减少的存储器通道流量的存储器系统及其操作方法
US20130238859A1 (en) Cache with scratch pad memory structure and processor including the cache
CN102792296B (zh) 移动终端中请求页面调度方法、控制器以及移动终端
CN114968099B (zh) 一种访问nvm的方法及nvm控制器
CN115826885B (zh) 一种数据迁移方法、装置及电子设备和存储介质
CN1977243A (zh) 模拟实模式内存访问时访问扩展内存的系统和方法
US12106104B2 (en) Processor instructions for data compression and decompression
WO2017184477A1 (en) Adapted block translation table (btt)
CN103229150B (zh) 数据控制方法及系统
US20070005625A1 (en) Storage architecture for embedded systems
JP2022061450A (ja) 読出しコントローラおよび入出力コントローラ
CN111966606B (zh) 数据储存装置与数据处理方法
EP4202692A1 (en) Apparatus and method for constant detection during compress operations
US12013799B2 (en) Non-interrupting portable page request interface
KR20210023184A (ko) 런타임 오버레이를 통해 펌웨어를 관리하는 장치 및 방법
US12153515B2 (en) Storage device
BR102022023763A2 (pt) Aparelho e método para detecção de constante durante operações de compactação
JP6080490B2 (ja) 情報処理装置、起動方法およびプログラム
JP6080491B2 (ja) 情報処理装置、起動方法およびプログラム

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 201180005383.6

Country of ref document: CN

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 11859503

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 10324/CHENP/2012

Country of ref document: IN

WWE Wipo information: entry into national phase

Ref document number: 13698337

Country of ref document: US

REEP Request for entry into the european phase

Ref document number: 2011859503

Country of ref document: EP

WWE Wipo information: entry into national phase

Ref document number: 2011859503

Country of ref document: EP

NENP Non-entry into the national phase

Ref country code: DE