+

WO2022116067A1 - Data processing method and data processing apparatus for flash memory - Google Patents

Data processing method and data processing apparatus for flash memory Download PDF

Info

Publication number
WO2022116067A1
WO2022116067A1 PCT/CN2020/133497 CN2020133497W WO2022116067A1 WO 2022116067 A1 WO2022116067 A1 WO 2022116067A1 CN 2020133497 W CN2020133497 W CN 2020133497W WO 2022116067 A1 WO2022116067 A1 WO 2022116067A1
Authority
WO
WIPO (PCT)
Prior art keywords
address
data
area
mapping relationship
specified
Prior art date
Application number
PCT/CN2020/133497
Other languages
French (fr)
Chinese (zh)
Inventor
丁强
姚琮
冯刚
尹飞飞
马崇良
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Priority to CN202080107643.XA priority Critical patent/CN116547652A/en
Priority to PCT/CN2020/133497 priority patent/WO2022116067A1/en
Publication of WO2022116067A1 publication Critical patent/WO2022116067A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/06Addressing a physical block of locations, e.g. base addressing, module addressing, memory dedication
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14Handling requests for interconnection or transfer
    • G06F13/20Handling requests for interconnection or transfer for access to input/output bus
    • G06F13/28Handling requests for interconnection or transfer for access to input/output bus using burst mode transfer, e.g. direct memory access DMA, cycle steal

Definitions

  • the present application relates to the field of storage, and, more particularly, to a data processing method and data processing apparatus of flash memory.
  • Flash is a type of memory chip, and data stored in flash can be modified or updated through specific programs. Flash can be used to store a bootloader, operating system or program code, or used directly as a hard disk.
  • the present application provides a new data processing method and data processing device for flash, which can improve the efficiency of data update, thereby improving the service interaction performance of flash; and can also delay the aging speed of flash and improve the service life of flash.
  • the present application provides a data processing method for flash memory.
  • the pages in the flash memory are divided into multiple storage areas, and the multiple storage areas include an initial data area, a remapping data area, and an address remapping area.
  • the method includes: receiving a data update request message, the data update request message being used to request to update data in a specified address of a specified page in the flash memory to specified data, where the specified address is a specified address in the initial data area. address; write the specified data into the currently available address in the remapping data area; write the address remapping from the address mapping relationship between the specified address and the currently available address in the remapping data area area.
  • the flash memory in this method in addition to the initial data area for storing the initial data, also divides the remapping data area for storing the updated data and the address remapping area for storing the mapping relationship between the storage address of the updated data and the original address. and, when updating the data in the original address in the initial data area, the method stores the updated data in the remapped data area, and records the mapping relationship between the original address and the address where the updated data is stored. Therefore, when using this method to update the data in the flash, it is not necessary to erase the data of the entire page every time the data is updated, and reprogram all the data including the updated data, so that the data update efficiency of the flash memory can be improved, and the speed of the flash memory can be reduced. aging speed to increase the lifespan of flash memory
  • the designated page further includes a marked area.
  • the method further includes: judging whether there is an available marker bit in the marker area, where the marker bit is used to indicate whether an address map is stored in the address corresponding to the marker bit in the address remapping area relationship; in the case of whether there are still available marker bits in the marker area, the currently available address in the address remapping area is determined according to the available marker bits in the marker area.
  • the flash is additionally divided into a flag area, and the flag area uses a flag bit to indicate whether the corresponding address in the addr remap area has stored the address mapping relationship.
  • the flag bit in the flag area it can be judged whether there is any storage space that can store the address mapping relationship in the addr remap area, and if there is still storage space that can store the address mapping relationship in the addr remap area, based on The position of the flag bit calculates the currently available address in the addr remap, instead of reading the contents of each address in the addr remap area one by one to determine whether the addr remap area can still store the memory space of the address mapping relationship and find the addr remap
  • the currently available address in the addr remap area can save the time to find the currently available address in the addr remap area, thereby improving the data update efficiency of the flash.
  • the method further includes: receiving a data read request message, where the data read request message is used to request to read the data in the specified page.
  • the data in the specified address determine whether the marked area is empty; if the marked area is not empty, the address mapping is stored in the corresponding address in the address remapping area according to the marked area
  • the number of marker bits of the relationship determines the end storage address in the address remapping area, and the end storage address is the last address in the address remapping area that has stored the address mapping relationship; in the address remapping area Query the target address mapping relationship including the specified address in the storage space between the starting storage address and the ending storage address, and the starting storage address is the first storage address mapping relationship in the address remapping area.
  • the target address is the target address that is included in the target address mapping relationship and has a mapping relationship with the specified address address; if the marked area is not empty, read the data in the specified address.
  • the method further includes: judging whether there is an available address in the address remapping area.
  • the writing the specified data to the currently available address in the remapping data area includes: in the case that there is still an available address in the address remapping area, writing the specified data to the Remap the currently available address in the data area.
  • the specified data is written into the remap data area, and the corresponding address mapping relationship is written into the addr remap area only when there is an available address in the addr remap area, so as to avoid data overflow, and thus can Avoid data loss.
  • the method further includes: receiving a data read request message, where the data read request message is used to request to read the data in the specified page.
  • the data in the specified address ; query the target address mapping relationship including the specified address in the storage space between the starting storage address and the ending storage address of the address remapping area, and the starting storage address is the address of the first storage address mapping relationship in the address remapping area, and the end storage address is the last address in the address remapping area that has stored the address mapping relationship; read according to the target address mapping relationship The data in the target address in the remapping data area, where the target address is an address that is included in the target address mapping relationship and has a mapping relationship with the specified address.
  • the query is performed in the storage space between the start storage address and the end storage address of the address remapping area.
  • the target address mapping relationship including the specified address includes: sequentially reading the storage space corresponding to each address in the address remapping area in the order from the ending storage address to the starting storage address. address mapping relationship, and determine whether the address mapping relationship in each address is an address mapping relationship including the specified address, until the read address mapping relationship is an address mapping relationship including the specified address, and The address mapping relationship read last time is used as the target address mapping relationship.
  • the present application provides a data processing device for flash memory, wherein a page in the flash memory is divided into multiple storage areas, and the multiple storage areas include an initial data area, a remapping data area, and an address remapping area,
  • the apparatus may include one or more functional modules for implementing the method in the first aspect or any one of the implementation manners, and each functional module may be implemented by means of software and/or hardware.
  • the apparatus includes a receiving module and a writing module.
  • the receiving module is used to receive a data update request message, the data update request message is used to request to update the data in the specified address of the specified page in the flash memory to specified data, and the specified address is the address in the initial data area; write
  • the input module is used to write the specified data into the currently available address in the remapped data area; the write module is also used to write the specified address with the address of the currently available address in the remapped data area
  • the mapping relationship is written into the address remapping area.
  • the designated page further includes a marked area.
  • the apparatus further includes a judgment module and a determination module.
  • the judging module is used to judge whether there is an available marker bit in the marker area, and the marker bit is used to indicate whether an address mapping relationship is stored in the address corresponding to the marker bit in the address remapping area;
  • the determining module is configured to determine the currently available address in the address remapping area according to the available marker bits in the marker area under the condition of whether there are available marker bits in the marker area.
  • the receiving module is further configured to receive a data read request message, where the data read request message is used to request to read the specified page. data in the specified address.
  • the apparatus further includes a judgment module, a determination module, a query module and a reading module.
  • the judging module is used for judging whether the marked area is empty; the determining module is used for indicating the corresponding address in the address remapping area according to the marked area when the marked area is not empty
  • the number of marked bits of the stored address mapping relationship in the determines the end storage address in the address remapping area, and the ending storage address is the last address in the address remapping area that has stored the address mapping relationship;
  • the The query module is configured to query the target address mapping relationship including the specified address in the storage space between the starting storage address and the ending storage address of the address remapping area, and the starting storage address is the address The address of the first storage address mapping relationship in the remapping area; the read module is used to read the data in the target address in the remapping data area according to the target address mapping relationship, and the target address is The target address mapping relationship includes an address that has a mapping relationship with the specified
  • the apparatus further includes a judgment module and a determination module, where the judgment module is used for judging whether there is an available address in the address remapping area, and the determination module is used for determining a currently available address.
  • the writing module is specifically configured to: write the specified data to the currently available address in the remapping data region in the case that there is still an available address in the address remapping region.
  • the receiving module is further configured to receive a data read request message, where the data read request message is used to request to read the data in the designated address in the designated page.
  • the apparatus further includes a query module and a reading module.
  • the query module is configured to query the target address mapping relationship including the specified address in the storage space between the starting storage address and the ending storage address of the address remapping area, where the starting storage address is the specified address.
  • the address of the first storage address mapping relationship in the described address remapping area, and the end storage address is the address of the last stored address mapping relationship in the address remapping area; the read module is used for according to the target
  • the address mapping relationship reads the data in the target address in the remapped data area, where the target address is an address included in the target address mapping relationship that has a mapping relationship with the specified address.
  • the query module may be specifically configured to: sequentially read each of the address remapping areas in the sequence from the end storage address to the start storage address address mapping relationship stored in the storage space corresponding to the address, and determine whether the address mapping relationship in each address is an address mapping relationship including the specified address, until the read address mapping relationship is the specified address address mapping relationship, and use the address mapping relationship read for the first time as the target address mapping relationship.
  • the present application provides a flash data processing apparatus, which may include a processor coupled with a memory.
  • the memory is used for storing program codes
  • the processor is used for executing the program codes in the memory, so as to implement the method in the first aspect or any one of the implementation manners.
  • the apparatus may also include the memory.
  • the apparatus may further include a transceiver for communicating with other devices; or may further include an input/output device for interacting with a user.
  • the apparatus may further include a communication interface for communicating with other apparatuses in the electronic apparatus, for example, for communicating with a transceiver of the electronic apparatus.
  • the present application provides a computer-readable storage medium, where the computer-readable medium stores a program code for execution by a processor, the program code including a method for implementing the first aspect or any one of the possible implementation manners. method in the directive.
  • the present application provides a computer program product comprising instructions, which, when the computer program product runs on a processor, causes the processor to implement the method of the first aspect or any one of the implementation manners.
  • the present application provides a chip, the chip includes a logic circuit and a flash, and the logic circuit and the flash are used to implement the method in the first aspect or any of the possible implementation manners.
  • FIG. 1 is a schematic diagram of an application scenario of the technical solution of the embodiment of the application
  • FIG. 2 is a schematic diagram of a data storage structure of a flash according to an embodiment of the application.
  • FIG. 3 is a schematic flowchart of a data update method according to an embodiment of the present application.
  • FIG. 4 is a schematic flowchart of a data reading method according to an embodiment of the present application.
  • FIG. 5 is a schematic flowchart of a data update method according to an embodiment of the present application.
  • FIG. 6 is a schematic flowchart of a data reading method according to another embodiment of the present application.
  • FIG. 7 is a schematic flowchart of a data update method according to another embodiment of the present application.
  • FIG. 8 is a schematic diagram of a data storage structure of a flash according to another embodiment of the application.
  • FIG. 9 is a schematic structural diagram of a data processing apparatus according to an embodiment of the present application.
  • FIG. 10 is a schematic structural diagram of a data processing apparatus according to another embodiment of the present application.
  • the driver (device driver), the full name of "device driver”, is a special program that enables the computer to communicate with the device, which can be said to be equivalent to the hardware interface.
  • the driver is independent of the operating system; in other scenarios, the driver is included in the operating system. But no matter what kind of scenario, the operating system can only control the work of the hardware device through this interface.
  • the driver program for the flash in the embodiment of the present application is a program that enables the computer to communicate with the flash, and the operating system of the computer controls the flash to work through the driver program of the flash.
  • the application program running on the processor of the electronic device can call the driver of the flash to write data to the flash, update the data in the flash or read the data in the flash through the operating system .
  • the application program running on the processor of the electronic device can write data to the chip, update the data in the chip or read the data in the chip through the operating system .
  • the chip may include a communication interface, a logic circuit and a flash. After the communication interface receives a data write request, a data update request or a data read request, the logic circuit can respectively write data to the flash and update the data in the flash according to the request. data or read data in flash.
  • FIG. 2 is a schematic diagram of a data storage structure of a page of flash according to an embodiment of the present application.
  • a page of the flash is divided into five areas, which are: a header area, an initial data area, an address remapping (addr remap) area, and a remapping data ( remap data) area, flag (flag) area.
  • the head area is used to store the header information of the page, and the head information can be customized.
  • the initial data area can also be called the initial data space, which is used to store the code (code) and data (data) initially written to the page.
  • the code and data are collectively called data information, abbreviated as data.
  • the remap data area is reserved space. When updating the data in the specified address in the initial data area, the address in the remap data area can be used to store the data expected to be updated in the specified address in the initial data area.
  • each address in the addr remap area is used for the mapping relationship between the specified address in the initial data area and the new address of the updated data in the remap data area.
  • the flag area includes multiple flag bits, which correspond one-to-one with multiple addresses in the addr remap area. Each flag bit in the flag area is used to indicate whether the corresponding address in the addr remap area stores an address mapping relationship.
  • the marker bit indicates that the address mapping relationship is stored in the corresponding address in the addr remap area, it may be said that the marker bit has been set as valid, or the marker bit is valid; the marker bit represents the corresponding address in the addr remap area.
  • the flag bit is invalid;
  • a flag bit For example, if the value of a flag bit is "1", it indicates that the flag bit is valid, that is, the address mapping relationship is stored in the corresponding address in the addr remap area; the value of a flag bit is "0", indicating that the flag bit is invalid. , which means that the corresponding address in the addr remap area has not yet stored the address mapping relationship.
  • FIG. 3 is an exemplary flowchart of the data update method of the flash shown in FIG. 2 .
  • the method may include step 301 , step 302 , step 303 , step 304 , step 305 , step 306 , step 307 and step 308 .
  • the method of this embodiment is executed by a data processing device of flash.
  • the data processing apparatus is a flash driver running on the processor, or in other words, the data processing apparatus is a processor running the flash driver.
  • the data processing device is a logic circuit on a chip including flash.
  • the data processing device can record the address range of each area of the flash, for example, record the start address, end address of each area, and the size of each storage space in each area, or record each area.
  • the data processing apparatus may receive a data update request message from the operating system, or may receive a data update request message sent by the application program through the operating system. This message requests to update the data in the specified address in the specified page in the flash to the specified data.
  • the data update request message may carry the indication information of the specified page, the specified address and the specified data.
  • the message may only carry the specified data.
  • the data processing apparatus may read all flag bits in the storage space corresponding to the address range according to the pre-recorded address range of the flag area of the specified page.
  • Step 303 Determine whether there are any available flag bits in the flag area, if yes, go to step 304, otherwise go to step 308.
  • each flag bit is valid in turn, that is, determine whether each flag bit has indicated the specified page.
  • the address mapping relationship is stored in the corresponding address in the addr remap area.
  • an invalid flag bit is found, that is, a flag bit indicating that the address mapping relationship is not stored in the corresponding address in the addr remap area is found, then it is determined that there is an available flag bit in the flag area, and the flag bit is marked as the currently available flag bit; if The last flag bit is valid, that is, the last flag bit has indicated that the address mapping relationship is stored in the corresponding address in the addr remap area, then it is determined that there is no available flag bit in the flag area.
  • the mapping relationship between the position of the flag bit in the flag region in the flag region and the address corresponding to the flag bit in the addr remap region can be pre-recorded in the data processing device.
  • the driver can find out the corresponding address in the addr remap area according to the position of the currently available flag bit in the flag area and the mapping relationship.
  • this embodiment refers to this address as the currently available address in the addr remap area. .
  • the data processing apparatus may write or store or program data into the remap data area in the order of addresses from small to large or from large to small, and each time after writing data to the remap data area, Both record the address where the data is stored. In this case, the data processing apparatus may determine the currently available address in the remap data area based on the address.
  • the current available address is recorded, so that when the data is updated next time, the next currently available address is determined based on the currently available address .
  • the remap data area for storing the updated data and the storage address for storing the updated data are also divided into the original data area and the original data area.
  • the addr remap area of the address mapping relationship, and when updating the data in the original address in the initial data area, store the updated data in the remap data area, and record the original address and remap data after the update is stored The mapping relationship between the addresses of the data enables the data processing device to read the updated data according to the original address and the address mapping relationship.
  • the data update method does not need to erase the data of the entire page every time the data is updated, and reprogram all the data including the updated data, so that the data update efficiency of the flash can be improved, and the aging speed of the flash can be reduced to improve the flash performance. service life.
  • the flag area is additionally divided, and the flag area uses a flag bit to indicate whether the corresponding address in the addr remap area has stored the address mapping relationship.
  • This enables the data processing device to determine whether there is a storage space capable of storing address mapping relationships in the addr remap region according to the flag bits in the flag region, and whether there is a storage space capable of storing address mapping relationships in the addr remap region Next, calculate the currently available address in the addr remap based on the position of the marker bit, instead of reading the contents of each address in the addr remap area one by one to determine whether the addr remap area can still store the memory space of the address mapping relationship and Find the currently available address in the addr remap, which can save the time of finding the currently available address in the addr remap area, thereby improving the data update efficiency of the flash.
  • FIG. 4 is a schematic flowchart of a data reading method according to an embodiment of the present application.
  • the data reading method of this embodiment may include step 401 , step 402 , step 403 , step 404 , step 405 , step 406 and step 407 .
  • the method shown in FIG. 4 is performed by a data processing apparatus.
  • the data processing apparatus is a flash driver running on the processor, or in other words, the data processing apparatus is a processor running the flash driver.
  • the data processing device is a logic circuit on a chip including flash.
  • the data read request message may include page indication information in the flash to indicate the page to which the read data belongs; the data read request message may also include address information in the specified page to indicate that the data should be read The address space for fetching data.
  • step 402. Read the information stored in the flag area of the specified page. For this step, reference may be made to step 302, which will not be repeated here.
  • Step 403 determine whether the flag area is empty, if so, go to step 407 , otherwise go to step 404 .
  • any flag bit indicates that the address mapping relationship has not been stored in the address corresponding to the addr remap area of the specified page, it can be determined that the flag area is Empty, otherwise it can be determined that the flag area is not empty.
  • the end storage address in the addr remap area is the last address in the addr remap area where the address mapping relationship has been stored.
  • the data processing device can calculate the last address in the addr remap area that has stored the address mapping relationship according to the above-mentioned number, the starting address of the addr remap area, and the unit address size in the addr remap area, and use this address as the end storage address.
  • the starting storage address of the addr remap area refers to the address in which the first address mapping relationship is stored in the addr remap area, and generally speaking, the data processing device is based on the address from large to small or from small to large.
  • the address mapping relationship is sequentially stored in the addr remap area.
  • the data processing apparatus may sequentially read the address mapping relationship stored in the storage space corresponding to each address in the addr remap area in the order from the starting storage address to the ending storage address, and determine the address mapping relationship is the address mapping relationship including the specified address. If the address mapping relationship is an address mapping relationship including the specified address, the address mapping relationship is determined as a target address mapping relationship.
  • the data processing apparatus may sequentially read the address mapping relationship stored in the storage space corresponding to each address in the addr remap area in the order from the ending storage address to the starting storage address, and determine the address mapping Whether the relationship is an address mapping relationship including the specified address. If the address mapping relationship is an address mapping relationship including the specified address, the address mapping relationship is determined as a target address mapping relationship.
  • the latter example compared with the former example, can query to obtain the latest target of the specified address The address mapping relationship, so that the storage address of the latest data can be queried, and the latest data can be read.
  • the target address is the target address that is included in the target address mapping relationship and has a mapping relationship with the specified address. address.
  • step 407 may be executed.
  • the flag area may not be divided in the flash.
  • the flash in this embodiment can be divided into a head area, an addr remap area, a remap data area, and an initial data area.
  • step 302 , step 303 , step 304 and step 307 may not be included in the flash data update method of this embodiment.
  • the following steps may be included: judging whether there is an available address in the addr remap area, if so, execute step 305, otherwise execute 308.
  • the data processing apparatus writes the address mapping relational expression into the addr remap area, and writes the addresses in ascending order.
  • the data processing device determines whether there are any available addresses in the addr remap area, it can read the contents in the storage space corresponding to each address in the addr remap area in order of the addresses from small to large, and according to the storage space Whether the address mapping relationship has been stored in the storage space is used to determine whether the storage space is available.
  • the corresponding address is an available address, that is, it is determined that there is an available address in the addr remap area, and the available address is determined as the currently available address in the addr remap area.
  • the address mapping relationship is stored in all storage spaces in the addr remap area, it can be determined that there are no available addresses in the addr remap area.
  • the data processing device when the data processing device writes the address mapping relationship into the addr remap area, the addresses are written in ascending order, and after each time the data processing device writes the address mapping relationship into the addr remap area, it can Record the address of the current write address mapping relationship.
  • the data processing device needs to determine that there is an available address in the addr remap area, it can determine whether the recorded address is the largest address in the addr remap area, and if so, it can be determined that there is no available address in the addr remap area, otherwise it can be determined
  • There are also available addresses in the addr remap area and the current available address in the addr remap area can be obtained by adding the recorded address to the unit storage space size.
  • the data processing device when the data processing device receives a message requesting to update the data in the specified address of the specified page in the flash to the specified data, it only needs to store the specified data in the remap data area. In the storage space of the storage space, and record the mapping relationship between the new address corresponding to the storage space and the specified address in the addr remap area.
  • the specified page can be updated without erasing the content of the entire page.
  • the purpose of the data in the address is to save the data update time and improve the service life of the flash.
  • 501 Receive a data update request message, where the data update request message is used to request to update data in a specified address of a specified page in the flash to specified data.
  • step 301 For this step, reference may be made to step 301, which will not be repeated here.
  • step 502 judging whether there is an available address in the addr remap area of the specified page, if so, go to step 503, otherwise go to step 505.
  • the specified data is written into the remap data area, and the corresponding address mapping relationship is written into the addr remap area, which can avoid data overflow and thus avoid data loss.
  • the currently available address may be recorded as the end storage address.
  • step 505 enter the page change process. For this step, reference may be made to step 308, which will not be repeated here.
  • FIG. 6 A schematic flowchart of a data reading method corresponding to the data updating method shown in FIG. 5 is shown in FIG. 6 .
  • the method may include step 601 , step 602 and step 603 .
  • the end storage address is the address of the last stored address mapping relationship in the addr remap area.
  • the target address is the target address that is included in the target address mapping relationship and has a mapping relationship with the specified address. address.
  • step 601, step 602, and step 603 may refer to step 401, step 405, and step 406, respectively, and details are not repeated here.
  • the storage space of each page in the flash may be designed to be larger, and further the addr remap area and the remap data area may be designed to be larger, for example, so large that In the life cycle of the page, the storage space of all data to be updated will not exceed the storage space of the remap data area. Accordingly, the storage space required for the address mapping relationship generated by the update will not exceed the storage space of the addr remap area. .
  • the method may include step 701 , step 702 and step 703 .
  • Step 701, step 702, and step 703 in this embodiment may refer to step 501, step 503, and step 504, respectively, and details are not repeated here.
  • the data updating method and the data reading method in this application may be collectively referred to as a data processing method of flash.
  • the flash in each embodiment of the present application may not include a header area.
  • the names of the header area, the addr remap area, the flag area, the remap data area, and the initial area in the various embodiments of this application are only examples, and the application does not limit the names of these areas, as long as the functions are the same as those in the foregoing embodiments.
  • the functions of the respective regions are consistent with each other, that is, they belong to the protection scope of the present application.
  • FIG. 9 is a schematic structural diagram of a data processing apparatus provided by an embodiment of the present application.
  • the apparatus shown in FIG. 9 can be used to execute the method described in any one of the foregoing embodiments.
  • the apparatus 900 in this embodiment may include: a receiving module 901 and a writing module 902 .
  • the apparatus 900 may further include a query module 903 and a reading module 904 .
  • the apparatus 900 may further include a judgment module 905 and a determination module 906 .
  • the apparatus 900 may be used to perform the method described in FIG. 3 .
  • the receiving module 901 can be used to perform step 301
  • the reading module 906 can be used to perform step 302
  • the judging module 905 can be used to perform step 303
  • the determining module 906 can be used to perform step 304
  • the writing module 902 can be used to perform step 304. Steps 305 to 308 are performed.
  • the apparatus 900 may be used to perform the method described in FIG. 4 .
  • the receiving module 901 can be used to execute step 401
  • the reading module 906 can be used to execute step 402
  • the judgment module 905 can be used to execute step 403
  • the determination module 906 can be used to execute step 404
  • the query module 903 can be used to execute step 404.
  • the reading module 906 can also be used to perform steps 406 and 407 .
  • the apparatus 900 may be used to perform the method described in FIG. 5 .
  • the receiving module 901 may be used to perform step 501
  • the judging module 905 may be used to perform step 502
  • the writing module 902 may be used to perform steps 503 to 505 .
  • the apparatus 900 may be used to perform the method described in FIG. 6 .
  • the receiving module 901 can be used to perform step 601
  • the query module 903 can be used to perform step 602
  • the reading module 906 can also be used to perform step 603 .
  • the apparatus 900 may be used to perform the method described in FIG. 7 .
  • the receiving module 901 can be used to perform step 701
  • the writing module 902 can be used to perform steps 702 and 703 .
  • FIG. 10 is a schematic structural diagram of a data processing apparatus provided by another embodiment of the present application.
  • the apparatus shown in FIG. 10 can be used to perform the method described in any one of the foregoing embodiments.
  • the apparatus 1000 in this embodiment includes: a memory 1001 , a processor 1002 , a communication interface 1003 , and a bus 1004 .
  • the memory 1001 , the processor 1002 , and the communication interface 1003 are connected to each other through the bus 1004 for communication.
  • the memory 1001 may be a read only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM).
  • the memory 1001 may store a program, and when the program stored in the memory 1001 is executed by the processor 602, the processor 602 is configured to execute each step of the method shown in any of FIG. 3 to FIG. 7 .
  • the processor 1002 can use a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits for executing related programs to The methods in the various embodiments of the present application are implemented.
  • CPU central processing unit
  • ASIC application-specific integrated circuit
  • the processor 1002 may also be an integrated circuit chip with signal processing capability. In the implementation process, each step of the method in the various embodiments of the present application may be completed by an integrated logic circuit of hardware in the processor 1002 or an instruction in the form of software.
  • the above-mentioned processor 1002 can also be a general-purpose processor, a digital signal processor (digital signal processing, DSP), an application-specific integrated circuit (ASIC), an off-the-shelf programmable gate array (field programmable gate array, FPGA) or other programmable logic devices, Discrete gate or transistor logic devices, discrete hardware components.
  • DSP digital signal processor
  • ASIC application-specific integrated circuit
  • FPGA field programmable gate array
  • a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
  • the steps of the method disclosed in conjunction with the embodiments of the present application may be directly embodied as executed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor.
  • the software modules may be located in random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers and other storage media mature in the art.
  • the storage medium is located in the memory 1001, and the processor 1002 reads the information in the memory 1001, and performs the functions required to be performed by the units included in the device of the present application in combination with its hardware. For example, the embodiment shown in any of FIG. 3 to FIG. 7 can be performed. the individual steps/functions.
  • the communication interface 1003 can use, but is not limited to, a transceiver such as a transceiver to implement communication between the device 1000 and other devices or a communication network.
  • a transceiver such as a transceiver to implement communication between the device 1000 and other devices or a communication network.
  • the bus 1004 may include a pathway for communicating information between the various components of the apparatus 1000 (eg, the memory 1001, the processor 1002, the communication interface 1003).
  • the apparatus 1000 shown in this embodiment of the present application may be an electronic device, or may also be a chip configured in the electronic device.
  • the processor in the embodiment of the present application may be a central processing unit (central processing unit, CPU), and the processor may also be other general-purpose processors, digital signal processors (digital signal processors, DSP), application-specific integrated circuits (application specific integrated circuit, ASIC), off-the-shelf programmable gate array (field programmable gate array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
  • a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
  • the memory in the embodiments of the present application may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory.
  • the non-volatile memory can be read-only memory (read-only memory, ROM), programmable read-only memory (programmable ROM, PROM), erasable programmable read-only memory (erasable PROM, EPROM), electrically programmable Erase programmable read-only memory (electrically EPROM, EEPROM) or flash memory.
  • Volatile memory may be random access memory (RAM), which acts as an external cache.
  • the above embodiments may be implemented in whole or in part by software, hardware, firmware or any other combination.
  • the above-described embodiments may be implemented in whole or in part in the form of a computer program product.
  • the computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, all or part of the processes or functions described in the embodiments of the present application are generated.
  • the computer may be a general purpose computer, special purpose computer, computer network, or other programmable device.
  • the computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be downloaded from a website site, computer, server, or data center Transmission to another website site, computer, server or data center by wire (eg, infrared, wireless, microwave, etc.).
  • the computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, a data center, or the like that contains one or more sets of available media.
  • the usable media may be magnetic media (eg, floppy disks, hard disks, magnetic tapes), optical media (eg, DVDs), or semiconductor media.
  • the semiconductor medium may be a solid state drive.
  • At least one means one or more, and “plurality” means two or more.
  • At least one item(s) below” or similar expressions thereof refer to any combination of these items, including any combination of single item(s) or plural items(s).
  • at least one item (a) of a, b, or c can represent: a, b, c, a-b, a-c, b-c, or a-b-c, where a, b, c may be single or multiple .
  • the size of the sequence numbers of the above-mentioned processes does not mean the sequence of execution, and the execution sequence of each process should be determined by its functions and internal logic, and should not be dealt with in the embodiments of the present application. implementation constitutes any limitation.
  • the disclosed system, apparatus and method may be implemented in other manners.
  • the apparatus embodiments described above are only illustrative.
  • the division of the units is only a logical function division. In actual implementation, there may be other division methods.
  • multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not implemented.
  • the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
  • the units described as separate components may or may not be physically separated, and components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
  • the functions, if implemented in the form of software functional units and sold or used as independent products, may be stored in a computer-readable storage medium.
  • the technical solution of the present application can be embodied in the form of a software product in essence, or the part that contributes to the prior art or the part of the technical solution, and the computer software product is stored in a storage medium, including Several instructions are used to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.
  • the aforementioned storage medium includes: a U disk, a removable hard disk, a read-only memory, a random access memory, a magnetic disk or an optical disk and other media that can store program codes.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

Proposed are a data updating method and data processing apparatus for a flash memory. In a page of the flash memory, in addition to an initial data region for storing initial data, the page is also divided into a remapped data region for storing updated data and an address remapping region for storing a mapping relationship between a storage address of the updated data and an original address. Moreover, when data in the original address in the initial data region is updated, the updated data is stored in the remapped data region, and the mapping relationship between the original address and the address where the updated data is stored is recorded. By using the method, it is not necessary to erase data of an entire page every time the data is updated and reprogram all the data comprising the updated data, so that the data updating efficiency of the flash memory may be increased, and the aging speed of the flash memory may be reduced so as to improve the service life of the flash memory.

Description

闪存的数据处理方法和数据处理装置Data processing method and data processing device of flash memory 技术领域technical field
本申请涉及存储领域,并且,更具体地,涉及闪存(flash)的数据处理方法和数据处理装置。The present application relates to the field of storage, and, more particularly, to a data processing method and data processing apparatus of flash memory.
背景技术Background technique
flash是存储芯片的一种,通过特定的程序可以修改或者更新flash里面存储的数据。flash可以用作存储启动装载程序(bootloader)、操作系统或者程序代码,或者直接当硬盘使用。Flash is a type of memory chip, and data stored in flash can be modified or updated through specific programs. Flash can be used to store a bootloader, operating system or program code, or used directly as a hard disk.
现有flash的数据更新方法中,对页面中存储的数据进行更新时,哪怕该页面只需要更新1比特(bit)的数据,也需要先读取整个页面的数据缓存在存储器中,然后擦除整个页面;擦除完成后,将存储器中存储的数据再次写入该页面中,同时将该地址内更新后的数据写为最新的值;写完后,将整个页面的数据读出,跟存储器中存储的数据进行比对,判断写入的数据是否正确。In the existing flash data update method, when updating the data stored in the page, even if the page only needs to update 1 bit of data, it is necessary to first read the data of the entire page and cache it in the memory, and then erase it. The entire page; after erasing is completed, write the data stored in the memory into the page again, and at the same time write the updated data in the address as the latest value; after writing, read the data of the entire page, and follow the memory Compare the data stored in it to determine whether the written data is correct.
随着flash的广泛应用,大容量flash的也越来越多,大容量flash设计上一个页面的容量也比较大,按照现有的页面更新流程,每次需要更新页面中部分地址中的数据时,需要完成一次完整页面更新,不仅需要的时间长,影响更新效率,而且会导致其他地址进行不必要的擦除,加快flash的老化。With the wide application of flash, there are more and more large-capacity flashes, and the capacity of a page in the design of large-capacity flash is also relatively large. According to the existing page update process, every time the data in some addresses in the page needs to be updated , it is necessary to complete a complete page update, which not only takes a long time, affecting the update efficiency, but also causes unnecessary erasure of other addresses and accelerates the aging of the flash.
发明内容SUMMARY OF THE INVENTION
本申请为flash提供了新的数据处理方法和数据处理装置,可以提高数据的更新效率,从而提高flash的业务交互性能;还可以延缓flash的老化速度,提升flash的使用寿命。The present application provides a new data processing method and data processing device for flash, which can improve the efficiency of data update, thereby improving the service interaction performance of flash; and can also delay the aging speed of flash and improve the service life of flash.
第一方面,本申请提供了一种闪存的数据处理方法。所述闪存中的页面划分为多个存储区域,所述多个存储区域包括初始数据区域、重映射数据区域和地址重映射区域。所述方法包括:接收数据更新请求消息,所述数据更新请求消息用于请求将所述闪存内指定页面的指定地址中的数据更新为指定数据,所述指定地址为所述初始数据区域中的地址;将所述指定数据写入所述重映射数据区域中的当前可用地址;将所述指定地址与所述重映射数据区域中的当前可用地址的地址映射关系,写入所述地址重映射区域。In a first aspect, the present application provides a data processing method for flash memory. The pages in the flash memory are divided into multiple storage areas, and the multiple storage areas include an initial data area, a remapping data area, and an address remapping area. The method includes: receiving a data update request message, the data update request message being used to request to update data in a specified address of a specified page in the flash memory to specified data, where the specified address is a specified address in the initial data area. address; write the specified data into the currently available address in the remapping data area; write the address remapping from the address mapping relationship between the specified address and the currently available address in the remapping data area area.
该方法中的闪存,除了存储初始数据的初始数据区域,还划分用于存储更新后数据的重映射数据区域和用于存储更新后的数据的存储地址与原始地址的映射关系的地址重映射区域;并且,对初始数据区域中的原始地址中的数据进行更新时,该方法将更新后的数据存储到重映射数据区域中,并记录该原始地址与存储更新后数据的地址的映射关系。因此,使用本方法更新flash中的数据时,不需要每次更新数据都擦除整 个页面的数据,并重新烧写包含更新后数据的所有数据,从而可以提高闪存的数据更新效率,以及降低闪存的老化速度以提高闪存的使用寿命The flash memory in this method, in addition to the initial data area for storing the initial data, also divides the remapping data area for storing the updated data and the address remapping area for storing the mapping relationship between the storage address of the updated data and the original address. and, when updating the data in the original address in the initial data area, the method stores the updated data in the remapped data area, and records the mapping relationship between the original address and the address where the updated data is stored. Therefore, when using this method to update the data in the flash, it is not necessary to erase the data of the entire page every time the data is updated, and reprogram all the data including the updated data, so that the data update efficiency of the flash memory can be improved, and the speed of the flash memory can be reduced. aging speed to increase the lifespan of flash memory
结合第一方面,在第一种可能的实现方式中,所述指定页面还包括标记区域。相应地,所述方法还包括:判断所述标记区域中是否还有可用标记位,所述标记位用于指示所述地址重映射区域中与所述标记位对应的地址中是否存储有地址映射关系;在所述标记区域中是否还有可用标记位的情况下,根据所述标记区域中的可用标记位确定所述地址重映射区域中的当前可用地址。With reference to the first aspect, in a first possible implementation manner, the designated page further includes a marked area. Correspondingly, the method further includes: judging whether there is an available marker bit in the marker area, where the marker bit is used to indicate whether an address map is stored in the address corresponding to the marker bit in the address remapping area relationship; in the case of whether there are still available marker bits in the marker area, the currently available address in the address remapping area is determined according to the available marker bits in the marker area.
该实现方式中,flash中再额外划分flag区域,该flag区域用标记位来表示addr remap区域中相应的地址是否已存储地址映射关系。这样,根据flag区域中的标记位就能判断出addr remap区域中是否还有能够存储地址映射关系的存储空间,并且在addr remap区域中还有能够存储地址映射关系的存储空间的情况下,基于标记位的位置计算出addr remap中的当前可用地址,而不用挨个读取addr remap区域中每个地址中的内容来判断addr remap区域中是否还能能够存储地址映射关系的存储空间以及查找addr remap中的当前可用地址,从而可以节省查找addr remap区域中当前可用地址的时间,进而提高flash的数据更新效率。In this implementation, the flash is additionally divided into a flag area, and the flag area uses a flag bit to indicate whether the corresponding address in the addr remap area has stored the address mapping relationship. In this way, according to the flag bit in the flag area, it can be judged whether there is any storage space that can store the address mapping relationship in the addr remap area, and if there is still storage space that can store the address mapping relationship in the addr remap area, based on The position of the flag bit calculates the currently available address in the addr remap, instead of reading the contents of each address in the addr remap area one by one to determine whether the addr remap area can still store the memory space of the address mapping relationship and find the addr remap The currently available address in the addr remap area can save the time to find the currently available address in the addr remap area, thereby improving the data update efficiency of the flash.
结合第一种可能的实现方式,在第二种可能的实现方式中,所述方法还包括:接收数据读取请求消息,所述数据读取请求消息用于请求读取所述指定页面中的所述指定地址中的数据;判断所述标记区域是否为空;所述标记区域不为空的情况下,根据所述标记区域中表示所述地址重映射区域中对应的地址中已存储地址映射关系的标记位的数量,确定所述地址重映射区域中的结束存储地址,所述结束存储地址为所述地址重映射区域中最后一个已经存储地址映射关系的地址;在所述地址重映射区域的起始存储地址至所述结束存储地址之间的存储空间中查询包含所述指定地址的目标地址映射关系,所述起始存储地址为所述地址重映射区域中第一个存储地址映射关系的地址;根据所述目标地址映射关系读取所述重映射数据区域中所述目标地址中的数据,所述目标地址为所述目标地址映射关系中包含的与所述指定地址具有映射关系的地址;所述标记区域不为空的情况下,读取所述指定地址中的数据。With reference to the first possible implementation manner, in the second possible implementation manner, the method further includes: receiving a data read request message, where the data read request message is used to request to read the data in the specified page. The data in the specified address; determine whether the marked area is empty; if the marked area is not empty, the address mapping is stored in the corresponding address in the address remapping area according to the marked area The number of marker bits of the relationship determines the end storage address in the address remapping area, and the end storage address is the last address in the address remapping area that has stored the address mapping relationship; in the address remapping area Query the target address mapping relationship including the specified address in the storage space between the starting storage address and the ending storage address, and the starting storage address is the first storage address mapping relationship in the address remapping area. address; read the data in the target address in the remapped data area according to the target address mapping relationship, and the target address is the target address that is included in the target address mapping relationship and has a mapping relationship with the specified address address; if the marked area is not empty, read the data in the specified address.
结合第一方面,在第三种可能的实现方式中,所述方法还包括:判断所述地址重映射区域中是否还有可用地址。相应地,所述将所述指定数据写入所述重映射数据区域中的当前可用地址,包括:所述地址重映射区域中还有可用地址的情况下,将所述指定数据写入所述重映射数据区域中的当前可用地址。With reference to the first aspect, in a third possible implementation manner, the method further includes: judging whether there is an available address in the address remapping area. Correspondingly, the writing the specified data to the currently available address in the remapping data area includes: in the case that there is still an available address in the address remapping area, writing the specified data to the Remap the currently available address in the data area.
该实现方式中,在addr remap区域中是否还有可用地址的情况下,才将所述指定数据写入remap data区域,将相应的地址映射关系写入addr remap区域,可以避免数据溢出,从而可以避免数据丢失。In this implementation, the specified data is written into the remap data area, and the corresponding address mapping relationship is written into the addr remap area only when there is an available address in the addr remap area, so as to avoid data overflow, and thus can Avoid data loss.
结合第三种可能的实现方式,在第四种可能的实现方式中,所述方法还包括:接收数据读取请求消息,所述数据读取请求消息用于请求读取所述指定页面中的所述指定地址中的数据;在所述地址重映射区域的起始存储地址至所述结束存储地址之间的存储空间中查询包含所述指定地址的目标地址映射关系,所述起始存储地址为所述地址重映射区域中第一个存储地址映射关系的地址,所述结束存储地址为所述地址重映射区域中最后一个已经存储地址映射关系的地址;根据所述目标地址映射关系读取所 述重映射数据区域中所述目标地址中的数据,所述目标地址为所述目标地址映射关系中包含的与所述指定地址具有映射关系的地址。With reference to the third possible implementation manner, in a fourth possible implementation manner, the method further includes: receiving a data read request message, where the data read request message is used to request to read the data in the specified page. The data in the specified address; query the target address mapping relationship including the specified address in the storage space between the starting storage address and the ending storage address of the address remapping area, and the starting storage address is the address of the first storage address mapping relationship in the address remapping area, and the end storage address is the last address in the address remapping area that has stored the address mapping relationship; read according to the target address mapping relationship The data in the target address in the remapping data area, where the target address is an address that is included in the target address mapping relationship and has a mapping relationship with the specified address.
结合第二种或第四种可能的实现方式,在第五种可能的实现方式中,所述在所述地址重映射区域的起始存储地址至所述结束存储地址之间的存储空间中查询包含所述指定地址的目标地址映射关系,包括:按照从所述结束存储地址开始至所述起始存储地址的顺序,依次读取所述地址重映射区域中每个地址对应的存储空间中存储的地址映射关系,并判断所述每个地址中的地址映射关系中是否为包含所述指定地址的地址映射关系,直到读取到的地址映射关系为包含所述指定地址的地址映射关系,并将最后一次读取到的地址映射关系作为所述目标地址映射关系。In combination with the second or fourth possible implementation manner, in a fifth possible implementation manner, the query is performed in the storage space between the start storage address and the end storage address of the address remapping area. The target address mapping relationship including the specified address includes: sequentially reading the storage space corresponding to each address in the address remapping area in the order from the ending storage address to the starting storage address. address mapping relationship, and determine whether the address mapping relationship in each address is an address mapping relationship including the specified address, until the read address mapping relationship is an address mapping relationship including the specified address, and The address mapping relationship read last time is used as the target address mapping relationship.
第二方面,本申请提供了一种闪存的数据处理装置,所述闪存中的页面划分为多个存储区域,所述多个存储区域包括初始数据区域、重映射数据区域和地址重映射区域,所述装置可以包括用于实现第一方面或其中任意一种实现方式中的方法的一个或多个功能模块,每个功能模块可以通过软件和/或硬件的方式实现。In a second aspect, the present application provides a data processing device for flash memory, wherein a page in the flash memory is divided into multiple storage areas, and the multiple storage areas include an initial data area, a remapping data area, and an address remapping area, The apparatus may include one or more functional modules for implementing the method in the first aspect or any one of the implementation manners, and each functional module may be implemented by means of software and/or hardware.
例如,所述装置包括接收模块和写入模块。接收模块用于接收数据更新请求消息,所述数据更新请求消息用于请求将闪存内指定页面的指定地址中的数据更新为指定数据,所述指定地址为所述初始数据区域中的地址;写入模块用于将所述指定数据写入所述重映射数据区域中的当前可用地址;所述写入模块还用于将所述指定地址与所述重映射数据区域中的当前可用地址的地址映射关系,写入所述地址重映射区域。For example, the apparatus includes a receiving module and a writing module. The receiving module is used to receive a data update request message, the data update request message is used to request to update the data in the specified address of the specified page in the flash memory to specified data, and the specified address is the address in the initial data area; write The input module is used to write the specified data into the currently available address in the remapped data area; the write module is also used to write the specified address with the address of the currently available address in the remapped data area The mapping relationship is written into the address remapping area.
在第一种可能的实现方式中,所述指定页面还包括标记区域。相应地,所述装置还包括判断模块和确定模块。所述判断模块用于判断所述标记区域中是否还有可用标记位,所述标记位用于指示所述地址重映射区域中与所述标记位对应的地址中是否存储有地址映射关系;所述确定模块用于在所述标记区域中是否还有可用标记位的情况下,根据所述标记区域中的可用标记位确定所述地址重映射区域中的当前可用地址。In a first possible implementation manner, the designated page further includes a marked area. Correspondingly, the apparatus further includes a judgment module and a determination module. The judging module is used to judge whether there is an available marker bit in the marker area, and the marker bit is used to indicate whether an address mapping relationship is stored in the address corresponding to the marker bit in the address remapping area; The determining module is configured to determine the currently available address in the address remapping area according to the available marker bits in the marker area under the condition of whether there are available marker bits in the marker area.
结合第一种可能的实现方式,在第二种可能的实现方式中,所述接收模块还用于接收数据读取请求消息,所述数据读取请求消息用于请求读取所述指定页面中的所述指定地址中的数据。In combination with the first possible implementation manner, in the second possible implementation manner, the receiving module is further configured to receive a data read request message, where the data read request message is used to request to read the specified page. data in the specified address.
相应地,所述装置还包括判断模块、确定模块、查询模块和读取模块。所述判断模块用于判断所述标记区域是否为空;所述确定模块用于在所述标记区域不为空的情况下,根据所述标记区域中表示所述地址重映射区域中对应的地址中已存储地址映射关系的标记位的数量,确定所述地址重映射区域中的结束存储地址,所述结束存储地址为所述地址重映射区域中最后一个已经存储地址映射关系的地址;所述查询模块用于在所述地址重映射区域的起始存储地址至所述结束存储地址之间的存储空间中查询包含所述指定地址的目标地址映射关系,所述起始存储地址为所述地址重映射区域中第一个存储地址映射关系的地址;所述读取模块用于根据所述目标地址映射关系读取所述重映射数据区域中所述目标地址中的数据,所述目标地址为所述目标地址映射关系中包含的与所述指定地址具有映射关系的地址;所述读取模块还用于在所述标记区域不为空的情况下,读取所述指定地址中的数据。Correspondingly, the apparatus further includes a judgment module, a determination module, a query module and a reading module. The judging module is used for judging whether the marked area is empty; the determining module is used for indicating the corresponding address in the address remapping area according to the marked area when the marked area is not empty The number of marked bits of the stored address mapping relationship in the , determines the end storage address in the address remapping area, and the ending storage address is the last address in the address remapping area that has stored the address mapping relationship; the The query module is configured to query the target address mapping relationship including the specified address in the storage space between the starting storage address and the ending storage address of the address remapping area, and the starting storage address is the address The address of the first storage address mapping relationship in the remapping area; the read module is used to read the data in the target address in the remapping data area according to the target address mapping relationship, and the target address is The target address mapping relationship includes an address that has a mapping relationship with the specified address; the reading module is further configured to read data in the specified address when the marked area is not empty.
在另一种可能的实现方式中,所述装置还包括判断模块和确定模块,判断模块用于判断所述地址重映射区域中是否还有可用地址,确定模块用于确定当前可用地址。In another possible implementation manner, the apparatus further includes a judgment module and a determination module, where the judgment module is used for judging whether there is an available address in the address remapping area, and the determination module is used for determining a currently available address.
相应地,所述写入模块具体用于:在所述地址重映射区域中还有可用地址的情况下,将所述指定数据写入所述重映射数据区域中的当前可用地址。Correspondingly, the writing module is specifically configured to: write the specified data to the currently available address in the remapping data region in the case that there is still an available address in the address remapping region.
在该实现方式中,可选地,所述接收模块还用于接收数据读取请求消息,所述数据读取请求消息用于请求读取所述指定页面中的所述指定地址中的数据。In this implementation manner, optionally, the receiving module is further configured to receive a data read request message, where the data read request message is used to request to read the data in the designated address in the designated page.
相应地,所述装置还包括查询模块和读取模块。所述查询模块用于在所述地址重映射区域的起始存储地址至所述结束存储地址之间的存储空间中查询包含所述指定地址的目标地址映射关系,所述起始存储地址为所述地址重映射区域中第一个存储地址映射关系的地址,所述结束存储地址为所述地址重映射区域中最后一个已经存储地址映射关系的地址;所述读取模块用于根据所述目标地址映射关系读取所述重映射数据区域中所述目标地址中的数据,所述目标地址为所述目标地址映射关系中包含的与所述指定地址具有映射关系的地址。Correspondingly, the apparatus further includes a query module and a reading module. The query module is configured to query the target address mapping relationship including the specified address in the storage space between the starting storage address and the ending storage address of the address remapping area, where the starting storage address is the specified address. The address of the first storage address mapping relationship in the described address remapping area, and the end storage address is the address of the last stored address mapping relationship in the address remapping area; the read module is used for according to the target The address mapping relationship reads the data in the target address in the remapped data area, where the target address is an address included in the target address mapping relationship that has a mapping relationship with the specified address.
在一些可能的实现方式中,进一步地,所述查询模块可以具体用于:按照从所述结束存储地址开始至所述起始存储地址的顺序,依次读取所述地址重映射区域中每个地址对应的存储空间中存储的地址映射关系,并判断所述每个地址中的地址映射关系中是否为包含所述指定地址的地址映射关系,直到读取到的地址映射关系为所述指定地址的地址映射关系,并将第一次读取到的地址映射关系作为所述目标地址映射关系。In some possible implementations, further, the query module may be specifically configured to: sequentially read each of the address remapping areas in the sequence from the end storage address to the start storage address address mapping relationship stored in the storage space corresponding to the address, and determine whether the address mapping relationship in each address is an address mapping relationship including the specified address, until the read address mapping relationship is the specified address address mapping relationship, and use the address mapping relationship read for the first time as the target address mapping relationship.
第三方面,本申请提供了一种flash的数据处理装置,该装置可以包括与存储器耦合的处理器。其中,该存储器用于存储程序代码,该处理器用于执行该存储器中的程序代码,以实现第一方面或其中任意一种实现方式中的方法。In a third aspect, the present application provides a flash data processing apparatus, which may include a processor coupled with a memory. Wherein, the memory is used for storing program codes, and the processor is used for executing the program codes in the memory, so as to implement the method in the first aspect or any one of the implementation manners.
可选地,该装置还可以包括该存储器。Optionally, the apparatus may also include the memory.
该装置为电子设备时,在一些实现方式中,该装置还可以包括收发器,用于与其他设备通信;或还可以包括与用户交互的输入输出装置。When the apparatus is an electronic device, in some implementations, the apparatus may further include a transceiver for communicating with other devices; or may further include an input/output device for interacting with a user.
该装置为用于电子设备的芯片时,在一些实现方式中,该装置还可以包括通信接口,用于与电子设备中的其他装置通信,例如用于与电子设备的收发器进行通信。When the apparatus is a chip for an electronic device, in some implementations, the apparatus may further include a communication interface for communicating with other apparatuses in the electronic apparatus, for example, for communicating with a transceiver of the electronic apparatus.
第四方面,本申请提供了一种计算机可读存储介质,该计算机可读介质存储用于处理器执行的程序代码,该程序代码包括用于实现第一方面或其中任意一种可能的实现方式中的方法的指令。In a fourth aspect, the present application provides a computer-readable storage medium, where the computer-readable medium stores a program code for execution by a processor, the program code including a method for implementing the first aspect or any one of the possible implementation manners. method in the directive.
第五方面,本申请提供一种包含指令的计算机程序产品,当该计算机程序产品在处理器上运行时,使得该处理器实现第一方面或其中任意一种实现方式中的方法。In a fifth aspect, the present application provides a computer program product comprising instructions, which, when the computer program product runs on a processor, causes the processor to implement the method of the first aspect or any one of the implementation manners.
第六方面,本申请提供一种芯片,该芯片包括逻辑电路和flash,该逻辑电路和该flash用于实现第一方面或其中任意一种可能的实现方式中的方法。In a sixth aspect, the present application provides a chip, the chip includes a logic circuit and a flash, and the logic circuit and the flash are used to implement the method in the first aspect or any of the possible implementation manners.
附图说明Description of drawings
图1为本申请实施例的技术方案的一种应用场景的示意性;FIG. 1 is a schematic diagram of an application scenario of the technical solution of the embodiment of the application;
图2为本申请一个实施例的flash的数据存储结构示意图;2 is a schematic diagram of a data storage structure of a flash according to an embodiment of the application;
图3为本申请一个实施例的数据更新方法的流程示意图;3 is a schematic flowchart of a data update method according to an embodiment of the present application;
图4为本申请一个实施例的数据读取方法的流程示意图;4 is a schematic flowchart of a data reading method according to an embodiment of the present application;
图5为本申请一个实施例的数据更新方法的流程示意图;5 is a schematic flowchart of a data update method according to an embodiment of the present application;
图6为本申请另一个实施例的数据读取方法的流程示意图;6 is a schematic flowchart of a data reading method according to another embodiment of the present application;
图7本申请又一个实施例的数据更新方法的流程示意图;7 is a schematic flowchart of a data update method according to another embodiment of the present application;
图8为本申请另一个实施例的flash的数据存储结构示意图;8 is a schematic diagram of a data storage structure of a flash according to another embodiment of the application;
图9为本申请一个实施例的数据处理装置的示意性结构图;FIG. 9 is a schematic structural diagram of a data processing apparatus according to an embodiment of the present application;
图10为本申请另一个实施例的数据处理装置的示意性结构图。FIG. 10 is a schematic structural diagram of a data processing apparatus according to another embodiment of the present application.
具体实施方式Detailed ways
为了更好地理解本申请实施例的技术方案,下面先对本申请实施例中使用到的一些概念进行介绍。In order to better understand the technical solutions of the embodiments of the present application, some concepts used in the embodiments of the present application are first introduced below.
驱动程序(device driver),全称为“设备驱动程序”,是一种可以使计算机和设备通信的特殊程序,可以说相当于硬件的接口。The driver (device driver), the full name of "device driver", is a special program that enables the computer to communicate with the device, which can be said to be equivalent to the hardware interface.
在一些应用场景中,驱动程序独立于操作系统;在另一些场景中,驱动程序包含于操作系统。但是不管是哪种场景,操作系统只能通过这个接口,才能控制硬件设备的工作。In some application scenarios, the driver is independent of the operating system; in other scenarios, the driver is included in the operating system. But no matter what kind of scenario, the operating system can only control the work of the hardware device through this interface.
针对本申请实施例中的flash的驱动程序,是一种可以使得计算机和flash通信的程序,计算机的操作系统通过flash的驱动程序控制flash工作。The driver program for the flash in the embodiment of the present application is a program that enables the computer to communicate with the flash, and the operating system of the computer controls the flash to work through the driver program of the flash.
例如,如图1中左边的图所示,电子设备的处理器上运行的应用程序可以通过操作系统调用flash的驱动程序向flash中写入数据、更新flash中的数据或读取flash中的数据。For example, as shown in the figure on the left in Figure 1, the application program running on the processor of the electronic device can call the driver of the flash to write data to the flash, update the data in the flash or read the data in the flash through the operating system .
作为另一种可能的实现方式,如图1右边的图所示,电子设备的处理器上运行的应用程序可以通过操作系统向芯片写入数据、更新芯片中的数据或读取芯片中的数据。其中,芯片上可以包括通信接口、逻辑电路和flash,通信接口接收到数据写入请求、数据更新请求或数据读取请求之后,逻辑电路可以根据请求分别向flash中写入数据、更新flash中的数据或读取flash中的数据。As another possible implementation, as shown in the figure on the right side of Figure 1, the application program running on the processor of the electronic device can write data to the chip, update the data in the chip or read the data in the chip through the operating system . Among them, the chip may include a communication interface, a logic circuit and a flash. After the communication interface receives a data write request, a data update request or a data read request, the logic circuit can respectively write data to the flash and update the data in the flash according to the request. data or read data in flash.
图2是本申请一个实施例的flash的一个页面的数据存储结构示意性。如图2所示,本实施例将flash的一个页面划分为5个区域,分别是:头(header)区域,初始数据(initial data)区域,地址重映射(addr remap)区域,重映射数据(remap data)区域,标记(flag)区域。FIG. 2 is a schematic diagram of a data storage structure of a page of flash according to an embodiment of the present application. As shown in FIG. 2 , in this embodiment, a page of the flash is divided into five areas, which are: a header area, an initial data area, an address remapping (addr remap) area, and a remapping data ( remap data) area, flag (flag) area.
head区域用于存储该页面的header信息,head信息可以自定义。The head area is used to store the header information of the page, and the head information can be customized.
initial data区域又可以称为初始数据空间,用于存储初始写入该页面的代码(code)和数据(data),该代码和数据统一称为数据信息,简称为数据。The initial data area can also be called the initial data space, which is used to store the code (code) and data (data) initially written to the page. The code and data are collectively called data information, abbreviated as data.
remap data区域为预留的空间。对initial data区域中指定地址中的数据进行更新时,remap data区域中的地址可以用来存储initial data中指定地址中期望更新得到的数据。The remap data area is reserved space. When updating the data in the specified address in the initial data area, the address in the remap data area can be used to store the data expected to be updated in the specified address in the initial data area.
对initial data区域中指定地址中的数据进行更新时,addr remap区域中的每个地址用于initial data区域中的该指定地址和更新后的数据在remap data区域中的新地址的映射关系。When updating the data in the specified address in the initial data area, each address in the addr remap area is used for the mapping relationship between the specified address in the initial data area and the new address of the updated data in the remap data area.
flag区域中包括多个标记位,这多个标记位与addr remap区域中的多个地址一一对应。flag区域中的每个标记位用于表示addr remap区域中对应的地址是否存储了地址映射关系。The flag area includes multiple flag bits, which correspond one-to-one with multiple addresses in the addr remap area. Each flag bit in the flag area is used to indicate whether the corresponding address in the addr remap area stores an address mapping relationship.
本实施例中,标记位表示addr remap区域中对应的地址存储了地址映射关系时, 可以称为该标记位已置为有效,或者称为该标记位有效;标记位表示addr remap区域中对应的地址未存储地址映射关系时,可以称为该标记位无效;In this embodiment, when the marker bit indicates that the address mapping relationship is stored in the corresponding address in the addr remap area, it may be said that the marker bit has been set as valid, or the marker bit is valid; the marker bit represents the corresponding address in the addr remap area. When the address does not store the address mapping relationship, it can be said that the flag bit is invalid;
例如,一个标记位的值为“1”,则表明该标记位有效,即表示addr remap区域中对应的地址存储了地址映射关系;一个标记位的值为“0”,则表明该标记位无效,即表示addr remap区域中对应的地址还未存储地址映射关系。For example, if the value of a flag bit is "1", it indicates that the flag bit is valid, that is, the address mapping relationship is stored in the corresponding address in the addr remap area; the value of a flag bit is "0", indicating that the flag bit is invalid. , which means that the corresponding address in the addr remap area has not yet stored the address mapping relationship.
可以理解的是,上述flag区域中每个标记位的值与该标记位是否有效,即与addr remap区域中对应的地址是否存储地址映射关系之间的对应关系仅是示例,本实施例对此并不限制。It can be understood that whether the value of each marker bit in the above-mentioned flag area and the marker bit are valid, that is, whether the corresponding relationship with the address in the addr remap area stores the address mapping relationship is only an example, and this embodiment is only an example. Not limited.
图3是图2所示的flash的数据更新方法的一种示例性流程图。如图3所示,该方法可以包括步骤301、步骤302、步骤303、步骤304、步骤305、步骤306、步骤307和步骤308。FIG. 3 is an exemplary flowchart of the data update method of the flash shown in FIG. 2 . As shown in FIG. 3 , the method may include step 301 , step 302 , step 303 , step 304 , step 305 , step 306 , step 307 and step 308 .
本实施例的方法由flash的数据处理装置来执行。作为一种示例,该数据处理装置为运行在处理器上的flash驱动程序,或者说,该数据处理装置为运行了flash驱动程序的处理器。作为另一种示例,该数据处理装置为包含flash的芯片上的逻辑电路。The method of this embodiment is executed by a data processing device of flash. As an example, the data processing apparatus is a flash driver running on the processor, or in other words, the data processing apparatus is a processor running the flash driver. As another example, the data processing device is a logic circuit on a chip including flash.
本实施例中,数据处理装置中可以记录flash的每个区域的地址范围,例如记录了每个区域的起始地址、结束地址以及每个区域中每个存储空间的大小,又如记录了每个区域的起始地址、每个区域的总存储空间大小以及每个区域中每个存储空间的大小。In this embodiment, the data processing device can record the address range of each area of the flash, for example, record the start address, end address of each area, and the size of each storage space in each area, or record each area. The starting address of each region, the total storage size of each region, and the size of each storage space in each region.
301,接收数据更新请求消息,所述数据更新请求消息用于请求将flash内指定页面的指定地址中的数据更新为指定数据。301. Receive a data update request message, where the data update request message is used to request to update data in a specified address of a specified page in the flash to specified data.
例如,数据处理装置可以接收来自操作系统的数据更新请求消息,也可以接收应用程序通过操作系统发送的数据更新请求消息。该消息请求将flash中指定页面中的指定地址中的数据更新为指定数据。For example, the data processing apparatus may receive a data update request message from the operating system, or may receive a data update request message sent by the application program through the operating system. This message requests to update the data in the specified address in the specified page in the flash to the specified data.
该数据处理装置为驱动程序时,作为一种示例,该数据更新请求消息中可以携带该指定页面的指示信息、该指定地址和该指定数据。When the data processing apparatus is a driver, as an example, the data update request message may carry the indication information of the specified page, the specified address and the specified data.
该数据处理装置为芯片中的逻辑电路时,该消息中可以仅携带该指定数据。When the data processing device is a logic circuit in a chip, the message may only carry the specified data.
302,读取所述指定页面的flag区域中存储的信息。302. Read the information stored in the flag area of the specified page.
例如,数据处理装置可以根据预先记录的、所述指定页面的flag区域的地址范围读取该地址范围对应的存储空间中的所有标记位。For example, the data processing apparatus may read all flag bits in the storage space corresponding to the address range according to the pre-recorded address range of the flag area of the specified page.
303,判断所述flag区域中是否还有可用标记位,若是,则执行步骤304,否则执行步骤308。Step 303: Determine whether there are any available flag bits in the flag area, if yes, go to step 304, otherwise go to step 308.
或者可以说,判断flag区域中是否还有无效标记位。也可以说,判断flag区域中是否所有标记位都有效。In other words, it is judged whether there are invalid flag bits in the flag area. It can also be said that it is judged whether all the flag bits in the flag area are valid.
例如,按照步骤302中读取到的所有标记位的使用先后顺序,从第一个标记位开始,依次判断每个标记位是否为有效,即判断每个标记位是否已表示所述指定页面的addr remap区域中对应的地址中存储了地址映射关系。若找到无效标记位,即找到表示addr remap区域中对应的地址中未存储地址映射关系的标记位,则确定flag区域中还有可用标记位,且将该标记位记为当前可用标记位;若最后一个标记位都已有效,即最后一个标记位都已经表示addr remap区域中对应的地址中存储了地址映射关系,则确定flag区域中已无可用标记位。For example, according to the order of use of all the flag bits read in step 302, starting from the first flag bit, determine whether each flag bit is valid in turn, that is, determine whether each flag bit has indicated the specified page. The address mapping relationship is stored in the corresponding address in the addr remap area. If an invalid flag bit is found, that is, a flag bit indicating that the address mapping relationship is not stored in the corresponding address in the addr remap area is found, then it is determined that there is an available flag bit in the flag area, and the flag bit is marked as the currently available flag bit; if The last flag bit is valid, that is, the last flag bit has indicated that the address mapping relationship is stored in the corresponding address in the addr remap area, then it is determined that there is no available flag bit in the flag area.
304,根据所述flag区域中的可用标记位确定addr remap区域中的当前可用地址。304. Determine the currently available address in the addr remap area according to the available flag bits in the flag area.
例如,数据处理装置中可以预先记录flag区域中的标记位在flag区域中的位置与addr remap区域中与该标记位对应的地址之间的映射关系。这样,驱动程序可以根据当前可用标记位在flag区域中的位置与该映射关系寻找出addr remap区域中对应的地址,为了描述方便,本实施例将该地址称为addr remap区域中的当前可用地址。For example, the mapping relationship between the position of the flag bit in the flag region in the flag region and the address corresponding to the flag bit in the addr remap region can be pre-recorded in the data processing device. In this way, the driver can find out the corresponding address in the addr remap area according to the position of the currently available flag bit in the flag area and the mapping relationship. For the convenience of description, this embodiment refers to this address as the currently available address in the addr remap area. .
305,将所述指定地址和所述指定页面的remap data区域中的当前可用地址的映射关系存储到所述addr remap区域中的当前可用地址。305. Store the mapping relationship between the specified address and the currently available address in the remap data area of the specified page to the currently available address in the addr remap area.
作为一种示例,数据处理装置可以按照地址从小到大或从大到小的顺序向remap data区域中写入或者说存储或者说烧写数据,并且每次向remap data区域中写入数据之后,都记录存储该数据的地址。这种情况下,数据处理装置可以基于该地址确定remap data区域中的当前可用地址。As an example, the data processing apparatus may write or store or program data into the remap data area in the order of addresses from small to large or from large to small, and each time after writing data to the remap data area, Both record the address where the data is stored. In this case, the data processing apparatus may determine the currently available address in the remap data area based on the address.
306,将所述指定数据存储到所述remap data区域中的当前可用地址。306. Store the specified data to the currently available address in the remap data area.
作为一种示例,数据处理装置将所述指定数据存储到remap data区域中的当前可用地址之后,记录下当前可用地址,以使得下一次更新数据时,基于该当前可用地址确定下一个当前可用地址。As an example, after the data processing apparatus stores the specified data to the currently available address in the remap data area, the current available address is recorded, so that when the data is updated next time, the next currently available address is determined based on the currently available address .
307,向所述flag区域中的当前可用标记位写入表示所述addr remap区域中的当前可用地址已存储地址映射关系的值。307: Write a value representing the stored address mapping relationship of the currently available address in the addr remap area to the currently available flag bit in the flag area.
也就是说,将flag区域中的当前可用标记位烧写为有效。That is, programming the currently available flag bits in the flag area as valid.
308,进入换页流程。308, enter the page change process.
例如,将所述指定页面中的所有内容写入另一个页面中,然后擦除所述指定页面中的内容。擦除所述指定页面中的内容之后,可以将所述另一个页面中的内容以及更新后的数据写入所述指定页面。For example, write all the content in the specified page into another page, and then erase the content in the specified page. After erasing the content in the designated page, the content in the other page and the updated data may be written into the designated page.
上述换页流程仅是一种示例,本实施例对此不作限制。其他换页流程的实现方式可以参考现有技术,此处不再赘述。The above page changing process is only an example, which is not limited in this embodiment. For other implementation manners of the page changing process, reference may be made to the prior art, which will not be repeated here.
本实施例的数据更新方法中,在flash中,除了存储初始数据的初始存储空间initial data区域,还划分用于存储更新后数据的remap data区域和用于存储更新后的数据的存储地址与原始地址的映射关系的addr remap区域,并且,对initial data区域中的原始地址中的数据进行更新时,将更新后的数据存储到remap data区域中,并记录该原始地址与remap data中存储更新后数据的地址的映射关系,使得数据处理装置根据该原始地址以及该地址映射关系就能够读取到更新后的数据。In the data update method of the present embodiment, in the flash, in addition to the initial data area of the initial storage space for storing the initial data, the remap data area for storing the updated data and the storage address for storing the updated data are also divided into the original data area and the original data area. The addr remap area of the address mapping relationship, and when updating the data in the original address in the initial data area, store the updated data in the remap data area, and record the original address and remap data after the update is stored The mapping relationship between the addresses of the data enables the data processing device to read the updated data according to the original address and the address mapping relationship.
该数据更新方法,不需要每次更新数据都擦除整个页面的数据,并重新烧写包含更新后数据的所有数据,从而可以提高flash的数据更新效率,以及降低flash的老化速度以提高flash的使用寿命。The data update method does not need to erase the data of the entire page every time the data is updated, and reprogram all the data including the updated data, so that the data update efficiency of the flash can be improved, and the aging speed of the flash can be reduced to improve the flash performance. service life.
此外,本实施例中,再额外划分flag区域,该flag区域用标记位来表示addr remap区域中相应的地址是否已存储地址映射关系。这使得数据处理装置根据flag区域中的标记位就能判断出addr remap区域中是否还有能够存储地址映射关系的存储空间,并且在addr remap区域中还有能够存储地址映射关系的存储空间的情况下,基于标记位的位置计算出addr remap中的当前可用地址,而不用挨个读取addr remap区域中每个地址中的内容来判断addr remap区域中是否还能能够存储地址映射关系的存储空间以 及查找addr remap中的当前可用地址,从而可以节省查找addr remap区域中当前可用地址的时间,进而提高flash的数据更新效率。In addition, in this embodiment, the flag area is additionally divided, and the flag area uses a flag bit to indicate whether the corresponding address in the addr remap area has stored the address mapping relationship. This enables the data processing device to determine whether there is a storage space capable of storing address mapping relationships in the addr remap region according to the flag bits in the flag region, and whether there is a storage space capable of storing address mapping relationships in the addr remap region Next, calculate the currently available address in the addr remap based on the position of the marker bit, instead of reading the contents of each address in the addr remap area one by one to determine whether the addr remap area can still store the memory space of the address mapping relationship and Find the currently available address in the addr remap, which can save the time of finding the currently available address in the addr remap area, thereby improving the data update efficiency of the flash.
可以理解的是,本实施例中的步骤305至步骤307的执行顺序只是一种示例,本实施例并不限制这三个步骤之间的执行顺序。It can be understood that, the execution sequence of steps 305 to 307 in this embodiment is only an example, and this embodiment does not limit the execution sequence of the three steps.
针对上述数据更新方法更新的数据的读取,本申请进一步提出了新的数据读取方法。图4为本申请一个实施例的数据读取方法的流程示意图。For reading the data updated by the above data updating method, the present application further proposes a new data reading method. FIG. 4 is a schematic flowchart of a data reading method according to an embodiment of the present application.
如图4所示,本实施例的数据读取方法可以包括步骤401、步骤402、步骤403、步骤404、步骤405、步骤406和步骤407。As shown in FIG. 4 , the data reading method of this embodiment may include step 401 , step 402 , step 403 , step 404 , step 405 , step 406 and step 407 .
图4所示的方法由数据处理装置执行。作为一种示例,该数据处理装置为运行在处理器上的flash驱动程序,或者说,该数据处理装置为运行了flash驱动程序的处理器。作为另一种示例,该数据处理装置为包含flash的芯片上的逻辑电路。The method shown in FIG. 4 is performed by a data processing apparatus. As an example, the data processing apparatus is a flash driver running on the processor, or in other words, the data processing apparatus is a processor running the flash driver. As another example, the data processing device is a logic circuit on a chip including flash.
401,接收数据读取请求消息,所述数据读取请求消息用于请求读取flash的指定页面中的指定地址中的数据。401. Receive a data read request message, where the data read request message is used to request to read data in a specified address in a specified page of the flash.
例如,该数据读取请求消息中可以包括flash中页面指示信息,以指示读取的数据所属的页面;该数据读取请求消息中还可以包括该指定页面中的地址信息,用于指示应读取数据的地址空间。For example, the data read request message may include page indication information in the flash to indicate the page to which the read data belongs; the data read request message may also include address information in the specified page to indicate that the data should be read The address space for fetching data.
402,读取所述指定页面的flag区域中存储的信息。该步骤可以参考步骤302,此处不再赘述。402. Read the information stored in the flag area of the specified page. For this step, reference may be made to step 302, which will not be repeated here.
403,判断所述flag区域是否为空,若是,则执行步骤407,否则执行步骤404。Step 403 , determine whether the flag area is empty, if so, go to step 407 , otherwise go to step 404 .
作为一种示例,读取flag区域中所有标记位的内容,若任何一个标记位均表示所述指定页面的addr remap区域中对应的地址中还未存储地址映射关系,则可以确定flag区域中为空,否则可以确定flag区域不为空。As an example, read the content of all flag bits in the flag area, if any flag bit indicates that the address mapping relationship has not been stored in the address corresponding to the addr remap area of the specified page, it can be determined that the flag area is Empty, otherwise it can be determined that the flag area is not empty.
404,根据所述flag区域中表示所述指定页面的addr remap区域中对应的地址中已存储地址映射关系的标记位的数量,确定所述addr remap区域中的结束存储地址,所述结束存储地址为所述addr remap区域中最后一个已经存储地址映射关系的地址。404, according to the number of marked bits of the stored address mapping relationship in the address corresponding to the address in the addr remap area representing the specified page in the flag area, determine the end storage address in the addr remap area, the end storage address is the last address in the addr remap area where the address mapping relationship has been stored.
例如,数据处理装置中可以根据上述数量、addr remap区域的起始地址和addr remap区域中的单位地址大小,计算addr remap区域中最后一个已经存储了地址映射关系的地址,并将该地址作为结束存储地址。For example, the data processing device can calculate the last address in the addr remap area that has stored the address mapping relationship according to the above-mentioned number, the starting address of the addr remap area, and the unit address size in the addr remap area, and use this address as the end storage address.
可以理解的是,addr remap区域的起始存储地址指的是在addr remap区域中存储第一个地址映射关系的地址,且通常来说,数据处理装置按照地址从大到小或从小到大的顺序向addr remap区域中存储地址映射关系。It can be understood that the starting storage address of the addr remap area refers to the address in which the first address mapping relationship is stored in the addr remap area, and generally speaking, the data processing device is based on the address from large to small or from small to large. The address mapping relationship is sequentially stored in the addr remap area.
405,在所述addr remap区域的起始存储地址至所述结束存储地址之间的存储空间中查询包含所述指定地址的目标地址映射关系,所述起始存储地址为所述addr remap区域中第一个存储地址映射关系的地址。405, query the target address mapping relationship including the specified address in the storage space between the starting storage address of the addr remap area to the ending storage address, and the starting storage address is in the addr remap area. The address of the first storage address mapping relationship.
作为一种示例,数据处理装置可以按照从起始存储地址开始至结束存储地址的顺序,依次读取addr remap区域中每个地址对应的存储空间中存储的地址映射关系,并判断该地址映射关系中为包含所述指定地址的地址映射关系。若该地址映射关系中为包含所述指定地址的地址映射关系,则将该地址映射关系确定为目标地址映射关系。As an example, the data processing apparatus may sequentially read the address mapping relationship stored in the storage space corresponding to each address in the addr remap area in the order from the starting storage address to the ending storage address, and determine the address mapping relationship is the address mapping relationship including the specified address. If the address mapping relationship is an address mapping relationship including the specified address, the address mapping relationship is determined as a target address mapping relationship.
作为另一种示例,数据处理装置可以按照从结束存储地址开始至起始存储地址的 顺序,依次读取addr remap区域中每个地址对应的存储空间中存储的地址映射关系,并判断该地址映射关系中是否为包含所述指定地址的地址映射关系。若该地址映射关系中为包含所述指定地址的地址映射关系,则将该地址映射关系确定为目标地址映射关系。As another example, the data processing apparatus may sequentially read the address mapping relationship stored in the storage space corresponding to each address in the addr remap area in the order from the ending storage address to the starting storage address, and determine the address mapping Whether the relationship is an address mapping relationship including the specified address. If the address mapping relationship is an address mapping relationship including the specified address, the address mapping relationship is determined as a target address mapping relationship.
若在读取所述指定地址中的数据之前,更新过所述地址中的数据两次或以上次数,则后一种示例与前一种示例相比,可以查询得到所述指定地址的最新目标地址映射关系,从而可以查询得到最新数据的存储地址,进而可以读取到最新数据。If the data in the specified address is updated twice or more times before the data in the specified address is read, the latter example, compared with the former example, can query to obtain the latest target of the specified address The address mapping relationship, so that the storage address of the latest data can be queried, and the latest data can be read.
406,根据所述目标地址映射关系读取所述指定页面的remap data区域中的目标地址中的数据,所述目标地址为所述目标地址映射关系中包含的与所述指定地址具有映射关系的地址。406, read the data in the target address in the remap data area of the specified page according to the target address mapping relationship, and the target address is the target address that is included in the target address mapping relationship and has a mapping relationship with the specified address. address.
407,读取initial data区域中的所述指定地址中的数据。407: Read the data in the specified address in the initial data area.
本实施例中,在步骤405中,若直到查询完起始存储地址至结束存储地址之间的存储空间,都没有查询到包含所述指定地址的地址映射关系,则可以执行步骤407。In this embodiment, in step 405, if no address mapping relationship including the specified address is found until the storage space between the start storage address and the end storage address is queried, step 407 may be executed.
本申请另一个实施例中,flash中可以不划分flag区域。如图8所示,本实施例中的flash可以划分为head区域、addr remap区域、remap data区域和initial data区域。In another embodiment of the present application, the flag area may not be divided in the flash. As shown in FIG. 8 , the flash in this embodiment can be divided into a head area, an addr remap area, a remap data area, and an initial data area.
相应地,本实施例的flash的数据更新方法中可以不包括步骤302、步骤303、步骤304和步骤307。该实施例中,在步骤301之后,步骤305之前,可以包括如下步骤:判断addr remap区域中是否还有可用地址,若是,则执行步骤305,否则执行308。Correspondingly, step 302 , step 303 , step 304 and step 307 may not be included in the flash data update method of this embodiment. In this embodiment, after step 301 and before step 305, the following steps may be included: judging whether there is an available address in the addr remap area, if so, execute step 305, otherwise execute 308.
下面通过几个示例介绍一下判断addr remap区域中是否还有可用地址的实现方式。可以理解的是,本申请的实施例中并不限定判断addr remap区域中是否还有可用地址的实现方式。The following describes the implementation of judging whether there are any available addresses in the addr remap area through several examples. It can be understood that the embodiments of the present application do not limit the implementation of judging whether there is any available address in the addr remap area.
作为一种示例,数据处理装置向addr remap区域中写入地址映射关系式,按照地址从小到大的顺序写入。该示例中,数据处理装置判断addr remap区域中是否还有可用地址时,可以按照地址从小到大的顺序依次读取addr remap区域中每个地址对应的存储空间中的内容,并根据该存储空间中是否已存储有地址映射关系来判断该存储空间是否可用。若该存储空间中已存储有地址映射关系,则确定该存储空间对应的地址为不可用地址,且继续读取下一个地址对应的存储空间中的内容,重复前述操作;否则可以确定该存储空间对应的地址为可用地址,即确定addr remap区域中还有可用地址,且将该可用地址确定为addr remap区域中的当前可用地址。As an example, the data processing apparatus writes the address mapping relational expression into the addr remap area, and writes the addresses in ascending order. In this example, when the data processing device determines whether there are any available addresses in the addr remap area, it can read the contents in the storage space corresponding to each address in the addr remap area in order of the addresses from small to large, and according to the storage space Whether the address mapping relationship has been stored in the storage space is used to determine whether the storage space is available. If an address mapping relationship has been stored in the storage space, determine that the address corresponding to the storage space is an unavailable address, continue to read the content in the storage space corresponding to the next address, and repeat the foregoing operations; otherwise, the storage space can be determined The corresponding address is an available address, that is, it is determined that there is an available address in the addr remap area, and the available address is determined as the currently available address in the addr remap area.
若addr remap区域中所有存储空间中均存储了地址映射关系,则可以确定addr remap区域中已无可用地址。If the address mapping relationship is stored in all storage spaces in the addr remap area, it can be determined that there are no available addresses in the addr remap area.
作为另一种示例,数据处理装置向addr remap区域中写入地址映射关系时,按照地址从小到大的顺序写入,且数据处理装置每次向addr remap区域中写入地址映射关系之后,可以记录当前写入地址映射关系的地址。这样,数据处理装置需要判断该addr remap区域中还有可用地址时,可以判断记录的地址是否为addr remap区域中的最大地址,若是,则可以确定addr remap区域中已无可用地址,否则可以确定addr remap区域中还有可用地址,且将记录的地址加上单位存储空间大小即可得到addr remap区域中的当前可用地址。As another example, when the data processing device writes the address mapping relationship into the addr remap area, the addresses are written in ascending order, and after each time the data processing device writes the address mapping relationship into the addr remap area, it can Record the address of the current write address mapping relationship. In this way, when the data processing device needs to determine that there is an available address in the addr remap area, it can determine whether the recorded address is the largest address in the addr remap area, and if so, it can be determined that there is no available address in the addr remap area, otherwise it can be determined There are also available addresses in the addr remap area, and the current available address in the addr remap area can be obtained by adding the recorded address to the unit storage space size.
由上述各个实施例可知,本申请的技术方案中,在数据处理装置接收到请求将flash 内指定页面的指定地址中的数据更新为指定数据的消息时,只要将指定数据存储到remap data区域中的存储空间中,并在addr remap区域中记录下该存储空间对应的新地址与该指定地址的映射关系即可。As can be seen from the above-mentioned embodiments, in the technical scheme of the present application, when the data processing device receives a message requesting to update the data in the specified address of the specified page in the flash to the specified data, it only needs to store the specified data in the remap data area. In the storage space of the storage space, and record the mapping relationship between the new address corresponding to the storage space and the specified address in the addr remap area.
也就是说,本申请提出的数据更新方法中,如图5所示,只要至少包括步骤501、步骤502、步骤503、步骤504和步骤505,即可以达到不擦除整页内容就能够更新指定地址中的数据的目的,从而可以节省数据更新时间,提高flash的使用寿命。That is to say, in the data update method proposed in the present application, as shown in FIG. 5 , as long as at least steps 501 , 502 , 503 , 504 and 505 are included, the specified page can be updated without erasing the content of the entire page. The purpose of the data in the address is to save the data update time and improve the service life of the flash.
501,接收数据更新请求消息,所述数据更新请求消息用于请求将flash内指定页面的指定地址中的数据更新为指定数据。501. Receive a data update request message, where the data update request message is used to request to update data in a specified address of a specified page in the flash to specified data.
该步骤可以参考步骤301,此处不再赘述。For this step, reference may be made to step 301, which will not be repeated here.
502,判断所述指定页面的addr remap区域中是否还有可用地址,若是则执行步骤503,否则执行步骤505。502, judging whether there is an available address in the addr remap area of the specified page, if so, go to step 503, otherwise go to step 505.
判断所述指定页面的addr remap区域中是否还有可用地址的方法参考前述相关内容,此处不再赘述。For the method of judging whether there is still an available address in the addr remap area of the specified page, please refer to the aforementioned related content, which will not be repeated here.
在addr remap区域中是否还有可用地址的情况下,才将所述指定数据写入remap data区域,将相应的地址映射关系写入addr remap区域,可以避免数据溢出,从而可以避免数据丢失。In the case of whether there is any available address in the addr remap area, the specified data is written into the remap data area, and the corresponding address mapping relationship is written into the addr remap area, which can avoid data overflow and thus avoid data loss.
503,将所述指定地址与所述指定页面的remap data区域中的当前可用地址的地址映射关系,写入所述指定页面的addr remap区域中的当前可用地址中。503, write the address mapping relationship between the specified address and the currently available address in the remap data area of the specified page into the currently available address in the addr remap area of the specified page.
作为一种示例,将所述地址映射关系写入所述addr remap区域中的当前可用地址中之后,可以将该当前可用地址记录下来作为结束存储地址。As an example, after the address mapping relationship is written into the currently available address in the addr remap area, the currently available address may be recorded as the end storage address.
504,将所述指定数据写入所述指定页面的remap data区域中的当前可用地址。504. Write the specified data to the currently available address in the remap data area of the specified page.
505,进入换页流程。该步骤可以参考步骤308,此处不再赘述。505, enter the page change process. For this step, reference may be made to step 308, which will not be repeated here.
图5所示的数据更新方法对应的数据读取方法的一种流程示意图如图6所示。该方法可以包括步骤601、步骤602和步骤603。A schematic flowchart of a data reading method corresponding to the data updating method shown in FIG. 5 is shown in FIG. 6 . The method may include step 601 , step 602 and step 603 .
601,接收数据读取请求消息,所述数据读取请求消息用于请求读取flash的指定页面中的指定地址中的数据。601. Receive a data read request message, where the data read request message is used to request to read data in a specified address in a specified page of the flash.
602,在所述指定页面的addr remap区域的起始存储地址至结束存储地址之间的存储空间中查询包含所述指定地址的目标地址映射关系,所述起始存储地址为所述addr remap区域中第一个存储地址映射关系的地址,所述结束存储地址为所述addr remap区域中最后一个已经存储地址映射关系的地址。602, query the target address mapping relationship containing the specified address in the storage space between the starting storage address of the addr remap area of the specified page to the ending storage address, and the starting storage address is the addr remap area In the address of the first storage address mapping relationship, the end storage address is the address of the last stored address mapping relationship in the addr remap area.
603,根据所述目标地址映射关系读取所述指定页面的remap data区域中的目标地址中的数据,所述目标地址为所述目标地址映射关系中包含的与所述指定地址具有映射关系的地址。603, read the data in the target address in the remap data area of the specified page according to the target address mapping relationship, and the target address is the target address that is included in the target address mapping relationship and has a mapping relationship with the specified address. address.
本实施例中,步骤601、步骤602和步骤603可以分别参考步骤401、步骤405和步骤406,此处不再赘述。In this embodiment, step 601, step 602, and step 603 may refer to step 401, step 405, and step 406, respectively, and details are not repeated here.
在本申请的又一些实施例中,可选地,可以将flash中的每个页面的存储空间设计的较大,进一步可以将addr remap区域和remap data区域设计得较大,例如大到在该页面的生命周期中,进行更新的所有数据的存储空间均不会超过remap data区域的存储空间,相应地,进行更新所生成的地址映射关系所需的存储空间不会超过addr remap 区域的存储空间。In still other embodiments of the present application, optionally, the storage space of each page in the flash may be designed to be larger, and further the addr remap area and the remap data area may be designed to be larger, for example, so large that In the life cycle of the page, the storage space of all data to be updated will not exceed the storage space of the remap data area. Accordingly, the storage space required for the address mapping relationship generated by the update will not exceed the storage space of the addr remap area. .
本实施例的数据更新方法的流程示意图如图7所示。该方法可以包括步骤701、步骤702和步骤703。A schematic flowchart of the data updating method in this embodiment is shown in FIG. 7 . The method may include step 701 , step 702 and step 703 .
701,接收数据更新请求消息,所述数据更新请求消息用于请求将flash内指定页面的指定地址中的数据更新为指定数据。701. Receive a data update request message, where the data update request message is used to request to update data in a specified address of a specified page in the flash to specified data.
702,将所述指定地址与所述指定页面的remap data区域中的当前可用地址的地址映射关系,写入所述指定页面的addr remap区域中的当前可用地址中。702, write the address mapping relationship between the specified address and the currently available address in the remap data area of the specified page into the currently available address in the addr remap area of the specified page.
703,将所述指定数据写入所述指定页面的remap data区域中的当前可用地址。703. Write the specified data to the currently available address in the remap data area of the specified page.
本实施例中的步骤701、步骤702和步骤703可以分别参考步骤501、步骤503和步骤504,此处不再赘述。Step 701, step 702, and step 703 in this embodiment may refer to step 501, step 503, and step 504, respectively, and details are not repeated here.
本实施例的数据更新方法对应的数据读取方法,可以参看图6所示的方法,此处不再赘述。For the data reading method corresponding to the data updating method in this embodiment, reference may be made to the method shown in FIG. 6 , which will not be repeated here.
可以理解的是,本申请中的数据更新方法和数据读取方法,可以统称为flash的数据处理方法。此外,本申请各个实施例中的flash中可以不包括header区域。另外,本申请各个实施例中的header区域、addr remap区域、flag区域、remap data区域和initial区域的名称只是示例,本申请对这些区域的名称并不做限制,只要功能与前述各个实施例中的各个区域的功能相符,即属于本申请的保护范围。It can be understood that, the data updating method and the data reading method in this application may be collectively referred to as a data processing method of flash. In addition, the flash in each embodiment of the present application may not include a header area. In addition, the names of the header area, the addr remap area, the flag area, the remap data area, and the initial area in the various embodiments of this application are only examples, and the application does not limit the names of these areas, as long as the functions are the same as those in the foregoing embodiments. The functions of the respective regions are consistent with each other, that is, they belong to the protection scope of the present application.
图9为本申请一个实施例提供的数据处理装置的结构示意图。图9所示的装置可以用于执行前述任意一个实施例所述的方法。如图9所示,本实施例的装置900可以包括:接收模块901和写入模块902。可选地,装置900还可以包括查询模块903和读取模块904。进一步地,装置900还可以包括判断模块905和确定模块906。FIG. 9 is a schematic structural diagram of a data processing apparatus provided by an embodiment of the present application. The apparatus shown in FIG. 9 can be used to execute the method described in any one of the foregoing embodiments. As shown in FIG. 9 , the apparatus 900 in this embodiment may include: a receiving module 901 and a writing module 902 . Optionally, the apparatus 900 may further include a query module 903 and a reading module 904 . Further, the apparatus 900 may further include a judgment module 905 and a determination module 906 .
在一种示例中,装置900可以用于执行图3所述的方法。例如,接收模块901可以用于执行步骤301,读取模块906可以用于执行步骤302,判断模块905可以用于执行步骤303,确定模块906可以用于执行步骤304,写入模块902可以用于执行步骤305至步骤308。In one example, the apparatus 900 may be used to perform the method described in FIG. 3 . For example, the receiving module 901 can be used to perform step 301, the reading module 906 can be used to perform step 302, the judging module 905 can be used to perform step 303, the determining module 906 can be used to perform step 304, and the writing module 902 can be used to perform step 304. Steps 305 to 308 are performed.
在一种示例中,装置900可以用于执行图4所述的方法。例如,接收模块901可以用于执行步骤401,读取模块906可以用于执行步骤402,判断模块905可以用于执行步骤403,确定模块906可以用于执行步骤404,查询模块903可以用于执行步骤405,读取模块906还可以用于执行步骤406和步骤407。In one example, the apparatus 900 may be used to perform the method described in FIG. 4 . For example, the receiving module 901 can be used to execute step 401, the reading module 906 can be used to execute step 402, the judgment module 905 can be used to execute step 403, the determination module 906 can be used to execute step 404, and the query module 903 can be used to execute step 404. In step 405 , the reading module 906 can also be used to perform steps 406 and 407 .
在一种示例中,装置900可以用于执行图5所述的方法。例如,接收模块901可以用于执行步骤501,判断模块905可以用于执行步骤502,写入模块902可以用于执行步骤503至步骤505。In one example, the apparatus 900 may be used to perform the method described in FIG. 5 . For example, the receiving module 901 may be used to perform step 501 , the judging module 905 may be used to perform step 502 , and the writing module 902 may be used to perform steps 503 to 505 .
在一种示例中,装置900可以用于执行图6所述的方法。例如,接收模块901可以用于执行步骤601,查询模块903可以用于执行步骤602,读取模块906还可以用于执行步骤603。In one example, the apparatus 900 may be used to perform the method described in FIG. 6 . For example, the receiving module 901 can be used to perform step 601 , the query module 903 can be used to perform step 602 , and the reading module 906 can also be used to perform step 603 .
在一种示例中,装置900可以用于执行图7所述的方法。例如,接收模块901可以用于执行步骤701,写入模块902可以用于执行步骤702和步骤703。In one example, the apparatus 900 may be used to perform the method described in FIG. 7 . For example, the receiving module 901 can be used to perform step 701 , and the writing module 902 can be used to perform steps 702 and 703 .
图10为本申请另一个实施例提供的数据处理装置的结构示意图。图10所示的装置可以用于执行前述任意一个实施例所述的方法。FIG. 10 is a schematic structural diagram of a data processing apparatus provided by another embodiment of the present application. The apparatus shown in FIG. 10 can be used to perform the method described in any one of the foregoing embodiments.
如图10所示,本实施例的装置1000包括:存储器1001、处理器1002、通信接口1003以及总线1004。其中,存储器1001、处理器1002、通信接口1003通过总线1004实现彼此之间的通信连接。As shown in FIG. 10 , the apparatus 1000 in this embodiment includes: a memory 1001 , a processor 1002 , a communication interface 1003 , and a bus 1004 . The memory 1001 , the processor 1002 , and the communication interface 1003 are connected to each other through the bus 1004 for communication.
存储器1001可以是只读存储器(read only memory,ROM),静态存储设备,动态存储设备或者随机存取存储器(random access memory,RAM)。存储器1001可以存储程序,当存储器1001中存储的程序被处理器602执行时,处理器602用于执行图3至图7中任意图所示的方法的各个步骤。The memory 1001 may be a read only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 1001 may store a program, and when the program stored in the memory 1001 is executed by the processor 602, the processor 602 is configured to execute each step of the method shown in any of FIG. 3 to FIG. 7 .
处理器1002可以采用通用的中央处理器(central processing unit,CPU),微处理器,应用专用集成电路(application specific integrated circuit,ASIC),或者一个或多个集成电路,用于执行相关程序,以实现本申请各个实施例中的方法。The processor 1002 can use a general-purpose central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits for executing related programs to The methods in the various embodiments of the present application are implemented.
处理器1002还可以是一种集成电路芯片,具有信号的处理能力。在实现过程中,本申请各个实施例的方法的各个步骤可以通过处理器1002中的硬件的集成逻辑电路或者软件形式的指令完成。The processor 1002 may also be an integrated circuit chip with signal processing capability. In the implementation process, each step of the method in the various embodiments of the present application may be completed by an integrated logic circuit of hardware in the processor 1002 or an instruction in the form of software.
上述处理器1002还可以是通用处理器、数字信号处理器(digital signal processing,DSP)、专用集成电路(ASIC)、现成可编程门阵列(field programmable gate array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本申请实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。The above-mentioned processor 1002 can also be a general-purpose processor, a digital signal processor (digital signal processing, DSP), an application-specific integrated circuit (ASIC), an off-the-shelf programmable gate array (field programmable gate array, FPGA) or other programmable logic devices, Discrete gate or transistor logic devices, discrete hardware components. The methods, steps, and logic block diagrams disclosed in the embodiments of this application can be implemented or executed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
结合本申请实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器1001,处理器1002读取存储器1001中的信息,结合其硬件完成本申请的装置包括的单元所需执行的功能,例如,可以执行图3至图7任意图所示实施例的各个步骤/功能。The steps of the method disclosed in conjunction with the embodiments of the present application may be directly embodied as executed by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software modules may be located in random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers and other storage media mature in the art. The storage medium is located in the memory 1001, and the processor 1002 reads the information in the memory 1001, and performs the functions required to be performed by the units included in the device of the present application in combination with its hardware. For example, the embodiment shown in any of FIG. 3 to FIG. 7 can be performed. the individual steps/functions.
通信接口1003可以使用但不限于收发器一类的收发装置,来实现装置1000与其他设备或通信网络之间的通信。The communication interface 1003 can use, but is not limited to, a transceiver such as a transceiver to implement communication between the device 1000 and other devices or a communication network.
总线1004可以包括在装置1000各个部件(例如,存储器1001、处理器1002、通信接口1003)之间传送信息的通路。The bus 1004 may include a pathway for communicating information between the various components of the apparatus 1000 (eg, the memory 1001, the processor 1002, the communication interface 1003).
应理解,本申请实施例所示的装置1000可以是电子设备,或者,也可以是配置于电子设备中的芯片。It should be understood that the apparatus 1000 shown in this embodiment of the present application may be an electronic device, or may also be a chip configured in the electronic device.
应理解,本申请实施例中的处理器可以为中央处理单元(central processing unit,CPU),该处理器还可以是其他通用处理器、数字信号处理器(digital signal processor,DSP)、专用集成电路(application specific integrated circuit,ASIC)、现成可编程门阵列(field programmable gate array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。It should be understood that the processor in the embodiment of the present application may be a central processing unit (central processing unit, CPU), and the processor may also be other general-purpose processors, digital signal processors (digital signal processors, DSP), application-specific integrated circuits (application specific integrated circuit, ASIC), off-the-shelf programmable gate array (field programmable gate array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
还应理解,本申请实施例中的存储器可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(read-only memory,ROM)、可编程只读存储器(programmable ROM,PROM)、 可擦除可编程只读存储器(erasable PROM,EPROM)、电可擦除可编程只读存储器(electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(random access memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的随机存取存储器(random access memory,RAM)可用,例如静态随机存取存储器(static RAM,SRAM)、动态随机存取存储器(DRAM)、同步动态随机存取存储器(synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(double data rate SDRAM,DDR SDRAM)、增强型同步动态随机存取存储器(enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(direct rambus RAM,DR RAM)。It should also be understood that the memory in the embodiments of the present application may be volatile memory or non-volatile memory, or may include both volatile and non-volatile memory. Among them, the non-volatile memory can be read-only memory (read-only memory, ROM), programmable read-only memory (programmable ROM, PROM), erasable programmable read-only memory (erasable PROM, EPROM), electrically programmable Erase programmable read-only memory (electrically EPROM, EEPROM) or flash memory. Volatile memory may be random access memory (RAM), which acts as an external cache. By way of example and not limitation, many forms of random access memory (RAM) are available, such as static random access memory (SRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (DRAM) Access memory (synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (double data rate SDRAM, DDR SDRAM), enhanced synchronous dynamic random access memory (enhanced SDRAM, ESDRAM), synchronous connection dynamic random access memory Fetch memory (synchlink DRAM, SLDRAM) and direct memory bus random access memory (direct rambus RAM, DR RAM).
上述实施例,可以全部或部分地通过软件、硬件、固件或其他任意组合来实现。当使用软件实现时,上述实施例可以全部或部分地以计算机程序产品的形式实现。所述计算机程序产品包括一个或多个计算机指令或计算机程序。在计算机上加载或执行所述计算机指令或计算机程序时,全部或部分地产生按照本申请实施例所述的流程或功能。所述计算机可以为通用计算机、专用计算机、计算机网络、或者其他可编程装置。所述计算机指令可以存储在计算机可读存储介质中,或者从一个计算机可读存储介质向另一个计算机可读存储介质传输,例如,所述计算机指令可以从一个网站站点、计算机、服务器或数据中心通过有线(例如红外、无线、微波等)方式向另一个网站站点、计算机、服务器或数据中心进行传输。所述计算机可读存储介质可以是计算机能够存取的任何可用介质或者是包含一个或多个可用介质集合的服务器、数据中心等数据存储设备。所述可用介质可以是磁性介质(例如,软盘、硬盘、磁带)、光介质(例如,DVD)、或者半导体介质。半导体介质可以是固态硬盘。The above embodiments may be implemented in whole or in part by software, hardware, firmware or any other combination. When implemented in software, the above-described embodiments may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions or computer programs. When the computer instructions or computer programs are loaded or executed on a computer, all or part of the processes or functions described in the embodiments of the present application are generated. The computer may be a general purpose computer, special purpose computer, computer network, or other programmable device. The computer instructions may be stored in or transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions may be downloaded from a website site, computer, server, or data center Transmission to another website site, computer, server or data center by wire (eg, infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, a data center, or the like that contains one or more sets of available media. The usable media may be magnetic media (eg, floppy disks, hard disks, magnetic tapes), optical media (eg, DVDs), or semiconductor media. The semiconductor medium may be a solid state drive.
应理解,本文中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况,其中A,B可以是单数或者复数。另外,本文中字符“/”,一般表示前后关联对象是一种“或”的关系,但也可能表示的是一种“和/或”的关系,具体可参考前后文进行理解。It should be understood that the term "and/or" in this document is only an association relationship to describe associated objects, indicating that there can be three kinds of relationships, for example, A and/or B, which can mean that A exists alone, and A and B exist at the same time , there are three cases of B alone, where A and B can be singular or plural. In addition, the character "/" in this document generally indicates that the related objects before and after are an "or" relationship, but may also indicate an "and/or" relationship, which can be understood with reference to the context.
本申请中,“至少一个”是指一个或者多个,“多个”是指两个或两个以上。“以下至少一项(个)”或其类似表达,是指的这些项中的任意组合,包括单项(个)或复数项(个)的任意组合。例如,a,b,或c中的至少一项(个),可以表示:a,b,c,a-b,a-c,b-c,或a-b-c,其中a,b,c可以是单个,也可以是多个。In this application, "at least one" means one or more, and "plurality" means two or more. "At least one item(s) below" or similar expressions thereof refer to any combination of these items, including any combination of single item(s) or plural items(s). For example, at least one item (a) of a, b, or c can represent: a, b, c, a-b, a-c, b-c, or a-b-c, where a, b, c may be single or multiple .
应理解,在本申请的各种实施例中,上述各过程的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。It should be understood that, in various embodiments of the present application, the size of the sequence numbers of the above-mentioned processes does not mean the sequence of execution, and the execution sequence of each process should be determined by its functions and internal logic, and should not be dealt with in the embodiments of the present application. implementation constitutes any limitation.
本领域普通技术人员可以意识到,结合本文中所公开的实施例描述的各示例的单元及算法步骤,能够以电子硬件、或者计算机软件和电子硬件的结合来实现。这些功能究竟以硬件还是软件方式来执行,取决于技术方案的特定应用和设计约束条件。专业技术人员可以对每个特定的应用来使用不同方法来实现所描述的功能,但是这种实现不应认为超出本申请的范围。Those of ordinary skill in the art can realize that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Skilled artisans may implement the described functionality using different methods for each particular application, but such implementations should not be considered beyond the scope of this application.
所属领域的技术人员可以清楚地了解到,为描述的方便和简洁,上述描述的系统、 装置和单元的具体工作过程,可以参考前述方法实施例中的对应过程,在此不再赘述。Those skilled in the art can clearly understand that, for the convenience and brevity of description, for the specific working process of the above-described systems, devices and units, reference may be made to the corresponding processes in the foregoing method embodiments, and details are not repeated here.
在本申请所提供的几个实施例中,应该理解到,所揭露的系统、装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the apparatus embodiments described above are only illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components may be combined or Can be integrated into another system, or some features can be ignored, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, and may be in electrical, mechanical or other forms.
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution in this embodiment.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
所述功能如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本申请各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器、随机存取存储器、磁碟或者光盘等各种可以存储程序代码的介质。The functions, if implemented in the form of software functional units and sold or used as independent products, may be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be embodied in the form of a software product in essence, or the part that contributes to the prior art or the part of the technical solution, and the computer software product is stored in a storage medium, including Several instructions are used to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application. The aforementioned storage medium includes: a U disk, a removable hard disk, a read-only memory, a random access memory, a magnetic disk or an optical disk and other media that can store program codes.
以上所述,仅为本申请的具体实施方式,但本申请的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本申请揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本申请的保护范围之内。因此,本申请的保护范围应以所述权利要求的保护范围为准。The above are only specific embodiments of the present application, but the protection scope of the present application is not limited to this. should be covered within the scope of protection of this application. Therefore, the protection scope of the present application should be subject to the protection scope of the claims.

Claims (16)

  1. 一种闪存的数据处理方法,其特征在于,所述闪存中的页面划分为多个存储区域,所述多个存储区域包括初始数据区域、重映射数据区域和地址重映射区域,所述方法包括:A data processing method of flash memory, characterized in that a page in the flash memory is divided into multiple storage areas, the multiple storage areas include an initial data area, a remapping data area, and an address remapping area, the method includes :
    接收数据更新请求消息,所述数据更新请求消息用于请求将所述闪存内指定页面的指定地址中的数据更新为指定数据,所述指定地址为所述初始数据区域中的地址;receiving a data update request message, where the data update request message is used to request to update data in a specified address of a specified page in the flash memory to specified data, where the specified address is an address in the initial data area;
    将所述指定数据写入所述重映射数据区域中的当前可用地址;writing the specified data to a currently available address in the remapped data area;
    将所述指定地址与所述重映射数据区域中的当前可用地址的地址映射关系,写入所述地址重映射区域。The address mapping relationship between the specified address and the currently available address in the remapping data area is written into the address remapping area.
  2. 根据权利要求1所述的方法,其特征在于,所述指定页面还包括标记区域,相应地,所述方法还包括:The method according to claim 1, wherein the designated page further comprises a marked area, and correspondingly, the method further comprises:
    判断所述标记区域中是否还有可用标记位,所述标记位用于指示所述地址重映射区域中与所述标记位对应的地址中是否存储有地址映射关系;Judging whether there is an available marker bit in the marker area, the marker bit is used to indicate whether an address mapping relationship is stored in the address corresponding to the marker bit in the address remapping area;
    在所述标记区域中是否还有可用标记位的情况下,根据所述标记区域中的可用标记位确定所述地址重映射区域中的当前可用地址。In the case of whether there are any available marker bits in the marker area, the currently available address in the address remapping area is determined according to the available marker bits in the marker area.
  3. 根据权利要求2所述的方法,其特征在于,所述方法还包括:The method according to claim 2, wherein the method further comprises:
    接收数据读取请求消息,所述数据读取请求消息用于请求读取所述指定页面中的所述指定地址中的数据;receiving a data read request message, where the data read request message is used to request to read the data in the specified address in the specified page;
    判断所述标记区域是否为空;Determine whether the marked area is empty;
    所述标记区域不为空的情况下,根据所述标记区域中表示所述地址重映射区域中对应的地址中已存储地址映射关系的标记位的数量,确定所述地址重映射区域中的结束存储地址,所述结束存储地址为所述地址重映射区域中最后一个已经存储地址映射关系的地址;In the case that the marker area is not empty, the end of the address remapping area is determined according to the number of marker bits in the marker area indicating that the address mapping relationship has been stored in the address corresponding to the address remapping area. storage address, the end storage address is the address of the last stored address mapping relationship in the address remapping area;
    在所述地址重映射区域的起始存储地址至所述结束存储地址之间的存储空间中查询包含所述指定地址的目标地址映射关系,所述起始存储地址为所述地址重映射区域中第一个存储地址映射关系的地址;The target address mapping relationship including the specified address is queried in the storage space between the starting storage address and the ending storage address of the address remapping area, and the starting storage address is the address remapping area in the address remapping area. The address of the first storage address mapping relationship;
    根据所述目标地址映射关系读取所述重映射数据区域中所述目标地址中的数据,所述目标地址为所述目标地址映射关系中包含的与所述指定地址具有映射关系的地址;Read the data in the target address in the remapped data area according to the target address mapping relationship, where the target address is an address that is included in the target address mapping relationship and has a mapping relationship with the specified address;
    所述标记区域不为空的情况下,读取所述指定地址中的数据。When the marked area is not empty, the data in the specified address is read.
  4. 根据权利要求1所述的方法,其特征在于,所述方法还包括:判断所述地址重映射区域中是否还有可用地址;The method according to claim 1, wherein the method further comprises: judging whether there is an available address in the address remapping area;
    相应地,所述将所述指定数据写入所述重映射数据区域中的当前可用地址,包括:Correspondingly, the writing of the specified data to the currently available address in the remapped data area includes:
    所述地址重映射区域中还有可用地址的情况下,将所述指定数据写入所述重映射数据区域中的当前可用地址。When there is still an available address in the address remapping area, the specified data is written into the currently available address in the remapping data area.
  5. 根据权利要求4所述的方法,其特征在于,所述方法还包括:The method according to claim 4, wherein the method further comprises:
    接收数据读取请求消息,所述数据读取请求消息用于请求读取所述指定页面中的所述指定地址中的数据;receiving a data read request message, where the data read request message is used to request to read the data in the specified address in the specified page;
    在所述地址重映射区域的起始存储地址至所述结束存储地址之间的存储空间中查询包含所述指定地址的目标地址映射关系,所述起始存储地址为所述地址重映射区域 中第一个存储地址映射关系的地址,所述结束存储地址为所述地址重映射区域中最后一个已经存储地址映射关系的地址;The target address mapping relationship including the specified address is queried in the storage space between the starting storage address and the ending storage address of the address remapping area, and the starting storage address is the address remapping area in the address remapping area. The address of the first storage address mapping relationship, and the end storage address is the address of the last stored address mapping relationship in the address remapping area;
    根据所述目标地址映射关系读取所述重映射数据区域中所述目标地址中的数据,所述目标地址为所述目标地址映射关系中包含的与所述指定地址具有映射关系的地址。The data in the target address in the remapped data area is read according to the target address mapping relationship, where the target address is an address included in the target address mapping relationship that has a mapping relationship with the specified address.
  6. 根据权利要求3或5所述的方法,其特征在于,所述在所述地址重映射区域的起始存储地址至所述结束存储地址之间的存储空间中查询包含所述指定地址的目标地址映射关系,包括:The method according to claim 3 or 5, characterized in that, in the storage space between the starting storage address and the ending storage address of the address remapping area, the target address including the specified address is searched for Mapping relationships, including:
    按照从所述结束存储地址开始至所述起始存储地址的顺序,依次读取所述地址重映射区域中每个地址对应的存储空间中存储的地址映射关系,并判断所述每个地址中的地址映射关系中是否为包含所述指定地址的地址映射关系,直到读取到的地址映射关系为包含所述指定地址的地址映射关系,并将最后一次读取到的地址映射关系作为所述目标地址映射关系。According to the sequence from the end storage address to the start storage address, sequentially read the address mapping relationship stored in the storage space corresponding to each address in the address remapping area, and determine the address mapping relationship in each address. Whether the address mapping relationship is an address mapping relationship that includes the specified address, until the address mapping relationship that is read is an address mapping relationship that includes the specified address, and the last read address mapping relationship is used as the address mapping relationship. Destination address mapping relationship.
  7. 一种闪存的数据处理装置,其特征在于,所述闪存中的页面划分为多个存储区域,所述多个存储区域包括初始数据区域、重映射数据区域和地址重映射区域,所述装置包括:A data processing device for flash memory, characterized in that a page in the flash memory is divided into multiple storage areas, and the multiple storage areas include an initial data area, a remapping data area, and an address remapping area, and the device includes :
    接收模块,用于接收数据更新请求消息,所述数据更新请求消息用于请求将闪存内指定页面的指定地址中的数据更新为指定数据,所述指定地址为所述初始数据区域中的地址;a receiving module, configured to receive a data update request message, the data update request message being used to request to update the data in the specified address of the specified page in the flash memory to specified data, and the specified address is the address in the initial data area;
    写入模块,用于将所述指定数据写入所述重映射数据区域中的当前可用地址;a writing module for writing the specified data to a currently available address in the remapped data area;
    所述写入模块还用于将所述指定地址与所述重映射数据区域中的当前可用地址的地址映射关系,写入所述地址重映射区域。The writing module is further configured to write the address mapping relationship between the specified address and the currently available address in the remapping data region into the address remapping region.
  8. 根据权利要求7所述的装置,其特征在于,所述指定页面还包括标记区域,相应地,所述装置还包括判断模块和确定模块;The device according to claim 7, wherein the designated page further comprises a marked area, and correspondingly, the device further comprises a judgment module and a determination module;
    所述判断模块用于判断所述标记区域中是否还有可用标记位,所述标记位用于指示所述地址重映射区域中与所述标记位对应的地址中是否存储有地址映射关系;The judging module is used to judge whether there is an available marker bit in the marker area, and the marker bit is used to indicate whether an address mapping relationship is stored in the address corresponding to the marker bit in the address remapping area;
    所述确定模块用于在所述标记区域中是否还有可用标记位的情况下,根据所述标记区域中的可用标记位确定所述地址重映射区域中的当前可用地址。The determining module is configured to determine a currently available address in the address remapping area according to the available marker bits in the marker area under the condition of whether there are available marker bits in the marker area.
  9. 根据权利要求8所述的装置,其特征在于,所述接收模块还用于接收数据读取请求消息,所述数据读取请求消息用于请求读取所述指定页面中的所述指定地址中的数据;The device according to claim 8, wherein the receiving module is further configured to receive a data read request message, wherein the data read request message is used to request to read the specified address in the specified page The data;
    相应地,所述装置还包括判断模块、确定模块、查询模块和读取模块;Correspondingly, the device further includes a judgment module, a determination module, a query module and a reading module;
    所述判断模块用于判断所述标记区域是否为空;The judging module is used to judge whether the marked area is empty;
    所述确定模块用于在所述标记区域不为空的情况下,根据所述标记区域中表示所述地址重映射区域中对应的地址中已存储地址映射关系的标记位的数量,确定所述地址重映射区域中的结束存储地址,所述结束存储地址为所述地址重映射区域中最后一个已经存储地址映射关系的地址;The determining module is configured to, in the case that the marker area is not empty, determine the marker bit according to the number of marker bits in the marker area indicating that the address mapping relationship has been stored in the address corresponding to the address remapping area. The ending storage address in the address remapping area, the ending storage address is the last address in the address remapping area that has stored the address mapping relationship;
    所述查询模块用于在所述地址重映射区域的起始存储地址至所述结束存储地址之间的存储空间中查询包含所述指定地址的目标地址映射关系,所述起始存储地址为所述地址重映射区域中第一个存储地址映射关系的地址;The query module is configured to query the target address mapping relationship including the specified address in the storage space between the starting storage address and the ending storage address of the address remapping area, where the starting storage address is the specified address. Describe the address of the first storage address mapping relationship in the address remapping area;
    所述读取模块用于根据所述目标地址映射关系读取所述重映射数据区域中所述目标地址中的数据,所述目标地址为所述目标地址映射关系中包含的与所述指定地址具有映射关系的地址;The read module is configured to read the data in the target address in the remapped data area according to the target address mapping relationship, where the target address is the same as the specified address included in the target address mapping relationship. An address with a mapping relationship;
    所述读取模块还用于在所述标记区域不为空的情况下,读取所述指定地址中的数据。The reading module is further configured to read the data in the specified address when the marked area is not empty.
  10. 根据权利要求7所述的装置,其特征在于,所述装置还包括判断模块,用于判断所述地址重映射区域中是否还有可用地址;The device according to claim 7, wherein the device further comprises a judgment module for judging whether there is an available address in the address remapping area;
    相应地,所述写入模块具体用于:Correspondingly, the writing module is specifically used for:
    在所述地址重映射区域中还有可用地址的情况下,将所述指定数据写入所述重映射数据区域中的当前可用地址。In the case where there are still available addresses in the address remapping area, the specified data is written to the currently available address in the remapping data area.
  11. 根据权利要求10所述的装置,其特征在于,所述接收模块还用于接收数据读取请求消息,所述数据读取请求消息用于请求读取所述指定页面中的所述指定地址中的数据;The device according to claim 10, wherein the receiving module is further configured to receive a data read request message, wherein the data read request message is used to request to read the specified address in the specified page The data;
    相应地,所述装置还包括查询模块和读取模块;Correspondingly, the device further includes a query module and a reading module;
    所述查询模块用于在所述地址重映射区域的起始存储地址至所述结束存储地址之间的存储空间中查询包含所述指定地址的目标地址映射关系,所述起始存储地址为所述地址重映射区域中第一个存储地址映射关系的地址,所述结束存储地址为所述地址重映射区域中最后一个已经存储地址映射关系的地址;The query module is configured to query the target address mapping relationship including the specified address in the storage space between the starting storage address and the ending storage address of the address remapping area, where the starting storage address is the specified address. Describe the address of the first storage address mapping relationship in the address remapping area, and the end storage address is the last address in the address remapping area that has stored the address mapping relationship;
    所述读取模块用于根据所述目标地址映射关系读取所述重映射数据区域中所述目标地址中的数据,所述目标地址为所述目标地址映射关系中包含的与所述指定地址具有映射关系的地址。The read module is configured to read the data in the target address in the remapped data area according to the target address mapping relationship, where the target address is the same as the specified address included in the target address mapping relationship. Addresses with mappings.
  12. 根据权利要求9或11所述的装置,其特征在于,所述查询模块具体用于:The device according to claim 9 or 11, wherein the query module is specifically configured to:
    按照从所述结束存储地址开始至所述起始存储地址的顺序,依次读取所述地址重映射区域中每个地址对应的存储空间中存储的地址映射关系,并判断所述每个地址中的地址映射关系中是否为包含所述指定地址的地址映射关系,直到读取到的地址映射关系为所述指定地址的地址映射关系,并将第一次读取到的地址映射关系作为所述目标地址映射关系。According to the sequence from the end storage address to the start storage address, sequentially read the address mapping relationship stored in the storage space corresponding to each address in the address remapping area, and determine the address mapping relationship in each address. Whether the address mapping relationship contains the address mapping relationship of the specified address, until the address mapping relationship read is the address mapping relationship of the specified address, and the address mapping relationship read for the first time is used as the address mapping relationship. Destination address mapping relationship.
  13. 一种闪存的数据处理装置,其特征在于,所述装置包括与存储器耦合的处理器,所述处理器用于执行所述存储器中的程序代码,以实现如权利要求1至6中任一项所述的方法。A data processing device for flash memory, characterized in that the device comprises a processor coupled with a memory, and the processor is configured to execute program codes in the memory, so as to realize the invention as claimed in any one of claims 1 to 6 method described.
  14. 一种计算机可读介质,其特征在于,所述存储介质中存储有计算机程序或指令,当所述计算机程序或指令被处理器执行时,实现如权利要求1至6中任一项所述的方法。A computer-readable medium, characterized in that, a computer program or instruction is stored in the storage medium, and when the computer program or instruction is executed by a processor, the computer program or instruction according to any one of claims 1 to 6 is implemented. method.
  15. 一种芯片,其特征在于,包括逻辑电路和闪存,所述闪存中的页面划分为多个存储区域,所述多个存储区域包括初始数据区域、重映射数据区域和地址重映射区域,所述逻辑电路用于实现如权利要求1至6中任一项所述的方法。A chip, characterized in that it includes a logic circuit and a flash memory, a page in the flash memory is divided into multiple storage areas, the multiple storage areas include an initial data area, a remapping data area and an address remapping area, the A logic circuit is used to implement the method as claimed in any one of claims 1 to 6 .
  16. 一种计算机程序产品,所述计算机程序产品能够在处理器上运行,其特征在于,所述计算机程序产品包含用于实现如权利要求1至6中任一项所述的方法的指令。A computer program product capable of being run on a processor, characterized in that the computer program product contains instructions for implementing the method of any one of claims 1 to 6.
PCT/CN2020/133497 2020-12-03 2020-12-03 Data processing method and data processing apparatus for flash memory WO2022116067A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202080107643.XA CN116547652A (en) 2020-12-03 2020-12-03 Data processing method and data processing device for flash memory
PCT/CN2020/133497 WO2022116067A1 (en) 2020-12-03 2020-12-03 Data processing method and data processing apparatus for flash memory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2020/133497 WO2022116067A1 (en) 2020-12-03 2020-12-03 Data processing method and data processing apparatus for flash memory

Publications (1)

Publication Number Publication Date
WO2022116067A1 true WO2022116067A1 (en) 2022-06-09

Family

ID=81853759

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/133497 WO2022116067A1 (en) 2020-12-03 2020-12-03 Data processing method and data processing apparatus for flash memory

Country Status (2)

Country Link
CN (1) CN116547652A (en)
WO (1) WO2022116067A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117853312A (en) * 2024-01-16 2024-04-09 上海为旌科技有限公司 Method and device for extracting image data from memory
CN118573674A (en) * 2024-08-01 2024-08-30 恒生电子股份有限公司 Data access processing method, device, equipment, storage medium and program product

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101030167A (en) * 2007-01-17 2007-09-05 忆正存储技术(深圳)有限公司 Flash-memory zone block management
US20100174853A1 (en) * 2009-01-08 2010-07-08 Samsung Electronics Co., Ltd. User device including flash and random write cache and method writing data
CN104317753A (en) * 2014-10-21 2015-01-28 中国科学院上海微系统与信息技术研究所 Storage device and data reading-writing method thereof
CN107526535A (en) * 2016-06-22 2017-12-29 伊姆西公司 For managing the method and system of storage system

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101030167A (en) * 2007-01-17 2007-09-05 忆正存储技术(深圳)有限公司 Flash-memory zone block management
US20100174853A1 (en) * 2009-01-08 2010-07-08 Samsung Electronics Co., Ltd. User device including flash and random write cache and method writing data
CN104317753A (en) * 2014-10-21 2015-01-28 中国科学院上海微系统与信息技术研究所 Storage device and data reading-writing method thereof
CN107526535A (en) * 2016-06-22 2017-12-29 伊姆西公司 For managing the method and system of storage system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117853312A (en) * 2024-01-16 2024-04-09 上海为旌科技有限公司 Method and device for extracting image data from memory
CN118573674A (en) * 2024-08-01 2024-08-30 恒生电子股份有限公司 Data access processing method, device, equipment, storage medium and program product

Also Published As

Publication number Publication date
CN116547652A (en) 2023-08-04

Similar Documents

Publication Publication Date Title
JP5597666B2 (en) Semiconductor memory device, information processing system, and control method
TWI592865B (en) Data reading method, data writing method and storage controller using the same
US10698814B2 (en) Data storage devices and data processing methods
US8423709B2 (en) Controller
US9563551B2 (en) Data storage device and data fetching method for flash memory
US10324651B2 (en) Data transmission method, and storage controller and list management circuit using the same
WO2023098032A1 (en) Memory space extension method and apparatus, electronic device, and storage medium
TW201923589A (en) a circuit for accessing at least one non-volatile memory element
TW201926046A (en) Method for accessing flash memory module and associated flash memory controller and electronic device
US20160124639A1 (en) Dynamic storage channel
TWI785876B (en) Mapping information recording method, memory control circuit unit and memory storage device
TWI749279B (en) A data storage device and a data processing method
US8185687B2 (en) Semiconductor storage device and method of controlling semiconductor storage device
CN115756312A (en) Data access system, data access method, and storage medium
WO2022116067A1 (en) Data processing method and data processing apparatus for flash memory
TWI762275B (en) Method for performing access management of memory device with aid of dedicated bit information, memory device, electronic device, controller of memory device, and host device
JP2011203809A (en) Data processing method, program, and system
CN110362509B (en) Unified address conversion method and unified address space
US10236066B2 (en) Method of managing semiconductor memories, corresponding interface, memory and device
US20240264946A1 (en) Memory controller, method of driving memory controller, and memory system
TWI860033B (en) Method for performing data access management of memory device in predetermined communications architecture with aid of unbalanced table regions, memory controller of memory device, memory device, and electronic device
CN117632809B (en) Memory controller, data reading method and memory device
US12189551B2 (en) Computing system for determining resource to perform operation on data and operating method thereof
TWI852599B (en) Memory device, flash memory controller and associated control method
TWI734370B (en) Data merging method, memory control circuit unit and memory storage device for flash memory

Legal Events

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

Ref document number: 20963915

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 202080107643.X

Country of ref document: CN

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20963915

Country of ref document: EP

Kind code of ref document: A1

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载