WO2017215137A1 - 一种数据处理方法、装置及系统 - Google Patents

一种数据处理方法、装置及系统 Download PDF

Info

Publication number
WO2017215137A1
WO2017215137A1 PCT/CN2016/099004 CN2016099004W WO2017215137A1 WO 2017215137 A1 WO2017215137 A1 WO 2017215137A1 CN 2016099004 W CN2016099004 W CN 2016099004W WO 2017215137 A1 WO2017215137 A1 WO 2017215137A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
address
memory card
cold data
controller
Prior art date
Application number
PCT/CN2016/099004
Other languages
English (en)
French (fr)
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 US15/568,011 priority Critical patent/US10545808B2/en
Priority to EP16897479.8A priority patent/EP3377965B1/en
Publication of WO2017215137A1 publication Critical patent/WO2017215137A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0751Error or fault detection not based on redundancy
    • G06F11/0754Error or fault detection not based on redundancy by exceeding limits
    • G06F11/076Error or fault detection not based on redundancy by exceeding limits by exceeding a count or rate limit, e.g. word- or bit count limit
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/0703Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation
    • G06F11/0706Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment
    • G06F11/0727Error or fault processing not based on redundancy, i.e. by taking additional measures to deal with the error or fault not making use of redundancy in operation, in hardware, or in data representation the processing taking place on a specific hardware platform or in a specific software environment in a storage system, e.g. in a DASD or network based storage system
    • 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/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • G06F12/0238Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory
    • G06F12/0246Memory management in non-volatile memory, e.g. resistive RAM or ferroelectric memory in block erasable memory, e.g. flash memory
    • 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
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/061Improving I/O performance
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0602Interfaces specially adapted for storage systems specifically adapted to achieve a particular effect
    • G06F3/0614Improving the reliability of storage systems
    • G06F3/0616Improving the reliability of storage systems in relation to life time, e.g. increasing Mean Time Between Failures [MTBF]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0629Configuration or reconfiguration of storage systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0638Organizing or formatting or addressing of data
    • G06F3/064Management of blocks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • G06F3/0658Controller construction arrangements
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0628Interfaces specially adapted for storage systems making use of a particular technique
    • G06F3/0655Vertical data movement, i.e. input-output transfer; data movement between one or more hosts and one or more storage devices
    • G06F3/0659Command handling arrangements, e.g. command buffers, queues, command scheduling
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/06Digital input from, or digital output to, record carriers, e.g. RAID, emulated record carriers or networked record carriers
    • G06F3/0601Interfaces specially adapted for storage systems
    • G06F3/0668Interfaces specially adapted for storage systems adopting a particular infrastructure
    • G06F3/0671In-line storage system
    • G06F3/0673Single storage device
    • G06F3/0679Non-volatile semiconductor memory device, e.g. flash memory, one time programmable memory [OTP]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/10Providing a specific technical effect
    • G06F2212/1016Performance improvement
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/10Providing a specific technical effect
    • G06F2212/1016Performance improvement
    • G06F2212/1024Latency reduction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/10Providing a specific technical effect
    • G06F2212/1032Reliability improvement, data loss prevention, degraded operation etc
    • G06F2212/1036Life time enhancement
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/17Embedded application
    • G06F2212/171Portable consumer electronics, e.g. mobile phone
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/72Details relating to flash memory management
    • G06F2212/7201Logical to physical mapping or translation of blocks or pages
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/72Details relating to flash memory management
    • G06F2212/7205Cleaning, compaction, garbage collection, erase control
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/72Details relating to flash memory management
    • G06F2212/7211Wear leveling

Definitions

  • the present application relates to the field of data processing technologies, and in particular, to a data processing method, apparatus, and system.
  • a solid state memory card refers to a card that uses a flash memory chip (for example, Nand Flash, etc.) as a storage medium.
  • flash memory chip for example, Nand Flash, etc.
  • memory cards have been widely used in various electronic devices (for example, network cameras, notebook computers, handheld game consoles, etc.), and electronic devices can read and write data on the memory card.
  • the data read and write operations of the memory card are based on physical pages (referred to as "pages").
  • pages There are unbalanced operations when storing and reading data, that is, the frequency of reading data on different pages of the memory card is different.
  • the data with higher reading frequency but lower writing frequency is called cold data, and the cold data has higher reading frequency and lower writing frequency, which is not conducive to the balanced utilization of the storage space in the memory card;
  • the storage particles store data by electric charge. When the number of data reading reaches a certain level, the reading failure occurs, resulting in a change in the stored charge, that is, when the number of readings of the cold data reaches a certain level. It is easy to see that the data cannot be read (that is, the read fails). It can be seen that it is very necessary to process the cold data in the memory card (such as data transfer).
  • the electronic device needs to scan the data in the memory card by using the mapping relationship of the FTL (Flash Translation Layer) algorithm before the cold data processing, and determine whether the scanned data is cold data, and then judge according to the judgment.
  • the cold data in the memory card is processed.
  • the process of scanning the data in the memory card and judging whether it is cold data often requires a large amount of calculation, and the scanning and judgment of the cold data is realized by the FTL in the memory card.
  • the read and write operations on the data in the memory card also need to be implemented by FTL. Therefore, the scanning and judging of the cold data increases the calculation amount of the memory card, and reduces the read and write performance of the memory card.
  • the purpose of the embodiment of the present application is to provide a data processing method, device, and system, so as to reduce the calculation amount of the memory card, thereby improving the data read and write performance of the memory card.
  • the embodiment of the present application discloses a data processing method, which is applied to an electronic device, where the electronic device is connected to a memory card, and the memory card has been subjected to a private formatting process in advance, and the memory card includes At least one cold data area, the method comprising:
  • the method further includes:
  • the start address and the end address of the stored data in the target cold data area C are sent to the controller of the memory card, and the number of readings C R and the number of writes C W are Initializing, respectively, to cause the controller to process the stored data according to the start address and the termination address.
  • the memory card further includes at least one hot data area.
  • the method further includes:
  • the controller processes the stored data according to the start address and the termination address, including:
  • the controller converts the start address and the end address into their corresponding physical start addresses and physical end addresses respectively according to a mapping relationship between a logical address and a physical address provided by the flash translation layer FTL; Release a sequence of block storage spaces in the memory card, and move data corresponding to the physical start address and the physical termination address to the released block storage space, and according to the current physical start address of the moved data
  • the mapping relationship is updated with a physical termination address.
  • the sending to the controller of the memory card, the start address and the end address of the stored data in the target cold data area C, including:
  • the cold data processing table is sent to the controller.
  • the cold data processing table includes: a header identifier and a footer identifier;
  • the controller processes the stored data according to the start address and the termination address, including:
  • the controller determines, according to the header identifier and the footer identifier, whether the cold data processing table is valid; if valid, processes the stored data corresponding to the start address and the termination address.
  • the cold data processing table includes: a priority corresponding to the cold data, wherein the priority is determined according to the number of writes C W ;
  • the controller processes the stored data according to the start address and the termination address, including:
  • the controller processes the stored data corresponding to the start address and the termination address according to the priority.
  • an embodiment of the present application further discloses a data processing apparatus, which is applied to an electronic device, where the electronic device is connected to a memory card, and the memory card has been subjected to a private formatting process in advance, and the memory card is in the memory card.
  • the apparatus includes:
  • a reading number obtaining unit configured to obtain a reading number C R of the stored data in the locally stored target cold data area C;
  • the reading times determining unit is configured to determine whether the reading frequency C R reaches a preset cold data reading failure number threshold T CR ;
  • An information sending unit configured to send, to the controller of the memory card, the start address and the end address of the stored data in the target cold data area C, in a case that the result of the number determining unit is YES, and The number of reads C R is initialized such that the controller processes the stored data according to the start address and the termination address.
  • the device further includes:
  • a first write count obtaining unit configured to obtain, in the case where the read count determining unit determines that the result is negative, the number of writes C W of the data in the target cold data area C stored locally;
  • a first write count determining unit configured to determine whether the write count C W is less than a preset first cold data write count threshold T CW1 , and if yes, triggering the information sending unit;
  • the information sending unit is specifically configured to:
  • the memory card further includes at least one hot data area
  • the device further includes:
  • a second write count obtaining unit configured to obtain, in the case where the read count determining unit determines that the result is negative, the locally written number of writes C W of the data in the target cold data area C and the target hot data area Number of writes of data in H H W ;
  • the second write count determining unit is configured to determine whether the write count H W reaches a preset hot data write count threshold T HW ; if the hot data write count threshold T HW is reached, determine the write Whether the number CW is less than a preset second cold data write count threshold T CW2 , and if yes, triggering the information sending unit;
  • the information sending unit is specifically configured to:
  • an embodiment of the present application further discloses a data processing system, where the system includes: an electronic device and a memory card, the electronic device is connected to the memory card, and the memory card has been pre-private formatted. Processing, and the memory card includes at least one cold data area:
  • the electronic device is configured to obtain a read count C R of the stored data in the locally stored target cold data area C; and determine whether the read count C R reaches a preset cold data read failure number threshold T CR ; If yes, the start address and the end address of the stored data in the target cold data area C are sent to the controller of the memory card, and the number of readings C R is initialized;
  • the memory card includes a controller for processing the stored data according to the start address and the termination address.
  • controller is specifically configured to:
  • the electronic device is specifically configured to generate a cold data processing table including the start address and the termination address; and send the cold data processing table to the controller.
  • the cold data processing table further includes: a header identifier and a footer identifier;
  • the controller is specifically configured to:
  • the cold data processing table further includes: a priority corresponding to the cold data, wherein the priority is determined according to the number of writes C W ;
  • the controller is specifically configured to:
  • the data corresponding to the start address and the end address is processed according to the priority.
  • an embodiment of the present application discloses an electronic device, where the electronic device includes:
  • processor a memory, a communication interface, and a bus
  • the processor, the memory, and the communication interface are connected by the bus and complete communication with each other;
  • the memory stores executable program code
  • the processor by reading the executable program code stored in the memory, runs a program corresponding to the executable program code for executing the data processing method described in the embodiments of the present application.
  • the embodiment of the present application discloses an application program, which is used to execute the data processing method described in the embodiment of the present application at runtime.
  • the embodiment of the present application discloses a storage medium, where the storage medium is used to store an application, and the application is used to execute the data processing method described in the embodiment of the present application.
  • the electronic device obtains the number of times C R of the stored data in the target cold data area C stored locally, and the number of readings C R reaches the preset threshold of the number of failed cold data readings.
  • the data stored in the target cold data area C is the data to be processed, and the start address and the end address of the stored data in the target cold data area C are sent to the controller of the memory card, and will be read.
  • the number of acquisitions C R is initialized, and the controller processes the stored data according to the start address and the termination address.
  • the scanning and judging of the cold data are completed by the electronic device, and the memory card only needs to process the data, which reduces the calculation amount of the memory card, thereby improving the data reading and writing performance of the memory card.
  • FIG. 1 is a schematic structural diagram of a data processing system according to an embodiment of the present application
  • FIG. 3 is a schematic flowchart diagram of a data processing method according to an embodiment of the present disclosure
  • FIG. 4 is a schematic flowchart diagram of another data processing method according to an embodiment of the present disclosure.
  • FIG. 5 is a schematic flowchart diagram of another data processing method according to an embodiment of the present disclosure.
  • FIG. 6 is a schematic structural diagram of a data processing apparatus according to an embodiment of the present application.
  • FIG. 7 is a schematic structural diagram of another data processing apparatus according to an embodiment of the present disclosure.
  • FIG. 8 is a schematic structural diagram of another data processing apparatus according to an embodiment of the present disclosure.
  • FIG. 9 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
  • FIG. 1 is a schematic structural diagram of a data processing system according to an embodiment of the present disclosure.
  • the system includes: an electronic device 101 and a memory card 102.
  • the electronic device 101 is connected to the memory card 102, and the memory card 102 is pre-private. Formatting processing, and the memory card 102 includes at least one cold data area;
  • the electronic device 101 is configured to obtain a read count C R of the stored data in the locally stored target cold data area C, and determine whether the read count C R reaches a preset cold data read failure threshold T CR ; Yes, the start address and the end address of the stored data in the target cold data area C are sent to the controller of the memory card 102, and the number of readings C R is initialized;
  • the electronic device 101 may be a webcam.
  • the webcam is first privately formatted before storing data in a memory card connected thereto. The memory card then creates a cold data area in the memory card in a fixed write mode.
  • an operating system provider usually develops a corresponding formatted manner in combination with the characteristics of its operating system and provides it to the user.
  • the commonly used formatting method is Microsoft.
  • the memory card can be privately formatted in consideration of various characteristics of various application scenarios and data security and the like.
  • private formatting can be understood as: the formatted mode developed by the developer according to the specific situation, which can be improved by the developer based on the format provided by the operating system provider, or It is developed by the developer itself, and this application does not limit it.
  • the above private format may be compatible with the format provided by the operating system provider, or may not be compatible with the format provided by the operating system provider, which is not limited in this application.
  • the cold data area is used to store cold data.
  • the writing manners of different electronic devices 101 are different, but the writing manner of the same electronic device 101 is fixed.
  • the electronic device 101 can determine the number of updates and the update frequency of the stored data in the cold data area created in the memory card according to a fixed writing manner, and the number of times of reading and the reading frequency of the stored data in the cold data area, and the like.
  • the initialization of the number of readings C R may be performed by setting the number of readings C R to zero.
  • the memory card 102 includes a controller for processing the stored data in accordance with a start address and a termination address.
  • the controller is specifically configured to:
  • the start address and the end address are respectively converted into their corresponding physical start addresses and physical end addresses; according to the release of the block storage space in the memory card In the order, the data corresponding to the physical start address and the physical end address is moved to the released block storage space, and the mapping relationship is updated according to the current physical start address and physical termination address of the moved data.
  • the electronic device 101 is specifically configured to:
  • a cold data processing table containing a start address and a stop address is generated; the cold data processing table is sent to the controller of the memory card 102 by a private instruction conforming to the SD card protocol.
  • the cold data processing table may further include: a header identifier and a footer identifier;
  • the above controller is specifically used to:
  • the cold data processing table is determined to be valid according to the header identifier and the footer identifier; if valid, the data corresponding to the start address and the end address is processed.
  • the cold data processing table may further include: a priority corresponding to the cold data, wherein the priority is determined according to the number of writes C W of the data in the target cold data area C;
  • the above controller is specifically used to:
  • the cold data corresponding to the start address and the end address is processed according to the priority.
  • FIG. 2 is a system block diagram of an embodiment of the present application.
  • the network camera 100 is provided with an SD/MMC (Secure Digital/Multi Media Card) interface, and the memory card 200 is connected to the SD/MMC interface of the network camera 100 through a bus. Connected to the network camera 100.
  • SD/MMC Secure Digital/Multi Media Card
  • the network camera 100 can privately format the memory card before storing the data in the memory card 200 connected thereto, so that the cold data area can be created in the memory card 200 in a fixed write manner.
  • the network camera 100 can analyze the data stored in the memory card 200 by the private format to obtain a cold data table, and then send the private instruction including the cold data table to the memory card 200 through the SD/MMC interface, and the memory card 200 The cold data is processed based on the information in the cold data table.
  • the electronic device obtains the number of times C R of the stored data in the target cold data area C stored locally, and reaches the preset cold data read failure threshold T CR at the number of readings C R .
  • the data stored in the target cold data area C is the data to be processed, and the start address and the end address of the stored data in the target cold data area C are sent to the controller of the memory card, and the number of readings is performed.
  • C R is initialized, and the controller processes the stored data according to the start address and the end address.
  • the scanning and judging of the cold data are completed by the electronic device, and the memory card only needs to process the data, thereby reducing the calculation amount of the memory card, thereby improving the data reading and writing performance of the memory card.
  • FIG. 3 is a schematic flowchart diagram of a data processing method according to an embodiment of the present disclosure.
  • the method is applied to an electronic device, where the electronic device is connected to a memory card, and the memory card is pre-privately formatted and stored.
  • the card includes at least one cold data area.
  • the method includes the following steps:
  • each time the stored data in the cold data area is read the number of reads for the stored data is incremented by one.
  • the problem that the data is unreadable due to excessive wear of the memory card after the number of times of reading a certain data is reached is reached, and a cold data read failure threshold T CR is set in the electronic device.
  • the read count C R of a data reaches the preset cold data read failure threshold threshold T CR , the data is processed.
  • S303 Send the start address and the end address of the stored data in the target cold data area C to the controller of the memory card, and initialize the read count C R .
  • initialization can be understood as zeroing.
  • the controller of the memory card can process the stored data corresponding to the start address and the end address according to the received start address and end address.
  • the electronic device sets the number of readings C R to zero, and prevents the number of readings of the stored data from being acquired next time from being affected by the number of readings C R obtained this time, and accumulating the number of statistical readings C R , causing the controller to
  • data processing is performed, the same data is processed (such as moving data), which increases the workload of the controller and reduces the service life of the memory card.
  • the controller that sends the start address and the end address of the stored data in the target cold data area C to the memory card may include:
  • the cold data processing table should not be too large (such as a cold data processing table size of 512 bytes), so that the electronic device can quickly transfer the cold data processing table to the memory card.
  • the communication between the electronic device and the memory card can adopt segmented communication, that is, when the performance of the electronic device is good, the cold data processing table transmitted to the memory card is increased, so that the memory card can be processed. More data; when the performance of the electronic device is poor, the cold data processing table transmitted to the memory card is reduced, so that the memory card processes less data.
  • the cold data processing table may further include: a header identifier, a footer identifier, and a priority corresponding to the cold data.
  • the priority is determined according to the number of writes C W of the data in the target cold data area C, and the smaller the number of writes C W is , the higher the priority of the cold data can be understood.
  • the controller of the memory card may first determine whether the cold data processing table is valid according to the header identifier and the footer identifier before processing the data; if valid, if The data corresponding to the start address and the end address is processed.
  • the header identifier and the footer identifier are in inverse relationship, so as to verify whether the cold data processing table is valid. For example, if the hexadecimal header identifier is 1, then the footer identifier should be E.
  • the header identifier Tabel_Head_Flag is: 0x13245768ACBD09FE
  • the footer identifier Table_Tail_Flag is: 0xECDBA8975342F601
  • the controller of the memory card can process the data corresponding to the start address and the end address according to the priority of each data.
  • the cold data processing table includes two pieces of cold data X and Y, X has a priority of 1, Y has a priority of 2, and priority 1 is greater than priority 2, so X is processed first and then Y is processed.
  • C w the number of writes high priority data is small, the high priority data priority, to better ensure that wear leveling memory card.
  • the cold data table may further include other information, such as video data, picture data, index, log information, etc., specifically, refer to Table 1, and the cold data table shown in Table 1 is composed of 512 bytes, including: Header identification (8 bytes), 62 cold data strips (each cold data strip includes: starting point Address (4 bytes), termination address (4 bytes), priority (4 bytes), other information (recorded data, picture data, index, log information) (4 bytes)), footer identification (8 words) Section).
  • the mapping between the logical address and the physical address is stored in the FTL of the controller of the memory card.
  • the process of processing the data by the controller may be:
  • the received start address and the end address are respectively converted into corresponding physical start addresses and physical end addresses;
  • the start address and the end address of the controller sent by the electronic device to the memory card are logical addresses.
  • the memory card needs to convert the received logical address into a physical address, thereby obtaining the storage area corresponding to the physical address. Corresponding data.
  • the storage space in the memory card is stored in the form of a block, and its storage space is released by one block storage space and one block storage space instead of releasing all the block storage space at one time.
  • A, B, and C in the current memory card.
  • the memory card releases A first, then releases C, and finally releases.
  • B then the data corresponding to the physical start address and the physical end address is moved to A first, then moved to C, and finally moved to B.
  • the change of the correspondence between the logical address and the physical address needs to update the mapping relationship between the logical address and the physical address stored in the FTL, so that when the data is processed again, the required data can be accurately obtained.
  • a block storage space can be understood as: a cold data area or a hot data area.
  • the problem that the data cannot be read is related not only to the number of times the data is read but also to the number of times the data is written.
  • the present application provides another data processing method, which can be referred to. 4 is applied to an electronic device, and the method includes the following steps:
  • each time data is written in the cold data area the number of writes C W for the data is increased by 1, which can also be understood as the number of writes C W for the cold data area C. plus 1.
  • S401 may occur before any of steps S301 and S302, or may occur after any of steps S301 and S302, or may occur simultaneously with any of steps S301 and S302.
  • the application does not limit this.
  • S401 and S402 and S403 are executed to determine whether the data is data that needs to be processed, and the electronic device can be effectively reduced. The amount of work.
  • S402 determining whether the number of writes C W is less than a preset first cold data write count threshold T CW1 , and if so, executing S403;
  • the data with higher reading frequency and lower writing frequency is called cold data. Therefore, when determining the cold data to be processed, the threshold value of the first cold data writing threshold T CW1 should not be too high, which can Take values in the range of [0,5].
  • the number of writes C W is not less than the preset first cold data write count threshold T CW1 , it can be considered that the usage of each storage area of the current memory card is relatively balanced, and no The data of the cold data area is processed, and the number of times of reading C R and the number of times of writing C W are respectively initialized, so as to avoid the number of readings of the stored data to be obtained next time by the number of readings C R and the number of times of writing C obtained this time.
  • S403 Send the start address and the end address of the stored data in the target cold data area C to the controller of the memory card, and initialize the read count C R and the write count C W respectively.
  • the controller of the memory card can process the stored data corresponding to the start address and the end address according to the received start address and end address.
  • the electronic device also needs to initialize both the number of readings C R and the number of writes C W .
  • the memory card may include at least one cold data area, and may further include at least one hot data area.
  • the hot data area in order to avoid the problem that data cannot be read, it is necessary to balance the hot data area and the cold data.
  • FIG. 5 is a schematic flowchart of another data processing method according to an embodiment of the present disclosure. The method includes the following steps:
  • each time data is written in the hot data area the number of writes H W for the data is increased by 1, which can also be understood as the number of writes H W for the hot data area H. plus 1.
  • S501 may occur before any of steps S301 and S302, or may occur after any of steps S301 and S302, and may also occur simultaneously with any of steps S301 and S302.
  • the application does not limit this.
  • the execution of 501 and S502 , S503 , and S504 to determine whether the data is data to be processed can be effectively reduced.
  • S502 determining whether the number of writes H W reaches a preset number of hot data write thresholds T HW , and if so, executing S503;
  • Hot data Data with a higher write frequency is called hot data. If the number of writes H W of the hot data stored in the hot data area is small, the update frequency of the hot data area is low, and the wear condition of each storage area of the current memory card is relatively balanced with respect to the memory card, and the storage is not correct.
  • the cold data in the card is processed, and the memory card does not have the problem that some storage areas cannot read data, so the cold data can be processed without being processed, thereby reducing the workload of the memory card.
  • the value of the hot data write threshold T HW should not be too high, and it can take values in the range of [6, 10].
  • the data of the area is processed, and the number of times of reading C R , the number of times of writing C W , and the number of times of writing H W are respectively set to zero, so as to avoid the number of readings of the stored data to be obtained next time by the number of readings obtained this time C R
  • the number of write times C W and the number of writes H W , the cumulative number of statistical reads C R , the number of writes C W , and the number of writes H W cause the controller to process the same data every time data is processed. Increase the workload of the controller and reduce the service life of the memory card due to excessive processing of data (such as moving data).
  • S503 determining whether the number of writes C W is less than a preset second cold data write count threshold T CW2 ; if yes, executing S504;
  • the second cold data write count threshold T CW2 and the first cold data write count threshold T CW1 may be the same or different, and are not limited herein.
  • the wear condition of each storage area of the current memory card is relatively balanced, and no cold data is needed.
  • the data of the area is processed, and the number of readings C R , the number of writes C W , and the number of writes H W are initialized, respectively.
  • S504 Send the start address and the end address of the stored data in the target cold data area C to the controller of the memory card, and initialize the read count C R , the write count C W and the write count H W , respectively.
  • the controller of the memory card can process the stored data corresponding to the start address and the end address according to the received start address and end address.
  • the electronic device also needs to initialize the number of readings C R , the number of writes C W , and the number of writes H W .
  • the electronic device obtains the number of readings C R of the stored data in the locally stored target cold data area C, and the reading frequency C R reaches the preset cold data read failure threshold threshold T CR .
  • the controller processes the stored data according to the start address and the end address.
  • the scanning and judging of the cold data are completed by the electronic device, and the memory card only needs to process the data, which reduces the calculation amount of the memory card, thereby improving the data reading and writing performance of the memory card.
  • FIG. 6 is a schematic structural diagram of a data processing apparatus according to an embodiment of the present disclosure, which is applied to an electronic device, where an electronic device is connected to a memory card, and the memory card is pre-privately formatted, and the memory card includes at least A cold data area, the device includes:
  • the number-of-reads obtaining unit 601 is configured to obtain the number of times C R of the stored data in the locally stored target cold data area C;
  • the reading times determining unit 602 is configured to determine whether the reading frequency C R reaches a preset cold data reading failure number threshold T CR ;
  • the information transmitting unit 603 is configured to: when the result of the number determining unit determines that the result is YES, send the start address and the end address of the stored data in the target cold data area C to the controller of the memory card, and read the number of times C R is initialized so that the controller processes the stored data based on the start address and the end address.
  • the problem that the data cannot be read is related not only to the number of times the data is read but also to the number of times the data is written.
  • the present application provides another data processing device, which can be referred to.
  • FIG. 7 is applied to an electronic device, and the device may further include:
  • the first write count obtaining unit 701 is configured to obtain the number of writes C W of data in the locally stored target cold data area C when the read count determination unit determines that the result is negative;
  • the first write count determining unit 702 is configured to determine whether the write count C W is less than a preset first cold data write count threshold T CW1 , and if so, the trigger information sending unit 603;
  • the information sending unit 603 is specifically configured to:
  • the memory card may include at least one cold data area, and may further include at least one hot data area.
  • the memory card in order to avoid the problem that data cannot be read, it is necessary to balance the hot data area and the cold data.
  • the number of reading and writing of data stored in the area specifically can refer to Figure 8, 8 is a schematic structural diagram of another data processing apparatus according to an embodiment of the present disclosure, which is applied to an electronic device, and the apparatus may further include:
  • the second write count obtaining unit 801 is configured to obtain, in the case where the read count determination unit determines that the result is NO, the number of writes C W of the data in the locally stored target cold data area C and the data in the target hot data area H. Number of writes H W ;
  • a second write count determination unit 802 configured to judge whether the write count H W reaches a preset threshold number of data writes thermal T HW; if the number of writes reaches a thermal threshold data T HW, it is determined whether the write count C W The second cold data write times threshold T CW2 is less than the preset, if yes, the trigger information sending unit 603;
  • the information sending unit 603 is specifically configured to:
  • the stored data is processed according to the start address and the end address.
  • the electronic device obtains the number of readings C R of the stored data in the locally stored target cold data area C, and the reading frequency C R reaches the preset cold data read failure threshold threshold T CR .
  • the controller processes the stored data according to the start address and the end address.
  • the scanning and judging of the cold data are completed by the electronic device, and the memory card only needs to process the data, which reduces the calculation amount of the memory card, thereby improving the data reading and writing performance of the memory card.
  • the embodiment of the present application further provides an electronic device, where the electronic device is connected to a memory card, the memory card has been subjected to a private formatting process in advance, and the memory card includes at least one cold data area, the electronic device Equipment includes:
  • processor 910 a processor 910, a memory 920, a communication interface 930, and a bus 940;
  • the processor 910, the memory 920, and the communication interface 930 are connected by the bus 940 and complete communication with each other;
  • the memory 920 stores executable program code
  • the processor 910 is shipped by reading executable program code stored in the memory 920. Executing a program corresponding to the executable program code for execution:
  • the electronic device exists in a variety of forms including, but not limited to:
  • Mobile communication devices These devices are characterized by mobile communication functions and are mainly aimed at providing voice and data communication.
  • Such terminals include: smart phones (such as iPhone), multimedia phones, functional phones, and low-end phones.
  • Ultra-mobile personal computer equipment This type of equipment belongs to the category of personal computers, has computing and processing functions, and generally has mobile Internet access.
  • Such terminals include: PDAs, MIDs, and UMPC devices, such as the iPad.
  • Portable entertainment devices These devices can display and play multimedia content. Such devices include: audio, video players (such as iPod), handheld game consoles, e-books, and smart toys and portable car navigation devices.
  • the server consists of a processor, a hard disk, a memory, a system bus, etc.
  • the server is similar to a general-purpose computer architecture, but because of the need to provide highly reliable services, processing power and stability High reliability in terms of reliability, security, scalability, and manageability.
  • the electronic device obtains the number of times C R of the stored data in the target cold data area C stored locally, and the number of readings C R reaches the preset threshold of the number of failed cold data readings.
  • the data stored in the target cold data area C is the data to be processed, and the start address and the end address of the stored data in the target cold data area C are sent to the controller of the memory card, and will be read.
  • the number of acquisitions C R is initialized, and the controller processes the stored data according to the start address and the termination address.
  • the scanning and judging of the cold data are completed by the electronic device, and the memory card only needs to process the data, which reduces the calculation amount of the memory card, thereby improving the data reading and writing performance of the memory card.
  • the embodiment of the present application further provides an application, where the application is used to execute the data processing method in the embodiment of the present application at runtime;
  • the data processing method is applied to an electronic device, the electronic device is connected to a memory card, the memory card has been subjected to a private formatting process in advance, and the memory card includes at least one cold data area, wherein the method include:
  • the electronic device obtains the number of readings C R of the stored data in the locally stored target cold data area C by executing the above application program, and reaches the preset cold data in the reading frequency C R .
  • the failure number threshold T CR is read, it may be determined that the stored data in the target cold data area C is the data to be processed, and the start address and the end address of the stored data in the target cold data area C are sent to the memory card.
  • the controller initializes the number of reads C R , and the controller processes the stored data according to the start address and the end address.
  • the scanning and judging of the cold data are completed by the electronic device, and the memory card only needs to process the data, which reduces the calculation amount of the memory card, thereby improving the data reading and writing performance of the memory card.
  • the embodiment of the present application further provides a storage medium, where the storage medium is used to execute an application, and the application is used to execute the data processing method described in the embodiment of the present application;
  • the data processing method is applied to an electronic device, the electronic device is connected to a memory card, the memory card has been subjected to a private formatting process in advance, and the memory card includes at least one cold data area, wherein the method include:
  • the electronic device obtains the number of times C R of the stored data in the locally stored target cold data area C by executing the application stored in the storage medium, and the number of readings C R is reached.
  • the preset cold data read failure threshold threshold T CR it may be determined that the stored data in the target cold data area C is the data to be processed, and the start address and termination of the stored data in the target cold data area C.
  • the address is sent to the controller of the memory card, the number of readings C R is initialized, and the controller processes the stored data according to the start address and the end address.
  • the scanning and judging of the cold data are completed by the electronic device, and the memory card only needs to process the data, which reduces the calculation amount of the memory card, thereby improving the data reading and writing performance of the memory card.
  • the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Quality & Reliability (AREA)
  • Techniques For Improving Reliability Of Storages (AREA)
  • Control Of Vending Devices And Auxiliary Devices For Vending Devices (AREA)

Abstract

一种数据处理方法、装置及系统,该方法应用于电子设备(101),电子设备(101)与存储卡(102)连接,存储卡(102)已预先进行私有格式化处理,且存储卡(102)中包括至少一个冷数据区,该方法包括:获得本地存储的目标冷数据区C中已存储数据的读取次数C R(S301);判断读取次数C R是否达到预设的冷数据读取失效次数阈值T CR(S302);如果是,则将目标冷数据区C中已存储数据的起始地址和终止地址发送给存储卡(102)的控制器,并将读取次数C R初始化(S303),该控制器根据起始地址和终止地址对该已存储数据进行处理。从而降低了存储卡(102)的计算量,提高了存储卡(102)的数据读写性能。

Description

一种数据处理方法、装置及系统
本申请要求于2016年6月14日提交中国专利局、申请号为201610417424.7发明名称为“一种数据处理方法、装置及系统”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及数据处理技术领域,特别是涉及一种数据处理方法、装置及系统。
背景技术
固态存储卡(简称“存储卡”),是指使用快闪存储器芯片(例如,Nand Flash等)作为存储介质的卡片。目前,存储卡已广泛应用于各种电子设备(例如,网络摄像机、笔记本电脑、掌上游戏机等),电子设备可对存储卡中的数据进行读写操作。
存储卡的数据读写操作是以物理页(简称“页”)为单位的,其在存储和读取数据时会存在不均衡操作,即存储卡在不同页中读取数据的频繁程度是不同的,其中,读取频率较高但写入频率较低的数据被称为冷数据,冷数据由于读取频率较高但写入频率较低,不利于存储卡中存储空间的均衡利用;另外,存储颗粒是通过电荷来存储数据的,当数据读取次数达到一定程度之后就会出现读取失效的现象,导致存储电荷发生变化,也就是说,当冷数据的读取次数达到一定程度后容易出现数据无法读取(即读取失效)的问题,可见,对存储卡中的冷数据进行处理(如数据搬移等)是非常必要的。
现有技术中,电子设备需要在冷数据处理前先利用FTL(Flash Translation Layer,快闪转换层)算法的映射关系扫描存储卡中的数据并判断所扫描的数据是否为冷数据,然后根据判断结果对存储卡中的冷数据进行处理,然而,扫描存储卡中的数据并判断是否为冷数据的过程往往需要进行大量的计算,且冷数据的扫描与判断又是通过存储卡中FTL实现的,而对存储卡中数据的读写操作也需要通过FTL实现,因此,冷数据的扫描与判断增大了存储卡的计算量,降低了存储卡对数据的读写性能。
发明内容
本申请实施例的目的在于提供一种数据处理方法、装置及系统,以降低存储卡的计算量,从而提高存储卡的数据读写性能。
为达到上述目的,本申请实施例公开了一种数据处理方法,应用于电子设备,所述电子设备与存储卡连接,所述存储卡已预先进行私有格式化处理,且所述存储卡中包括至少一个冷数据区,所述方法包括:
获得本地存储的目标冷数据区C中已存储数据的读取次数CR
判断所述读取次数CR是否达到预设的冷数据读取失效次数阈值TCR
如果是,则将所述目标冷数据区C中已存储数据的起始地址和终止地址发送给所述存储卡的控制器,并将所述读取次数CR初始化,以使得所述控制器根据所述起始地址和所述终止地址对所述已存储数据进行处理。
可选地,在判定所述读取次数CR未达到预设的冷数据读取失效次数阈值TCR的情况下,所述方法还包括:
获得本地存储的所述目标冷数据区C中数据的写入次数CW
判断所述写入次数CW是否小于预设的第一冷数据写入次数阈值TCW1
如果是,则将所述目标冷数据区C中已存储数据的起始地址和终止地址发送给所述存储卡的控制器,并将所述读取次数CR和所述写入次数CW分别初始化,以使得所述控制器根据所述起始地址和所述终止地址对所述已存储数据进行处理。
可选地,所述存储卡中还包括至少一个热数据区,在判定所述读取次数CR未达到预设的冷数据读取失效次数阈值TCR的情况下,所述方法还包括:
获得本地存储的所述目标冷数据区C中数据的写入次数CW和目标热数据区H中数据的写入次数HW
判断所述写入次数HW是否达到预设的热数据写入次数阈值THW
如果达到所述热数据写入次数阈值THW,则判断所述写入次数CW是否小于预设的第二冷数据写入次数阈值TCW2
如果不小于所述第二冷数据写入次数阈值TCW2,则将所述目标冷数据区C中已存储数据的起始地址和终止地址发送给所述存储卡的控制器,并将所述读取次数CR、所述写入次数CW和所述写入次数HW分别初始化,以使得所述控制器根据所述起始地址和所述终止地址对所述已存储数据进行处理。
可选地,所述控制器根据所述起始地址和所述终止地址对所述已存储数据进行处理,包括:
所述控制器基于快闪转换层FTL提供的逻辑地址和物理地址之间的映射关系,将所述起始地址和所述终止地址分别转换为其对应的物理起始地址和物理终止地址;按照释放所述存储卡中块存储空间的先后顺序,将所述物理起始地址和所述物理终止地址对应的数据搬移至被释放的块存储空间中,并按照被搬移数据当前的物理起始地址和物理终止地址更新所述映射关系。
可选地,所述将所述目标冷数据区C中已存储数据的起始地址和终止地址发送给所述存储卡的控制器,包括:
生成包含所述起始地址和所述终止地址的冷数据处理表;
将所述冷数据处理表发送至所述控制器。
可选地,所述冷数据处理表中包括:表头标识和表尾标识;
所述控制器根据所述起始地址和所述终止地址对所述已存储数据进行处理,包括:
所述控制器根据所述表头标识和所述表尾标识,判断所述冷数据处理表是否有效;若有效,对所述起始地址和所述终止地址对应的已存储数据进行处理。
可选地,所述冷数据处理表中包括:冷数据对应的优先级,其中,所述优先级是根据所述写入次数CW确定的;
所述控制器根据所述起始地址和所述终止地址对所述已存储数据进行处理,包括:
所述控制器按照所述优先级对所述起始地址和所述终止地址对应的已存储数据进行处理。
为达到上述目的,本申请实施例还公开了一种数据处理装置,应用于电子设备,所述电子设备与存储卡连接,所述存储卡已预先进行私有格式化处理,且所述存储卡中包括至少一个冷数据区,所述装置包括:
读取次数获得单元,用于获得本地存储的目标冷数据区C中已存储数据的读取次数CR
读取次数判断单元,用于判断所述读取次数CR是否达到预设的冷数据读取失效次数阈值TCR
信息发送单元,用于在所述次数判断单元判断结果为是的情况下,将所述目标冷数据区C中已存储数据的起始地址和终止地址发送给所述存储卡的控制器,并将所述读取次数CR初始化,以使得所述控制器根据所述起始地址和所述终止地址对所述已存储数据进行处理。
可选地,所述装置还包括:
第一写入次数获得单元,用于在所述读取次数判断单元判断结果为否的情况下,获得本地存储的所述目标冷数据区C中数据的写入次数CW
第一写入次数判断单元,用于判断所述写入次数CW是否小于预设的第一冷数据写入次数阈值TCW1,若为是,触发所述信息发送单元;
所述信息发送单元,具体用于:
将所述目标冷数据区C中已存储数据的起始地址和终止地址发送给所述存储卡的控制器,并将所述读取次数CR和所述写入次数CW分别初始化,以使得所述控制器根据所述起始地址和所述终止地址对所述已存储数据进行处理。
可选地,所述存储卡中还包括至少一个热数据区,所述装置还包括:
第二写入次数获得单元,用于在所述读取次数判断单元判断结果为否的情况下,获得本地存储的所述目标冷数据区C中数据的写入次数CW和目标热数据区H中数据的写入次数HW
第二写入次数判断单元,用于判断所述写入次数HW是否达到预设的热数据写入次数阈值THW;如果达到所述热数据写入次数阈值THW,则判断所述写入次数CW是否小于预设的第二冷数据写入次数阈值TCW2,若为是,触发所述 信息发送单元;
所述信息发送单元,具体用于:
将所述目标冷数据区C中已存储数据的起始地址和终止地址发送给所述存储卡的控制器,并将所述读取次数CR、所述写入次数CW和所述写入次数HW分别初始化,以使得所述控制器根据所述起始地址和所述终止地址对所述已存储数据进行处理。
为达到上述目的,本申请实施例还公开了一种数据处理系统,所述系统包括:电子设备和存储卡,所述电子设备与所述存储卡连接,所述存储卡已预先进行私有格式化处理,且所述存储卡中包括至少一个冷数据区:
所述电子设备,用于获得本地存储的目标冷数据区C中已存储数据的读取次数CR;判断所述读取次数CR是否达到预设的冷数据读取失效次数阈值TCR;如果是,则将所述目标冷数据区C中已存储数据的起始地址和终止地址发送给所述存储卡的控制器,并将所述读取次数CR初始化;
所述存储卡包括控制器,所述控制器用于根据所述起始地址和所述终止地址对所述已存储数据进行处理。
可选地,所述控制器,具体用于:
基于快闪转换层FTL提供的逻辑地址和物理地址之间的映射关系,将所述起始地址和所述终止地址分别转换为其对应的物理起始地址和物理终止地址;按照释放所述存储卡中块存储空间的先后顺序,将所述物理起始地址和所述物理终止地址对应的数据搬移至被释放的块存储空间中,并按照被搬移数据当前的物理起始地址和物理终止地址更新所述映射关系。
可选地,所述电子设备,具体用于生成包含所述起始地址和所述终止地址的冷数据处理表;将所述冷数据处理表发送至所述控制器。
可选地,所述冷数据处理表中还包含:表头标识和表尾标识;
所述控制器,具体用于:
根据所述表头标识和所述表尾标识,判断所述冷数据处理表是否有效;若有效,对所述起始地址和所述终止地址对应的数据进行处理。
可选地,所述冷数据处理表中还包含:冷数据对应的优先级,其中,所述优先级是根据所述写入次数CW确定的;
所述控制器,具体用于:
按照所述优先级对所述起始地址和所述终止地址对应的数据进行处理。
为达到上述目的,本申请实施例公开了一种电子设备,所述电子设备包括:
处理器、存储器、通信接口和总线;
所述处理器、所述存储器和所述通信接口通过所述总线连接并完成相互间的通信;
所述存储器存储可执行程序代码;
所述处理器通过读取所述存储器中存储的可执行程序代码来运行与所述可执行程序代码对应的程序,以用于执行本申请实施例所述的数据处理方法。
为达到上述目的,本申请实施例公开了一种应用程序,所述应用程序用于在运行时执行本申请实施例所述的数据处理方法。
为达到上述目的,本申请实施例公开了一种存储介质,所述存储介质用于存储应用程序,所述应用程序用于执行本申请实施例所述的数据处理方法。
由上可知,本申请实施例中,电子设备获得本地存储的目标冷数据区C中已存储数据的读取次数CR,在读取次数CR达到预设的冷数据读取失效次数阈值TCR的情况下,可以判定该目标冷数据区C中已存储数据为待处理的数据,将目标冷数据区C中已存储数据的起始地址和终止地址发送给存储卡的控制器,将读取次数CR初始化,控制器根据起始地址和终止地址对该已存储数据进行处理。这里,冷数据的扫描和判断均有电子设备来完成,而存储卡只需要对数据进行处理,降低了存储卡的计算量,从而提高了存储卡的数据读写性能。
附图说明
为了更清楚地说明本申请实施例和现有技术的技术方案,下面对实施例和现有技术中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出 创造性劳动的前提下,还可以根据这些附图获得其他的附图。
图1为本申请实施例提供的一种数据处理系统的结构示意图;
图2为本申请实施例提供的一种系统框图;
图3为本申请实施例提供的一种数据处理方法的流程示意图;
图4为本申请实施例提供的另一种数据处理方法的流程示意图;
图5为本申请实施例提供的另一种数据处理方法的流程示意图;
图6为本申请实施例提供的一种数据处理装置的结构示意图;
图7为本申请实施例提供的另一种数据处理装置的结构示意图;
图8为本申请实施例提供的另一种数据处理装置的结构示意图;
图9为本申请实施例提供的一种电子设备的结构示意图。
具体实施方式
为使本申请的目的、技术方案、及优点更加清楚明白,以下参照附图并举实施例,对本申请进一步详细说明。显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
下面通过具体实施例,对本申请进行详细说明。
参考图1,图1为本申请实施例提供的一种数据处理系统的结构示意图,该系统包括:电子设备101和存储卡102,电子设备101与存储卡102连接,存储卡102已预先进行私有格式化处理,且该存储卡102中包括至少一个冷数据区;
其中,电子设备101,用于获得本地存储的目标冷数据区C中已存储数据的读取次数CR;判断读取次数CR是否达到预设的冷数据读取失效次数阈值TCR;如果是,则将目标冷数据区C中已存储数据的起始地址和终止地址发送给存储卡102的控制器,并将读取次数CR初始化;
在本申请的一个实施方式中,电子设备101可以为网络摄像机。在一个实施例中,网络摄像机在向与其连接的存储卡中存储数据前,首先私有格式化 该存储卡,然后以固定的写入方式在该存储卡中创建冷数据区。
可以理解的,在特定操作系统中,操作系统提供商通常会结合其操作系统的特点开发相应的格式化方式,并提供给用户使用,例如,在微软操作系统中,常用的格式化方式为微软提供的格式化方式。本申请实施例中考虑到各种应用场景的不同特点以及数据安全性等因素,可以对存储卡进行私有格式化。
基于上述信息,私有格式化可以理解为:开发人员根据具体情况而开发的格式化方式,该格式化方式可以是开发人员在操作系统提供商提供的格式化方式的基础上改进得到的,也可以是开发人员自行开发的,本申请并不对此进行限定。
另外,上述私有格式化可以与操作系统提供商提供的格式化方式兼容,也可以不与操作系统提供商提供的格式化方式兼容,本申请并不对此进行限定。
在一个实施例中,冷数据区用于存储冷数据。
值得一提的是,不同的电子设备101的写入方式是不同的,但同一电子设备101的写入方式是固定的。这样,电子设备101可以根据固定的写入方式,确定在存储卡中创建冷数据区中已存储数据的更新次数和更新频率,以及冷数据区中已存储数据的读取次数和读取频率等。另外,上述将读取次数CR初始化可以为:将读取次数CR置零。
存储卡102包括控制器,控制器用于根据起始地址和终止地址对该已存储数据进行处理。
在本申请的一个实施方式中,上述控制器,具体用于:
基于快闪转换层FTL提供的逻辑地址和物理地址之间的映射关系,将起始地址和终止地址分别转换为其对应的物理起始地址和物理终止地址;按照释放存储卡中块存储空间的先后顺序,将物理起始地址和物理终止地址对应的数据搬移至被释放的块存储空间中,并按照被搬移数据当前的物理起始地址和物理终止地址更新映射关系。
在本申请的一个实施方式中,上述电子设备101,具体用于:
生成包含起始地址和终止地址的冷数据处理表;通过符合SD卡协议的私有指令将冷数据处理表发送至存储卡102的控制器。
在本申请的一个实施方式中,冷数据处理表中还可以包含:表头标识和表尾标识;
这种情况下,上述控制器,具体用于:
根据表头标识和表尾标识,判断冷数据处理表是否有效;若有效,对起始地址和终止地址对应的数据进行处理。
在本申请的一个实施方式中,冷数据处理表中还可以包含:冷数据对应的优先级,其中,优先级是根据目标冷数据区C中数据的写入次数CW确定的;
这种情况下,上述控制器,具体用于:
按照优先级对起始地址和终止地址对应的冷数据进行处理。
下面以网络摄像机为例,可参考图2,图2为本申请实施例提供的一种系统框图。从图2中可以获知,网络摄像机100上设置有一个SD/MMC(Secure Digital/Multi Media Card,安全数字/多媒体卡)接口,存储卡200通过总线与网络摄像机100的SD/MMC接口连接,进而与该网络摄像机100连接。
网络摄像机100在向与其连接的存储卡200中存储数据前,可以私有格式化该存储卡,这样就可以以固定的写入方式在该存储卡200中创建冷数据区。同时,网络摄像机100可以通过该私有格式化分析存储卡200中存储的数据,获得冷数据表,然后,通过SD/MMC接口将包含该冷数据表的私有指令发送给存储卡200,存储卡200根据该冷数据表中的信息处理冷数据。
应用图1所示实施例,电子设备获得本地存储的目标冷数据区C中已存储数据的读取次数CR,在读取次数CR达到预设的冷数据读取失效次数阈值TCR的情况下,可以判定该目标冷数据区C中已存储数据为待处理的数据,将目标冷数据区C中已存储数据的起始地址和终止地址发送给存储卡的控制器,将读取次数CR初始化,控制器根据起始地址和终止地址对该已存储数据进行处理。这里,冷数据的扫描和判断均有电子设备来完成,而存储卡只需要对数据进 行处理就可以了,降低了存储卡的计算量,从而提高了存储卡的数据读写性能。
参考图3,图3为本申请实施例提供的一种数据处理方法的流程示意图,该方法应用于电子设备,该电子设备与存储卡连接,该存储卡已预先进行私有格式化处理,且存储卡中包括至少一个冷数据区,具体地,该方法包括如下步骤:
S301:获得本地存储的目标冷数据区C中已存储数据的读取次数CR
在本申请的一个实施方式中,每读取一次冷数据区中的已存储数据,针对该已存储数据的读取次数加1。
S302:判断读取次数CR是否达到预设的冷数据读取失效次数阈值TCR;若为是,执行S303;
在本申请的一个实施方式中,避免因读取某一数据的次数达到一定程度后存储卡过度磨损,出现数据无法读取的问题,在电子设备中设置一个冷数据读取失效次数阈值TCR,当一数据的读取次数CR达到预设的冷数据读取失效次数阈值TCR时,对该数据进行处理。
S303:将目标冷数据区C中已存储数据的起始地址和终止地址发送给存储卡的控制器,并将读取次数CR初始化。
这里,初始化可以理解为置零。
这种情况下,存储卡的控制器可以根据接收到的起始地址和终止地址,对该起始地址和终止地址对应的已存储数据进行处理。另外,电子设备将读取次数CR置零,避免下一次获得已存储数据的读取次数受本次获得的读取次数CR的影响,累计统计读取次数CR,致使控制器每次进行数据处理时,都对同一数据进行处理(如搬移数据),增加控制器的工作量的同时,减少了存储卡的使用寿命
在本申请的一个实施方式中,上述将目标冷数据区C中已存储数据的起始地址和终止地址发送给存储卡的控制器,可以包括:
生成包含起始地址和终止地址的冷数据处理表;将冷数据处理表发送至 存储卡的控制器。
这里,冷数据处理表不宜太大(如一个冷数据处理表的大小为512字节),以便于电子设备快速地将冷数据处理表传输给存储卡。另外,为了保证存储卡的工作效率,电子设备和存储卡间的通信可以采用分段式通信,即:在电子设备性能好时,增多向存储卡传输的冷数据处理表,使得存储卡能够处理多的数据;在电子设备性能差时,减少向存储卡传输的冷数据处理表,使得存储卡处理少的数据。
在一个实施例中,冷数据处理表还可以包括:表头标识、表尾标识和冷数据对应的优先级。这里,优先级是根据目标冷数据区C中数据的写入次数CW确定的,写入次数CW越小,可以理解为该冷数据的优先级越高。
当冷数据处理表包括表头标识和表尾标识时,存储卡的控制器在对数据进行处理前,可以根据表头标识和表尾标识,先判断冷数据处理表是否有效;若有效,再对起始地址和终止地址对应的数据进行处理。在一个实施例中,表头标识和表尾标识是取反的关系,以便于验证冷数据处理表是否有效,如:16进制的表头标识为1,那么表尾标识应为E。假设,表头标识Tabel_Head_Flag为:0x13245768ACBD09FE,若表尾标识Table_Tail_Flag为:0xECDBA8975342F601,此时,表头标识和表尾标识为取反关系,确定该冷数据处理表有效,可以对该冷数据处理表中起始地址和终止地址对应的数据进行处理;若表尾标识Table_Tail_Flag不是0xECDBA8975342F601,此时,表头标识和表尾标识就不是取反关系,可以确定该冷数据处理表无效,丢弃该冷数据处理表。
另外,当冷数据处理表包括冷数据对应的优先级时,存储卡的控制器可以根据按照每一数据的优先级对起始地址和终止地址对应的数据进行处理。假设,冷数据处理表包括2条冷数据X和Y,X的优先级为1,Y的优先级为2,优先级1大于优先级2,因此先处理X再处理Y。优先级高的数据的写入次数Cw较小,优先处理优先级高的数据,能够更好地保证存储卡的磨损均衡。
在本申请中冷数据表中还可以包括其他信息,如录像数据、图片数据、索引、日志信息等,具体地可以参考表1,表1所示的冷数据表为512字节组成,包括:表头标识(8字节)、62条冷数据条带(每条冷数据条带包括:起始地 址(4字节)、终止地址(4字节)、优先级(4字节)、其他信息(录像数据、图片数据、索引、日志信息)(4字节))、表尾标识(8字节)。
表1
Figure PCTCN2016099004-appb-000001
在本申请的一个实施方式中,存储卡的控制器的FTL中存储有逻辑地址和物理地址之间的映射关系,这种情况下,控制器对数据进行处理的过程可以为:
S1、基于快闪转换层FTL提供的逻辑地址和物理地址之间的映射关系,接收到的将起始地址和终止地址分别转换为其对应的物理起始地址和物理终止地址;
电子设备发送给存储卡的控制器的起始地址和终止地址为逻辑地址,为了获得准确获得数据,存储卡需要将接收到的逻辑地址转换为物理地址,进而从物理地址对应的存储区域中获得相应的数据。
S2、按照释放存储卡中块存储空间的先后顺序,将物理起始地址和物理终止地址对应的数据搬移至被释放的块存储空间中,并按照被搬移数据当前的物理起始地址和物理终止地址更新映射关系。
存储卡中的存储空间是以块的形式存储的,且其存储空间一个块存储空间接一个块存储空间释放的,而不是一次释放全部的块存储空间。假设,当前存储卡中有块存储空间A、B和C,存储卡先释放了A,再释放C,最后释放 B,那么将物理起始地址和物理终止地址对应的数据先搬移到A,再搬移到C,最后搬移到B。此时,逻辑地址和物理地址的对应关系发生的变化,需要更新FTL中存储有逻辑地址和物理地址之间的映射关系,以便于再次处理数据时,能够准确获得需要的数据。这里,一个块存储空间可以理解为:一个冷数据区或一个热数据区。
在本申请的一个实施方式中,导致数据无法读取的问题,不仅与数据的读取次数相关,还与数据的写入次数相关,此时本申请提供了另一种数据处理方法,可以参考图4,应用于电子设备,该方法包括如下步骤:
S401:获得本地存储的目标冷数据区C中数据的写入次数CW
在本申请的一个实施方式中,冷数据区中每写入一次数据,针对该数据的写入次数CW加1,这也可以理解为,该针对该冷数据区C的写入次数CW加1。
值得一提的是,S401可以发生在S301和S302中的任一步骤之前,也可以发生在S301和S302中的任一步骤之后,还可以与步骤S301和S302中的任一步骤同时发生,本申请对此不进行限定。另外,在判定读取次数CR未达到预设的冷数据读取失效次数阈值TCR的情况下,再执行S401以及S402、S403,确定数据是否为需要处理的数据,可以有效地减少电子设备的工作量。
S402:判断写入次数CW是否小于预设的第一冷数据写入次数阈值TCW1,若为是,执行S403;
读取频率较高并且写入频率较低的数据被称为冷数据,因此,在确定需要处理的冷数据时,第一冷数据写入次数阈值TCW1的取值不应太高,其可以在[0,5]的范围内取值。
在本申请的一个实施方式中,若判定写入次数CW不小于预设的第一冷数据写入次数阈值TCW1,则可以认为当前存储卡各个存储区域的使用情况较为均衡,不需要对冷数据区的数据进行处理,并将读取次数CR和写入次数CW分别初始化,避免下一次获得已存储数据的读取次数受本次获得的读取次数CR和写入次数CW的影响,累计统计读取次数CR和写入次数CW,致使控制器每次数据处理时,都对同一数据进行处理,增加控制器的工作量,同时还会因为过度的处理数据(如搬移数据),增加控制器的工作量的同时,减少了存储卡 的使用寿命。
S403:将目标冷数据区C中已存储数据的起始地址和终止地址发送给存储卡的控制器,并将读取次数CR和写入次数CW分别初始化。
这种情况下,存储卡的控制器可以根据接收到的起始地址和终止地址,对该起始地址和终止地址对应的已存储数据进行处理。另外,电子设备还需要将读取次数CR和写入次数CW都初始化。
在本申请的一个实施方式中,存储卡中可以包括至少一个冷数据区,还可以包括至少一个热数据区,此时,为了避免数据无法读取的问题,需要均衡考虑热数据区和冷数据区中存储数据的读写次数,具体地可以参考图5,图5为本申请实施例提供的另一种数据处理方法的流程示意图,该方法包括如下步骤:
S501:获得本地存储的目标冷数据区C中数据的写入次数CW和目标热数据区H中数据的写入次数HW
在本申请的一个实施方式中,热数据区中每写入一次数据,针对该数据的写入次数HW加1,这也可以理解为,该针对该热数据区H的写入次数HW加1。
值得一提的是,S501可以发生在S301和S302中的任一步骤之前,也可以发生在S301和S302中的任一步骤之后,还可以与步骤S301和S302中的任一步骤同时发生,本申请对此不进行限定。另外,在判定读取次数CR未达到预设的冷数据读取失效次数阈值TCR的情况下,再执行501以及S502、S503、S504,确定数据是否为需要处理的数据,可以有效地减少电子设备的工作量。
S502:判断写入次数HW是否达到预设的热数据写入次数阈值THW,若为是,执行S503;
写入频率较高的数据被称为热数据。若热数据区内存储的热数据的写入次数HW较小,说明该热数据区的更新频率低,相对于存储卡来说,当前存储卡的各个存储区域的磨损情况较为均衡,不对存储卡中的冷数据进行处理,存储卡也不会出现部分存储区域不能读取数据的问题,因此可以不对冷数据进行处理,进而减少了存储卡的工作量。
值得一提的是,为了保证存储卡的各个存储空间的磨损情况均衡,热数据写入次数阈值THW的取值不应太高,其可以在[6,10]的范围内取值。
在本申请的一个实施方式中,若判定写入次数HW未达到预设的热数据写入次数阈值THW,则可以认为当前存储卡各个存储区域的使用情况较为均衡,不需要对冷数据区的数据进行处理,并将读取次数CR、写入次数CW和写入次数HW分别置零,避免下一次获得已存储数据的读取次数受本次获得的读取次数CR、写入次数CW和写入次数HW的影响,累计统计读取次数CR、写入次数CW和写入次数HW,致使控制器每次数据处理时,都对同一数据进行处理,增加控制器的工作量,同时还会因为过度的处理数据(如搬移数据),减少了存储卡的使用寿命。
S503:判断写入次数CW是否小于预设的第二冷数据写入次数阈值TCW2;若为是,执行S504;
这里,第二冷数据写入次数阈值TCW2与第一冷数据写入次数阈值TCW1可以相同,也可以不同,此处不进行限定。
在本申请的一个实施方式中,若判定写入次数CW不小于第二冷数据写入次数阈值TCW2,则可以理解为当前存储卡各个存储区域的磨损情况较为均衡,不需要对冷数据区的数据进行处理,并将读取次数CR、写入次数CW和写入次数HW分别初始化。
S504:将目标冷数据区C中已存储数据的起始地址和终止地址发送给存储卡的控制器,并将读取次数CR、写入次数CW和写入次数HW分别初始化。
这种情况下,存储卡的控制器可以根据接收到的起始地址和终止地址,对该起始地址和终止地址对应的已存储数据进行处理。另外,电子设备还需要将读取次数CR、写入次数CW和写入次数HW都初始化。
应用上述各个实施例,电子设备获得本地存储的目标冷数据区C中已存储数据的读取次数CR,在读取次数CR达到预设的冷数据读取失效次数阈值TCR的情况下,可以判定该目标冷数据区C中已存储数据为待处理的数据,将目标冷数据区C中已存储数据的起始地址和终止地址发送给存储卡的控制器,将读取次数CR初始化,控制器根据起始地址和终止地址对该已存储数据进行处理。 这里,冷数据的扫描和判断均有电子设备来完成,而存储卡只需要对数据进行处理,降低了存储卡的计算量,从而提高了存储卡的数据读写性能。
参考图6,图6为本申请实施例提供的一种数据处理装置的结构示意图,应用于电子设备,电子设备与存储卡连接,存储卡已预先进行私有格式化处理,且存储卡中包括至少一个冷数据区,该装置包括:
读取次数获得单元601,用于获得本地存储的目标冷数据区C中已存储数据的读取次数CR
读取次数判断单元602,用于判断读取次数CR是否达到预设的冷数据读取失效次数阈值TCR
信息发送单元603,用于在次数判断单元判断结果为是的情况下,将目标冷数据区C中已存储数据的起始地址和终止地址发送给存储卡的控制器,并将读取次数CR初始化,以使得控制器根据起始地址和终止地址对该已存储数据进行处理。
在本申请的一个实施方式中,导致数据无法读取的问题,不仅与数据的读取次数相关,还与数据的写入次数相关,此时本申请提供了另一种数据处理装置,可以参考图7,应用于电子设备,该装置还可以包括:
第一写入次数获得单元701,用于在读取次数判断单元判断结果为否的情况下,获得本地存储的目标冷数据区C中数据的写入次数CW
第一写入次数判断单元702,用于判断写入次数CW是否小于预设的第一冷数据写入次数阈值TCW1,若为是,触发信息发送单元603;
这种情况下,信息发送单元603,具体用于:
将目标冷数据区C中已存储数据的起始地址和终止地址发送给存储卡的控制器,并将读取次数CR和写入次数CW分别初始化,以使得控制器根据起始地址和终止地址对该已存储数据进行处理。
在本申请的一个实施方式中,存储卡中可以包括至少一个冷数据区,还可以包括至少一个热数据区,此时,为了避免数据无法读取的问题,需要均衡考虑热数据区和冷数据区中存储数据的读写次数,具体地可以参考图8,图 8为本申请实施例提供的另一种数据处理装置的结构示意图,应用于电子设备,该装置还可以包括:
第二写入次数获得单元801,用于在读取次数判断单元判断结果为否的情况下,获得本地存储的目标冷数据区C中数据的写入次数CW和目标热数据区H中数据的写入次数HW
第二写入次数判断单元802,用于判断写入次数HW是否达到预设的热数据写入次数阈值THW;如果达到热数据写入次数阈值THW,则判断写入次数CW是否小于预设的第二冷数据写入次数阈值TCW2,若为是,触发信息发送单元603;
这种情况下,信息发送单元603,具体用于:
将目标冷数据区C中已存储数据的起始地址和终止地址发送给存储卡的控制器,并将读取次数CR、写入次数CW和写入次数HW分别初始化,以使得控制器根据起始地址和终止地址对该已存储数据进行处理。
应用上述各个实施例,电子设备获得本地存储的目标冷数据区C中已存储数据的读取次数CR,在读取次数CR达到预设的冷数据读取失效次数阈值TCR的情况下,可以判定该目标冷数据区C中已存储数据为待处理的数据,将目标冷数据区C中已存储数据的起始地址和终止地址发送给存储卡的控制器,将读取次数CR初始化,控制器根据起始地址和终止地址对该已存储数据进行处理。这里,冷数据的扫描和判断均有电子设备来完成,而存储卡只需要对数据进行处理,降低了存储卡的计算量,从而提高了存储卡的数据读写性能。
另外,本申请实施例还提供了一种电子设备,该电子设备与存储卡连接,所述存储卡已预先进行私有格式化处理,且所述存储卡中包括至少一个冷数据区,所述电子设备包括:
处理器910、存储器920、通信接口930和总线940;
所述处理器910、所述存储器920和所述通信接口930通过所述总线940连接并完成相互间的通信;
所述存储器920存储可执行程序代码;
所述处理器910通过读取所述存储器920中存储的可执行程序代码来运 行与所述可执行程序代码对应的程序,以用于执行:
获得本地存储的目标冷数据区C中已存储数据的读取次数CR
判断所述读取次数CR是否达到预设的冷数据读取失效次数阈值TCR
如果是,则将所述目标冷数据区C中已存储数据的起始地址和终止地址发送给所述存储卡的控制器,并将所述读取次数CR初始化,以使得所述控制器根据所述起始地址和所述终止地址对所述已存储数据进行处理。
该电子设备以多种形式存在,包括但不限于:
(1)移动通信设备:这类设备的特点是具备移动通信功能,并且以提供话音、数据通信为主要目标。这类终端包括:智能手机(例如iPhone)、多媒体手机、功能性手机,以及低端手机等。
(2)超移动个人计算机设备:这类设备属于个人计算机的范畴,有计算和处理功能,一般也具备移动上网特性。这类终端包括:PDA、MID和UMPC设备等,例如iPad。
(3)便携式娱乐设备:这类设备可以显示和播放多媒体内容。该类设备包括:音频、视频播放器(例如iPod),掌上游戏机,电子书,以及智能玩具和便携式车载导航设备。
(4)服务器:提供计算服务的设备,服务器的构成包括处理器、硬盘、内存、系统总线等,服务器和通用的计算机架构类似,但是由于需要提供高可靠的服务,因此在处理能力、稳定性、可靠性、安全性、可扩展性、可管理性等方面要求较高。
(5)其他具有数据交互功能的电子装置。
由上可知,本申请实施例中,电子设备获得本地存储的目标冷数据区C中已存储数据的读取次数CR,在读取次数CR达到预设的冷数据读取失效次数阈值TCR的情况下,可以判定该目标冷数据区C中已存储数据为待处理的数据,将目标冷数据区C中已存储数据的起始地址和终止地址发送给存储卡的控制器,将读取次数CR初始化,控制器根据起始地址和终止地址对该已存储数据进行处理。这里,冷数据的扫描和判断均有电子设备来完成,而存储卡 只需要对数据进行处理,降低了存储卡的计算量,从而提高了存储卡的数据读写性能。
另外,本申请实施例还提供了一种应用程序,所述应用程序用于在运行时执行本申请实施例所述的数据处理方法;
该数据处理方法应用于电子设备,所述电子设备与存储卡连接,所述存储卡已预先进行私有格式化处理,且所述存储卡中包括至少一个冷数据区,其特征在于,所述方法包括:
获得本地存储的目标冷数据区C中已存储数据的读取次数CR
判断所述读取次数CR是否达到预设的冷数据读取失效次数阈值TCR
如果是,则将所述目标冷数据区C中已存储数据的起始地址和终止地址发送给所述存储卡的控制器,并将所述读取次数CR初始化,以使得所述控制器根据所述起始地址和所述终止地址对所述已存储数据进行处理。
由上可知,本申请实施例中,电子设备通过执行上述应用程序,获得本地存储的目标冷数据区C中已存储数据的读取次数CR,在读取次数CR达到预设的冷数据读取失效次数阈值TCR的情况下,可以判定该目标冷数据区C中已存储数据为待处理的数据,将目标冷数据区C中已存储数据的起始地址和终止地址发送给存储卡的控制器,将读取次数CR初始化,控制器根据起始地址和终止地址对该已存储数据进行处理。这里,冷数据的扫描和判断均有电子设备来完成,而存储卡只需要对数据进行处理,降低了存储卡的计算量,从而提高了存储卡的数据读写性能。
另外,本申请实施例还提供了一种存储介质,所述存储介质用于存储应用程序,所述应用程序用于执行本申请实施例所述的数据处理方法;
该数据处理方法应用于电子设备,所述电子设备与存储卡连接,所述存储卡已预先进行私有格式化处理,且所述存储卡中包括至少一个冷数据区,其特征在于,所述方法包括:
获得本地存储的目标冷数据区C中已存储数据的读取次数CR
判断所述读取次数CR是否达到预设的冷数据读取失效次数阈值TCR
如果是,则将所述目标冷数据区C中已存储数据的起始地址和终止地址发送给所述存储卡的控制器,并将所述读取次数CR初始化,以使得所述控制器根据所述起始地址和所述终止地址对所述已存储数据进行处理。
由上可知,本申请实施例中,电子设备通过执行上述存储介质中存储的应用程序,获得本地存储的目标冷数据区C中已存储数据的读取次数CR,在读取次数CR达到预设的冷数据读取失效次数阈值TCR的情况下,可以判定该目标冷数据区C中已存储数据为待处理的数据,将目标冷数据区C中已存储数据的起始地址和终止地址发送给存储卡的控制器,将读取次数CR初始化,控制器根据起始地址和终止地址对该已存储数据进行处理。这里,冷数据的扫描和判断均有电子设备来完成,而存储卡只需要对数据进行处理,降低了存储卡的计算量,从而提高了存储卡的数据读写性能。
对于装置、电子设备、应用程序及存储介质实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。
需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。
本领域普通技术人员可以理解实现上述方法实施方式中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,所述的程序可以存储于计算机可读取存储介质中,这里所称得的存储介质,如:ROM/RAM、磁碟、光盘等。
以上所述仅为本申请的较佳实施例而已,并不用以限制本申请,凡在本申请的精神和原则之内,所做的任何修改、等同替换、改进等,均应包含在本申请保护的范围之内。

Claims (18)

  1. 一种数据处理方法,应用于电子设备,所述电子设备与存储卡连接,所述存储卡已预先进行私有格式化处理,且所述存储卡中包括至少一个冷数据区,其特征在于,所述方法包括:
    获得本地存储的目标冷数据区C中已存储数据的读取次数CR
    判断所述读取次数CR是否达到预设的冷数据读取失效次数阈值TCR
    如果是,则将所述目标冷数据区C中已存储数据的起始地址和终止地址发送给所述存储卡的控制器,并将所述读取次数CR初始化,以使得所述控制器根据所述起始地址和所述终止地址对所述已存储数据进行处理。
  2. 根据权利要求1所述的方法,其特征在于,在判定所述读取次数CR未达到预设的冷数据读取失效次数阈值TCR的情况下,所述方法还包括:
    获得本地存储的所述目标冷数据区C中数据的写入次数CW
    判断所述写入次数CW是否小于预设的第一冷数据写入次数阈值TCW1
    如果是,则将所述目标冷数据区C中已存储数据的起始地址和终止地址发送给所述存储卡的控制器,并将所述读取次数CR和所述写入次数CW分别初始化,以使得所述控制器根据所述起始地址和所述终止地址对所述已存储数据进行处理。
  3. 根据权利要求1所述的方法,其特征在于,所述存储卡中还包括至少一个热数据区,在判定所述读取次数CR未达到预设的冷数据读取失效次数阈值TCR的情况下,所述方法还包括:
    获得本地存储的所述目标冷数据区C中数据的写入次数CW和目标热数据区H中数据的写入次数HW
    判断所述写入次数HW是否达到预设的热数据写入次数阈值THW
    如果达到所述热数据写入次数阈值THW,则判断所述写入次数CW是否小于预设的第二冷数据写入次数阈值TCW2
    如果不小于所述第二冷数据写入次数阈值TCW2,则将所述目标冷数据区C 中已存储数据的起始地址和终止地址发送给所述存储卡的控制器,并将所述读取次数CR、所述写入次数CW和所述写入次数HW分别初始化,以使得所述控制器根据所述起始地址和所述终止地址对所述已存储数据进行处理。
  4. 根据权利要求1-3中任一项所述的方法,其特征在于,所述控制器根据所述起始地址和所述终止地址对所述已存储数据进行处理,包括:
    所述控制器基于快闪转换层FTL提供的逻辑地址和物理地址之间的映射关系,将所述起始地址和所述终止地址分别转换为其对应的物理起始地址和物理终止地址;按照释放所述存储卡中块存储空间的先后顺序,将所述物理起始地址和所述物理终止地址对应的数据搬移至被释放的块存储空间中,并按照被搬移数据当前的物理起始地址和物理终止地址更新所述映射关系。
  5. 根据权利要求1-3中任一项所述的方法,其特征在于,所述将所述目标冷数据区C中已存储数据的起始地址和终止地址发送给所述存储卡的控制器,包括:
    生成包含所述起始地址和所述终止地址的冷数据处理表;
    将所述冷数据处理表发送至所述控制器。
  6. 根据权利要求5所述的方法,其特征在于,所述冷数据处理表中包括:表头标识和表尾标识;
    所述控制器根据所述起始地址和所述终止地址对所述已存储数据进行处理,包括:
    所述控制器根据所述表头标识和所述表尾标识,判断所述冷数据处理表是否有效;若有效,对所述起始地址和所述终止地址对应的已存储数据进行处理。
  7. 根据权利要求5所述的方法,其特征在于,所述冷数据处理表中包括:冷数据对应的优先级,其中,所述优先级是根据所述写入次数CW确定的;
    所述控制器根据所述起始地址和所述终止地址对所述已存储数据进行处理,包括:
    所述控制器按照所述优先级对所述起始地址和所述终止地址对应的已存 储数据进行处理。
  8. 一种数据处理装置,应用于电子设备,所述电子设备与存储卡连接,所述存储卡已预先进行私有格式化处理,且所述存储卡中包括至少一个冷数据区,其特征在于,所述装置包括:
    读取次数获得单元,用于获得本地存储的目标冷数据区C中已存储数据的读取次数CR
    读取次数判断单元,用于判断所述读取次数CR是否达到预设的冷数据读取失效次数阈值TCR
    信息发送单元,用于在所述次数判断单元判断结果为是的情况下,将所述目标冷数据区C中已存储数据的起始地址和终止地址发送给所述存储卡的控制器,并将所述读取次数CR初始化,以使得所述控制器根据所述起始地址和所述终止地址对所述已存储数据进行处理。
  9. 根据权利要求8所述的装置,其特征在于,所述装置还包括:
    第一写入次数获得单元,用于在所述读取次数判断单元判断结果为否的情况下,获得本地存储的所述目标冷数据区C中数据的写入次数CW
    第一写入次数判断单元,用于判断所述写入次数CW是否小于预设的第一冷数据写入次数阈值TCW1,若为是,触发所述信息发送单元;
    所述信息发送单元,具体用于:
    将所述目标冷数据区C中已存储数据的起始地址和终止地址发送给所述存储卡的控制器,并将所述读取次数CR和所述写入次数CW分别初始化,以使得所述控制器根据所述起始地址和所述终止地址对所述已存储数据进行处理。
  10. 根据权利要求8所述的装置,其特征在于,所述存储卡中还包括至少一个热数据区,所述装置还包括:
    第二写入次数获得单元,用于在所述读取次数判断单元判断结果为否的情况下,获得本地存储的所述目标冷数据区C中数据的写入次数CW和目标热数据区H中数据的写入次数HW
    第二写入次数判断单元,用于判断所述写入次数HW是否达到预设的热数据写入次数阈值THW;如果达到所述热数据写入次数阈值THW,则判断所述写入次数CW是否小于预设的第二冷数据写入次数阈值TCW2,若为是,触发所述信息发送单元;
    所述信息发送单元,具体用于:
    将所述目标冷数据区C中已存储数据的起始地址和终止地址发送给所述存储卡的控制器,并将所述读取次数CR、所述写入次数CW和所述写入次数HW分别初始化,以使得所述控制器根据所述起始地址和所述终止地址对所述已存储数据进行处理。
  11. 一种数据处理系统,所述系统包括:电子设备和存储卡,所述电子设备与所述存储卡连接,所述存储卡已预先进行私有格式化处理,且所述存储卡中包括至少一个冷数据区,其特征在于:
    所述电子设备,用于获得本地存储的目标冷数据区C中已存储数据的读取次数CR;判断所述读取次数CR是否达到预设的冷数据读取失效次数阈值TCR;如果是,则将所述目标冷数据区C中已存储数据的起始地址和终止地址发送给所述存储卡的控制器,并将所述读取次数CR初始化;
    所述存储卡包括控制器,所述控制器用于根据所述起始地址和所述终止地址对所述已存储数据进行处理。
  12. 根据权利要11所述的系统,其特征在于,所述控制器,具体用于:
    基于快闪转换层FTL提供的逻辑地址和物理地址之间的映射关系,将所述起始地址和所述终止地址分别转换为其对应的物理起始地址和物理终止地址;按照释放所述存储卡中块存储空间的先后顺序,将所述物理起始地址和所述物理终止地址对应的数据搬移至被释放的块存储空间中,并按照被搬移数据当前的物理起始地址和物理终止地址更新所述映射关系。
  13. 根据权利要求11-12中任一项所述的系统,其特征在于,
    所述电子设备,具体用于生成包含所述起始地址和所述终止地址的冷数据处理表;将所述冷数据处理表发送至所述控制器。
  14. 根据权利要求13所述的系统,其特征在于,所述冷数据处理表中还包含:表头标识和表尾标识;
    所述控制器,具体用于:
    根据所述表头标识和所述表尾标识,判断所述冷数据处理表是否有效;若有效,对所述起始地址和所述终止地址对应的数据进行处理。
  15. 根据权利要求13所述的系统,其特征在于,所述冷数据处理表中还包含:冷数据对应的优先级,其中,所述优先级是根据所述写入次数CW确定的;
    所述控制器,具体用于:
    按照所述优先级对所述起始地址和所述终止地址对应的数据进行处理。
  16. 一种电子设备,其特征在于,所述电子设备包括:
    处理器、存储器、通信接口和总线;
    所述处理器、所述存储器和所述通信接口通过所述总线连接并完成相互间的通信;
    所述存储器存储可执行程序代码;
    所述处理器通过读取所述存储器中存储的可执行程序代码来运行与所述可执行程序代码对应的程序,以用于执行权利要求1-7中任一项所述的数据处理方法。
  17. 一种应用程序,其特征在于,所述应用程序用于在运行时执行权利要求1-7中任一项所述的数据处理方法。
  18. 一种存储介质,其特征在于,所述存储介质用于存储应用程序,所述应用程序用于执行权利要求1-7中任一项所述的数据处理方法。
PCT/CN2016/099004 2016-06-14 2016-09-14 一种数据处理方法、装置及系统 WO2017215137A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
US15/568,011 US10545808B2 (en) 2016-06-14 2016-09-14 Method, apparatus and system for processing data
EP16897479.8A EP3377965B1 (en) 2016-06-14 2016-09-14 Data processing method, device, and system

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610417424.7A CN107506135B (zh) 2016-06-14 2016-06-14 一种数据处理方法、装置及系统
CN201610417424.7 2016-06-14

Publications (1)

Publication Number Publication Date
WO2017215137A1 true WO2017215137A1 (zh) 2017-12-21

Family

ID=60663960

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/099004 WO2017215137A1 (zh) 2016-06-14 2016-09-14 一种数据处理方法、装置及系统

Country Status (4)

Country Link
US (1) US10545808B2 (zh)
EP (1) EP3377965B1 (zh)
CN (1) CN107506135B (zh)
WO (1) WO2017215137A1 (zh)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TWI647567B (zh) * 2017-12-13 2019-01-11 國立中正大學 使用記憶體位址定位冷熱存取區間之方法
KR20200069889A (ko) * 2018-12-07 2020-06-17 에스케이하이닉스 주식회사 컨트롤러, 이를 포함하는 메모리 시스템 및 이의 동작 방법
CN111831212B (zh) * 2019-04-19 2023-07-04 杭州海康威视数字技术股份有限公司 一种数据写入、读取方法、装置及设备
CN111444034A (zh) * 2020-03-25 2020-07-24 江铃汽车股份有限公司 一种预防仪表Dflash初始化失败的方法
CN113422620B (zh) * 2021-06-21 2023-06-27 维沃移动通信有限公司 通信速率控制方法、装置、设备和可读存储介质
CN114063933B (zh) * 2021-12-02 2022-06-28 深圳市宝佳乐电子科技有限公司 区块管理方法、存储器控制器和存储器存储装置
CN116719581B (zh) * 2023-07-11 2024-02-02 沐曦集成电路(上海)有限公司 芯片多实例模块初始化系统
CN116820351B (zh) * 2023-07-21 2024-04-09 北京得瑞领新科技有限公司 冷热数据标定方法、装置、存储介质及电子设备

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101740110A (zh) * 2009-12-17 2010-06-16 中兴通讯股份有限公司 一种Nand Flash擦除均衡的方法及装置
CN103699492A (zh) * 2012-09-27 2014-04-02 擎泰科技股份有限公司 非易失性存储器的数据收集方法
CN103777905A (zh) * 2014-02-14 2014-05-07 华中科技大学 一种软件定义的固态盘融合存储方法
WO2015185002A1 (zh) * 2014-06-06 2015-12-10 华为技术有限公司 一种数据写入方法及装置

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4294142B2 (ja) * 1999-02-02 2009-07-08 株式会社日立製作所 ディスクサブシステム
US20090132621A1 (en) * 2006-07-28 2009-05-21 Craig Jensen Selecting storage location for file storage based on storage longevity and speed
US8135900B2 (en) 2007-03-28 2012-03-13 Kabushiki Kaisha Toshiba Integrated memory management and memory management method
DE102007023408A1 (de) * 2007-05-18 2008-11-20 Mobotix Ag Verfahren zur Speicherverwaltung
US8213229B2 (en) * 2008-08-22 2012-07-03 HGST Netherlands, B.V. Error control in a flash memory device
JP2010186341A (ja) * 2009-02-12 2010-08-26 Toshiba Corp メモリシステム
US8285920B2 (en) * 2010-07-09 2012-10-09 Nokia Corporation Memory device with dynamic controllable physical logical mapping table loading
KR20120132820A (ko) * 2011-05-30 2012-12-10 삼성전자주식회사 스토리지 디바이스, 스토리지 시스템 및 스토리지 디바이스의 가상화 방법
EP2742429A4 (en) * 2011-08-09 2015-03-25 Lsi Corp I / O DEVICE AND INTERACTION WITH DATA PROCESSING HOST
CN104934066B (zh) * 2014-03-19 2018-03-27 安华高科技通用Ip(新加坡)公司 Nand闪存中的读取干扰处理
US9569120B2 (en) * 2014-08-04 2017-02-14 Nvmdurance Limited Adaptive flash tuning

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101740110A (zh) * 2009-12-17 2010-06-16 中兴通讯股份有限公司 一种Nand Flash擦除均衡的方法及装置
CN103699492A (zh) * 2012-09-27 2014-04-02 擎泰科技股份有限公司 非易失性存储器的数据收集方法
CN103777905A (zh) * 2014-02-14 2014-05-07 华中科技大学 一种软件定义的固态盘融合存储方法
WO2015185002A1 (zh) * 2014-06-06 2015-12-10 华为技术有限公司 一种数据写入方法及装置

Non-Patent Citations (1)

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

Also Published As

Publication number Publication date
US10545808B2 (en) 2020-01-28
CN107506135A (zh) 2017-12-22
CN107506135B (zh) 2022-05-06
EP3377965A4 (en) 2019-01-23
EP3377965A1 (en) 2018-09-26
EP3377965B1 (en) 2021-12-22
US20180293121A1 (en) 2018-10-11

Similar Documents

Publication Publication Date Title
WO2017215137A1 (zh) 一种数据处理方法、装置及系统
US20130311712A1 (en) Control apparatus, storage device, and storage control method
EP3410290B1 (en) Audio processing method, server, user equipment, and system
US9214138B2 (en) Redundant pixel mitigation
US20160330283A1 (en) Data Storage Method and Network Interface Card
TWI521518B (zh) 快閃記憶體設備中數據儲存之方法及裝置
WO2021082969A1 (zh) 核间数据处理方法、系统、片上系统以及电子设备
CN104021069A (zh) 基于分布式虚拟机系统的软件性能测试的管理方法和系统
EP3142014A1 (en) Method, device and user equipment for reading/writing data in nand flash
US20180150260A1 (en) Key-based memory deduplication protection
CN109446147B (zh) 一种网络存储设备与pcie设备的数据交互方法
US20200034042A1 (en) Method for writing data in a distributed storage system
US20150089663A1 (en) Data redaction system
CN110826036A (zh) 用户操作行为安全性的识别方法、装置和电子设备
WO2019047708A1 (zh) 资源配置方法及相关产品
WO2017147794A1 (zh) 差异数据备份的方法和设备
KR102405593B1 (ko) 전자 장치 및 그의 데이터 운용 방법
CN111459881A (zh) 一种分布式文件存储系统的目录文件配额设置方法及系统
CN108804258B (zh) 数据恢复方法、装置、移动终端和存储介质
WO2017054182A1 (zh) 一种数据校验方法和装置
WO2019205703A1 (zh) 一种画面捕捉方法及终端
CN114422236B (zh) 一种智能设备的访问方法、装置和电子设备
CN114064247A (zh) 应用程序中相机控制方法、装置、电子设备及存储介质
CN114691549A (zh) 一种文件写入方法、装置及计算设备
US20150356011A1 (en) Electronic device and data writing method

Legal Events

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

Ref document number: 15568011

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE