WO2015172698A1 - 一种数据处理的方法和设备 - Google Patents

一种数据处理的方法和设备 Download PDF

Info

Publication number
WO2015172698A1
WO2015172698A1 PCT/CN2015/078703 CN2015078703W WO2015172698A1 WO 2015172698 A1 WO2015172698 A1 WO 2015172698A1 CN 2015078703 W CN2015078703 W CN 2015078703W WO 2015172698 A1 WO2015172698 A1 WO 2015172698A1
Authority
WO
WIPO (PCT)
Prior art keywords
sector
data
media
stored
read
Prior art date
Application number
PCT/CN2015/078703
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 华为技术有限公司
Publication of WO2015172698A1 publication Critical patent/WO2015172698A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G11INFORMATION STORAGE
    • G11BINFORMATION STORAGE BASED ON RELATIVE MOVEMENT BETWEEN RECORD CARRIER AND TRANSDUCER
    • G11B20/00Signal processing not specific to the method of recording or reproducing; Circuits therefor
    • G11B20/10Digital recording or reproducing
    • G11B20/18Error detection or correction; Testing, e.g. of drop-outs

Definitions

  • the present invention relates to the field of data processing, and in particular, to a data processing method and apparatus.
  • hard disks mainly store system data and media data, wherein the system data includes system configuration.
  • System information data such as files, system databases, and system startup parameters, including multimedia data such as graphic image data, audio data, video data, text data, and multimedia databases.
  • the read data is checked by the check code, if it is read. If there is an error in the data, the data is corrected according to the check code, and when it is determined that the data is correct, the data processing operation is continued.
  • the computer system cannot correct the error of the data, the next operation cannot be performed on the data. If the data is media data, if there is an uncorrectable error, the media data will be obviously paused during playback. It affects the smoothness of media data playback, which reduces the user experience.
  • Embodiments of the present invention provide a method and apparatus for data processing to improve the fluency of reading media data.
  • a method of data processing comprising:
  • the data processing device reads the first data stored in the first sector of the memory
  • the determining the number of readings of the first sector includes:
  • the check code when determining that the number of readings of the first sector is less than the first preset value, changes the first data stored in the first sector to the third data;
  • the first stored in the second sector is read according to an address of the second sector After the second data, the method further includes:
  • the read count flag bit of the first sector is cleared.
  • the data processing device stores the first sector of the memory Before the first data, the method further includes:
  • Determining, according to the identification information of the first sector, that the first sector is a media sector comprises:
  • the identification information of the first sector is included in the first identifier set, determining that the first sector is a media sector.
  • the check code when determining that the identifier information of the first sector is not included in the first identifier set, The check code changes the first data stored in the first sector to the fourth data;
  • a data processing device comprising: a memory for storing data through a sector;
  • An acquiring unit configured to read first data stored in a first sector of the memory, and acquire a check code corresponding to the first sector;
  • a processing unit configured to check the first data according to the check code
  • the obtaining unit is further configured to: when the processing unit determines that the first data is erroneous data according to the check code, take the identifier information of the first sector;
  • the processing unit is further configured to: when the first sector is determined to be a media sector according to the identifier information of the first sector obtained by the acquiring unit, determine the number of times of reading the first sector;
  • the media sector is a sector storing media data;
  • the obtaining unit is further configured to: when the processing unit determines that the number of times of reading is greater than or equal to a first preset value, acquiring indication information stored in the first sector; wherein the indication information includes a second The address of the sector;
  • the obtaining unit is further configured to read the second data stored in the second sector according to the address of the second sector.
  • the acquiring unit is further configured to acquire a read count flag bit stored in the first sector, where the read count flag bit Marking the number of readings of the first sector;
  • the processing unit is specifically configured to obtain, according to the read times flag bit, the number of times of reading the first sector.
  • the processing unit is further configured to: determine that the number of times of reading the first sector is smaller than the first When the preset value is used, the first data stored in the first sector is changed to the third data according to the check code;
  • the reading unit is further configured to: read third data stored in the first sector;
  • the processing unit is further configured to add 1 to the read count flag of the first sector.
  • the processing unit is further configured to: at the acquiring unit, according to an address of the second sector After reading the second data stored in the second sector, the read count flag bit of the first sector is cleared.
  • the processing unit is further configured to: read, by the acquiring unit, the first part of the memory Before determining the first data stored in the sector, determining media sectors in the memory, and storing the identification information of the respective media sectors in the first identifier set;
  • the processing unit is specifically configured to: when determining the identifier information of the first sector in the first identifier set, determine that the first sector is a media sector.
  • the processing unit is further configured to: not include the first sector in determining the first identifier set And the first data stored in the first sector is changed to the fourth data according to the check code;
  • the obtaining unit is further configured to read fourth data stored in the first sector.
  • the data processing device reads the first data stored in the first sector of the memory, obtains the check code corresponding to the first sector, and determines that the first data is erroneous data according to the check code. Obtaining the identification information of the first sector, and determining that the first sector is a media sector according to the identification information of the first sector, determining the number of times of reading the first sector, determining the read When the number of times is greater than or equal to the first preset value, obtaining the indication information stored in the first sector, reading the second data stored in the second sector according to the address of the second sector, and passing the multiple times When the check code is changed and re-reading that the media data stored in the first sector is still erroneous data, determining that the media data is erroneous data that cannot be corrected by the check code, the data processing device is configured according to the first sector.
  • the stored indication information reads the next data of the data stored in the first sector, such that the data processing device can directly read the number of media after the media data when encountering media data in which an error occurs and cannot be corrected.
  • Media data can solve the problem pause during playback, media data to improve reading fluency, thereby improving the user experience.
  • FIG. 1 is a schematic flowchart of a data processing method according to an embodiment of the present invention.
  • FIG. 2 is a schematic flowchart of another data processing method according to an embodiment of the present invention.
  • FIG. 3 is a schematic structural diagram of a data processing device according to an embodiment of the present disclosure.
  • FIG. 4 is a schematic structural diagram of another data processing device according to an embodiment of the present invention.
  • the embodiment of the invention provides a data processing method, as shown in FIG. 1 , the execution body of the method For data processing equipment, the method includes:
  • the data processing device reads the first data stored in the first sector of the memory.
  • the memory stores data through the sector, and each sector can store 512 bytes of data.
  • each sector also stores identification information, indication information, and a check code of the sector, and the identification information may be a fan.
  • the data processing device determines a corresponding sector according to the sector flag, the indication information is used to indicate that after the data stored in the sector is read, the data processing device further reads an address of the data, and the check code is used by the identifier To check the data stored in the sector.
  • the data processing device can be a multimedia device with a hard disk that can read a sector of the hard disk to obtain data stored within the sector.
  • the data processing device determines the media sectors in the memory, and saves the identification information of the respective media sectors in the first identifier. In the collection.
  • the data processing device presets a media sector in all sectors of the memory, and saves the identification information of each media sector in the first identifier set.
  • the data processing device is configured according to the first identifier.
  • the collection looks up the media sector and stores the media data in a media sector.
  • the data processing device may be a set top box with a hard disk, the set top box may determine a sector storing the media data from the hard disk, and record an identifier of a sector storing the media data to find a fan storing the media data according to the flag Area.
  • the data processing device acquires a check code corresponding to the first sector, and obtains identifier information of the first sector when the first data is determined to be erroneous data according to the check code.
  • the check code may be an ECC code
  • the data processing device may check the data bit of the first data according to the ECC code, and determine the first data when determining that the data bit of the first data is in error according to the ECC code.
  • the data processing device reads the identification information of the first sector.
  • the data processing device determines, when the first sector is a media sector according to the identifier information of the first sector, the number of times of reading the first sector.
  • the media sector is a sector that stores media data.
  • the data processing device determines, in the first identifier set, the identification letter of the first sector. When it is time, it is determined that the first sector is a media sector.
  • the data processing device may determine that the sector numbered 010 to 6 sectors numbered 015 is a media sector, then the number is stored in the first identification set, and the data processing device determines the identity of the first sector.
  • the information is any one of 010 to 015, it can be determined that the first sector is a media sector, which is only illustrated by way of example in the embodiment of the present invention.
  • the data processing device when determining that the first identifier of the first identifier does not include the identifier information of the first sector, the data processing device changes the first data stored in the first sector to the fourth data according to the check code, and The fourth data stored in the first sector is read.
  • the data processing device changes the first data according to the check code to obtain the fourth data, and replaces the first data stored in the first sector with the fourth data, and re-reads the first sector to obtain the first data.
  • the check code may be an ECC code
  • the data processing device may check the first data according to the ECC code. If an error occurs in a data bit in the first data, the error data may be determined according to the ECC code. Bit, the data processing device changes the data bit to complete the error correction of the first data. If two or more data bits in the first data have an error, the data processing device may determine the first according to the ECC code. A data error occurred, but the data bit in which the error occurred could not be determined and the data bit in which the error occurred could not be corrected.
  • the first data may be system data
  • the data processing device determines, according to the identification information of the first sector, that the first sector is not a media sector, and determines that the first data is not media data, then the data processing device Repairing and re-reading the data stored in the first sector to ensure the accuracy of the data. If there is two data bits with errors in the first data, the data processing device will perform the repair and read in a loop, and An error message is issued when a preset time has elapsed or when the book exceeds a preset value.
  • the data processing device obtains the number of readings of the first sector according to the read count flag stored in the first sector.
  • the read count flag indicates the number of reads of the first sector.
  • the read count flag bit may be set for each sector, and the data processing device determines the read count of the first sector according to the read count flag bit of the first sector.
  • the first sector may be determined. It was read 5 times repeatedly.
  • the data processing device acquires the indication information stored in the first sector when determining that the number of readings is greater than or equal to the first preset value.
  • the indication information includes an address of the second sector.
  • the data processing device when the data processing device reads the first sector for more than a preset number of times, it may be determined that the data stored in the first sector cannot be corrected by the check code, and at this time, in order to ensure smooth flow of the media data during playback The data processing device determines to skip data within the first sector.
  • the data stored in the memory may be video, the first frame of the video is stored in the first sector, and the second frame of the video is stored in the second sector, if the first preset value is 5 And the data processing device stops reading the first frame video and obtains the first The address of the second sector stored in the sector to read the second frame of video, so that when a video is played, if an uncorrectable error occurs in a certain frame of video, the next frame of video will be directly played, thereby improving the playing video.
  • the fluency may be video, the first frame of the video is stored in the first sector, and the second frame of the video is stored in the second sector, if the first preset value is 5
  • the data processing device stops reading the first frame video and obtains the first The address of the second sector stored in the sector to read the second frame of video, so that when a video is played, if an uncorrectable error occurs in a certain frame of video, the next frame of video will be directly played, thereby improving the playing video.
  • the fluency may be video, the
  • the data processing device changes the first data according to the check code to obtain the third data, and replaces the first data stored in the first sector with the third data, and re-reads the first sector to obtain The third data stored in the first sector, and after reading the third data, increments the read count flag of the first sector by one.
  • the read count flag of the first sector is incremented by 1, so that the data processing device determines the first according to the read count flag. The number of times the sector is continuously read.
  • the data processing device also adds 1 to the read count flag of the first sector, that is, the data processing device. The read count flag of the first sector is incremented by one each time the data stored in the first sector is read.
  • the data processing device reads the second data stored in the second sector according to the address of the second sector.
  • the data processing device obtains an address of the second sector according to the indication information stored in the first sector, and reads the second data stored in the second sector according to the address of the second sector.
  • the data processing device clears the read count flag of the first sector.
  • the read count flag of the first sector indicates the number of times the first sector is repeatedly read, and after the data processing device reads the data stored in the second sector, the data processing device may be determined to stop reading.
  • the region number flag of the first sector is cleared, and the data is re-counted when the data stored in the first sector is read next time.
  • the data processing device reads the first data stored in the first sector of the memory, obtains the check code corresponding to the first sector, and determines the check code according to the check code by using the method that the execution body is the data processing device.
  • the first data is erroneous data
  • the data processing device Reading the next data of the data stored in the first sector according to the indication information stored in the first sector, so that the data processing device can directly read the media data when an error
  • An embodiment of the present invention provides a data processing method. As shown in FIG. 2, the method includes:
  • the data processing device determines a media sector in the memory, and saves the identifier information of each media sector in the first identifier set.
  • the media sector is a sector for storing media data
  • the first identifier set includes identification information of all media sectors.
  • the data processing device presets a media sector in all sectors of the memory, and saves the identification information of each media sector in the first identifier set.
  • the data processing device is configured according to the first identifier.
  • the collection looks up the media sector and stores the media data in a media sector.
  • the data processing device may be a multimedia device (eg, a set top box), and the memory may be a hard disk of the multimedia device, and the multimedia device may store data through the hard disk.
  • the multimedia device eg, a set top box
  • the data processing device reads the first data stored in the first sector of the memory.
  • the memory stores data through the sector, and each sector can store 512 bytes of data.
  • each sector also stores identification information, indication information, and a check code of the sector, and the identification information may be a fan.
  • the data processing device determines a corresponding sector according to the sector flag, the indication information is used to indicate that after the data stored in the sector is read, the data processing device further reads an address of the data, and the check code is used by the identifier To check the data stored in the sector.
  • the data processing device acquires a check code corresponding to the first sector.
  • the check code may be an ECC (Error Correcting Code) code
  • the data processing device may check and correct an error of the data stored in the first sector according to the ECC code.
  • ECC Error Correcting Code
  • the data processing device acquires the identifier information of the first sector when the first data is determined to be erroneous data according to the check code.
  • the check code may be an ECC code
  • the data processing device may check the data bit of the first data according to the ECC code, and determine the first data when determining that the data bit of the first data is in error according to the ECC code.
  • the data processing device reads the identification information of the first sector.
  • the data processing device determines the type of the first sector according to the identification information of the first sector.
  • the data processing device when determining that the identification information of the first sector is not included in the first identifier set, performs the following steps S2060 to S2070.
  • the data processing device changes the first data stored in the first sector to the fourth data according to the check code.
  • the data processing device changes the first data according to the check code to obtain the fourth data, and replaces the first data stored in the first sector with the fourth data.
  • the data processing device reads the fourth data stored in the first sector.
  • the first data may be system data
  • the data processing device determines, according to the identification information of the first sector, that the first sector is not a media sector, and determines that the first data is not media data
  • the data processing device repairs and re-reads the data stored in the first sector to ensure the accuracy of the data. If the first data has two data bits that have an error, the data processing device will perform the repair and read cyclically. Take and send an error alert when a preset time has elapsed or when the book exceeds a preset value.
  • the data processing device determines that the first identifier of the first identifier is included in the first identifier set, performing the following steps S206 to S207.
  • the data processing device acquires a read count flag bit stored in the first sector.
  • the data processing device obtains the number of times of reading the first sector according to the read times flag bit stored in the first sector.
  • the read count flag bit may be set for each sector, and the data processing device determines the read count of the first sector according to the read count flag bit of the first sector.
  • the read count flag of the first sector is 5
  • the data processing device obtains the number of readings of the first sector, if it is determined that the number of readings is less than the first preset value, the following steps S2080 to S2090 are performed.
  • the data processing device changes the first data stored in the first sector to the third data according to the check code.
  • the data processing device checks the first data according to the check code, and after finding an error of the first data according to the check code, changing an error data bit in the first data, and re-changing the changed data Write to the first sector.
  • the check code may be an ECC code
  • the data processing device detects an error of the 10th data bit of the first data according to the ECC code, and if it is determined that the 10th data bit is “0”, The data bit is changed to "1", and the changed data is rewritten into the first sector.
  • the data processing device reads the third data stored in the first sector, and adds 1 to the read count flag of the first sector.
  • the data processing device changes the first data according to the check code to obtain the third data, and replaces the first data stored in the first sector with the third data, and the data processing device reads the first fan again.
  • the third data stored in the first sector is obtained, and after the third data is read, the read count flag of the first sector is incremented by one.
  • the third data is obtained by the data processing device, the third data is checked according to the check code, and if it is determined that the third data has no error, the third data is further processed, and if the third data is determined according to the check code, The third data is erroneous data, and the third data is changed according to the check code.
  • the read count flag of the first sector is incremented by 1, so that the data processing device determines the first according to the read count flag. The number of times the sector is continuously read.
  • the data processing device also adds 1 to the read count flag of the first sector, that is, the data processing device. The read count flag of the first sector is incremented by one each time the data stored in the first sector is read.
  • the data processing device acquires the indication information stored in the first sector.
  • the indication information includes an address of the second sector.
  • the data processing device when the data processing device reads the first sector for more than a preset number of times, it may be determined that the data stored in the first sector cannot be corrected by the check code, and at this time, in order to ensure smooth flow of the media data during playback The data processing device determines to skip data within the first sector.
  • the data processing device reads the second data stored in the second sector according to the address of the second sector.
  • the data stored in the memory may be video, the first frame of the video is stored in the first sector, and the second frame of the video is stored in the second sector, if the first preset value is 5 And the data processing device stops reading the first frame video and obtains the first The address of the second sector stored in the sector to read the second frame of video, so that when a video is played, if an uncorrectable error occurs in a certain frame of video, the next frame of video will be directly played, thereby improving the playing video.
  • the fluency may be video, the first frame of the video is stored in the first sector, and the second frame of the video is stored in the second sector, if the first preset value is 5
  • the data processing device stops reading the first frame video and obtains the first The address of the second sector stored in the sector to read the second frame of video, so that when a video is played, if an uncorrectable error occurs in a certain frame of video, the next frame of video will be directly played, thereby improving the playing video.
  • the fluency may be video, the
  • the data processing device clears the read count flag of the first sector.
  • the read count flag of the first sector indicates the number of times the first sector is repeatedly read, and after the data processing device reads the data stored in the second sector, the data processing device may be determined to stop reading.
  • the region number flag of the first sector is cleared, and the data is re-counted when the data stored in the first sector is read next time.
  • the data processing device reads the first data stored in the first sector of the memory, acquires a check code corresponding to the first sector, and determines that the first data is erroneous data according to the check code.
  • the check code is changed and re-reading that the media data stored in the first sector is still erroneous data, determining that the media data is erroneous data that cannot be corrected by the check code, the data processing device is configured according to the first sector.
  • the stored indication information reads the next data of the data stored in the first sector, such that the data processing device can directly read the number of media after the media data when encountering media data in which an error occurs and cannot be corrected.
  • Media data can solve the problem pause during playback, media data to improve reading fluency, thereby improving the user experience.
  • the embodiment of the present invention provides a data processing device 30, as shown in FIG. 3, including:
  • the memory 31 is configured to store data through a sector.
  • the memory may be a hard disk, and the hard disk stores data through a sector, and each sector may store 512 bytes of data.
  • each sector also stores identification information, indication information, and a check code of the sector.
  • the identification information may be a sector flag, and the data processing device determines a corresponding sector according to the sector flag, the indication information is used to indicate that the data processing device further reads the address of the data after reading the data stored in the sector. This check code is used to check the data stored in the sector.
  • the obtaining unit 32 is configured to read the first data stored in the first sector of the memory 31, and obtain a check code corresponding to the first sector.
  • the processing unit 33 is configured to check the first data according to the check code.
  • the obtaining unit 32 is further configured to: when the processing unit 33 determines that the first data is erroneous data according to the check code, take the identification information of the first sector.
  • the processing unit 33 is further configured to determine, when the first sector is a media sector, according to the identification information of the first sector obtained by the obtaining unit 32, the number of times of reading the first sector.
  • the media sector is a sector that stores media data.
  • the obtaining unit 32 is further configured to: at the processing unit 33, determine that the number of readings is greater than or equal to the first When a preset value is obtained, the indication information stored in the first sector is acquired.
  • the indication information includes an address of the second sector.
  • the obtaining unit 32 is further configured to read the second data stored in the second sector according to the address of the second sector.
  • the obtaining unit 32 is further configured to acquire a read count flag bit stored in the first sector.
  • the read count flag indicates the number of times the first sector is read.
  • the processing unit 33 is specifically configured to obtain the number of times of reading the first sector according to the read count flag.
  • the read count flag bit may be set for each sector, and the data processing device determines the read count of the first sector according to the read count flag bit of the first sector.
  • the read count flag of the first sector is 5
  • the processing unit 33 is further configured to, when determining that the number of times of reading the first sector is less than the first preset value, change the first data stored in the first sector according to the check code. For the third data.
  • the data processing device checks the first data according to the check code, and after finding an error of the first data according to the check code, changing an error data bit in the first data, and re-changing the changed data Write to the first sector.
  • the check code may be an ECC code
  • the data processing device detects an error of the 10th data bit of the first data according to the ECC code, and if it is determined that the 10th data bit is “0”, The data bit is changed to "1", and the changed data is rewritten into the first sector.
  • the reading unit 32 is further configured to read the third data stored in the first sector.
  • the processing unit 33 is further configured to increment the read count flag of the first sector by one.
  • the data processing device changes the first data according to the check code to obtain the third data, and replaces the first data stored in the first sector with the third data, and the data processing device reads the first fan again.
  • the third data stored in the first sector is obtained, and after the third data is read, the read count flag of the first sector is incremented by one.
  • the third data is obtained by the data processing device, the third data is checked according to the check code, and if it is determined that the third data has no error, the third data is further processed, and if the third data is determined according to the check code, The third data is erroneous data, and the third data is changed according to the check code.
  • the processing unit 33 is further configured to: after the acquiring unit reads the second data stored in the second sector according to the address of the second sector, the number of times of reading the first sector is The bit is cleared.
  • the read count flag of the first sector indicates the number of times the first sector is repeatedly read, and after the data processing device reads the data stored in the second sector, the data processing device may be determined to stop reading.
  • the region number flag of the first sector is cleared, and the data is re-counted when the data stored in the first sector is read next time.
  • the processing unit 33 is further configured to: before the acquiring unit 32 reads the first data stored in the first sector of the memory, determine a media sector in the memory, and select the media sector.
  • the identification information is saved in the first identification set.
  • the data processing device presets a media sector in all sectors of the memory, and saves the identification information of each media sector in the first identifier set.
  • the data processing device is configured according to the first identifier.
  • the collection looks up the media sector and stores the media data in a media sector.
  • the data processing device may be a multimedia device (eg, a set top box), and the memory may be a hard disk of the multimedia device, and the multimedia device may store data through the hard disk.
  • the multimedia device eg, a set top box
  • the processing unit 33 is specifically configured to: when determining the identifier information of the first sector in the first identifier set, determine that the first sector is a media sector.
  • the processing unit 33 is further configured to, when determining that the identifier information of the first sector is not included in the first identifier set, change the first data stored in the first sector according to the check code. For the fourth data.
  • the data processing device changes the first data according to the check code to obtain the fourth data, and replaces the first data stored in the first sector with the fourth data.
  • the obtaining unit 32 is further configured to read the fourth data stored in the first sector.
  • the first data may be system data
  • the data processing device determines, according to the identification information of the first sector, that the first sector is not a media sector, and determines that the first data is not media data, then the data processing device Repairing and re-reading the data stored in the first sector to ensure the accuracy of the data. If there is two data bits with errors in the first data, the data processing device will perform the repair and read in a loop, and An error alarm is issued when a preset time elapses or when the book exceeds a preset value.
  • the data processing device reads the first data stored in the first sector of the memory, obtains a check code corresponding to the first sector, and determines the first data according to the check code.
  • the identification information of the first sector is obtained, and when the first sector is determined to be a media sector according to the identification information of the first sector, the number of times of reading the first sector is determined.
  • the media data stored in the first sector is still erroneous data, and the media data is determined to be erroneous data that cannot be corrected by the check code, and the data processing device is configured according to the first fan.
  • the indication information stored in the area reads the next data of the data stored in the first sector, such that the data processing device can directly read the media data after encountering the media data in which an error occurs and cannot be corrected.
  • Media data media data can solve the problem pause during playback, media data to improve reading fluency, thereby improving the user experience.
  • the embodiment of the present invention provides a data processing device 40, as shown in FIG. 4, including:
  • processor 41 a processor 41, a communication interface 42, a memory 43, and a communication bus 44; wherein the processor 41, the communication interface 42, and the memory 43 complete communication with each other through the communication bus 44 .
  • the processor 41 may be a central processing unit CPU, or an Application Specific Integrated Circuit (ASIC), or one or more integrated circuits configured to implement embodiments of the present invention.
  • CPU central processing unit
  • ASIC Application Specific Integrated Circuit
  • the memory 43 is used to store program code, which includes computer operating instructions.
  • the memory 43 may include a high speed RAM memory and may also include a non-volatile memory such as at least one disk memory.
  • the communication interface 42 is for implementing connection communication between these devices.
  • the processor 41 executes program code for reading first data stored in a first sector of the memory, acquiring a check code corresponding to the first sector, and determining the first data according to the check code
  • the identification information of the first sector is obtained, and when the first sector is determined to be a media sector according to the identification information of the first sector, the number of times of reading the first sector is determined.
  • the indication information stored in the first sector is obtained, and the second data stored in the second sector is read according to the address of the second sector.
  • the media sector is a sector storing media data, and the indication information includes an address of the second sector.
  • the processor 41 is further configured to obtain the number of times of reading the first sector according to the number of read times flag stored in the first sector.
  • the read count flag indicates the number of reads of the first sector.
  • the processor 41 is further configured to: when determining that the number of times the first sector is read is less than the first preset value, change the first data stored in the first sector according to the check code For the third data, the third data stored in the first sector is read, and the read count flag of the first sector is incremented by one.
  • the processor 41 is further configured to: after reading the second data stored in the second sector according to the address of the second sector, clear the read count flag of the first sector. .
  • the processor 41 is further configured to: before the data processing device reads the first data stored in the first sector of the memory, determine a media sector in the memory, and identify the media sector. The information is saved in the first set of identifiers.
  • the processor 41 is specifically configured to: when determining the identifier information of the first sector in the first identifier set, determine that the first sector is a media sector.
  • the processor 41 is further configured to, when determining that the identifier information of the first sector is not included in the first identifier set, change the first data stored in the first sector according to the check code. Is the fourth data, and reads the fourth data stored in the first sector.

Landscapes

  • Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Signal Processing For Digital Recording And Reproducing (AREA)

Abstract

本发明实施例提供一种数据处理的方法和设备,涉及数据处理领域,以提高读取媒体数据的流畅性,该方法包括:数据处理设备读取存储器的第一扇区中存储的第一数据(S101);获取该第一扇区对应的校验码,并在根据该校验码确定该第一数据为错误数据时,获取该第一扇区的标识信息(S102);并在根据该第一扇区的标识信息确定该第一扇区为媒体扇区时,确定该第一扇区的读取次数(S103);在确定该读取次数大于或者等于第一预设值时,获取该第一扇区存储的指示信息(S104);根据该第二扇区的地址读取该第二扇区中存储的第二数据(S105)。

Description

一种数据处理的方法和设备
本申请要求于2014年05月16日提交中国专利局、申请号为201410209078.4、发明名称为“一种数据处理的方法和设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及数据处理领域,尤其涉及一种数据处理的方法和设备。
背景技术
嵌入式多媒体技术的发展以及用户需求的升级,硬盘等存储设备已经广泛应用于嵌入式多媒体设备中,在嵌入式多媒体设备中,硬盘主要存储系统数据和媒体数据,其中,该系统数据包括系统配置文件、系统数据库和系统启动参数等系统信息数据,该媒体数据包括图形图像数据、音频数据、视频数据、文本数据和多媒体数据库等多媒体数据。
对于计算机系统而言,保证数据的完整性和准确性是最高的要求,因此为了保证系统的稳定性,在进行数据读取时,通过校验码对读取到的数据进行检查,若读取到的数据出现错误,则根据该校验码对该数据进行纠正校验,直到确定该数据正确时,继续执行数据处理操作。
但是,计算机系统在无法纠正该数据的错误时,不能对该数据执行下一步操作,在该数据为媒体数据时,若出现无法纠正的错误,则会导致媒体数据在播放时出现明显的停顿,影响了媒体数据播放的流畅性,从而降低了用户体验。
发明内容
本发明的实施例提供一种数据处理的方法和设备,以提高读取媒体数据的流畅性。
为达到上述目的,本发明的实施例采用如下技术方案:
第一方面,提供一种数据处理的方法,包括:
数据处理设备读取存储器的第一扇区中存储的第一数据;
获取所述第一扇区对应的校验码,并在根据所述校验码确定所述第一数据为错误数据时,获取所述第一扇区的标识信息;
在根据所述第一扇区的标识信息确定所述第一扇区为媒体扇区时,确定所述第一扇区的读取次数;其中,所述媒体扇区为存储媒体数据的扇区;
在确定所述读取次数大于或者等于第一预设值时,获取所述第一扇区存储的指示信息;其中,所述指示信息包括第二扇区的地址;
根据所述第二扇区的地址读取所述第二扇区中存储的第二数据。
结合第一方面,在第一方面第一种可能的实现方式中,所述确定所述第一扇区的读取次数包括:
根据所述第一扇区存储的读取次数标志位得到所述第一扇区的读取次数,其中,所述读取次数标志位表示所述第一扇区的读取次数。
结合第一方面第一种可能的实现方式,在第一方面第二种可能的实现方式中,在确定所述第一扇区的读取次数小于所述第一预设值时,根据所述校验码将所述第一扇区中存储的第一数据变更为第三数据;
读取所述第一扇区中存储的第三数据,并将所述第一扇区的读取次数标志位加1。
结合第一方面第一或第二种可能的实现方式,在第一方面第三种可能的实现方式中,在根据所述第二扇区的地址读取所述第二扇区中存储的第二数据后,所述方法还包括:
将所述第一扇区的读取次数标志位清零。
结合第一方面至第一方面第三种可能的实现方式中的任一种,在第一方面第四种可能的实现方式中,在所述数据处理设备读取存储器的第一扇区中存储的第一数据前,所述方法还包括:
确定所述存储器中的媒体扇区;
将所述各个媒体扇区的标识信息保存在第一标识集合中;
所述根据所述第一扇区的标识信息确定所述第一扇区为媒体扇区包括:
在确定所述第一标识集合中包括所述第一扇区的标识信息时,确定所述第一扇区为媒体扇区。
结合第一方面第四种可能的实现方式,在第一方面第五种可能的实现方式中,在确定所述第一标识集合中不包括所述第一扇区的标识信息时,根据所述校验码将所述第一扇区中存储的第一数据变更为第四数据;
读取所述第一扇区中存储的第四数据。
第二方面,提供一种数据处理设备,包括:存储器,用于通过扇区存储数据;
获取单元,用于读取所述存储器的第一扇区中存储的第一数据,并获取所述第一扇区对应的校验码;
处理单元,用于根据所述校验码检验所述第一数据;
所述获取单元还用于,在所述处理单元根据所述校验码确定所述第一数据为错误数据时,取所述第一扇区的标识信息;
所述处理单元还用于,在根据所述获取单元得到的第一扇区的标识信息确定所述第一扇区为媒体扇区时,确定所述第一扇区的读取次数;其中,所述媒体扇区为存储媒体数据的扇区;
所述获取单元还用于,在所述处理单元确定所述读取次数大于或者等于第一预设值时,获取所述第一扇区存储的指示信息;其中,所述指示信息包括第二扇区的地址;
所述获取单元还用于,根据所述第二扇区的地址读取所述第二扇区中存储的第二数据。
结合第二方面,在第二方面第一种可能的实现方式中,所述获取单元还用于,获取所述第一扇区存储的读取次数标志位;其中,所述读取次数标志位标示所述第一扇区的读取次数;
所述处理单元具体用于,根据所述读取次数标志位得到所述第一扇区的读取次数。
结合第二方面第一种可能的实现方式,在第二方面第二种可能的实现方式中,所述处理单元还用于,在确定所述第一扇区的读取次数小于所述第一预设值时,根据所述校验码将所述第一扇区中存储的第一数据变更为第三数据;
所述读取单元还用于,读取所述第一扇区中存储的第三数据;
所述处理单元还用于,将所述第一扇区的读取次数标志位加1。
结合第二方面第一或第二种可能的实现方式,在第二方面第三种可能的实现方式中,所述处理单元还用于,在所述获取单元根据所述第二扇区的地址读取所述第二扇区中存储的第二数据后,将所述第一扇区的读取次数标志位清零。
结合第二方面至第一方面第三种可能的实现方式,在第二方面第四种可能的实现方式中,所述处理单元还用于,在所述获取单元读取所述存储器的第一扇区中存储的第一数据前,确定所述存储器中的媒体扇区,并将所述各个媒体扇区的标识信息保存在第一标识集合中;
所述处理单元具体用于,在确定所述第一标识集合中包括所述第一扇区的标识信息时,确定所述第一扇区为媒体扇区。
结合第二方面第四种可能的实现方式,在第二方面第五种可能的实现方式中,所述处理单元还用于,在确定所述第一标识集合中不包括所述第一扇区的标识信息时,根据所述校验码将所述第一扇区中存储的第一数据变更为第四数据;
所述获取单元还用于,读取所述第一扇区中存储的第四数据。
通过采用上述方案,数据处理设备读取存储器的第一扇区中存储的第一数据,获取该第一扇区对应的校验码,并在根据该校验码确定该第一数据为错误数据时,获取该第一扇区的标识信息,并在根据该第一扇区的标识信息确定该第一扇区为媒体扇区时,确定该第一扇区的读取次数,在确定该读取次数大于或者等于第一预设值时,获取该第一扇区存储的指示信息,根据该第二扇区的地址读取该第二扇区中存储的第二数据,在多次通过该校验码变更并重新读取该第一扇区中存储的媒体数据依然为错误数据时,确定媒体数据为无法通过该校验码纠正的错误数据,则数据处理设备根据该第一扇区中存储的指示信息读取该第一扇区中存储的数据的下一数据,这样,在遇到出现错误并无法纠错的媒体数据时,数据处理设备可以直接读取该媒体数据之后的媒体数据,可以解决媒体数据在播放时出现停顿的问题,提高读取媒体数据的流畅性,从而提高用户体验。
附图说明
图1为本发明实施例提供的一种数据处理方法的流程示意图;
图2为本发明实施例提供的另一种数据处理方法的流程示意图;
图3为本发明实施例提供的一种数据处理设备的结构示意图;
图4为本发明实施例提供的另一种数据处理设备的结构示意图。
具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
本发明实施例提供一种数据处理的方法,如图1所示,该方法的执行主体 为数据处理设备,该方法包括:
S101、数据处理设备读取存储器的第一扇区中存储的第一数据。
具体地,存储器通过扇区存储数据,每个扇区可以存储512字节的数据,此外,每个扇区还存储该扇区的标识信息、指示信息和校验码,该标识信息可以是扇区标志,数据处理设备根据该扇区标志确定对应的扇区,该指示信息用于指示在读取该扇区内存储的数据后,数据处理设备进一步读取数据的地址,该校验码用于检查该扇区内存储的数据。
示例地,该数据处理设备可以是带硬盘的多媒体设备,该多媒体设备可以读取该硬盘的扇区,得到该扇区内存储的数据。
进一步地,在该数据处理设备读取存储器的第一扇区中存储的第一数据前,数据处理设备确定该存储器中的媒体扇区,并将各个媒体扇区的标识信息保存在第一标识集合中。
具体地,数据处理设备在存储器的全部扇区内预设媒体扇区,并将各个媒体扇区的标识信息保存在第一标识集合中,在存储媒体数据时,数据处理设备根据该第一标识集合查找该媒体扇区,并将媒体数据存储在媒体扇区内。
示例地,该数据处理设备可以是带硬盘的机顶盒,该机顶盒可以从该硬盘中确定存储媒体数据的扇区,并记录存储媒体数据的扇区的标识,以便根据该标志找到存储媒体数据的扇区。
S102、数据处理设备获取该第一扇区对应的校验码,并在根据该校验码确定该第一数据为错误数据时,获取该第一扇区的标识信息。
具体地,该校验码可以是ECC码,数据处理设备可以根据该ECC码检查该第一数据的数据位,在根据该ECC码确定该第一数据的数据位出错时,确定该第一数据为错误数据(即该第一数据出错)时,数据处理设备读取该第一扇区的标识信息。
S103、数据处理设备在根据该第一扇区的标识信息确定该第一扇区为媒体扇区时,确定该第一扇区的读取次数。
其中,该媒体扇区为存储媒体数据的扇区。
具体地,数据处理设备在确定该第一标识集合中包括该第一扇区的标识信 息时,确定该第一扇区为媒体扇区。
示例地,数据处理设备可以确定编号为010的扇区至编号为015的6个扇区为媒体扇区,则将编号存储在第一标识集合中,当数据处理设备确定第一扇区的标识信息为010至015中的任一个时,则可以确定该第一扇区为媒体扇区,这里只是举例说明,本发明实施例对此不作限定。
进一步地,数据处理设备在确定该第一标识集合中不包括该第一扇区的标识信息时,根据该校验码将该第一扇区中存储的第一数据变更为第四数据,并读取该第一扇区中存储的第四数据。
具体地,在确定该第一标识集合中不包括该第一扇区的标识信息时,可以确定该第一扇区不是媒体扇区,则该第一扇区中存储的第一数据不是媒体数据,则数据处理设备根据该校验码变更该第一数据得到第四数据,并将该第一扇区中存储的第一数据替换为第四数据,重新读取该第一扇区,获取第四数据。
进一步地,该校验码可以是ECC码,数据处理设备可以根据该ECC码检查该第一数据,若该第一数据中一个数据位发生错误,则可以根据该ECC码确定该发生错误的数据位,数据处理设备变更该数据位,即可完成该第一数据的错误纠正,若该第一数据中两个或两个以上数据位发生错误,则数据处理设备可以根据该ECC码确定该第一数据出错,但无法确定发生错误的数据位,无法纠正出现错误的数据位。
示例地,该第一数据可以是系统数据,数据处理设备根据该第一扇区的标识信息确定该第一扇区不是媒体扇区,并确定该第一数据不是媒体数据时,则数据处理设备修复并重新读取改第一扇区内存储的数据,以保证数据的准确性,若该第一数据存在两个发生错误的数据位,则该数据处理设备将循环执行修复和读取,并在经过预设时间或读取此书超过预设值时,发出出错提示。
进一步地,数据处理设备根据该第一扇区存储的读取次数标志位得到该第一扇区的读取次数。
其中,该读取次数标志位表示该第一扇区的读取次数。
具体地,可以给各个扇区设置读取次数标志位,数据处理设备根据第一扇区的读取次数标志位确定第一扇区的读取次数。
示例地,在确定第一扇区的读取次数标志位为5时,可以确定该第一扇区 被重复读取5次。
S104、数据处理设备在确定该读取次数大于或者等于第一预设值时,获取该第一扇区存储的指示信息。
其中,该指示信息包括第二扇区的地址。
具体地,数据处理设备读取该第一扇区超过预设次数时,可以确定该第一扇区内存储的数据无法通过该校验码纠正,这时,为了保证媒体数据在播放时的流畅性,数据处理设备确定跳过该第一扇区内的数据。
示例地,该存储器中存储的数据可以是视频,该视频的第一帧存储在第一扇区内,该视频的第二帧存储在第二扇区内,若该第一预设值为5,则在该数据处理设备第5次读取该第一帧视频时,依然确定该第一帧视频的数据出现错误,则该数据处理设备停止读取该第一帧视频,并获取该第一扇区内存储的第二扇区的地址,以读取第二帧视频,这样,在播放视频时,若某一帧视频出现无法纠正的错误,会直接播放下一帧视频,从而提高播放视频的流畅性。
进一步地,在确定该第一扇区的读取次数小于该第一预设值时,根据该校验码将该第一扇区中存储的第一数据变更为第三数据,读取该第一扇区中存储的第三数据,并将该第一扇区的读取次数标志位加1。
具体地,数据处理设备根据该校验码变更该第一数据得到第三数据,并将该第一扇区中存储的第一数据替换为第三数据,重新读取该第一扇区,得到该第一扇区中存储的第三数据,并在读取该第三数据后,将该第一扇区的读取次数标志位加1。
需要说明的是,在读取该第一扇区中存储的数据后,将该第一扇区的读取次数标志位加1,以便该数据处理设备根据该读取次数标志位确定该第一扇区被连续读取的次数,另外,数据处理设备在读取该第一扇区中存储的第一数据后,也将该第一扇区的读取次数标志位加1,即数据处理设备每次读取该第一扇区中存储的数据后,将该第一扇区的读取次数标志位加1。
S105、数据处理设备根据该第二扇区的地址读取该第二扇区中存储的第二数据。
具体地,数据处理设备根据该第一扇区存储的指示信息得到该第二扇区的地址,并根据该第二扇区的地址读取第二扇区中存储的第二数据。
进一步地,数据处理设备将该第一扇区的读取次数标志位清零。
具体地,该第一扇区的读取次数标志位表示重复读取该第一扇区的次数,在数据处理设备读取该第二扇区存储的数据后,可以确定该数据处理设备停止读取该第一扇区存储的数据,则将该第一扇区的地区次数标志位清零,等待下次读取该第一扇区存储的数据时重新计数。
通过采用上述执行主体为数据处理设备的方法,数据处理设备读取存储器的第一扇区中存储的第一数据,获取该第一扇区对应的校验码,并在根据该校验码确定该第一数据为错误数据时,获取该第一扇区的标识信息,并在根据该第一扇区的标识信息确定该第一扇区为媒体扇区时,确定该第一扇区的读取次数,在确定该读取次数大于或者等于第一预设值时,获取该第一扇区存储的指示信息,根据该第二扇区的地址读取该第二扇区中存储的第二数据,在多次通过该校验码变更并重新读取该第一扇区中存储的媒体数据依然为错误数据时,确定媒体数据为无法通过该校验码纠正的错误数据,则数据处理设备根据该第一扇区中存储的指示信息读取该第一扇区中存储的数据的下一数据,这样,在遇到出现错误并无法纠错的媒体数据时,数据处理设备可以直接读取该媒体数据之后的媒体数据,可以解决媒体数据在播放时出现停顿的问题,提高读取媒体数据的流畅性,从而提高用户体验。
本发明实施例提供一种数据处理的方法,如图2所示,该方法包括:
S201、数据处理设备确定存储器中的媒体扇区,并将各个媒体扇区的标识信息保存在第一标识集合中。
其中,该媒体扇区是用来存储媒体数据的扇区,该第一标识集合中包括全部媒体扇区的标识信息。
具体地,数据处理设备在存储器的全部扇区内预设媒体扇区,并将各个媒体扇区的标识信息保存在第一标识集合中,在存储媒体数据时,数据处理设备根据该第一标识集合查找该媒体扇区,并将媒体数据存储在媒体扇区内。
示例地,该数据处理设备可以是多媒体设备(如:机顶盒),该存储器可以是该多媒体设备的硬盘,该多媒体设备可以通过该硬盘存储数据。
S202、数据处理设备读取存储器的第一扇区中存储的第一数据。
具体地,存储器通过扇区存储数据,每个扇区可以存储512字节的数据,此外,每个扇区还存储该扇区的标识信息、指示信息和校验码,该标识信息可以是扇区标志,数据处理设备根据该扇区标志确定对应的扇区,该指示信息用于指示在读取该扇区内存储的数据后,数据处理设备进一步读取数据的地址,该校验码用于检查该扇区内存储的数据。
S203、数据处理设备获取该第一扇区对应的校验码。
具体地,该校验码可以是ECC(Error Correcting Code,错误检查和纠正)码,数据处理设备可以根据该ECC码检查和纠正该第一扇区中存储的数据的错误。
S204、数据处理设备在根据该校验码确定该第一数据为错误数据时,获取该第一扇区的标识信息。
具体地,该校验码可以是ECC码,数据处理设备可以根据该ECC码检查该第一数据的数据位,在根据该ECC码确定该第一数据的数据位出错时,确定该第一数据为错误数据(即该第一数据出错)时,数据处理设备读取该第一扇区的标识信息。
S205、数据处理设备根据该第一扇区的标识信息确定该第一扇区的类型。
具体地,数据处理设备在确定该第一标识集合中不包括该第一扇区的标识信息时,执行以下步骤S2060至S2070。
S2060、数据处理设备根据该校验码将该第一扇区中存储的第一数据变更为第四数据。
具体地,在确定该第一标识集合中不包括该第一扇区的标识信息时,可以确定该第一扇区不是媒体扇区,则该第一扇区中存储的第一数据不是媒体数据,则数据处理设备根据该校验码变更该第一数据得到第四数据,并将该第一扇区中存储的第一数据替换为第四数据。
S2070、数据处理设备读取该第一扇区中存储的第四数据。
示例地,该第一数据可以是系统数据,数据处理设备根据该第一扇区的标识信息确定该第一扇区不是媒体扇区,并确定该第一数据不是媒体数据时,则 数据处理设备修复并重新读取改第一扇区内存储的数据,以保证数据的准确性,若该第一数据存在两个发生错误的数据位,则该数据处理设备将循环执行修复和读取,并在经过预设时间或读取此书超过预设值时,发出出错警报。
可选地,数据处理设备在确定该第一标识集合中包括该第一扇区的标识信息时,执行以下步骤S206至S207。
S206、数据处理设备获取该第一扇区存储的读取次数标志位。
S207、数据处理设备根据该第一扇区存储的读取次数标志位得到该第一扇区的读取次数。
具体地,可以给各个扇区设置读取次数标志位,数据处理设备根据第一扇区的读取次数标志位确定第一扇区的读取次数。
示例地,在确定第一扇区的读取次数标志位为5时,可以确定该第一扇区被重复读取5次。
进一步地,数据处理设备得到该第一扇区的读取次数后,若确定该读取次数小于第一预设值时,执行以下步骤S2080至S2090。
S2080、数据处理设备根据该校验码将该第一扇区中存储的第一数据变更为第三数据。
具体地,数据处理设备根据该校验码检查该第一数据,在根据该校验码找到该第一数据的错误后,变更该第一数据中出错的数据位,并将变更后的数据重新写入该第一扇区。
示例地,该校验码可以是ECC码,数据处理设备在根据该ECC码检查出该第一数据的第10个数据位出现错误,若确定该第10个数据位为“0”,则将该数据位变更为“1”,并将变更后的数据重新写入第一扇区中。
S2090、数据处理设备读取该第一扇区中存储的第三数据,并将该第一扇区的读取次数标志位加1。
具体地,数据处理设备根据该校验码变更该第一数据得到第三数据,并将该第一扇区中存储的第一数据替换为第三数据,数据处理设备再次读取该第一扇区,得到该第一扇区中存储的第三数据,并在读取该第三数据后,将该第一扇区的读取次数标志位加1。
进一步地,若数据处理设备得到该第三数据后,根据该校验码检查该第三数据,若确定该第三数据没有错误,则继续处理该第三数据,若根据该校验码确定该第三数据为错误数据,则根据该校验码变更该第三数据。
需要说明的是,在读取该第一扇区中存储的数据后,将该第一扇区的读取次数标志位加1,以便该数据处理设备根据该读取次数标志位确定该第一扇区被连续读取的次数,另外,数据处理设备在读取该第一扇区中存储的第一数据后,也将该第一扇区的读取次数标志位加1,即数据处理设备每次读取该第一扇区中存储的数据后,将该第一扇区的读取次数标志位加1。
可选地,数据处理设备在确定该读取次数大于或者等于第一预设值时,执行以下步骤S208至S210,
S208、数据处理设备获取该第一扇区存储的指示信息。
其中,该指示信息包括第二扇区的地址。
具体地,数据处理设备读取该第一扇区超过预设次数时,可以确定该第一扇区内存储的数据无法通过该校验码纠正,这时,为了保证媒体数据在播放时的流畅性,数据处理设备确定跳过该第一扇区内的数据。
S209、数据处理设备根据该第二扇区的地址读取该第二扇区中存储的第二数据。
示例地,该存储器中存储的数据可以是视频,该视频的第一帧存储在第一扇区内,该视频的第二帧存储在第二扇区内,若该第一预设值为5,则在该数据处理设备第5次读取该第一帧视频时,依然确定该第一帧视频的数据出现错误,则该数据处理设备停止读取该第一帧视频,并获取该第一扇区内存储的第二扇区的地址,以读取第二帧视频,这样,在播放视频时,若某一帧视频出现无法纠正的错误,会直接播放下一帧视频,从而提高播放视频的流畅性。
S210、数据处理设备将该第一扇区的读取次数标志位清零。
具体地,该第一扇区的读取次数标志位表示重复读取该第一扇区的次数,在数据处理设备读取该第二扇区存储的数据后,可以确定该数据处理设备停止读取该第一扇区存储的数据,则将该第一扇区的地区次数标志位清零,等待下次读取该第一扇区存储的数据时重新计数。
通过采用上述方法,数据处理设备读取存储器的第一扇区中存储的第一数据,获取该第一扇区对应的校验码,并在根据该校验码确定该第一数据为错误数据时,获取该第一扇区的标识信息,并在根据该第一扇区的标识信息确定该第一扇区为媒体扇区时,确定该第一扇区的读取次数,在确定该读取次数大于或者等于第一预设值时,获取该第一扇区存储的指示信息,根据该第二扇区的地址读取该第二扇区中存储的第二数据,在多次通过该校验码变更并重新读取该第一扇区中存储的媒体数据依然为错误数据时,确定媒体数据为无法通过该校验码纠正的错误数据,则数据处理设备根据该第一扇区中存储的指示信息读取该第一扇区中存储的数据的下一数据,这样,在遇到出现错误并无法纠错的媒体数据时,数据处理设备可以直接读取该媒体数据之后的媒体数据,可以解决媒体数据在播放时出现停顿的问题,提高读取媒体数据的流畅性,从而提高用户体验。
本发明实施例提供一种数据处理设备30,如图3所示,包括:
存储器31,用于通过扇区存储数据。
其中,该存储器可以是硬盘,硬盘通过扇区存储数据,每个扇区可以存储512字节的数据,此外,每个扇区还存储该扇区的标识信息、指示信息和校验码,该标识信息可以是扇区标志,数据处理设备根据该扇区标志确定对应的扇区,该指示信息用于指示在读取该扇区内存储的数据后,数据处理设备进一步读取数据的地址,该校验码用于检查该扇区内存储的数据。
获取单元32,用于读取该存储器31的第一扇区中存储的第一数据,并获取该第一扇区对应的校验码。
处理单元33,用于根据该校验码检验该第一数据。
该获取单元32还用于,在该处理单元33根据该校验码确定该第一数据为错误数据时,取该第一扇区的标识信息。
该处理单元33还用于,在根据该获取单元32得到的第一扇区的标识信息确定该第一扇区为媒体扇区时,确定该第一扇区的读取次数。
其中,该媒体扇区为存储媒体数据的扇区。
该获取单元32还用于,在该处理单元33确定该读取次数大于或者等于第 一预设值时,获取该第一扇区存储的指示信息。
其中,该指示信息包括第二扇区的地址。
该获取单元32还用于,根据该第二扇区的地址读取该第二扇区中存储的第二数据。
可选地,该获取单元32还用于,获取该第一扇区存储的读取次数标志位。
其中,该读取次数标志位标示该第一扇区的读取次数。
该处理单元33具体用于,根据该读取次数标志位得到该第一扇区的读取次数。
具体地,可以给各个扇区设置读取次数标志位,数据处理设备根据第一扇区的读取次数标志位确定第一扇区的读取次数。
示例地,在确定第一扇区的读取次数标志位为5时,可以确定该第一扇区被重复读取5次。
可选地,该处理单元33还用于,在确定该第一扇区的读取次数小于该第一预设值时,根据该校验码将该第一扇区中存储的第一数据变更为第三数据。
具体地,数据处理设备根据该校验码检查该第一数据,在根据该校验码找到该第一数据的错误后,变更该第一数据中出错的数据位,并将变更后的数据重新写入该第一扇区。
示例地,该校验码可以是ECC码,数据处理设备在根据该ECC码检查出该第一数据的第10个数据位出现错误,若确定该第10个数据位为“0”,则将该数据位变更为“1”,并将变更后的数据重新写入第一扇区中。
该读取单元32还用于,读取该第一扇区中存储的第三数据。
该处理单元33还用于,将该第一扇区的读取次数标志位加1。
具体地,数据处理设备根据该校验码变更该第一数据得到第三数据,并将该第一扇区中存储的第一数据替换为第三数据,数据处理设备再次读取该第一扇区,得到该第一扇区中存储的第三数据,并在读取该第三数据后,将该第一扇区的读取次数标志位加1。
进一步地,若数据处理设备得到该第三数据后,根据该校验码检查该第三数据,若确定该第三数据没有错误,则继续处理该第三数据,若根据该校验码确定该第三数据为错误数据,则根据该校验码变更该第三数据。
需要说明的是,在读取该第一扇区中存储的数据后,将该第一扇区的读取次数标志位加1,以便该数据处理设备根据该读取次数标志位确定该第一扇区被连续读取的次数,另外,数据处理设备在读取该第一扇区中存储的第一数据后,也将该第一扇区的读取次数标志位加1,即数据处理设备每次读取该第一扇区中存储的数据后,将该第一扇区的读取次数标志位加1。
可选地,该处理单元33还用于,在该获取单元根据该第二扇区的地址读取该第二扇区中存储的第二数据后,将该第一扇区的读取次数标志位清零。
具体地,该第一扇区的读取次数标志位表示重复读取该第一扇区的次数,在数据处理设备读取该第二扇区存储的数据后,可以确定该数据处理设备停止读取该第一扇区存储的数据,则将该第一扇区的地区次数标志位清零,等待下次读取该第一扇区存储的数据时重新计数。
可选地,该处理单元33还用于,在该获取单元32读取该存储器的第一扇区中存储的第一数据前,确定该存储器中的媒体扇区,并将该各个媒体扇区的标识信息保存在第一标识集合中。
具体地,数据处理设备在存储器的全部扇区内预设媒体扇区,并将各个媒体扇区的标识信息保存在第一标识集合中,在存储媒体数据时,数据处理设备根据该第一标识集合查找该媒体扇区,并将媒体数据存储在媒体扇区内。
示例地,该数据处理设备可以是多媒体设备(如:机顶盒),该存储器可以是该多媒体设备的硬盘,该多媒体设备可以通过该硬盘存储数据。
该处理单元33具体用于,在确定该第一标识集合中包括该第一扇区的标识信息时,确定该第一扇区为媒体扇区。
可选地,该处理单元33还用于,在确定该第一标识集合中不包括该第一扇区的标识信息时,根据该校验码将该第一扇区中存储的第一数据变更为第四数据。
具体地,在确定该第一标识集合中不包括该第一扇区的标识信息时,可以确定该第一扇区不是媒体扇区,则该第一扇区中存储的第一数据不是媒体数据,则数据处理设备根据该校验码变更该第一数据得到第四数据,并将该第一扇区中存储的第一数据替换为第四数据。
该获取单元32还用于,读取该第一扇区中存储的第四数据。
示例地,该第一数据可以是系统数据,数据处理设备根据该第一扇区的标识信息确定该第一扇区不是媒体扇区,并确定该第一数据不是媒体数据时,则数据处理设备修复并重新读取改第一扇区内存储的数据,以保证数据的准确性,若该第一数据存在两个发生错误的数据位,则该数据处理设备将循环执行修复和读取,并在经过预设时间或读取此书超过预设值时,发出出错警报。
通过采用上述数据处理设备,数据处理设备读取存储器的第一扇区中存储的第一数据,获取该第一扇区对应的校验码,并在根据该校验码确定该第一数据为错误数据时,获取该第一扇区的标识信息,并在根据该第一扇区的标识信息确定该第一扇区为媒体扇区时,确定该第一扇区的读取次数,在确定该读取次数大于或者等于第一预设值时,获取该第一扇区存储的指示信息,根据该第二扇区的地址读取该第二扇区中存储的第二数据,在多次通过该校验码变更并重新读取该第一扇区中存储的媒体数据依然为错误数据时,确定媒体数据为无法通过该校验码纠正的错误数据,则数据处理设备根据该第一扇区中存储的指示信息读取该第一扇区中存储的数据的下一数据,这样,在遇到出现错误并无法纠错的媒体数据时,数据处理设备可以直接读取该媒体数据之后的媒体数据,可以解决媒体数据在播放时出现停顿的问题,提高读取媒体数据的流畅性,从而提高用户体验。
本发明实施例提供一种数据处理设备40,如图4所示,包括:
处理器(processor)41、通信接口(Communications Interface)42、存储器(memory)43和通信总线44;其中,该处理器41、该通信接口42和该存储器43通过该通信总线44完成相互间的通信。
处理器41可能是一个中央处理器CPU,或者是特定集成电路ASIC(Application Specific Integrated Circuit),或者是被配置成实施本发明实施例的一个或多个集成电路。
存储器43用于存放程序代码,该程序代码包括计算机操作指令。存储器43可能包含高速RAM存储器,也可能还包括非易失性存储器(non-volatile memory),例如至少一个磁盘存储器。
该通信接口42,用于实现这些装置之间的连接通信。
该处理器41执行程序代码,用于读取存储器的第一扇区中存储的第一数据,获取该第一扇区对应的校验码,并在根据该校验码确定该第一数据为错误数据时,获取该第一扇区的标识信息,并在根据该第一扇区的标识信息确定该第一扇区为媒体扇区时,确定该第一扇区的读取次数,在确定该读取次数大于或者等于第一预设值时,获取该第一扇区存储的指示信息,根据该第二扇区的地址读取该第二扇区中存储的第二数据。
其中,该媒体扇区为存储媒体数据的扇区,该指示信息包括第二扇区的地址。
可选地,该处理器41还用于,根据该第一扇区存储的读取次数标志位得到该第一扇区的读取次数。
其中,该读取次数标志位表示该第一扇区的读取次数。
可选地,该处理器41还用于,在确定该第一扇区的读取次数小于该第一预设值时,根据该校验码将该第一扇区中存储的第一数据变更为第三数据,读取该第一扇区中存储的第三数据,并将该第一扇区的读取次数标志位加1。
可选地,该处理器41还用于,在根据该第二扇区的地址读取该第二扇区中存储的第二数据后,将该第一扇区的读取次数标志位清零。
可选地,该处理器41还用于,在该数据处理设备读取存储器的第一扇区中存储的第一数据前,确定该存储器中的媒体扇区,将该各个媒体扇区的标识信息保存在第一标识集合中。
可选地,该处理器41具体用于,在确定该第一标识集合中包括该第一扇区的标识信息时,确定该第一扇区为媒体扇区。
可选地,该处理器41还用于,在确定该第一标识集合中不包括该第一扇区的标识信息时,根据该校验码将该第一扇区中存储的第一数据变更为第四数据,并读取该第一扇区中存储的第四数据。
以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应所述以权利要求的保护范围为准。

Claims (12)

  1. 一种数据处理的方法,其特征在于,包括:
    数据处理设备读取存储器的第一扇区中存储的第一数据;
    获取所述第一扇区对应的校验码,并在根据所述校验码确定所述第一数据为错误数据时,获取所述第一扇区的标识信息;
    在根据所述第一扇区的标识信息确定所述第一扇区为媒体扇区时,确定所述第一扇区的读取次数;其中,所述媒体扇区为存储媒体数据的扇区;
    在确定所述读取次数大于或者等于第一预设值时,获取所述第一扇区存储的指示信息;其中,所述指示信息包括第二扇区的地址;
    根据所述第二扇区的地址读取所述第二扇区中存储的第二数据。
  2. 根据权利要求1所述的方法,其特征在于,所述确定所述第一扇区的读取次数包括:
    根据所述第一扇区存储的读取次数标志位得到所述第一扇区的读取次数,其中,所述读取次数标志位表示所述第一扇区的读取次数。
  3. 根据权利要求2所述的方法,其特征在于,在确定所述第一扇区的读取次数小于所述第一预设值时,根据所述校验码将所述第一扇区中存储的第一数据变更为第三数据;
    读取所述第一扇区中存储的第三数据,并将所述第一扇区的读取次数标志位加1。
  4. 根据权利要求2或3所述的方法,其特征在于,在根据所述第二扇区的地址读取所述第二扇区中存储的第二数据后,所述方法还包括:
    将所述第一扇区的读取次数标志位清零。
  5. 根据权利要求1至4任一项所述的方法,其特征在于,在所述数据处理设备读取存储器的第一扇区中存储的第一数据前,所述方法还包括:
    确定所述存储器中的媒体扇区;
    将所述各个媒体扇区的标识信息保存在第一标识集合中;
    所述根据所述第一扇区的标识信息确定所述第一扇区为媒体扇区包括:
    在确定所述第一标识集合中包括所述第一扇区的标识信息时,确定所述第一扇区为媒体扇区。
  6. 根据权利要求5所述的方法,其特征在于,在确定所述第一标识集合中不包括所述第一扇区的标识信息时,根据所述校验码将所述第一扇区中存储的第一数据变更为第四数据;
    读取所述第一扇区中存储的第四数据。
  7. 一种数据处理设备,其特征在于,包括:
    存储器,用于通过扇区存储数据;
    获取单元,用于读取所述存储器的第一扇区中存储的第一数据,并获取所述第一扇区对应的校验码;
    处理单元,用于根据所述校验码检验所述第一数据;
    所述获取单元还用于,在所述处理单元根据所述校验码确定所述第一数据为错误数据时,取所述第一扇区的标识信息;
    所述处理单元还用于,在根据所述获取单元得到的第一扇区的标识信息确定所述第一扇区为媒体扇区时,确定所述第一扇区的读取次数;其中,所述媒体扇区为存储媒体数据的扇区;
    所述获取单元还用于,在所述处理单元确定所述读取次数大于或者等于第一预设值时,获取所述第一扇区存储的指示信息;其中,所述指示信息包括第二扇区的地址;
    所述获取单元还用于,根据所述第二扇区的地址读取所述第二扇区中存储的第二数据。
  8. 根据权利要求7所述的设备,其特征在于,所述获取单元还用于,获取所述第一扇区存储的读取次数标志位;其中,所述读取次数标志位标示所述第一扇区的读取次数;
    所述处理单元具体用于,根据所述读取次数标志位得到所述第一扇区的读取次数。
  9. 根据权利要求8所述的设备,其特征在于,所述处理单元还用于,在确定所述第一扇区的读取次数小于所述第一预设值时,根据所述校验码将所述第一扇区中存储的第一数据变更为第三数据;
    所述读取单元还用于,读取所述第一扇区中存储的第三数据;
    所述处理单元还用于,将所述第一扇区的读取次数标志位加1。
  10. 根据权利要求8或9所述的设备,其特征在于,所述处理单元还用于,在所述获取单元根据所述第二扇区的地址读取所述第二扇区中存储的第二数据后,将所述第一扇区的读取次数标志位清零。
  11. 根据权利要求7至10任一项所述的设备,其特征在于,所述处理单元还用于,在所述获取单元读取所述存储器的第一扇区中存储的第一数据前,确定所述存储器中的媒体扇区,并将所述各个媒体扇区的标识信息保存在第一标 识集合中;
    所述处理单元具体用于,在确定所述第一标识集合中包括所述第一扇区的标识信息时,确定所述第一扇区为媒体扇区。
  12. 根据权利要求11所述的设备,其特征在于,所述处理单元还用于,在确定所述第一标识集合中不包括所述第一扇区的标识信息时,根据所述校验码将所述第一扇区中存储的第一数据变更为第四数据;
    所述获取单元还用于,读取所述第一扇区中存储的第四数据。
PCT/CN2015/078703 2014-05-16 2015-05-11 一种数据处理的方法和设备 WO2015172698A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410209078.4A CN104021806B (zh) 2014-05-16 2014-05-16 一种数据处理的方法和设备
CN201410209078.4 2014-05-16

Publications (1)

Publication Number Publication Date
WO2015172698A1 true WO2015172698A1 (zh) 2015-11-19

Family

ID=51438525

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/078703 WO2015172698A1 (zh) 2014-05-16 2015-05-11 一种数据处理的方法和设备

Country Status (2)

Country Link
CN (1) CN104021806B (zh)
WO (1) WO2015172698A1 (zh)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104021806B (zh) * 2014-05-16 2017-06-16 华为技术有限公司 一种数据处理的方法和设备
CN109542685A (zh) * 2018-11-20 2019-03-29 江门市兰格电子有限公司 基于多扇区的存储器数据校验方法、装置、设备及介质
CN110069360B (zh) * 2019-04-22 2023-03-21 重庆长安新能源汽车科技有限公司 一种电机控制器数据的存储、读取方法及装置
CN113791930A (zh) * 2021-09-14 2021-12-14 浙江大华存储科技有限公司 读命令的处理方法和装置、存储介质及电子装置

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1776817A (zh) * 2004-11-19 2006-05-24 三星电子株式会社 在硬盘驱动器中访问数据扇区和处理坏扇区的方法
CN101228513A (zh) * 2005-06-28 2008-07-23 微软公司 从慢检索存储装置中检索图形
US20140068324A1 (en) * 2012-09-06 2014-03-06 International Business Machines Corporation Asynchronous raid stripe writesto enable response to media errors
CN104021806A (zh) * 2014-05-16 2014-09-03 华为技术有限公司 一种数据处理的方法和设备

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1306381C (zh) * 2004-08-18 2007-03-21 华为技术有限公司 一种磁盘阵列数据的读写方法及并行读写方法
CN102200937A (zh) * 2011-05-31 2011-09-28 深圳创维-Rgb电子有限公司 一种与非闪存中数据读取的方法、装置及电视机系统

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1776817A (zh) * 2004-11-19 2006-05-24 三星电子株式会社 在硬盘驱动器中访问数据扇区和处理坏扇区的方法
CN101228513A (zh) * 2005-06-28 2008-07-23 微软公司 从慢检索存储装置中检索图形
US20140068324A1 (en) * 2012-09-06 2014-03-06 International Business Machines Corporation Asynchronous raid stripe writesto enable response to media errors
CN104021806A (zh) * 2014-05-16 2014-09-03 华为技术有限公司 一种数据处理的方法和设备

Also Published As

Publication number Publication date
CN104021806A (zh) 2014-09-03
CN104021806B (zh) 2017-06-16

Similar Documents

Publication Publication Date Title
CN102937922B (zh) 查询和修复数据
US9250990B2 (en) Use of error correction pointers to handle errors in memory
KR101730510B1 (ko) 메타데이터 태그를 통한 불규칙적인 패리티 분포 검출
US8661306B2 (en) Baseboard management controller and memory error detection method of computing device utilized thereby
TWI582779B (zh) 讀取電壓準位估測方法、記憶體儲存裝置及記憶體控制電路單元
WO2015172698A1 (zh) 一种数据处理的方法和设备
TWI509624B (zh) 快閃記憶體裝置、記憶體控制器及快閃記憶體的控制方法
TWI640865B (zh) 解碼方法、記憶體儲存裝置及記憶體控制電路單元
US10475517B2 (en) Characterizing and operating a non-volatile memory device
US9384144B1 (en) Error detection using a logical address key
TWI459393B (zh) 用於非揮發性記憶體的資料寫入方法、控制器與儲存裝置
TWI459198B (zh) 記憶體儲存裝置、其記憶體控制器與有效資料識別方法
US9754682B2 (en) Implementing enhanced performance with read before write to phase change memory
US8738989B2 (en) Method and apparatus for detecting free page and a method and apparatus for decoding error correction code using the method and apparatus for detecting free page
CN109491828B (zh) 解码方法、存储器存储装置及存储器控制电路单元
TW201543496A (zh) 資料處理方法、記憶體控制電路單元以及記憶體儲存裝置
US9658922B2 (en) Computer-readable recording medium having stored therein program for write inspection, information processing device, and method for write inspection
TW201618112A (zh) 資料存取方法、記憶體控制電路單元及記憶體儲存裝置
JP2013223240A5 (zh)
US8549384B1 (en) Method and apparatus for determining, based on an error correction code, one or more locations to store data in a flash memory
US20150067192A1 (en) System and method for adjusting sas addresses of sas expanders
TW201735049A (zh) 非依電性記憶體裝置及其空頁偵測方法
US9678831B2 (en) Error correction method and memory device capable of reading pages continuously
TWI748214B (zh) 快閃記憶體控制器、儲存裝置及其讀取方法
US10019186B2 (en) Data maintenance method for error control and data storage device using the same

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: 15793054

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15793054

Country of ref document: EP

Kind code of ref document: A1