[go: up one dir, main page]

WO2016192110A1 - File information processing method and device, and file processing apparatus and system - Google Patents

File information processing method and device, and file processing apparatus and system Download PDF

Info

Publication number
WO2016192110A1
WO2016192110A1 PCT/CN2015/080923 CN2015080923W WO2016192110A1 WO 2016192110 A1 WO2016192110 A1 WO 2016192110A1 CN 2015080923 W CN2015080923 W CN 2015080923W WO 2016192110 A1 WO2016192110 A1 WO 2016192110A1
Authority
WO
WIPO (PCT)
Prior art keywords
index information
file
write
information area
memory
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2015/080923
Other languages
French (fr)
Chinese (zh)
Inventor
王珂
张强
庹伟
梁泰文
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
SZ DJI Technology Co Ltd
Original Assignee
SZ DJI Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by SZ DJI Technology Co Ltd filed Critical SZ DJI Technology Co Ltd
Priority to CN201580003155.3A priority Critical patent/CN105830067B/en
Priority to PCT/CN2015/080923 priority patent/WO2016192110A1/en
Publication of WO2016192110A1 publication Critical patent/WO2016192110A1/en
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; 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
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices

Definitions

  • the present invention relates to the field of file storage processing technologies, and in particular, to a file information processing method and apparatus, and a file processing device and system.
  • a file system is configured in a digital camera or the like, and the file system is used to clarify the method and data structure of the file on the storage device, that is, the method of organizing the file on the storage device, and the file management software is completed according to the organization structure of the file system.
  • File-related operations such as creating, storing, reading, and modifying, and the rate of reading and writing files depends on the organization of the file system and the data transfer speed of the storage device itself.
  • the current file system has a problem of missing file index information. It is necessary to propose related solutions to avoid the problem of missing file index information.
  • the embodiment of the invention provides a file information processing method and device, and a file processing device and system, which can effectively avoid the loss problem in the file index information writing back process.
  • an embodiment of the present invention provides a file information processing method, including:
  • the file index information to be written back is determined
  • the determined file index information is written into at least two index information areas configured in the memory.
  • the writing the determined file index information into the at least two index information areas configured in the memory including:
  • the determined file index information is written into at least two index information areas configured in the memory according to a preset write-back strategy.
  • the writing the determined file index information into the at least two index information areas configured in the memory including:
  • the determined file index information is written into the second index information area configured in the memory.
  • the determining the file index information to be written back includes:
  • the file index information to be written back is periodically determined according to a preset write-back cycle, so that the determined file index information is periodically written to the memory corresponding index information area.
  • the writing the determined file index information into the at least two index information areas configured in the memory including:
  • the determined file index information is written to the second index information area configured in the memory.
  • the writing the determined file index information into the at least two index information areas configured in the memory including:
  • the determined file index information is written to the second index information area configured in the memory.
  • the method further includes:
  • the determined associated file index information is separately stored in at least two index information areas configured in the memory.
  • the method further includes:
  • the write status of the index information area is set, and after the writing ends, the write status of the index information area is updated.
  • the method further includes:
  • a write start identifier is configured for the index information area
  • a write completion identifier is configured for the index information area
  • the method further includes:
  • the index identifier associated with the index information area is set as the write start identifier, and after the end of the write, the associated index identifier is set as the write completion identifier.
  • the method further includes:
  • the file index information in the index information area whose status is abnormal is updated with the file index information in the index information area whose status is normal.
  • the method further includes:
  • Detecting an application environment identifying a storage speed level, the storage speed level being determined based on a speed requirement to write data to the memory;
  • a writeback policy is selected based on the identified storage speed level.
  • the embodiment of the present invention further provides a file information processing method, including:
  • the memory is configured with at least two index information areas.
  • the setting the status of the index information area is a write start state, including:
  • the configuring the write completion identifier in the index information area of the memory includes:
  • the index identifier configured in the corresponding index information area is set to the write completion identifier.
  • the method further includes:
  • the file index information in the index information area whose status is abnormal is updated with the file index information in the index information area whose status is normal.
  • an embodiment of the present invention provides a file information processing apparatus, including:
  • a determining module configured to determine file index information to be written back when detecting that the file index information is written back to the memory
  • a write back module configured to write the determined file index information into at least two index information areas configured in the memory.
  • the write-back module is specifically configured to write the determined file index information into at least two index information areas configured in the memory according to a preset write-back policy.
  • the write-back module is specifically configured to write the determined file index information into the first index information area configured in the memory; and write the determined file index information to the memory In the second index information area configured in the middle.
  • the write-back module is configured to write the determined file index information into the first index information area configured in the memory, where the determined file index information is completely written. After the first index information area is reached, the determined file index information is written into the second index information area configured in the memory.
  • the determining module is configured to periodically determine file index information to be written back according to a preset writeback period, so as to periodically write the determined file index information to the The memory corresponds to an index information area.
  • the write-back module is specifically configured to: when the current number of write-backs is an odd number of times, write the determined file index information to the first index information area configured in the memory; The number of writebacks is an even number of times, and the determined file index information is written to the second index information area configured in the memory.
  • the write-back module is specifically configured to: when the current number of write-backs is an even number of times, write the determined file index information to the first index information area configured in the memory; The number of writebacks is an odd number of times, and the determined file index information is written to the second index information area configured in the memory.
  • the write-back module is further configured to: if the file corresponding to the file index information is stored in the memory, determine the associated file index information of the file; and determine the associated file index.
  • the information is separately stored into at least two index information areas configured in the memory.
  • the device further includes:
  • the first setting module is configured to set a write state of the index information area when detecting the writing of the file index information to the index information area, and update the write status of the index information area after the writing ends.
  • the device further includes:
  • the second setting module is configured to configure a write start identifier for the index information area when the file index information is written to the index information area, and configure a write completion identifier for the index information area after the writing ends.
  • the device further includes:
  • the third setting module is configured to: when the file index information is written to the index information area, set the index identifier associated with the index information area to a write start identifier, and after the writing ends, set the associated index identifier to write Complete the logo.
  • the device further includes:
  • an update module configured to determine, according to the write completion identifier, a state of each index information area of the memory; if there is an index information area whose status is abnormal, updating the status with the file index information in the index information area whose status is normal is abnormal. File index information in the index information area.
  • the device further includes:
  • a selection module for detecting an application environment, identifying a storage speed level, the storage speed level being determined based on a speed requirement of writing data to the memory; and selecting a writeback policy based on the identified storage speed level.
  • the embodiment of the present invention further provides a file information processing apparatus, including:
  • a state setting module configured to set a state of the index information area to a write start state when detecting that the determined file index information is written to the index information area configured in the memory
  • an update module configured to update the state of the index information area to a write completion state after the writing of the index information ends; wherein at least two index information areas are configured in the memory.
  • the state setting module is configured to: when the determined file index information is written to the index information area configured in the memory, set the index identifier configured in the corresponding index information area to a write start identifier. .
  • the update module is specifically configured to: after the end of the writing of the index information, the index identifier configured in the corresponding index information area is set as a write completion identifier.
  • the device further includes:
  • a processing module configured to determine, according to the write completion identifier, a state of each index information area of the memory; if there is an index information area whose state is abnormal, update the index information with the abnormality of the file index information in the index information area whose state is normal File index information in the zone.
  • the embodiment of the present invention further provides a file processing device, including: a processor, wherein: the processor is configured to determine to be written back when detecting that the file index information is written back to the connected memory. File index information; the determined file index information is written into at least two index information areas configured in the memory.
  • the processor is configured to write the determined file index information into at least two index information areas configured in the memory according to a preset write-back policy.
  • the processor is configured to write the determined file index information into the first index information area configured in the memory; and write the determined file index information into the memory.
  • the second index information area of the configuration is configured to write the determined file index information into the first index information area configured in the memory; and write the determined file index information into the memory.
  • the processor is configured to write the determined file index information into the first index information area configured in the memory, and the determined file index information is completely written. After the first index information area, the determined file index information is written into the second index information area configured in the memory.
  • the processor is configured to periodically determine file index information to be written back according to a preset write-back period, so as to periodically write the determined file index information to the The memory corresponds to an index information area.
  • the processor is configured to: if the current number of writeback times is an odd number of times, write the determined file index information to the first index information area configured in the memory; When the number of writebacks is an even number of times, the determined file index information is written to the second index information area configured in the memory.
  • the processor is further configured to: if the file corresponding to the file index information is stored in the memory, determine the associated file index information of the file; and determine the associated file index information. Stored separately into at least two index information areas configured in the memory.
  • the processor is further configured to: when detecting that the file index information is written into the index information area, set a write status of the index information area, and update the writing of the index information area after the writing ends status.
  • the processor is further configured to: when detecting that the file index information is written into the index information area, configure a write start identifier for the index information area, and configure the index information area after the writing ends Write the completion ID.
  • the processor is further configured to: when the file index information is written to the index information area, set an index identifier associated with the index information area as a write start identifier, and after the end of the writing, associate the identifier The index ID is set to the write completion ID.
  • the processor is further configured to determine, according to the write completion identifier, a state of each index information area of the memory; and if there is an index information area whose state is abnormal, the file index in the index information area whose status is normal The information is updated with the file index information in the abnormal index information area.
  • the processor is further configured to detect an application environment, and identify a storage speed level, where the storage speed level is determined based on a speed requirement for writing data into the memory; according to the identified storage speed level Choose a writeback strategy.
  • the embodiment of the present invention further provides a file processing device, including: a processor, wherein: the processor is configured to: write a determined file index in an index information area configured to be connected to a connected memory; In the information, the state of the index information area is set to a write start state; after the writing of the index information is finished, the state of updating the index information area is a write completion state; wherein at least two index information areas are configured in the memory .
  • the processor is configured to set an index identifier configured in the corresponding index information area as a write start identifier.
  • the processor is configured to set an index identifier configured in the corresponding index information area as a write completion identifier.
  • the processor is further configured to determine, according to the write completion identifier, a state of each index information area of the memory; if there is an index information area whose state is abnormal, the file index information status is normal in the index information area.
  • the file index information update status is file index information in the abnormal index information area.
  • the embodiment of the present invention further provides a file processing system, including: a memory, a memory, and a processor, wherein the processor is respectively connected to the memory and the memory, and the processor is configured to execute the foregoing A related step of the method on the one hand.
  • a file processing system including: a memory, a memory, and a processor, wherein the processor is respectively connected to the memory and the memory, and the processor is configured to execute the foregoing A related step of the method on the one hand.
  • the embodiment of the present invention further provides a file processing system, including: a memory, a memory, and a processor, wherein the processor is respectively connected to the memory and the memory, and the processor is used to The relevant steps of the method as described in the second aspect above are performed.
  • the embodiment of the invention optimizes the write back of the file index information, and can better ensure the write back and save of the file index information.
  • FIG. 1 is a schematic flow chart of a file information processing method according to an embodiment of the present invention.
  • FIG. 2 is a schematic flowchart diagram of another file information processing method according to an embodiment of the present invention.
  • FIG. 3 is a schematic flowchart diagram of still another file information processing method according to an embodiment of the present invention.
  • FIG. 4 is a schematic flowchart of a file information updating method according to an embodiment of the present invention.
  • FIG. 5 is a schematic flowchart diagram of still another file information processing method according to an embodiment of the present invention.
  • FIG. 6 is a schematic structural diagram of a file system
  • FIG. 7 is a schematic structural diagram of another system according to an embodiment of the present invention.
  • FIG. 8 is a schematic flowchart diagram of another file information updating method according to an embodiment of the present invention.
  • FIG. 9 is a schematic flow chart of a write back method in a high speed storage system according to an embodiment of the present invention.
  • FIG. 10 is a schematic flowchart diagram of a write back method in an ultra high speed storage system according to an embodiment of the present invention.
  • FIG. 11 is a schematic structural diagram of a file information processing apparatus according to an embodiment of the present invention.
  • FIG. 12 is a schematic structural diagram of another file information processing apparatus according to an embodiment of the present invention.
  • FIG. 13 is a schematic structural diagram of still another file information processing apparatus according to an embodiment of the present invention.
  • FIG. 14 is a schematic structural diagram of a file processing device according to an embodiment of the present invention.
  • FIG. 15 is a schematic structural diagram of another file processing device according to an embodiment of the present invention.
  • 16 is a schematic structural diagram of a file processing system according to an embodiment of the present invention.
  • FIG. 17 is a schematic structural diagram of another file processing system according to an embodiment of the present invention.
  • the file system related content is loaded into the device memory.
  • the file data storage is updated (write update)
  • the file index information recorded in the file system of the device memory is first modified.
  • the device then writes back the file system in memory to the index information area of the storage device (hard disk).
  • the embodiment of the invention configures at least two index information areas for storing index information of the file.
  • the file index information can be written into the corresponding index information area according to certain rules, such as writing or cross-back writing, random writing, and the like. In the entire write-back process, as long as there is no abnormality in one of the times, the content of the index information area in which the abnormality occurs may be updated by the content of the index information area where the abnormality does not occur.
  • FIG. 1 is a schematic flowchart of a method for processing file information according to an embodiment of the present invention.
  • the method in the embodiment of the present invention may be applied to various file systems, which may be specifically executed by a processor. , the method includes:
  • S101 Determine file index information to be written back when detecting that the file index information is written back to the memory.
  • the file system will request that the relevant data of the file in the memory be periodically written back to the hard disk.
  • the file system will The memory writes back information about the file to the memory, including file index information.
  • the memory can be an ordinary mechanical hard disk or an SSD (Solid State Drives) that can realize ultra-high speed storage.
  • the file index information about the file in the memory is updated, and the file index information may be information such as the address, file name, and creation time of each data block block in which the file is stored.
  • the file index information to be written back only the part of the content to be updated may be determined in order to reduce the write-back overhead.
  • S102 Write the determined file index information into at least two index information areas configured in the memory.
  • Two or more index information areas are configured in the memory in advance, and the determined file index information needs to be separately written to the configured two or more index information areas.
  • the file index information may be written back according to the preset write-back policy.
  • the preset write-back policy may include: sequentially writing the determined file index information into the corresponding index information area. Taking the two index information areas as an example, when the file index information needs to be written, the file index information is first written into the first index information area, and after completion, the file index information is written into the second index information area. If an abnormality occurs when the file index information is written to the second index information area, for example, the device is powered off, all file index information of the second index information area may be lost, but the file index information of the first index information area is still presence.
  • the file index information of the first index information area is lost, but in the last write back period, the file index information written to the second index information area is It still exists and has not been damaged. It should be noted that when the file index information is written to the first index information area, the data is still lost, but the lost data is not much, and the impact on the stored file data is not large. There will be no cases where the entire data cannot be recovered. The same reasoning can be made when there are three or more index information areas.
  • the preset writeback strategy may specifically be a back and forth write strategy.
  • the round-trip write strategy is performed based on the number of write-backs.
  • N-th write back if N is an odd number, the file index information is written into the first index information area, and if N is For an even number, the second index information area is written. In this case, it is also possible to prevent the file index information from being lost and the data cannot be recovered more effectively.
  • the preset write-back strategy may also be: simultaneously writing each index information area; or writing file index information to each index information area in a random order; or selecting two or more of which the data amount is less than the threshold. Index information area to write file index information.
  • the method in the embodiment of the present invention may also select different write-back strategies based on the current application environment. Specifically, if the detected application environment is a first-class application environment (for example, a high-speed storage application environment of 720P video), the write-back strategy used includes a first-type write-back strategy, as described above in order. Write, randomly write, select two or more index information area writeback strategies in which the amount of data is less than the threshold; and if the detected application environment is a second type of application environment (eg, 4K video super high speed storage) The application environment) uses a second type of write-back strategy, such as the round-trip strategy mentioned above.
  • a first-class application environment for example, a high-speed storage application environment of 720P video
  • the write-back strategy used includes a first-type write-back strategy, as described above in order. Write, randomly write, select two or more index information area writeback strategies in which the amount of data is less than the threshold; and if the detected application environment is a second type of application environment
  • FIG. 2 is a schematic flowchart of another file information processing method according to an embodiment of the present invention.
  • the method in the embodiment of the present invention may be applied to various file systems, and may be specifically executed by a processor.
  • the embodiment of the present invention is described by taking two index information areas as an example. When three or more index information areas are included, the write back process may refer to the processing manner of the two index information areas, and the method specifically includes:
  • file index information such as a location of a block of the file in the memory in the memory may be updated, and the S201 may determine only the index information in which the update occurs as the file index information to be written back. . After the file index information to be written back is determined, subsequent file index information is written to the first index information area and the second index information area.
  • the setting the write status of the first index information area may include: configuring a write start identifier for the first index information area, or setting an index identifier associated with the first index information area as a write start identifier. That is, a new write start identifier is configured, or an existing identifier is set to start writing.
  • the processor detects the index information of the file to be written back from the memory, it is determined that the file index information needs to be written to the first index information area.
  • S203 Write the determined file index information into the first index information area; and write the file index information to be written back determined in S201 into the first index information area.
  • the updating the write status of the first index information area to the write completion status includes: configuring a write completion identifier for the first index information area, or setting an index identifier associated with the first index information area as a write completion identifier. That is, a new write completion identifier is newly configured for the first index information area, corresponding to the write start identifier, or the identifier set to start writing is set to be completed.
  • the setting the write status of the second index information area may include: configuring a write start identifier for the second index information area, or setting an index identifier associated with the second index information area as a write start identifier. That is, a new write start identifier is newly configured for the second index information area, or the existing identifier is set to start writing.
  • the processor detects the index information of the file to be written back from the memory, it is determined that the file index information needs to be written to the first index information area.
  • the processor detects the index information of the file to be written back from the memory, it is determined that the file index information needs to be written to the first index information area.
  • the state of the first index information area is updated to the write completion state, or the file index information to be written back has been completely written to the first index information area, it is determined that the second index information area needs to be written. Enter file index information.
  • S206 Write the determined file index information into the second index information area; and write the file index information to be written back determined in S201 into the second index information area.
  • the updating the write status of the second index information area to the write completion status includes: configuring a write completion identifier for the second index information area, or setting an index identifier associated with the second index information area as a write completion identifier. That is, a write completion flag is newly configured for the second index information area, or an identifier set to start writing is set to be completed.
  • the writing operation of the first index information area by the foregoing S202 to S204 and the writing operation of the second index information area by the S205 to S207 may first perform a writing operation on the first index information area, and then perform the a write operation of the index information area, that is, after the determined file index information has been completely written into the first index information area, performing the writing of the determined file index information to the The second index information area configured in the memory.
  • the write-back strategy can be more flexibly configured. For example, when there are five index information areas, the sequential write-back and simultaneous write-back can be combined, that is, simultaneously The first, second, and third index information areas are written back, and after the write back is completed, the fourth index information is sequentially written back, and then the fifth index information area is written back.
  • the file index information for the file is written back.
  • the write-back operation of the related index information for the other files in the stored procedure can be continued by the steps of S201 to S207 described above.
  • the method may further include: detecting the application environment, when the initial device is initialized, or when the file index information to be written back is determined. Identifying a storage speed level that is determined based on a speed requirement to write data to the memory; that is, determining whether the memory is in an application environment such as 720P video high speed storage, or in a device such as 4K video Ultra-high-speed storage application environment. After the storage speed level is identified, the write-back strategy is selected according to the identified storage speed level, and may be selected from a preset write-back strategy. When the high speed storage speed level is recognized, the S201 to S207 may be executed by selecting a policy to be sequentially written back.
  • the file index information is written in the two index information areas in sequence, so that the file index information in at least one index information area is not lost, and the index information is effectively avoided.
  • the problem that the entire data cannot be recovered, especially in a high-speed storage system such as a mechanical hard disk, can better ensure that a large number of files are not lost or damaged.
  • FIG. 3 it is a schematic flowchart of still another file information processing method according to an embodiment of the present invention.
  • the method in the embodiment of the present invention can be applied to various file systems, which can be specifically executed by a processor.
  • the embodiment of the present invention is described by taking two index information areas as an example. When three or more index information areas are included, the processing may refer to the processing manner of the two index information areas, and the method specifically includes:
  • S301 Determine, when the file index information is written back to the memory, the file index information to be written back.
  • file index information such as a location of a block of the file in the memory in the memory may be updated, and the S301 may determine only the index information in which the update occurs as the file index information to be written back. . After the file index information to be written back is determined, the file index information is triggered to be written to the index information area.
  • the embodiment of the present invention periodically determines the file index information to be written back according to a preset write-back cycle, so as to periodically write the determined file index information to the file index information.
  • the memory corresponds to an index information area. Specifically, the number of times of writing back is recorded, so as to determine the index information area corresponding to the current number of times of writing back.
  • the setting the write status of the first index information area may include: configuring a write start identifier for the first index information area, or setting an index identifier associated with the first index information area as a write start identifier. That is, a write completion identifier is newly configured for the first index information area, or the identifier set to start writing is set to be completed.
  • the current writeback is the Nth time and N is an odd number, it is determined that the file index information is written to the first index information area.
  • S303 Write the determined file index information into the first index information area; and write the file index information to be written back determined in S301 into the first index information area.
  • the updating the write status of the first index information area to the write completion status includes: configuring a write completion identifier for the first index information area, or setting an index identifier associated with the first index information area as a write completion identifier. That is, a write completion identifier is newly configured for the first index information area, or the identifier set to start writing is set to be completed.
  • the setting the write status of the second index information area may include: configuring a write start identifier for the second index information area, or setting an index identifier associated with the second index information area as a write start identifier. That is, a new write start identifier is newly configured for the second index information area, or the existing identifier is set to start writing.
  • the detection determines that the file index information is written to the second index information area.
  • S306 Write the determined file index information into the second index information area; and write the file index information to be written back determined in S301 into the second index information area.
  • the updating the write status of the second index information area to the write completion status includes: configuring a write completion identifier for the second index information area, or setting an index identifier associated with the second index information area as a write completion identifier. That is, a write completion flag is newly configured for the second index information area, or an identifier set to start writing is set to be completed.
  • S309 Store the determined associated file index information into at least two index information areas configured in the memory.
  • the writing order may be opposite to that in the embodiment, for example, when the odd number of times, the determined file index information is written into the second index information area, in an even number of times.
  • the determined file index information is written into the first index information area.
  • the setting of writing completion or writing start identification performs the same processing.
  • the associated file index information may be all file index information of the file, including file index information written in the first index information area and the second index information area in S303 and S306. That is to say, after the file storage is completed, all the file index information of the file needs to be written back to all the index information areas. Specifically, it may be written back to each index information area in a sequential manner or in a random manner.
  • the file index information for the file is written back.
  • the embodiment of the present invention can continue to perform the write back operation for the related index information in other file storage processes based on the steps of S301 to S309 described above.
  • the method may further include: detecting the application environment, when the initial device is initialized, or when the file index information to be written back is determined. Identifying a storage speed level that is determined based on a speed requirement to write data to the memory; that is, determining whether the memory is in an application environment such as 720P video high speed storage, or in a device such as 4K video Ultra-high-speed storage application environment. After identifying the stored speed grade, a writeback strategy is selected based on the identified storage speed level. When it is recognized that the super high speed storage speed level is selected, the S301 to S309 may be executed by selecting a policy of writing back and forth.
  • the file index information in the two index information areas by writing the file index information in the two index information areas, it is better to ensure that the file index information in at least one index information area is not lost, and the index information is effectively avoided.
  • FIG. 4 it is a schematic flowchart of a method for updating a file information according to an embodiment of the present invention.
  • the method can be applied to various file systems, which can be executed by a processor, and the file involved in the embodiment of the present invention.
  • the information includes file index information
  • the hard disk includes at least two index information areas to store file index information.
  • the write status of the corresponding index information area is set and updated.
  • the method in the embodiment of the present invention performs update of the file index information based on the write status.
  • the method of the embodiment of the present invention specifically includes:
  • S401 Determine a state of each index information area of the memory based on the write completion identifier.
  • each index information area includes an abnormal status and a normal status.
  • a write completion identifier exists in an index information area, it indicates that the file index information is written to the index information area has been completed normally, and its status is normal; if there is no write completion identifier, it can be determined that the last time The write back operation of the index information area does not end normally, and its status should be abnormal.
  • a cross-backward and write-back strategy is generally adopted, in which the index information area in the normal state is under the policy.
  • the file index information may not be complete, for example, writing the file index information S1 to the first index information area on an odd number of times, and writing the file index information S2 to the second index information area on an even number of times, and S2 is the latest file information.
  • File index information if an exception occurs when writing back S2, the latest file index information will be lost, and this part of the latest data cannot be recovered.
  • the write-back cycle can be shortened, and the number of write-backs is increased to make the file index information of each write-back less, which can effectively reduce the amount of data lost when the file index information is lost.
  • the embodiment of the present invention adds a write start or a write completion identifier, and uses a double detection mechanism when checking a hard disk, which can easily and effectively realize whether all information is completely and effectively detected. Through the update operation, all index information areas can be guaranteed to have normal File index information.
  • FIG. 5 is a schematic flowchart of still another file information processing method according to an embodiment of the present invention.
  • the method in the embodiment of the present invention can be applied to various file systems, which can be specifically executed by a processor.
  • the methods include:
  • the memory is configured with at least two index information areas.
  • the setting the status of the index information area to the write start state includes: setting an index identifier configured in the corresponding index information area as a write start identifier.
  • the method includes: setting an index identifier configured in the corresponding index information area as a write completion identifier. That is, a new index identifier is configured for the index information area, or an existing index identifier is set.
  • the method of the embodiment of the present invention may further include the following steps in the next file system initialization phase or other suitable phase:
  • S503 Determine, according to the write completion identifier, a state of each index information area of the memory
  • the status of the index information area with the completion flag is normal, and if there is no write completion flag, it indicates that the previous file index information has not been written normally, or the abnormal situation such as the last power failure occurs, resulting in the file index information. All the information of the area is lost, and the status of the index information area is abnormal.
  • the file index information in the normal index information area can be directly written into the abnormal index information area.
  • the embodiment of the present invention adds a write start or a write completion identifier, and uses a double detection mechanism when checking a hard disk, which can easily and effectively realize whether all information is completely and effectively detected. Through the update operation, all index information areas can be guaranteed to have normal File index information.
  • the file information processing of the embodiment of the present invention will be further described in detail below with reference to FIG. 6, FIG. 7, FIG. 8, FIG. 9, and FIG.
  • the structure of the file system can be referred to as shown in FIG. 6. All key information related to the file system is recorded in the Super Sector Supersector, the related information of the directory is recorded in the directory table Dirtable, and the related information of the file itself is recorded in the index table InodeTable.
  • the block map BlockMap records the corresponding information of all the storage blocks, and the block area Blockarea is the data storage area, and stores the file data.
  • Supersector, Dirtable, InodeTable, and BlockMap are header areas, where Dirtable, InodeTable, and BlockMap are index information areas, and Blockarea is a data area.
  • the information about the index information area is loaded into the device memory.
  • the memory updates the related information in the memory according to the specific conditions of the file data stored in the data area. To record file index information for the file data. These index information can be periodically written back to the memory (in the hard disk).
  • the file system structure diagram of the embodiment of the present invention is shown in FIG. 7.
  • the key areas of the file system need to be 512 KB as a basic unit, and the Supersector is generally in the first block of the memory.
  • the first absolute sector Supersector1 is stored
  • the second absolute sector Supersector2 is stored on the second block. Since the file system index information (Dirtable, InodeTable, BlockMap) and the designer's definition are highly correlated, the specific allocation length and organization manner In some cases, the index information part can be flexibly configured, and the entry of the index information area is generally recorded in the corresponding absolute sector.
  • FIG. 1 the file system index information
  • BlockMap BlockMap
  • indexInfo7 includes a first index information area IndexInfo1 and a second index information area IndexInfo2, and each of the index information areas includes Dirtable, InodeTable, and BlockMap.
  • File data is stored in the Blockarea area.
  • the first index information area IndexInfo1 write start and stop identifiers are recorded in the first absolute sector Supersector1, in the second absolute The sector Supersector 2 records the start and stop flags of the second index information area IndexInfo2, the entry of the corresponding index information, and the like.
  • the upgrade to the file system includes: a) the need to upgrade the file system detection operation (ie, detecting the existence of the corresponding file system on the disk), and first comparing the first absolute sector with the second absolute sector. By starting to stop writing the label, it is easy to determine whether there is an abnormality in the last head write and the part where the exception occurred. b) It is necessary to upgrade the write back operation of the file system, and each time the write back operation to the header is performed, the start of the corresponding absolute sector is stopped and the write label is updated.
  • FIG. 8 is a schematic flowchart diagram of a method for updating file information according to an embodiment of the present invention.
  • the boot process detects whether an identifiable file system exists on the storage medium, if not detected. After the file system structure is improved, the detection of the file system needs to add a new content, that is, the state detection of the index information area and the file information update.
  • the method in the embodiment of the present invention specifically includes:
  • S801 Read in the first absolute sector and the second absolute sector (ie, the first BLOCK and the second BLOCK). Specifically, when the booting needs to be initialized, S801 is executed.
  • File system identification is performed on the first absolute sector and the second absolute sector. Identification includes the following three steps:
  • FIG. 9 is a flow chart showing a write-back method in a high-speed storage system (non-super-high-speed storage system) in which a first index information area IndexInfo1 and a second index are required to be written back.
  • the information area IndexInfo2 is updated separately, including:
  • the write identifier of the first index information area is set to start of writing, and the write start identifier is written into the first physical block, that is, the write start identifier is written into the supervisor1 in the first absolute sector;
  • S902 Write back the first index information area, and write the corresponding file index information, that is, write the file index information that needs to be written back to the first index information area;
  • S903 Write the write identifier of the first index information area to write completion, and write the write completion identifier to the first physical block, that is, after the write back file index information is completed, write the write completion identifier to the first absolute Supersector1 in the sector;
  • the write identifier of the second index information area is set to start of writing, and the write start identifier is written to the second physical block, that is, the write start identifier is written into the supervisor2 in the second absolute sector;
  • S905 Write back the second index information area, and write the corresponding file index information, that is, write the file index information that needs to be written back to the second index information area;
  • S906 Write the write identifier of the second index information area to write completion, and write the write completion identifier to the second physical block, that is, after the write back file index information is completed, write the write completion identifier to the second absolute In supersector2 in the sector.
  • This write back of the file index information is completed. It can be understood that if there are multiple index information areas, the file index information that needs to be written back is sequentially written back.
  • FIG. 10 is a schematic flow chart showing a method for performing file index information write back in a super high speed system.
  • a super high speed system for example, ultra high speed photographing
  • the file index information is written back and forth by using a ping-pong method. In this way, the bandwidth can be utilized more effectively, and the file index information can be correctly written.
  • the method includes:
  • the odd-numbered write-back writes back the first index information area and the corresponding file index information.
  • the write identifier of the first index information area is set to start of writing, and the write start identifier is written into the first physical block.
  • write the start identifier to the supervisor1 in the first absolute sector; write back the first index information area, and write the corresponding file index information, that is, write the file index information that needs to be written back to the first In an index information area;
  • the write identifier of the first index information area is set to write completion, and the write completion identifier is written into the first physical block, that is, after the write back file index information is completed, the write completion identifier is written to In supervisor1 in the first absolute sector;
  • S1002 Write back the second index information area and the corresponding file index information by an even number of writebacks.
  • the write identifier of the second index information area is set to start of writing, and the write start identifier is written to the second physical block. , that is, the write start identifier is written into the supervisor2 in the second absolute sector;
  • the second index information area is written back, and the corresponding file index information is written, that is, the file index information that needs to be written back is written to the first
  • the write identifier of the second index information area is set to write completion, and the write completion identifier is written to the second physical block, that is, after the write back file index information is completed, the write completion identifier is written to In supervisor2 in the second absolute sector;
  • the header area of the file index information is selected to perform more operations such as updating and loading into the memory. Medium operation.
  • the present invention by configuring two or more index information areas and introducing two or more times of writing, it is possible to ensure that file index information in at least one index information area is not lost when an exception occurs in the write back. It effectively avoids the loss of index information and the problem that the entire disk data cannot be recovered, and can better ensure that a large number of files are not lost or damaged.
  • the write start or write completion flag is added, and the double detection mechanism is used when checking the hard disk, which can completely and effectively realize whether all the information is completely and effectively detected, and can ensure that all the index information areas have normal file index information.
  • FIG. 11 is a schematic structural diagram of a file information processing apparatus according to an embodiment of the present invention.
  • the apparatus in the embodiment of the present invention may be disposed in a file processing device such as a camera with a storage device.
  • the device include:
  • the determining module 11 is configured to determine file index information to be written back when detecting that the file index information is written back to the memory;
  • the write back module 12 is configured to write the determined file index information into at least two index information areas configured in the memory.
  • the file system will periodically write back the data related to the file in the memory to the hard disk.
  • the time interval for writing back is reached, or when the time is written back, Write back information about the file from the memory to the memory, including file index information.
  • the memory can be an ordinary mechanical hard disk, an SSD that can realize ultra-high speed storage, and the like.
  • the file index information about the file in the memory is updated, and the file index information may be information such as the address, file name, creation time, and the like of each data block block in which the file is stored. Therefore, when determining the file index information to be written back, the determining module 11 may only determine the part of the content that is updated, so as to reduce the write-back overhead.
  • Two or more index information areas are configured in advance in the memory, and for the file index information determined by the determining module 11, two or more index information area writes respectively required to be written are required.
  • the write-back module 12 may specifically write back file index information according to the configured preset write-back policy, including sequentially writing the determined file index information into the corresponding index information area. Taking the two index information areas as an example, when the file index information needs to be written, the write-back module 12 first writes the file index information to the first index information area, and then writes the file index information to the file index information. The second index information area. If an abnormality occurs when the file index information is written to the second index information area, for example, the device is powered off, all file index information of the second index information area may be lost, but the file index information of the first index information area is still presence.
  • the file index information of the first index information area is lost, but in the last write back period, the file index information written to the second index information area is It still exists and has not been damaged. It should be noted that when the file index information is written to the first index information area, the data is still lost, but the lost data is not much, and the impact on the stored file data is not large. There will be no cases where the entire data cannot be recovered. The same reasoning can be made when there are three or more index information areas.
  • the writeback module 12 can also specifically write back according to a preset back and forth write strategy. Similarly, taking two index information areas as an example, the round-trip write-back strategy is executed based on the number of write-backs.
  • the write-back module 12 writes back the Nth time, if N is an odd number, the file index information is written to the first. The information area is indexed, and if N is an even number, the second index information area is written. In this case, it is also possible to prevent the file index information from being lost and the data cannot be recovered more effectively.
  • the write-back strategy executed by the write-back module 12 may also be: writing each index information area separately; or writing file index information to each index information area according to a random order; or selecting a data amount less than a threshold. Two or more index information areas to write file index information.
  • the method in the embodiment of the present invention may also select different write-back strategies based on the current application environment. Specifically, if the detected application environment is a first-class application environment (for example, a high-speed storage application environment of 720P video), the write-back strategy used includes a first-type write-back strategy, as described above in order. Write, randomly write, select two or more index information area writeback strategies in which the amount of data is less than the threshold; and if the detected application environment is a second type of application environment (eg, 4K video super high speed storage) The application environment) uses a second type of write-back strategy, such as the round-trip strategy mentioned above.
  • a first-class application environment for example, a high-speed storage application environment of 720P video
  • the write-back strategy used includes a first-type write-back strategy, as described above in order. Write, randomly write, select two or more index information area writeback strategies in which the amount of data is less than the threshold; and if the detected application environment is a second type of application environment
  • FIG. 12 is a schematic structural diagram of another file information processing apparatus according to an embodiment of the present invention.
  • the apparatus of the embodiment of the present invention may be disposed in a file processing device such as a camera with a storage device.
  • the device includes the determining module 11 and the write-back module 12 in the previous embodiment.
  • the write-back module 12 is specifically configured to determine the file according to a preset write-back strategy.
  • the index information is written into at least two index information areas configured in the memory.
  • the write-back strategy specifically includes the above-mentioned sequential write back, cross back and forth write, random write back, and the like.
  • the write-back module 12 is specifically configured to write the determined file index information into the first index information area configured in the memory; and write the determined file index information to the memory In the second index information area configured in the middle.
  • the write-back module 12 is specifically configured to write the determined file index information into the first index information area configured in the memory, where the determined file index information is completely written. After entering the first index information area, the determined file index information is written into the second index information area configured in the memory. That is, the strategy of writing back in turn.
  • the determining module 11 is specifically configured to periodically determine file index information to be written back according to a preset writeback period, so as to periodically write the determined file index information to the file index information.
  • the memory corresponds to an index information area.
  • the writeback module 12 is specifically configured to: if the current number of writeback times is an odd number of times, write the determined file index information to the first index information area configured in the memory; When the current number of writebacks is an even number of times, the determined file index information is written to the second index information area configured in the memory. That is, based on the number of writebacks, the strategy of cross-back writing back.
  • the write-back module 12 is further configured to: if the file corresponding to the file index information is stored in the memory, determine the associated file index information of the file; and determine the associated file index information. Stored separately into at least two index information areas configured in the memory. In the strategy of writing back and forth, it is also necessary to finally write all the file index information into at least two index information areas to ensure the integrity of the file index information in each index information area.
  • the apparatus of the embodiment of the present invention may further include: a module for setting and updating a write state of each file index area, which may specifically include:
  • the first setting module 13 is configured to set a write state of the index information area when detecting the file index information to the index information area, and update the write status of the index information area after the writing ends.
  • the first setting module 13 is configured to: when detecting that the file index information is written into the index information area, configure a write start identifier for the index information area, and after the writing ends, the index information is The zone configuration write completion flag.
  • the first setting module 13 is configured to: when detecting that the file index information is written to the index information area, set the index identifier associated with the index information area to a write start identifier, and after the writing ends, The associated index ID is set to the write completion ID.
  • the module for setting and updating the write status of each file index information area includes:
  • the second setting module is configured to: when the file index information is written to the index information area, configure a write start identifier for the index information area, and configure a write completion identifier for the index information area after the writing ends.
  • the module for setting and updating the write status of each file index information area includes:
  • the third setting module is configured to: when the file index information is written to the index information area, set the index identifier associated with the index information area to a write start identifier, and after the writing ends, set the associated index identifier to write Complete the logo.
  • apparatus of the embodiment of the present invention may further include:
  • the update module 14 is configured to determine, according to the write completion identifier, a state of each index information area of the memory; if there is an index information area whose state is abnormal, the status is updated as abnormal by the file index information in the index information area whose status is normal. File index information in the index information area.
  • apparatus of the embodiment of the present invention may further include:
  • the selection module 15 is configured to detect an application environment, and identify a storage speed level determined based on a speed requirement of writing data into the memory; and selecting a write back policy according to the identified storage speed level.
  • the present invention by configuring two or more index information areas and introducing two or more times of writing, it is possible to ensure that file index information in at least one index information area is not lost when an exception occurs in the write back. It effectively avoids the loss of index information and the problem that the entire disk data cannot be recovered, and can better ensure that a large number of files are not lost or damaged.
  • the write start or write completion flag is added, and the double detection mechanism is used when checking the hard disk, which can completely and effectively realize whether all the information is completely and effectively detected, and can ensure that all the index information areas have normal file index information.
  • FIG. 13 it is a schematic structural diagram of another file information processing apparatus according to an embodiment of the present invention.
  • the apparatus of the embodiment of the present invention may be disposed in a file processing device such as a camera with a storage device, specifically,
  • the device includes:
  • a state setting module 21 configured to set a state of the index information area to a write start state when detecting that the determined file index information is written to the index information area configured in the memory;
  • the updating module 22 is configured to update the state of the index information area to a write completion state after the writing of the index information ends; wherein at least two index information areas are configured in the memory.
  • the state setting module 21 is configured to: when the determined file index information is written to the index information area configured in the memory, set the index identifier configured in the corresponding index information area as the write start identifier. .
  • the update module 22 is specifically configured to: after the writing of the index information ends, the index identifier configured in the corresponding index information area is set as a write completion identifier.
  • the device may further include: a processing module 23, configured to determine, according to the write completion identifier, a state of each index information area of the memory; and if there is an index information area whose state is abnormal, the index information area with the status as normal The file index information update status in the file index information in the abnormal index information area.
  • a processing module 23 configured to determine, according to the write completion identifier, a state of each index information area of the memory; and if there is an index information area whose state is abnormal, the index information area with the status as normal The file index information update status in the file index information in the abnormal index information area.
  • relevant content of the write start state and the write completion state involved in the embodiment of the present invention may refer to related descriptions in the corresponding embodiments in FIG. 8 to FIG.
  • the embodiment of the present invention adds a write start or a write completion identifier, and uses a double detection mechanism when checking a hard disk, which can easily and effectively realize whether all information is completely and effectively detected. Through the update operation, all index information areas can be guaranteed to have normal File index information.
  • the file processing device of the embodiment of the present invention includes an input device 100, an output device 200, and a processor 300, wherein the input device
  • the processor 300 can be used to input related data and information by the processor 300, and the processor 300 can output relevant data through the output device 200 by executing a related processing by calling a file processing application stored in an external or built-in memory. ,information.
  • the processor 300 is configured to: when detecting that the file index information is written back to the connected memory, determine file index information to be written back; and write the determined file index information into the memory. Configured in at least two index information areas.
  • the processor 300 is configured to write the determined file index information into at least two index information areas configured in the memory according to a preset write-back policy.
  • the processor 300 is specifically configured to write the determined file index information into the first index information area configured in the memory; and write the determined file index information to the memory. In the second index information area configured in the middle.
  • the processor 300 is configured to write the determined file index information into the first index information area configured in the memory, and the determined file index information is completely written. After entering the first index information area, the determined file index information is written into the second index information area configured in the memory.
  • the processor 300 is configured to periodically determine file index information to be written back according to a preset write-back period, so as to periodically write the determined file index information to the file.
  • the memory corresponds to an index information area.
  • the processor 300 is configured to: when the current number of writeback times is an odd number of times, write the determined file index information to the first index information area configured in the memory; The number of writebacks is an even number of times, and the determined file index information is written to the second index information area configured in the memory.
  • the processor 300 is further configured to: if the file corresponding to the file index information is stored in the memory, determine the associated file index information of the file; and determine the associated file index.
  • the information is separately stored into at least two index information areas configured in the memory.
  • the processor 300 is further configured to: when detecting that the file index information is written into the index information area, set a write status of the index information area, and update the index information area after the end of the writing. Write status.
  • the processor 300 is further configured to: when detecting that the file index information is written into the index information area, configure a write start identifier for the index information area, and after the writing ends, the index information area Configure the write completion ID.
  • the processor 300 is further configured to: when the file index information is written to the index information area, set the index identifier associated with the index information area to a write start identifier, and after the writing ends, The associated index ID is set to the write completion ID.
  • the processor 300 is further configured to determine, according to the write completion identifier, a state of each index information area of the memory; and if there is an index information area whose state is abnormal, the file in the index information area whose status is normal The index information updates the file index information in the index information area whose state is abnormal.
  • the processor 300 is further configured to detect an application environment, and identify a storage speed level, where the storage speed level is determined based on a speed requirement for writing data into the memory; according to the identified storage speed.
  • the level selects the writeback strategy.
  • the present invention by configuring two or more index information areas and introducing two or more times of writing, it is possible to ensure that file index information in at least one index information area is not lost when an exception occurs in the write back. It effectively avoids the loss of index information and the problem that the entire disk data cannot be recovered, and can better ensure that a large number of files are not lost or damaged.
  • the write start or write completion flag is added, and the double detection mechanism is used when checking the hard disk, which can completely and effectively realize whether all the information is completely and effectively detected, and can ensure that all the index information areas have normal file index information.
  • the file processing device of the embodiment of the present invention may specifically include an input device 400, an output device 500, and a processor 600.
  • the input device 400 is configured to input relevant data and information to the processor 600 first, and the processor 600 can execute the related processing and then pass through the output device 500 by calling a file processing application stored in an external or built-in memory.
  • the processor 600 is configured to: when the determined file index information is written into the index information area configured in the connected memory, set the state of the index information area to a write start state; and write the index information. After the end, the state of the index information area is updated to a write completion state; wherein at least two index information areas are configured in the memory.
  • the processor 600 is specifically configured to set an index identifier configured in the corresponding index information area as a write start identifier.
  • the processor 600 is configured to set an index identifier configured in the corresponding index information area as a write completion identifier.
  • the processor 600 is further configured to determine, according to the write completion identifier, a state of each index information area of the memory; if there is an index information area whose status is abnormal, the file in the index information area whose status is normal
  • the index information update status is file index information in the abnormal index information area.
  • the embodiment of the present invention adds a write start or a write completion identifier, and uses a double detection mechanism when checking a hard disk, which can easily and effectively realize whether all information is completely and effectively detected. Through the update operation, all index information areas can be guaranteed to have normal File index information.
  • the embodiment of the present invention further provides a file processing system.
  • the system includes: a memory 1000, a memory 2000, and a processor 3000.
  • the processor 3000 is respectively associated with the memory 1000 and the memory 2000. Connected, the processor 3000 is configured to determine file index information to be written back when detecting that the file index information is written back from the memory 1000 to the memory 2000; writing the determined file index information to the At least two index information areas configured in the memory 2000. It is specifically used to perform the various steps of the related method in any of the embodiments of Figures 1 through 4, and Figures 8-10.
  • FIG. 17 Another embodiment of the present invention further provides a file processing system.
  • the system includes: a memory 4000, a memory 5000, and a processor 6000.
  • the processor 6000 and the memory 4000 and the memory are respectively Connected to 5000, the processor 6000 is configured to determine file index information to be written back when detecting the file index information from the memory 4000 to the memory 5000; and writing the determined file index information to the location
  • the at least two index information areas configured in the memory 5000 are described. It is specifically used to perform the various steps of the related method in the embodiment of FIG.
  • the embodiment of the present invention adds a write start or a write completion identifier, and uses a double detection mechanism when checking a hard disk, which can easily and effectively realize whether all information is completely and effectively detected. Through the update operation, all index information areas can be guaranteed to have normal File index information.
  • the related apparatus and method disclosed may be implemented in other manners.
  • the device embodiments described above are merely illustrative.
  • the division of the modules or units is only a logical function division.
  • there may be another division manner for example, multiple units or components may be used. Combinations can be integrated into another system, or some features can be ignored or not executed.
  • the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.
  • each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
  • the integrated unit if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium.
  • the technical solution of the present invention which is essential or contributes to the prior art, or all or part of the technical solution, may be embodied in the form of a software product stored in a storage medium.
  • a number of instructions are included to cause a computer processor to perform all or part of the steps of the methods described in various embodiments of the present invention.
  • the foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like. .

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)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)

Abstract

A file information processing method and device, and file processing apparatus and system. The method comprises: (S101) when write-back of file index information to a memory unit is detected, determining file index information to be written-back; (S102) writing the determined file index information into at least two index information regions configured in the memory unit. The present invention optimizes the write-back of file index information and better ensures the write-back and storage of the file index information.

Description

一种文件信息处理方法、装置及文件处理设备、系统File information processing method, device and file processing device and system 技术领域Technical field

本发明涉及文件存储处理技术领域,尤其涉及一种文件信息处理方法、装置及文件处理设备、系统。The present invention relates to the field of file storage processing technologies, and in particular, to a file information processing method and apparatus, and a file processing device and system.

背景技术Background technique

在数码相机等类似设备中均配置有文件系统,而文件系统用于明确存储设备上文件的方法和数据结构,即在存储设备上组织文件的方法,文件管理软件会按照文件系统的组织结构完成建立、存入、读出、修改等文件相关操作,而其中读、写文件速率则依赖于文件系统的组织结构以及存储设备自身的数据传输速度。A file system is configured in a digital camera or the like, and the file system is used to clarify the method and data structure of the file on the storage device, that is, the method of organizing the file on the storage device, and the file management software is completed according to the organization structure of the file system. File-related operations such as creating, storing, reading, and modifying, and the rate of reading and writing files depends on the organization of the file system and the data transfer speed of the storage device itself.

目前的文件系统存在文件索引信息丢失的问题。有必要提出相关方案以尽量避免文件索引信息丢失的问题。The current file system has a problem of missing file index information. It is necessary to propose related solutions to avoid the problem of missing file index information.

发明内容Summary of the invention

本发明实施例提供了一种文件信息处理方法、装置及文件处理设备、系统,可较为有效地避免文件索引信息回写过程中的丢失问题。The embodiment of the invention provides a file information processing method and device, and a file processing device and system, which can effectively avoid the loss problem in the file index information writing back process.

一方面,本发明实施例提供了一种文件信息处理方法,包括:In one aspect, an embodiment of the present invention provides a file information processing method, including:

在检测到向存储器回写文件索引信息时,确定出待回写的文件索引信息;When it is detected that the file index information is written back to the memory, the file index information to be written back is determined;

将确定出的文件索引信息写入到在所述存储器中配置的至少两个索引信息区中。The determined file index information is written into at least two index information areas configured in the memory.

其中可选地,所述将确定出的文件索引信息写入到在所述存储器中配置的至少两个索引信息区中,包括:Optionally, the writing the determined file index information into the at least two index information areas configured in the memory, including:

根据预置的回写策略,将确定出的文件索引信息写入到在所述存储器中配置的至少两个索引信息区中。The determined file index information is written into at least two index information areas configured in the memory according to a preset write-back strategy.

其中可选地,所述将确定出的文件索引信息写入到在所述存储器中配置的至少两个索引信息区中,包括:Optionally, the writing the determined file index information into the at least two index information areas configured in the memory, including:

将确定出的文件索引信息写入到所述存储器中配置的第一索引信息区中;Writing the determined file index information into the first index information area configured in the memory;

将确定出的文件索引信息写入到所述存储器中配置的第二索引信息区中。The determined file index information is written into the second index information area configured in the memory.

其中可选地,在确定出的所述文件索引信息已完全写入到所述第一索引信息区后,执行所述将确定出的文件索引信息写入到在所述存储器中配置的第二索引信息区中。Optionally, after the determined file index information has been completely written into the first index information area, performing the writing the determined file index information to the second configured in the memory. In the index information area.

其中可选地,所述确定出待回写的文件索引信息,包括:Optionally, the determining the file index information to be written back includes:

按照预置的回写周期,周期性地确定出待回写的文件索引信息,以便于周期性地将确定出的文件索引信息写入到所述存储器对应索引信息区。The file index information to be written back is periodically determined according to a preset write-back cycle, so that the determined file index information is periodically written to the memory corresponding index information area.

其中可选地,所述将确定出的文件索引信息写入到在所述存储器中配置的至少两个索引信息区中,包括:Optionally, the writing the determined file index information into the at least two index information areas configured in the memory, including:

若当前的回写次数是奇数次,则将确定出的文件索引信息写入到在所述存储器中配置的第一索引信息区;If the current number of writebacks is an odd number of times, writing the determined file index information to the first index information area configured in the memory;

若当前的回写次数为偶数次,则将确定出的文件索引信息写入到在所述存储器中配置的第二索引信息区。If the current number of writebacks is an even number of times, the determined file index information is written to the second index information area configured in the memory.

其中可选地,所述将确定出的文件索引信息写入到在所述存储器中配置的至少两个索引信息区中,包括:Optionally, the writing the determined file index information into the at least two index information areas configured in the memory, including:

若当前的回写次数是偶数次,则将确定出的文件索引信息写入到在所述存储器中配置的第一索引信息区;If the current number of writebacks is an even number of times, writing the determined file index information to the first index information area configured in the memory;

若当前的回写次数为奇数次,则将确定出的文件索引信息写入到在所述存储器中配置的第二索引信息区。If the current number of writebacks is an odd number of times, the determined file index information is written to the second index information area configured in the memory.

其中可选地,所述方法还包括:Optionally, the method further includes:

若所述文件索引信息所对应的文件在所述存储器中存储结束,则确定出该文件的关联文件索引信息;If the file corresponding to the file index information is stored in the memory, determining the associated file index information of the file;

将确定出的关联文件索引信息分别存储到在所述存储器中配置的至少两个索引信息区中。The determined associated file index information is separately stored in at least two index information areas configured in the memory.

其中可选地,所述方法还包括:Optionally, the method further includes:

在检测到向索引信息区写入文件索引信息时,设置该索引信息区的写状态,并在写入结束后,更新该索引信息区的写状态。When it is detected that the file index information is written to the index information area, the write status of the index information area is set, and after the writing ends, the write status of the index information area is updated.

其中可选地,所述方法还包括:Optionally, the method further includes:

在检测到向索引信息区写入文件索引信息时,为该索引信息区配置写开始标识,并在写入结束后,为该索引信息区配置写完成标识。When it is detected that the file index information is written to the index information area, a write start identifier is configured for the index information area, and after the writing ends, a write completion identifier is configured for the index information area.

其中可选地,所述方法还包括:Optionally, the method further includes:

在检测到向索引信息区写入文件索引信息时,将该索引信息区关联的索引标识设置为写开始标识,在写入结束后,将关联的索引标识设置为写完成标识。When the file index information is written to the index information area, the index identifier associated with the index information area is set as the write start identifier, and after the end of the write, the associated index identifier is set as the write completion identifier.

其中可选地,所述方法还包括:Optionally, the method further includes:

基于写完成标识判断存储器的各个索引信息区的状态;Determining a state of each index information area of the memory based on the write completion flag;

若存在状态为异常的索引信息区,则以状态为正常的索引信息区中的文件索引信息更新所述状态为异常的索引信息区中的文件索引信息。If there is an index information area whose status is abnormal, the file index information in the index information area whose status is abnormal is updated with the file index information in the index information area whose status is normal.

其中可选地,所述方法还包括:Optionally, the method further includes:

检测应用环境,识别存储速度等级,所述存储速度等级是基于向所述存储器中写入数据的速度需求来确定的;Detecting an application environment, identifying a storage speed level, the storage speed level being determined based on a speed requirement to write data to the memory;

根据识别的存储速度等级选择回写策略。A writeback policy is selected based on the identified storage speed level.

第二方面,本发明实施例还提供了一种文件信息处理方法,包括:In a second aspect, the embodiment of the present invention further provides a file information processing method, including:

在检测到向存储器中配置的索引信息区写入确定的文件索引信息时,设置该索引信息区的状态为写开始状态;When it is detected that the determined file index information is written to the index information area configured in the memory, setting the state of the index information area to a write start state;

在索引信息的写入结束后,更新该索引信息区的状态为写完成状态;After the writing of the index information ends, updating the state of the index information area to a write completion state;

其中,所述存储器中配置了至少两个索引信息区。The memory is configured with at least two index information areas.

其中可选地,所述设置该索引信息区的状态为写开始状态,包括:Optionally, the setting the status of the index information area is a write start state, including:

将对应的索引信息区中配置的索引标识设置为写开始标识。Set the index identifier configured in the corresponding index information area to the write start identifier.

其中可选地,所述在所述存储器的索引信息区中配置写完成标识,包括:Optionally, the configuring the write completion identifier in the index information area of the memory includes:

在对应的索引信息区中配置的索引标识设置为写完成标识。The index identifier configured in the corresponding index information area is set to the write completion identifier.

其中可选地,所述方法还包括:Optionally, the method further includes:

基于写完成标识判断存储器的各个索引信息区的状态;Determining a state of each index information area of the memory based on the write completion flag;

若存在状态为异常的索引信息区,则以状态为正常的索引信息区中的文件索引信息更新状态为异常的索引信息区中的文件索引信息。If there is an index information area whose status is abnormal, the file index information in the index information area whose status is abnormal is updated with the file index information in the index information area whose status is normal.

第三方面,本发明实施例提供了一种文件信息处理装置,包括:In a third aspect, an embodiment of the present invention provides a file information processing apparatus, including:

确定模块,用于在检测到向存储器回写文件索引信息时,确定出待回写的文件索引信息;a determining module, configured to determine file index information to be written back when detecting that the file index information is written back to the memory;

回写模块,用于将确定出的文件索引信息写入到在所述存储器中配置的至少两个索引信息区中。And a write back module, configured to write the determined file index information into at least two index information areas configured in the memory.

其中可选地,所述回写模块,具体用于根据预置的回写策略,将确定出的文件索引信息写入到在所述存储器中配置的至少两个索引信息区中。Optionally, the write-back module is specifically configured to write the determined file index information into at least two index information areas configured in the memory according to a preset write-back policy.

其中可选地,所述回写模块,具体用于将确定出的文件索引信息写入到所述存储器中配置的第一索引信息区中;将确定出的文件索引信息写入到所述存储器中配置的第二索引信息区中。Optionally, the write-back module is specifically configured to write the determined file index information into the first index information area configured in the memory; and write the determined file index information to the memory In the second index information area configured in the middle.

其中可选地,所述回写模块,具体用于将确定出的文件索引信息写入到所述存储器中配置的第一索引信息区中,在确定出的所述文件索引信息已完全写入到所述第一索引信息区后,再将确定出的文件索引信息写入到所述存储器中配置的第二索引信息区中。Optionally, the write-back module is configured to write the determined file index information into the first index information area configured in the memory, where the determined file index information is completely written. After the first index information area is reached, the determined file index information is written into the second index information area configured in the memory.

其中可选地,所述确定模块,具体用于按照预置的回写周期,周期性地确定出待回写的文件索引信息,以便于周期性地将确定出的文件索引信息写入到所述存储器对应索引信息区。Optionally, the determining module is configured to periodically determine file index information to be written back according to a preset writeback period, so as to periodically write the determined file index information to the The memory corresponds to an index information area.

其中可选地,所述回写模块,具体用于若当前的回写次数是奇数次,则将确定出的文件索引信息写入到在所述存储器中配置的第一索引信息区;若当前的回写次数为偶数次,则将确定出的文件索引信息写入到在所述存储器中配置的第二索引信息区。Optionally, the write-back module is specifically configured to: when the current number of write-backs is an odd number of times, write the determined file index information to the first index information area configured in the memory; The number of writebacks is an even number of times, and the determined file index information is written to the second index information area configured in the memory.

其中可选地,所述回写模块,具体用于若当前的回写次数是偶数次,则将确定出的文件索引信息写入到在所述存储器中配置的第一索引信息区;若当前的回写次数为奇数次,则将确定出的文件索引信息写入到在所述存储器中配置的第二索引信息区。Optionally, the write-back module is specifically configured to: when the current number of write-backs is an even number of times, write the determined file index information to the first index information area configured in the memory; The number of writebacks is an odd number of times, and the determined file index information is written to the second index information area configured in the memory.

其中可选地,所述回写模块,还用于若所述文件索引信息所对应的文件在所述存储器中存储结束,则确定出该文件的关联文件索引信息;将确定出的关联文件索引信息分别存储到在所述存储器中配置的至少两个索引信息区中。Optionally, the write-back module is further configured to: if the file corresponding to the file index information is stored in the memory, determine the associated file index information of the file; and determine the associated file index. The information is separately stored into at least two index information areas configured in the memory.

其中可选地,所述装置还包括:Optionally, the device further includes:

第一设置模块,用于在检测到向索引信息区写入文件索引信息时,设置该索引信息区的写状态,并在写入结束后,更新该索引信息区的写状态。The first setting module is configured to set a write state of the index information area when detecting the writing of the file index information to the index information area, and update the write status of the index information area after the writing ends.

其中可选地,所述装置还包括:Optionally, the device further includes:

第二设置模块,用于在检测到向索引信息区写入文件索引信息时,为该索引信息区配置写开始标识,并在写入结束后,为该索引信息区配置写完成标识。The second setting module is configured to configure a write start identifier for the index information area when the file index information is written to the index information area, and configure a write completion identifier for the index information area after the writing ends.

其中可选地,所述装置还包括:Optionally, the device further includes:

第三设置模块,用于在检测到向索引信息区写入文件索引信息时,将该索引信息区关联的索引标识设置为写开始标识,在写入结束后,将关联的索引标识设置为写完成标识。The third setting module is configured to: when the file index information is written to the index information area, set the index identifier associated with the index information area to a write start identifier, and after the writing ends, set the associated index identifier to write Complete the logo.

其中可选地,所述装置还包括:Optionally, the device further includes:

更新模块,用于基于写完成标识判断存储器的各个索引信息区的状态;若存在状态为异常的索引信息区,则以状态为正常的索引信息区中的文件索引信息更新所述状态为异常的索引信息区中的文件索引信息。And an update module, configured to determine, according to the write completion identifier, a state of each index information area of the memory; if there is an index information area whose status is abnormal, updating the status with the file index information in the index information area whose status is normal is abnormal. File index information in the index information area.

其中可选地,所述装置还包括:Optionally, the device further includes:

选择模块,用于检测应用环境,识别存储速度等级,所述存储速度等级是基于向所述存储器中写入数据的速度需求来确定的;根据识别的存储速度等级选择回写策略。A selection module for detecting an application environment, identifying a storage speed level, the storage speed level being determined based on a speed requirement of writing data to the memory; and selecting a writeback policy based on the identified storage speed level.

第四方面,本发明实施例还提供了一种文件信息处理装置,包括:In a fourth aspect, the embodiment of the present invention further provides a file information processing apparatus, including:

状态设置模块,用于在检测到向存储器中配置的索引信息区写入确定的文件索引信息时,设置该索引信息区的状态为写开始状态;a state setting module, configured to set a state of the index information area to a write start state when detecting that the determined file index information is written to the index information area configured in the memory;

更新模块,用于在索引信息的写入结束后,更新该索引信息区的状态为写完成状态;其中,所述存储器中配置了至少两个索引信息区。And an update module, configured to update the state of the index information area to a write completion state after the writing of the index information ends; wherein at least two index information areas are configured in the memory.

其中可选地,所述状态设置模块,具体用于在检测到向存储器中配置的索引信息区写入确定的文件索引信息时,将对应的索引信息区中配置的索引标识设置为写开始标识。Optionally, the state setting module is configured to: when the determined file index information is written to the index information area configured in the memory, set the index identifier configured in the corresponding index information area to a write start identifier. .

其中可选地,所述更新模块,具体用于在索引信息的写入结束后,在对应的索引信息区中配置的索引标识设置为写完成标识。Optionally, the update module is specifically configured to: after the end of the writing of the index information, the index identifier configured in the corresponding index information area is set as a write completion identifier.

其中可选地,所述装置还包括:Optionally, the device further includes:

处理模块,用于基于写完成标识判断存储器的各个索引信息区的状态;若存在状态为异常的索引信息区,则以状态为正常的索引信息区中的文件索引信息更新状态为异常的索引信息区中的文件索引信息。a processing module, configured to determine, according to the write completion identifier, a state of each index information area of the memory; if there is an index information area whose state is abnormal, update the index information with the abnormality of the file index information in the index information area whose state is normal File index information in the zone.

第五方面,本发明实施例还提供了一种文件处理设备,包括:处理器,其中:所述处理器,用于在检测到向相连的存储器回写文件索引信息时,确定出待回写的文件索引信息;将确定出的文件索引信息写入到在所述存储器中配置的至少两个索引信息区中。In a fifth aspect, the embodiment of the present invention further provides a file processing device, including: a processor, wherein: the processor is configured to determine to be written back when detecting that the file index information is written back to the connected memory. File index information; the determined file index information is written into at least two index information areas configured in the memory.

其中可选地,所述处理器,具体用于根据预置的回写策略,将确定出的文件索引信息写入到在所述存储器中配置的至少两个索引信息区中。Optionally, the processor is configured to write the determined file index information into at least two index information areas configured in the memory according to a preset write-back policy.

其中可选地,所述处理器,具体用于将确定出的文件索引信息写入到所述存储器中配置的第一索引信息区中;将确定出的文件索引信息写入到所述存储器中配置的第二索引信息区中。Optionally, the processor is configured to write the determined file index information into the first index information area configured in the memory; and write the determined file index information into the memory. The second index information area of the configuration.

其中可选地,所述处理器,具体用于将确定出的文件索引信息写入到所述存储器中配置的第一索引信息区中,并在确定出的所述文件索引信息已完全写入到所述第一索引信息区后,将所述将确定出的文件索引信息写入到在所述存储器中配置的第二索引信息区中。Optionally, the processor is configured to write the determined file index information into the first index information area configured in the memory, and the determined file index information is completely written. After the first index information area, the determined file index information is written into the second index information area configured in the memory.

其中可选地,所述处理器,具体用于按照预置的回写周期,周期性地确定出待回写的文件索引信息,以便于周期性地将确定出的文件索引信息写入到所述存储器对应索引信息区。Optionally, the processor is configured to periodically determine file index information to be written back according to a preset write-back period, so as to periodically write the determined file index information to the The memory corresponds to an index information area.

其中可选地,所述处理器,具体用于若当前的回写次数是奇数次,则将确定出的文件索引信息写入到在所述存储器中配置的第一索引信息区;若当前的回写次数为偶数次,则将确定出的文件索引信息写入到在所述存储器中配置的第二索引信息区。Optionally, the processor is configured to: if the current number of writeback times is an odd number of times, write the determined file index information to the first index information area configured in the memory; When the number of writebacks is an even number of times, the determined file index information is written to the second index information area configured in the memory.

其中可选地,所述处理器,还用于若所述文件索引信息所对应的文件在所述存储器中存储结束,则确定出该文件的关联文件索引信息;将确定出的关联文件索引信息分别存储到在所述存储器中配置的至少两个索引信息区中。Optionally, the processor is further configured to: if the file corresponding to the file index information is stored in the memory, determine the associated file index information of the file; and determine the associated file index information. Stored separately into at least two index information areas configured in the memory.

其中可选地,所述处理器,还用于在检测到向索引信息区写入文件索引信息时,设置该索引信息区的写状态,并在写入结束后,更新该索引信息区的写状态。Optionally, the processor is further configured to: when detecting that the file index information is written into the index information area, set a write status of the index information area, and update the writing of the index information area after the writing ends status.

其中可选地,所述处理器,还用于在检测到向索引信息区写入文件索引信息时,为该索引信息区配置写开始标识,并在写入结束后,为该索引信息区配置写完成标识。Optionally, the processor is further configured to: when detecting that the file index information is written into the index information area, configure a write start identifier for the index information area, and configure the index information area after the writing ends Write the completion ID.

其中可选地,所述处理器,还用于在检测到向索引信息区写入文件索引信息时,将该索引信息区关联的索引标识设置为写开始标识,在写入结束后,将关联的索引标识设置为写完成标识。Optionally, the processor is further configured to: when the file index information is written to the index information area, set an index identifier associated with the index information area as a write start identifier, and after the end of the writing, associate the identifier The index ID is set to the write completion ID.

其中可选地,所述处理器,还用于基于写完成标识判断存储器的各个索引信息区的状态;若存在状态为异常的索引信息区,则以状态为正常的索引信息区中的文件索引信息更新所述状态为异常的索引信息区中的文件索引信息。Optionally, the processor is further configured to determine, according to the write completion identifier, a state of each index information area of the memory; and if there is an index information area whose state is abnormal, the file index in the index information area whose status is normal The information is updated with the file index information in the abnormal index information area.

其中可选地,所述处理器,还用于检测应用环境,识别存储速度等级,所述存储速度等级是基于向所述存储器中写入数据的速度需求来确定的;根据识别的存储速度等级选择回写策略。Optionally, the processor is further configured to detect an application environment, and identify a storage speed level, where the storage speed level is determined based on a speed requirement for writing data into the memory; according to the identified storage speed level Choose a writeback strategy.

第六方面,本发明实施例还提供了一种文件处理设备,包括:处理器,其中:所述处理器,用于在检测到向相连的存储器中配置的索引信息区写入确定的文件索引信息时,设置该索引信息区的状态为写开始状态;在索引信息的写入结束后,更新该索引信息区的状态为写完成状态;其中,所述存储器中配置了至少两个索引信息区。In a sixth aspect, the embodiment of the present invention further provides a file processing device, including: a processor, wherein: the processor is configured to: write a determined file index in an index information area configured to be connected to a connected memory; In the information, the state of the index information area is set to a write start state; after the writing of the index information is finished, the state of updating the index information area is a write completion state; wherein at least two index information areas are configured in the memory .

其中可选地,所述处理器,具体用于将对应的索引信息区中配置的索引标识设置为写开始标识。Optionally, the processor is configured to set an index identifier configured in the corresponding index information area as a write start identifier.

其中可选地,所述处理器,具体用于在对应的索引信息区中配置的索引标识设置为写完成标识。Optionally, the processor is configured to set an index identifier configured in the corresponding index information area as a write completion identifier.

其中可选地,所述处理器,还用于基于写完成标识判断存储器的各个索引信息区的状态;若存在状态为异常的索引信息区,则以文件索引信息状态为正常的索引信息区中的文件索引信息更新状态为异常的索引信息区中的文件索引信息。Optionally, the processor is further configured to determine, according to the write completion identifier, a state of each index information area of the memory; if there is an index information area whose state is abnormal, the file index information status is normal in the index information area. The file index information update status is file index information in the abnormal index information area.

第七方面,本发明实施例还提供了一种文件处理系统,包括:内存、存储器和处理器,所述处理器分别与所述内存和所述存储器相连,所述处理器用于执行如上述第一方面所述方法的相关步骤。In a seventh aspect, the embodiment of the present invention further provides a file processing system, including: a memory, a memory, and a processor, wherein the processor is respectively connected to the memory and the memory, and the processor is configured to execute the foregoing A related step of the method on the one hand.

第八方面,本发明实施例还提供了一种文件处理系统,其特征在于,包括:内存、存储器和处理器,所述处理器分别与所述内存和所述存储器相连,所述处理器用于执行如上述第二方面所述方法的相关步骤。In an eighth aspect, the embodiment of the present invention further provides a file processing system, including: a memory, a memory, and a processor, wherein the processor is respectively connected to the memory and the memory, and the processor is used to The relevant steps of the method as described in the second aspect above are performed.

本发明实施例对文件索引信息的回写进行了优化,能够较好地保证文件索引信息的回写与保存。The embodiment of the invention optimizes the write back of the file index information, and can better ensure the write back and save of the file index information.

附图说明DRAWINGS

图1是本发明实施例中一种文件信息处理方法的流程示意图;1 is a schematic flow chart of a file information processing method according to an embodiment of the present invention;

图2是本发明实施例的另一种文件信息处理方法的流程示意图;2 is a schematic flowchart diagram of another file information processing method according to an embodiment of the present invention;

图3是本发明实施例的又一种文件信息处理方法的流程示意图;FIG. 3 is a schematic flowchart diagram of still another file information processing method according to an embodiment of the present invention; FIG.

图4是本发明实施例的一种文件信息更新方法的流程示意图;4 is a schematic flowchart of a file information updating method according to an embodiment of the present invention;

图5是本发明实施例的再一种文件信息处理方法的流程示意图;FIG. 5 is a schematic flowchart diagram of still another file information processing method according to an embodiment of the present invention; FIG.

图6是文件系统的一种结构示意图;6 is a schematic structural diagram of a file system;

图7是本发明实施例的另一种系统结构示意图;7 is a schematic structural diagram of another system according to an embodiment of the present invention;

图8是本发明实施例的另一种文件信息更新方法的流程示意图;FIG. 8 is a schematic flowchart diagram of another file information updating method according to an embodiment of the present invention; FIG.

图9是本发明实施例的在高速存储系统中的回写方法的流程示意图;9 is a schematic flow chart of a write back method in a high speed storage system according to an embodiment of the present invention;

图10是本发明实施例的在超高速存储系统中的回写方法的流程示意图;FIG. 10 is a schematic flowchart diagram of a write back method in an ultra high speed storage system according to an embodiment of the present invention; FIG.

图11是本发明实施例的一种文件信息处理装置的结构示意图;11 is a schematic structural diagram of a file information processing apparatus according to an embodiment of the present invention;

图12是本发明实施例的另一种文件信息处理装置的结构示意图;FIG. 12 is a schematic structural diagram of another file information processing apparatus according to an embodiment of the present invention; FIG.

图13是本发明实施例的又一种文件信息处理装置的结构示意图;FIG. 13 is a schematic structural diagram of still another file information processing apparatus according to an embodiment of the present invention; FIG.

图14是本发明实施例的一种文件处理设备的结构示意图;FIG. 14 is a schematic structural diagram of a file processing device according to an embodiment of the present invention; FIG.

图15是本发明实施例的另一种文件处理设备的结构示意图;FIG. 15 is a schematic structural diagram of another file processing device according to an embodiment of the present invention; FIG.

图16是本发明实施例的一种文件处理系统的结构示意图;16 is a schematic structural diagram of a file processing system according to an embodiment of the present invention;

图17是本发明实施例的另一种文件处理系统的结构示意图。FIG. 17 is a schematic structural diagram of another file processing system according to an embodiment of the present invention.

具体实施方式detailed description

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is obvious that the described embodiments are only a part of the embodiments of the present invention, but not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without creative efforts are within the scope of the present invention.

在将文件存储到存储设备的过程中,除了存储获取到的文件数据外,还需要记录这些文件数据对应的文件索引信息,以便于通过这些文件索引信息完成对文件数据的增、删、查、改等操作。In the process of storing the file to the storage device, in addition to storing the obtained file data, it is also required to record the file index information corresponding to the file data, so as to complete the addition, deletion, and check of the file data through the file index information. Change the operation.

在设备上电后,文件系统相关内容会被加载到设备内存中,当文件数据存储更新时(写入更新),首先会修改设备内存的文件系统中记录的文件索引信息。随后,设备会将内存中的文件系统回写到存储设备(硬盘)的索引信息区。After the device is powered on, the file system related content is loaded into the device memory. When the file data storage is updated (write update), the file index information recorded in the file system of the device memory is first modified. The device then writes back the file system in memory to the index information area of the storage device (hard disk).

本发明实施例配置了至少两个索引信息区用于存储文件的索引信息。可以按照一定的规则,如先后写或者交叉来回写、随机写等,将文件索引信息写入到对应的索引信息区中。在整个回写过程中,只要保证其中有一次没有出现异常即可,后续可以用没有出现异常的索引信息区的内容更新其他出现异常的索引信息区的内容。The embodiment of the invention configures at least two index information areas for storing index information of the file. The file index information can be written into the corresponding index information area according to certain rules, such as writing or cross-back writing, random writing, and the like. In the entire write-back process, as long as there is no abnormality in one of the times, the content of the index information area in which the abnormality occurs may be updated by the content of the index information area where the abnormality does not occur.

具体请参见图1,是本发明实施例中一种文件信息处理方法的流程示意图,本发明实施例的所述方法可应用于各类文件系统中,其具体可由一个处理器来执行,具体的,所述方法包括:1 is a schematic flowchart of a method for processing file information according to an embodiment of the present invention. The method in the embodiment of the present invention may be applied to various file systems, which may be specifically executed by a processor. , the method includes:

S101:在检测到向存储器回写文件索引信息时,确定出待回写的文件索引信息。S101: Determine file index information to be written back when detecting that the file index information is written back to the memory.

在某个文件存储到存储器的过程中,文件系统会要求将内存中该文件的相关数据周期性地回写到硬盘中,当达到回写的时间间隔要求、或者回写时间点时,会从内存向存储器回写该文件的相关信息,包括文件索引信息,存储器可以为普通的机械硬盘、可以实现超高速存储的SSD(Solid State Drives,固态硬盘)等。During the process of storing a file in the memory, the file system will request that the relevant data of the file in the memory be periodically written back to the hard disk. When the time interval for writing back is reached, or when the time is written back, the file system will The memory writes back information about the file to the memory, including file index information. The memory can be an ordinary mechanical hard disk or an SSD (Solid State Drives) that can realize ultra-high speed storage.

存储过程中,内存中关于该文件的文件索引信息会更新,文件索引信息可以为存储该文件的各个数据块block的地址、文件名、创建时间等信息。确定待回写的文件索引信息时,可以仅确定出被更新的那部分内容,以便于减小回写开销。During the storage process, the file index information about the file in the memory is updated, and the file index information may be information such as the address, file name, and creation time of each data block block in which the file is stored. When determining the file index information to be written back, only the part of the content to be updated may be determined in order to reduce the write-back overhead.

S102:将确定出的文件索引信息写入到在所述存储器中配置的至少两个索引信息区中。S102: Write the determined file index information into at least two index information areas configured in the memory.

预先在所述存储器中配置两个或者多个索引信息区,对于确定出的文件索引信息,需要分别写入到配置的两个或者多个索引信息区。Two or more index information areas are configured in the memory in advance, and the determined file index information needs to be separately written to the configured two or more index information areas.

具体可以按照预置的回写策略回写文件索引信息,预置的回写策略可包括:依次将确定出的文件索引信息写入到对应的索引信息区中。以包括两个索引信息区为例,在需要写入文件索引信息时,首先将文件索引信息写入到第一索引信息区,完成后,再将文件索引信息写入到第二索引信息区。其中,如果在向第二索引信息区写入文件索引信息时出现异常,例如设备掉电,第二索引信息区所有的文件索引信息可能会丢失,但第一索引信息区的文件索引信息仍然都存在。而如果在写入到第一索引信息区的过程中出现异常,导致第一索引信息区的文件索引信息丢失,但是在上一个回写周期中,写入到第二索引信息区的文件索引信息还存在,没有受到破坏。需要说明的是,在向第一索引信息区写入文件索引信息出现异常,仍然会丢失本次回写的数据,但丢失的文件索引信息并不多,对存储的文件数据的影响不大,更不会出现整盘数据均无法恢复的情况。在存在三个及以上的索引信息区时,可作相同的推理。Specifically, the file index information may be written back according to the preset write-back policy. The preset write-back policy may include: sequentially writing the determined file index information into the corresponding index information area. Taking the two index information areas as an example, when the file index information needs to be written, the file index information is first written into the first index information area, and after completion, the file index information is written into the second index information area. If an abnormality occurs when the file index information is written to the second index information area, for example, the device is powered off, all file index information of the second index information area may be lost, but the file index information of the first index information area is still presence. If an abnormality occurs in the process of writing to the first index information area, the file index information of the first index information area is lost, but in the last write back period, the file index information written to the second index information area is It still exists and has not been damaged. It should be noted that when the file index information is written to the first index information area, the data is still lost, but the lost data is not much, and the impact on the stored file data is not large. There will be no cases where the entire data cannot be recovered. The same reasoning can be made when there are three or more index information areas.

具体的,预置的回写策略具体还可以为来回回写策略。同样以具有两个索引信息区为例,来回回写策略是基于回写的次数执行,第N次回写时,如果N为奇数,将文件索引信息写入到第一索引信息区,而如果N为偶数,则写入第二索引信息区。在此情况下也可以较为有效地避免文件索引信息丢失,数据均无法恢复的情况。Specifically, the preset writeback strategy may specifically be a back and forth write strategy. Similarly, taking two index information areas as an example, the round-trip write strategy is performed based on the number of write-backs. When the N-th write back, if N is an odd number, the file index information is written into the first index information area, and if N is For an even number, the second index information area is written. In this case, it is also possible to prevent the file index information from being lost and the data cannot be recovered more effectively.

预置的回写策略还可以为:同时分别写入各个索引信息区;或者按照随机次序向各索引信息区写入文件索引信息;或者为选择其中的数据量少于阈值的两个或者多个索引信息区,以写入文件索引信息。The preset write-back strategy may also be: simultaneously writing each index information area; or writing file index information to each index information area in a random order; or selecting two or more of which the data amount is less than the threshold. Index information area to write file index information.

本发明实施例所述的方法还可以基于当前所处的应用环境,选择不同的回写策略。具体的,如果检测到的应用环境为第一类应用环境(如:720P视频的高速存储的应用环境),则使用的回写策略包括第一类回写策略,如上述提到的按照次序依次写、随机写、选择其中的数据量少于阈值的两个或者多个索引信息区回写等策略;而如果检测到的应用环境为第二类应用环境(如:4K视频的超高速存储的应用环境),则使用第二类回写策略,如上述提到的来回写策略。The method in the embodiment of the present invention may also select different write-back strategies based on the current application environment. Specifically, if the detected application environment is a first-class application environment (for example, a high-speed storage application environment of 720P video), the write-back strategy used includes a first-type write-back strategy, as described above in order. Write, randomly write, select two or more index information area writeback strategies in which the amount of data is less than the threshold; and if the detected application environment is a second type of application environment (eg, 4K video super high speed storage) The application environment) uses a second type of write-back strategy, such as the round-trip strategy mentioned above.

本发明实施例通过配置两个或者多个索引信息区,引入二次或者多次写入,可以在回写出现异常时较好地保证至少有一个索引信息区中的文件索引信息不会丢失,较为有效地避免了索引信息丢失,以及整盘数据无法恢复的问题,可较好地保证不会出现大量文件的丢失或损坏。In the embodiment of the present invention, by configuring two or more index information areas and introducing two or more times of writing, it is possible to ensure that file index information in at least one index information area is not lost when an exception occurs in the write back. It effectively avoids the loss of index information and the problem that the entire disk data cannot be recovered, and can better ensure that a large number of files are not lost or damaged.

再请参见图2,是本发明实施例的另一种文件信息处理方法的流程示意图,本发明实施例的所述方法可应用于各类文件系统中,其具体可由一个处理器来执行,本发明实施例以存在两个索引信息区为例进行说明,在包括三个或以上的索引信息区时,回写处理过程可参考两个索引信息区的处理方式,所述方法具体包括:2 is a schematic flowchart of another file information processing method according to an embodiment of the present invention. The method in the embodiment of the present invention may be applied to various file systems, and may be specifically executed by a processor. The embodiment of the present invention is described by taking two index information areas as an example. When three or more index information areas are included, the write back process may refer to the processing manner of the two index information areas, and the method specifically includes:

S201:在检测到向存储器回写文件索引信息时,确定出待回写的文件索引信息。S201: When detecting that the file index information is written back to the memory, determining file index information to be written back.

在某个文件存储过程,内存中诸如该文件的片段在存储器中数据块block的位置等文件索引信息会被更新,所述S201可以仅将发生更新的索引信息确定为待回写的文件索引信息。在确定出待回写的文件索引信息之后,即触发后续的向第一索引信息区和第二索引信息区写入文件索引信息。In a file storage process, file index information such as a location of a block of the file in the memory in the memory may be updated, and the S201 may determine only the index information in which the update occurs as the file index information to be written back. . After the file index information to be written back is determined, subsequent file index information is written to the first index information area and the second index information area.

S202:在检测到向第一索引信息区写入文件索引信息时,设置第一索引信息区的写状态为写开始状态;S202: When detecting that the file index information is written to the first index information area, setting a write status of the first index information area to a write start state;

其中,设置第一索引信息区的写状态具体可以包括:为所述第一索引信息区配置写开始标识、或者将所述第一索引信息区关联的索引标识设置为写开始标识。即新配置一个写开始标识、或将已有的标识置为写开始。The setting the write status of the first index information area may include: configuring a write start identifier for the first index information area, or setting an index identifier associated with the first index information area as a write start identifier. That is, a new write start identifier is configured, or an existing identifier is set to start writing.

具体可以在处理器检测到从内存中传输的待回写文件索引信息时,即确定当前需要向第一索引信息区写入文件索引信息。Specifically, when the processor detects the index information of the file to be written back from the memory, it is determined that the file index information needs to be written to the first index information area.

S203:将确定出的文件索引信息写入到所述第一索引信息区中;即将S201中确定出的待回写的文件索引信息写入到所述第一索引信息区中。S203: Write the determined file index information into the first index information area; and write the file index information to be written back determined in S201 into the first index information area.

S204:在检测到向第一索引信息区的文件索引信息写入结束后,将第一索引信息区的写状态更新为写完成状态;S204: After detecting that the writing of the file index information to the first index information area ends, updating the write status of the first index information area to a write completion state;

其中,将第一索引信息区的写状态更新为写完成状态包括:为所述第一索引信息区配置写完成标识、或者将所述第一索引信息区关联的索引标识设置为写完成标识。即为所述第一索引信息区新配置一个写完成标识,与写开始标识对应,或将所述被置为写开始的标识置为写完成。The updating the write status of the first index information area to the write completion status includes: configuring a write completion identifier for the first index information area, or setting an index identifier associated with the first index information area as a write completion identifier. That is, a new write completion identifier is newly configured for the first index information area, corresponding to the write start identifier, or the identifier set to start writing is set to be completed.

S205:在检测到向第二索引信息区写入文件索引信息时,设置第二索引信息区的写状态为写开始状态;S205: When detecting that the file index information is written to the second index information area, setting a write status of the second index information area to a write start state;

其中,设置第二索引信息区的写状态具体可以包括:为所述第二索引信息区配置写开始标识、或者将所述第二索引信息区关联的索引标识设置为写开始标识。即为所述第二索引信息区新配置一个写开始标识,或将已有的标识置为写开始。The setting the write status of the second index information area may include: configuring a write start identifier for the second index information area, or setting an index identifier associated with the second index information area as a write start identifier. That is, a new write start identifier is newly configured for the second index information area, or the existing identifier is set to start writing.

同样具体可以是在处理器检测到从内存中传输的待回写文件索引信息时,确定需要向第一索引信息区写入文件索引信息。或者可以是在检测到第一索引信息区的状态被更新为写完成状态,或待回写文件索引信息已完全写入到所述第一索引信息区时,确定需要向第二索引信息区写入文件索引信息。Similarly, when the processor detects the index information of the file to be written back from the memory, it is determined that the file index information needs to be written to the first index information area. Alternatively, when it is detected that the state of the first index information area is updated to the write completion state, or the file index information to be written back has been completely written to the first index information area, it is determined that the second index information area needs to be written. Enter file index information.

S206:将确定出的文件索引信息写入到所述第二索引信息区中;即将S201中确定出的待回写的文件索引信息写入到所述第二索引信息区中。S206: Write the determined file index information into the second index information area; and write the file index information to be written back determined in S201 into the second index information area.

S207:在检测到向第二索引信息区的文件索引信息写入结束后,将第二索引信息区的写状态更新为写完成状态;S207: After detecting that the writing of the file index information to the second index information area ends, updating the write status of the second index information area to a write completion state;

其中,将第二索引信息区的写状态更新为写完成状态包括:为所述第二索引信息区配置写完成标识、或者将所述第二索引信息区关联的索引标识设置为写完成标识。即为所述第二索引信息区新配置一个写完成标识,或者将被置为写开始的标识置为写完成。The updating the write status of the second index information area to the write completion status includes: configuring a write completion identifier for the second index information area, or setting an index identifier associated with the second index information area as a write completion identifier. That is, a write completion flag is newly configured for the second index information area, or an identifier set to start writing is set to be completed.

具体的,上述S202至S204对第一索引信息区的写入操作和所述S205至S207对第二索引信息区的写入操作可以先对第一索引信息区进行写入操作,然后执行对第二索引信息区的写入操作,即:在确定出的所述文件索引信息已完全写入到所述第一索引信息区后,执行所述将确定出的文件索引信息写入到在所述存储器中配置的第二索引信息区中。Specifically, the writing operation of the first index information area by the foregoing S202 to S204 and the writing operation of the second index information area by the S205 to S207 may first perform a writing operation on the first index information area, and then perform the a write operation of the index information area, that is, after the determined file index information has been completely written into the first index information area, performing the writing of the determined file index information to the The second index information area configured in the memory.

需要说明的是,在有三个或者以上的索引信息区时,回写策略可更灵活配置,例如,在有5个索引信息区时,可以将依次回写和同时回写结合,即先同时对第一、第二、第三索引信息区进行回写,在回写完成后再依次对第四索引信息进行回写,再对第五索引信息区进行回写。It should be noted that, when there are three or more index information areas, the write-back strategy can be more flexibly configured. For example, when there are five index information areas, the sequential write-back and simultaneous write-back can be combined, that is, simultaneously The first, second, and third index information areas are written back, and after the write back is completed, the fourth index information is sequentially written back, and then the fifth index information area is written back.

在所述文件存储结束后,并且其相关的文件索引信息也均回写到存储器中以后,本发明实施例的所述针对该文件的文件索引信息回写完成。可继续通过上述的S201至S207的步骤继续执行针对其他文件在存储过程中相关索引信息的回写操作。After the file storage is completed, and the related file index information is also written back to the memory, the file index information for the file is written back. The write-back operation of the related index information for the other files in the stored procedure can be continued by the steps of S201 to S207 described above.

在向索引信息区写入文件索引信息之前,具体可以在最初的设备开机初始化时,或者在确定待回写的文件索引信息时,本发明实施例的所述方法还可以包括:检测应用环境,识别存储速度等级,所述存储速度等级是基于向所述存储器中写入数据的速度需求来确定的;即需要判断所述存储器是处于诸如720P视频高速存储的应用环境,还是处于诸如4K视频的超高速存储的应用环境。在识别出存储速度等级后,根据识别的存储速度等级选择回写策略,具体可以从预置的回写策略中选择。在识别出为高速存储速度等级时,可以选择依次回写的策略执行所述S201至S207。Before the file index information is written to the index information area, the method may further include: detecting the application environment, when the initial device is initialized, or when the file index information to be written back is determined. Identifying a storage speed level that is determined based on a speed requirement to write data to the memory; that is, determining whether the memory is in an application environment such as 720P video high speed storage, or in a device such as 4K video Ultra-high-speed storage application environment. After the storage speed level is identified, the write-back strategy is selected according to the identified storage speed level, and may be selected from a preset write-back strategy. When the high speed storage speed level is recognized, the S201 to S207 may be executed by selecting a policy to be sequentially written back.

本发明实施例通过依次在两个索引信息区中写入文件索引信息等方式,较好地保证至少有一个索引信息区中的文件索引信息不会丢失,较为有效地避免了索引信息丢失,以及整盘数据无法恢复的问题,特别是在机械硬盘等高速存储系统中,可较好地保证不会出现大量文件的丢失或损坏。In the embodiment of the present invention, the file index information is written in the two index information areas in sequence, so that the file index information in at least one index information area is not lost, and the index information is effectively avoided. The problem that the entire data cannot be recovered, especially in a high-speed storage system such as a mechanical hard disk, can better ensure that a large number of files are not lost or damaged.

再请参见图3,是本发明实施例的又一种文件信息处理方法的流程示意图,本发明实施例的所述方法可应用于各类文件系统中,其具体可由一个处理器来执行,本发明实施例以存在两个索引信息区为例进行说明,在包括三个或以上的索引信息区时,处理过程可参考两个索引信息区的处理方式,所述方法具体包括:Referring to FIG. 3, it is a schematic flowchart of still another file information processing method according to an embodiment of the present invention. The method in the embodiment of the present invention can be applied to various file systems, which can be specifically executed by a processor. The embodiment of the present invention is described by taking two index information areas as an example. When three or more index information areas are included, the processing may refer to the processing manner of the two index information areas, and the method specifically includes:

S301:在检测到向存储器回写文件索引信息时,确定出待回写的文件索引信息。S301: Determine, when the file index information is written back to the memory, the file index information to be written back.

在某个文件存储过程,内存中诸如该文件的片段在存储器中数据块block的位置等文件索引信息会被更新,所述S301可以仅将发生更新的索引信息确定为待回写的文件索引信息。在确定出待回写的文件索引信息之后,即触发向索引信息区写入文件索引信息。In a file storage process, file index information such as a location of a block of the file in the memory in the memory may be updated, and the S301 may determine only the index information in which the update occurs as the file index information to be written back. . After the file index information to be written back is determined, the file index information is triggered to be written to the index information area.

在所述文件的存储过程中,本发明实施例是按照预置的回写周期,周期性地确定出待回写的文件索引信息,以便于周期性地将确定出的文件索引信息写入到所述存储器对应索引信息区。具体会记录回写的次数,以便于确定出当前回写次数下对应的索引信息区。In the storage process of the file, the embodiment of the present invention periodically determines the file index information to be written back according to a preset write-back cycle, so as to periodically write the determined file index information to the file index information. The memory corresponds to an index information area. Specifically, the number of times of writing back is recorded, so as to determine the index information area corresponding to the current number of times of writing back.

S302:在检测到向第一索引信息区写入文件索引信息时,若当前的回写次数是奇数次,设置第一索引信息区的写状态为写开始状态;S302: When detecting that the file index information is written to the first index information area, if the current number of write back times is an odd number of times, setting the write status of the first index information area to a write start state;

其中,设置第一索引信息区的写状态具体可以包括:为所述第一索引信息区配置写开始标识、或者将所述第一索引信息区关联的索引标识设置为写开始标识。即为所述第一索引信息区新配置一个写完成标识,或将所述被置为写开始的标识置为写完成。The setting the write status of the first index information area may include: configuring a write start identifier for the first index information area, or setting an index identifier associated with the first index information area as a write start identifier. That is, a write completion identifier is newly configured for the first index information area, or the identifier set to start writing is set to be completed.

具体的,若当前为第N次回写,且N为奇数,则确定是向第一索引信息区写入文件索引信息。Specifically, if the current writeback is the Nth time and N is an odd number, it is determined that the file index information is written to the first index information area.

S303:将确定出的文件索引信息写入到所述第一索引信息区中;即将S301中确定出的待回写的文件索引信息写入到所述第一索引信息区中。S303: Write the determined file index information into the first index information area; and write the file index information to be written back determined in S301 into the first index information area.

S304:在检测到向第一索引信息区的文件索引信息写入结束后,将第一索引信息区的写状态更新为写完成状态;S304: After detecting that the writing of the file index information to the first index information area ends, updating the write status of the first index information area to a write completion state;

其中,将第一索引信息区的写状态更新为写完成状态包括:为所述第一索引信息区配置写完成标识、或者将所述第一索引信息区关联的索引标识设置为写完成标识。即为所述第一索引信息区新配置一个写完成标识,或将所述被置为写开始的标识置为写完成。The updating the write status of the first index information area to the write completion status includes: configuring a write completion identifier for the first index information area, or setting an index identifier associated with the first index information area as a write completion identifier. That is, a write completion identifier is newly configured for the first index information area, or the identifier set to start writing is set to be completed.

S305:在检测到向第二索引信息区写入文件索引信息时,若当前的回写次数为偶数次,设置第二索引信息区的写状态为写开始状态;S305: When detecting that the file index information is written to the second index information area, if the current number of write back times is an even number of times, setting the write status of the second index information area to a write start state;

其中,设置第二索引信息区的写状态具体可以包括:为所述第二索引信息区配置写开始标识、或者将所述第二索引信息区关联的索引标识设置为写开始标识。即为所述第二索引信息区新配置一个写开始标识,或将已有的标识置为写开始。The setting the write status of the second index information area may include: configuring a write start identifier for the second index information area, or setting an index identifier associated with the second index information area as a write start identifier. That is, a new write start identifier is newly configured for the second index information area, or the existing identifier is set to start writing.

具体的,若当前为第N次回写,且N为偶数,则检测确定是向第二索引信息区写入文件索引信息。Specifically, if it is currently the Nth write back, and N is an even number, the detection determines that the file index information is written to the second index information area.

S306:将确定出的文件索引信息写入到所述第二索引信息区中;即将S301中确定出的待回写的文件索引信息写入到所述第二索引信息区中。S306: Write the determined file index information into the second index information area; and write the file index information to be written back determined in S301 into the second index information area.

S307:在检测到向第二索引信息区的文件索引信息写入结束后,将第二索引信息区的写状态更新为写完成状态;S307: After detecting that the writing of the file index information to the second index information area ends, updating the write status of the second index information area to a write completion state;

其中,将第二索引信息区的写状态更新为写完成状态包括:为所述第二索引信息区配置写完成标识、或者将所述第二索引信息区关联的索引标识设置为写完成标识。即为所述第二索引信息区新配置一个写完成标识,或者将被置为写开始的标识置为写完成。The updating the write status of the second index information area to the write completion status includes: configuring a write completion identifier for the second index information area, or setting an index identifier associated with the second index information area as a write completion identifier. That is, a write completion flag is newly configured for the second index information area, or an identifier set to start writing is set to be completed.

S308:若所述文件索引信息所对应的文件在所述存储器中存储结束,则确定出该文件的关联文件索引信息;S308: If the file corresponding to the file index information is stored in the memory, determining the associated file index information of the file;

S309:将确定出的关联文件索引信息分别存储到在所述存储器中配置的至少两个索引信息区中。S309: Store the determined associated file index information into at least two index information areas configured in the memory.

需要说明的是,在其他实施例中,写入顺序可以与本实施例中的相反,例如,在奇数次时,将确定出的文件索引信息写入到第二索引信息区中,在偶数次时,将确定出的文件索引信息写入到第一索引信息区中。而写完成或写开始标识的设置则执行相同处理。It should be noted that, in other embodiments, the writing order may be opposite to that in the embodiment, for example, when the odd number of times, the determined file index information is written into the second index information area, in an even number of times. The determined file index information is written into the first index information area. The setting of writing completion or writing start identification performs the same processing.

所述关联文件索引信息可以是该文件的所有的文件索引信息,包括在S303和S306中写入到第一索引信息区和第二索引信息区中的文件索引信息。也就是说,在所述文件存储完成后,需要将该文件的所有文件索引信息全部再回写到所有的索引信息区中。具体可以依次、随机等方式回写至各个索引信息区中。The associated file index information may be all file index information of the file, including file index information written in the first index information area and the second index information area in S303 and S306. That is to say, after the file storage is completed, all the file index information of the file needs to be written back to all the index information areas. Specifically, it may be written back to each index information area in a sequential manner or in a random manner.

该文件相关的文件索引信息均回写到存储器中各索引信息区后,本发明实施例的所述针对该文件的文件索引信息回写完成。本发明实施例可继续基于上述的S301至S309的步骤继续执行针对其他文件存储过程中相关索引信息的回写操作。After the file index information related to the file is written back to each index information area in the memory, the file index information for the file is written back. The embodiment of the present invention can continue to perform the write back operation for the related index information in other file storage processes based on the steps of S301 to S309 described above.

在向索引信息区写入文件索引信息之前,具体可以在最初的设备开机初始化时,或者在确定待回写的文件索引信息时,本发明实施例的所述方法还可以包括:检测应用环境,识别存储速度等级,所述存储速度等级是基于向所述存储器中写入数据的速度需求来确定的;即需要判断所述存储器是处于诸如720P视频高速存储的应用环境,还是处于诸如4K视频的超高速存储的应用环境。在识别出存储的速度等级后,根据识别的存储速度等级选择回写策略。在识别出为超高速存储速度等级时,可以选择来回回写的策略执行所述S301至S309。Before the file index information is written to the index information area, the method may further include: detecting the application environment, when the initial device is initialized, or when the file index information to be written back is determined. Identifying a storage speed level that is determined based on a speed requirement to write data to the memory; that is, determining whether the memory is in an application environment such as 720P video high speed storage, or in a device such as 4K video Ultra-high-speed storage application environment. After identifying the stored speed grade, a writeback strategy is selected based on the identified storage speed level. When it is recognized that the super high speed storage speed level is selected, the S301 to S309 may be executed by selecting a policy of writing back and forth.

本发明实施例通过来回在两个索引信息区中写入文件索引信息等方式,较好地保证至少有一个索引信息区中的文件索引信息不会丢失,较为有效地避免了索引信息丢失,以及整盘数据无法恢复的问题,特别是在SSD等超高速存储系统中,可较好地保证不会出现大量文件的丢失或损坏。In the embodiment of the present invention, by writing the file index information in the two index information areas, it is better to ensure that the file index information in at least one index information area is not lost, and the index information is effectively avoided. The problem that the entire data cannot be recovered, especially in a super high-speed storage system such as an SSD, can better ensure that a large number of files are not lost or damaged.

再请参见图4,是本发明实施例的一种文件信息更新方法的流程示意图,该方法可应用于各类文件系统中,其具体可由一个处理器来执行,本发明实施例所涉及的文件信息包括文件索引信息,且硬盘中包括至少两个索引信息区以存储文件索引信息。具体的,向各个索引信息区写入文件索引信息的具体方法可参考上述图1至图3对应实施例的描述。Referring to FIG. 4, it is a schematic flowchart of a method for updating a file information according to an embodiment of the present invention. The method can be applied to various file systems, which can be executed by a processor, and the file involved in the embodiment of the present invention. The information includes file index information, and the hard disk includes at least two index information areas to store file index information. For a specific method for writing file index information to each index information area, refer to the description of the corresponding embodiment of FIG. 1 to FIG. 3 above.

在文件索引信息写入过程中,设置、更新了对应索引信息区的写状态,本发明实施例的所述方法是基于该写状态来进行对文件索引信息的更新。本发明实施例的所述方法具体包括:In the process of writing the file index information, the write status of the corresponding index information area is set and updated. The method in the embodiment of the present invention performs update of the file index information based on the write status. The method of the embodiment of the present invention specifically includes:

S401:基于写完成标识判断存储器的各个索引信息区的状态。S401: Determine a state of each index information area of the memory based on the write completion identifier.

S402:若存在状态为异常的索引信息区,则以状态为正常的索引信息区中的文件索引信息更新所述状态为异常的索引信息区中的文件索引信息。S402: If there is an index information area whose status is abnormal, the file index information in the index information area whose status is abnormal is updated by the file index information in the index information area whose status is normal.

各个索引信息区的状态包括异常状态和正常状态。当某个索引信息区存在写完成标识时,说明在最近一次向该索引信息区写入文件索引信息已正常完成,其状态为正常;而如果不存在写完成标识,则可以确定最近一次向该索引信息区的回写操作没有正常结束,其状态应为异常。The status of each index information area includes an abnormal status and a normal status. When a write completion identifier exists in an index information area, it indicates that the file index information is written to the index information area has been completed normally, and its status is normal; if there is no write completion identifier, it can be determined that the last time The write back operation of the index information area does not end normally, and its status should be abnormal.

如果存在异常的索引信息区,则只需将正常的索引信息区中的文件索引信息写入到这些异常的索引信息区即可。后续的文件索引信息回写操作同样按照上述的图1、图2或图3对应实施例的描述进行。If there is an abnormal index information area, it is only necessary to write the file index information in the normal index information area to these abnormal index information areas. The subsequent file index information write-back operation is also performed in accordance with the description of the corresponding embodiment of FIG. 1, FIG. 2 or FIG. 3 described above.

需要说明的是,对于一些超高速存储系统,为了保证回写的速度能够跟上文件存储的速度,一般采用的是交叉来回回写的策略,在该策略下处于正常状态的索引信息区内的文件索引信息可能并不完整,例如:在奇数次将文件索引信息S1写入到第一索引信息区,在偶数次时将文件索引信息S2写入到第二索引信息区,S2为文件最新的文件索引信息,如果在回写S2时出现异常,则最新的文件索引信息会丢失,也会造成这部分最新的数据无法恢复的情况。具体可以缩短回写周期,增加回写次数使每次回写的文件索引信息较少,这样可有效降低文件索引信息丢失时丢失的数据量。It should be noted that, for some ultra-high-speed storage systems, in order to ensure that the speed of write-back can keep up with the speed of file storage, a cross-backward and write-back strategy is generally adopted, in which the index information area in the normal state is under the policy. The file index information may not be complete, for example, writing the file index information S1 to the first index information area on an odd number of times, and writing the file index information S2 to the second index information area on an even number of times, and S2 is the latest file information. File index information, if an exception occurs when writing back S2, the latest file index information will be lost, and this part of the latest data cannot be recovered. Specifically, the write-back cycle can be shortened, and the number of write-backs is increased to make the file index information of each write-back less, which can effectively reduce the amount of data lost when the file index information is lost.

本发明实施例加入写开始或写完成标识,在检查硬盘时使用双检测机制,能够简单、有效地实现所有信息是否完整有效的检测,通过更新操作,能够保证所有的索引信息区中具有正常的文件索引信息。The embodiment of the present invention adds a write start or a write completion identifier, and uses a double detection mechanism when checking a hard disk, which can easily and effectively realize whether all information is completely and effectively detected. Through the update operation, all index information areas can be guaranteed to have normal File index information.

再请参见图5,是本发明实施例的再一种文件信息处理方法的流程示意图,本发明实施例的所述方法可应用于各类文件系统中,其具体可由一个处理器来执行,所述方法包括:5 is a schematic flowchart of still another file information processing method according to an embodiment of the present invention. The method in the embodiment of the present invention can be applied to various file systems, which can be specifically executed by a processor. The methods include:

S501:在检测到向存储器中配置的索引信息区写入确定的文件索引信息时,设置该索引信息区的状态为写开始状态;S501: When detecting that the determined file index information is written into the index information area configured in the memory, setting a state of the index information area to a write start state;

S502:在索引信息的写入结束后,更新该索引信息区的状态为写完成状态。其中,所述存储器中配置了至少两个索引信息区。S502: After the writing of the index information ends, updating the state of the index information area to a write completion state. The memory is configured with at least two index information areas.

其中,设置该索引信息区的状态为写开始状态包括:将对应的索引信息区中配置的索引标识设置为写开始标识。或者包括:在对应的索引信息区中配置的索引标识设置为写完成标识。即为索引信息区配置新的索引标识,或者对已有的索引标识进行设置。The setting the status of the index information area to the write start state includes: setting an index identifier configured in the corresponding index information area as a write start identifier. Or the method includes: setting an index identifier configured in the corresponding index information area as a write completion identifier. That is, a new index identifier is configured for the index information area, or an existing index identifier is set.

通过上面的状态设置与状态更新步骤后,在下一次的文件系统初始化阶段或者在其他合适的阶段,本发明实施例的所述方法具体还可以包括如下步骤:After the state setting and the state update step, the method of the embodiment of the present invention may further include the following steps in the next file system initialization phase or other suitable phase:

S503:基于写完成标识判断存储器的各个索引信息区的状态;S503: Determine, according to the write completion identifier, a state of each index information area of the memory;

有写完成标识的索引信息区的状态为正常状态,而如不存在写完成标识,则表明上一次文件索引信息没有正常写完,或者在上一次出现掉电等异常情况,导致该文件索引信息区的所有信息都丢失了,此时该索引信息区的状态为异常。The status of the index information area with the completion flag is normal, and if there is no write completion flag, it indicates that the previous file index information has not been written normally, or the abnormal situation such as the last power failure occurs, resulting in the file index information. All the information of the area is lost, and the status of the index information area is abnormal.

S504:若存在状态为异常的索引信息区,则以状态为正常的索引信息区中的文件索引信息更新状态为异常的索引信息区中的文件索引信息。S504: If there is an index information area whose status is abnormal, the file index information in the index information area whose status is abnormal is updated by the file index information in the index information area whose status is normal.

具体可以将正常的索引信息区中的文件索引信息直接写入到异常的索引信息区即可。Specifically, the file index information in the normal index information area can be directly written into the abnormal index information area.

本发明实施例加入写开始或写完成标识,在检查硬盘时使用双检测机制,能够简单、有效地实现所有信息是否完整有效的检测,通过更新操作,能够保证所有的索引信息区中具有正常的文件索引信息。The embodiment of the present invention adds a write start or a write completion identifier, and uses a double detection mechanism when checking a hard disk, which can easily and effectively realize whether all information is completely and effectively detected. Through the update operation, all index information areas can be guaranteed to have normal File index information.

下面结合图6、图7、图8、图9以及图10对本发明实施例的文件信息处理作进一步的详细描述。文件系统的结构示意图可参考图6所示,在超级扇区Supersector中记录和文件系统相关的所有关键信息,目录表Dirtable中记录了目录的相关信息,索引表InodeTable中记录文件自身相关信息,数据块图BlockMap中记录了所有存储块的对应信息,数据块区Blockarea则为数据存储区,存储文件数据。Supersector、Dirtable、InodeTable、BlockMap为头区,其中的Dirtable、InodeTable、BlockMap为索引信息区,Blockarea则为数据区。The file information processing of the embodiment of the present invention will be further described in detail below with reference to FIG. 6, FIG. 7, FIG. 8, FIG. 9, and FIG. The structure of the file system can be referred to as shown in FIG. 6. All key information related to the file system is recorded in the Super Sector Supersector, the related information of the directory is recorded in the directory table Dirtable, and the related information of the file itself is recorded in the index table InodeTable. The block map BlockMap records the corresponding information of all the storage blocks, and the block area Blockarea is the data storage area, and stores the file data. Supersector, Dirtable, InodeTable, and BlockMap are header areas, where Dirtable, InodeTable, and BlockMap are index information areas, and Blockarea is a data area.

在可用于存储的设备开机时,索引信息区的相关信息会被加载到设备内存中,在该设备存储文件数据时,内存会根据文件数据存储到数据区的具体情况,更新内存中的相关信息,以便记录该文件数据的文件索引信息。这些索引信息可以周期性地回写到存储器(硬盘中)。When the device that can be used for storage is powered on, the information about the index information area is loaded into the device memory. When the device stores the file data, the memory updates the related information in the memory according to the specific conditions of the file data stored in the data area. To record file index information for the file data. These index information can be periodically written back to the memory (in the hard disk).

本发明实施例的文件系统结构图如图7所示,以存储器为SSD为例,由于SSD的块特性,文件系统的关键区都需要以512KB为基本单位,Supersector一般在存储器的第一个块上存储第一绝对扇区Supersector1,在第二个块上存储第二绝对扇区Supersector2,由于文件系统的索引信息(Dirtable、InodeTable、BlockMap)和设计者的定义高相关,具体分配长度、组织方式不定,索引信息部分可灵活配置,一般会在对应的绝对扇区中记录索引信息区的入口。图7中包括了第一索引信息区IndexInfo1和第二索引信息区IndexInfo2,每一个索引信息区中分别包括了Dirtable、InodeTable及BlockMap。文件数据存储到Blockarea区。如图7所示,相对以前的文件系统结构,在头区中需要记录更多的信息,在第一绝对扇区Supersector1中记录了第一索引信息区IndexInfo1写开始、停止标识,在第二绝对扇区Supersector2中记录了第二索引信息区IndexInfo2写开始、停止标识,对应索引信息的入口等。The file system structure diagram of the embodiment of the present invention is shown in FIG. 7. Taking the memory as an SSD as an example, due to the block characteristics of the SSD, the key areas of the file system need to be 512 KB as a basic unit, and the Supersector is generally in the first block of the memory. The first absolute sector Supersector1 is stored, and the second absolute sector Supersector2 is stored on the second block. Since the file system index information (Dirtable, InodeTable, BlockMap) and the designer's definition are highly correlated, the specific allocation length and organization manner In some cases, the index information part can be flexibly configured, and the entry of the index information area is generally recorded in the corresponding absolute sector. FIG. 7 includes a first index information area IndexInfo1 and a second index information area IndexInfo2, and each of the index information areas includes Dirtable, InodeTable, and BlockMap. File data is stored in the Blockarea area. As shown in FIG. 7, compared with the previous file system structure, more information needs to be recorded in the header area, and the first index information area IndexInfo1 write start and stop identifiers are recorded in the first absolute sector Supersector1, in the second absolute The sector Supersector 2 records the start and stop flags of the second index information area IndexInfo2, the entry of the corresponding index information, and the like.

对于文件系统的升级包括:a)需要对文件系统检测操作(即检测此盘上存在不存在相应的文件系统)进行升级,会先对第一绝对扇区和第二绝对扇区进行比对,通过开始停止写标号,可以容易判断最后一次头部写入有没有异常,以及出现异常的部分。b)需要对文件系统的回写操作进行升级,在每次对头部的回写操作时,要对对应的绝对扇区的开始停止写标号进行更新。The upgrade to the file system includes: a) the need to upgrade the file system detection operation (ie, detecting the existence of the corresponding file system on the disk), and first comparing the first absolute sector with the second absolute sector. By starting to stop writing the label, it is easy to determine whether there is an abnormality in the last head write and the part where the exception occurred. b) It is necessary to upgrade the write back operation of the file system, and each time the write back operation to the header is performed, the start of the corresponding absolute sector is stopped and the write label is updated.

图8示出了本发明实施例的文件信息更新方法的流程示意图,在一般带有存储媒体的系统中,开机过程会对存储媒体上是否存在可识别的文件系统进行检测,如果没有检测到会提示格式化;文件系统结构进行改进后,对文件系统的检测需要加入新的内容即索引信息区的状态检测和文件信息更新,本发明实施例的所述方法具体包括:FIG. 8 is a schematic flowchart diagram of a method for updating file information according to an embodiment of the present invention. In a system with a storage medium generally, the boot process detects whether an identifiable file system exists on the storage medium, if not detected. After the file system structure is improved, the detection of the file system needs to add a new content, that is, the state detection of the index information area and the file information update. The method in the embodiment of the present invention specifically includes:

S801:读入第一绝对扇区和第二绝对扇区(即第一个BLOCK与第二个BLOCK)。具体可以在开机需要初始化时,执行S801。S801: Read in the first absolute sector and the second absolute sector (ie, the first BLOCK and the second BLOCK). Specifically, when the booting needs to be initialized, S801 is executed.

对第一绝对扇区和第二绝对扇区进行文件系统识别。识别包括以下三步:File system identification is performed on the first absolute sector and the second absolute sector. Identification includes the following three steps:

S802:若第一绝对扇区和第二绝对扇区均识别不成功,则提示需要格式化。S802: If the first absolute sector and the second absolute sector are both unsuccessfully identified, the prompt is required to be formatted.

S803:若只有一个绝对扇区识别成功,确定出未识别成功的绝对扇区为异常块。S803: If only one absolute sector identification is successful, it is determined that the absolute sector that is not recognized successfully is an abnormal block.

S804:若第一绝对扇区和第二绝对扇区均识别成功,分别查看第一绝对扇区和第二绝对扇区的写标识,若其中有不存在写完成标识的绝对扇区,则说明该绝对扇区所对应索引信息区的文件索引信息不完整,需要使用另一个索引信息区的文件索引信息。S804: If the first absolute sector and the second absolute sector are successfully identified, respectively, the write identifiers of the first absolute sector and the second absolute sector are respectively viewed, and if there is an absolute sector in which the write completion identifier does not exist, The file index information of the index information area corresponding to the absolute sector is incomplete, and the file index information of another index information area needs to be used.

S805:若文件系统结构存在,将正确的文件索引信息初始化到内存中。S805: If the file system structure exists, the correct file index information is initialized into the memory.

S806:若存在不完整的文件索引信息,使用正确的文件索引信息进行修正。S806: If there is incomplete file index information, use the correct file index information to correct.

在后续过程中存在文件存储操作时,会基于回写周期来将内存中更新的文件索引信息回写到各个索引信息区中,防止实际数据已经写入磁盘而大量的文件索引信息并未更新。图9示出了在高速存储系统(非超高速存储系统)中的回写方法的流程示意图,在非超高速存储系统中,需要在回写时,对第一索引信息区IndexInfo1和第二索引信息区IndexInfo2分别更新,包括:When there is a file storage operation in the subsequent process, the file index information updated in the memory is written back to each index information area based on the write-back cycle, preventing the actual data from being written to the disk and a large amount of file index information is not updated. 9 is a flow chart showing a write-back method in a high-speed storage system (non-super-high-speed storage system) in which a first index information area IndexInfo1 and a second index are required to be written back. The information area IndexInfo2 is updated separately, including:

S901:将第一索引信息区的写标识置为写开始,并将写开始标识写入第一个物理block,即:将写开始标识写入到在第一绝对扇区中的supersector1中;S901: The write identifier of the first index information area is set to start of writing, and the write start identifier is written into the first physical block, that is, the write start identifier is written into the supervisor1 in the first absolute sector;

S902:对第一索引信息区进行回写,写入对应的文件索引信息,即:将当前需要回写的文件索引信息写入到第一索引信息区中;S902: Write back the first index information area, and write the corresponding file index information, that is, write the file index information that needs to be written back to the first index information area;

S903:将第一索引信息区的写标识置为写完成,并将写完成标识写入第一个物理block,即在回写文件索引信息完成后,将写完成标识写入到在第一绝对扇区中的supersector1中;S903: Write the write identifier of the first index information area to write completion, and write the write completion identifier to the first physical block, that is, after the write back file index information is completed, write the write completion identifier to the first absolute Supersector1 in the sector;

S904:将第二索引信息区的写标识置为写开始,并将写开始标识写入第二个物理block,即:将写开始标识写入到在第二绝对扇区中的supersector2中;S904: The write identifier of the second index information area is set to start of writing, and the write start identifier is written to the second physical block, that is, the write start identifier is written into the supervisor2 in the second absolute sector;

S905:对第二索引信息区进行回写,写入对应的文件索引信息,即:将当前需要回写的文件索引信息写入到第二索引信息区中;S905: Write back the second index information area, and write the corresponding file index information, that is, write the file index information that needs to be written back to the second index information area;

S906:将第二索引信息区的写标识置为写完成,并将写完成标识写入第二个物理block,即在回写文件索引信息完成后,将写完成标识写入到在第二绝对扇区中的supersector2中。S906: Write the write identifier of the second index information area to write completion, and write the write completion identifier to the second physical block, that is, after the write back file index information is completed, write the write completion identifier to the second absolute In supersector2 in the sector.

对文件索引信息的本次回写完成。可以理解的是,如果有多个索引信息区则依次继续回写本次需要回写的文件索引信息。This write back of the file index information is completed. It can be understood that if there are multiple index information areas, the file index information that needs to be written back is sequentially written back.

图10示出了在超高速系统中进行文件索引信息回写的方法的流程示意图,在超高速系统中(例如超高速拍照),在需要回写时,采用乒乓的方法来回回写文件索引信息,这样可以更加有效的利用带宽,保证文件索引信息能够正确写入,所述方法包括:FIG. 10 is a schematic flow chart showing a method for performing file index information write back in a super high speed system. In a super high speed system (for example, ultra high speed photographing), when a write back is required, the file index information is written back and forth by using a ping-pong method. In this way, the bandwidth can be utilized more effectively, and the file index information can be correctly written. The method includes:

S1001:奇数次回写对第一索引信息区及对应的文件索引信息进行回写;具体包括:将第一索引信息区的写标识置为写开始,并将写开始标识写入第一个物理block,即将写开始标识写入到在第一绝对扇区中的supersector1中;对第一索引信息区进行回写,写入对应的文件索引信息,即将当前需要回写的文件索引信息写入到第一索引信息区中;将第一索引信息区的写标识置为写完成,并将写完成标识写入第一个物理block,即在回写文件索引信息完成后,将写完成标识写入到在第一绝对扇区中的supersector1中;S1001: The odd-numbered write-back writes back the first index information area and the corresponding file index information. Specifically, the write identifier of the first index information area is set to start of writing, and the write start identifier is written into the first physical block. Write the start identifier to the supervisor1 in the first absolute sector; write back the first index information area, and write the corresponding file index information, that is, write the file index information that needs to be written back to the first In an index information area; the write identifier of the first index information area is set to write completion, and the write completion identifier is written into the first physical block, that is, after the write back file index information is completed, the write completion identifier is written to In supervisor1 in the first absolute sector;

S1002:偶数次回写对第二索引信息区及对应的文件索引信息进行回写;具体包括:将第二索引信息区的写标识置为写开始,并将写开始标识写入第二个物理block,即将写开始标识写入到在第二绝对扇区中的supersector2中;对第二索引信息区进行回写,写入对应的文件索引信息,即将当前需要回写的文件索引信息写入到第二索引信息区中;将第二索引信息区的写标识置为写完成,并将写完成标识写入第二个物理block,即在回写文件索引信息完成后,将写完成标识写入到在第二绝对扇区中的supersector2中;S1002: Write back the second index information area and the corresponding file index information by an even number of writebacks. Specifically, the write identifier of the second index information area is set to start of writing, and the write start identifier is written to the second physical block. , that is, the write start identifier is written into the supervisor2 in the second absolute sector; the second index information area is written back, and the corresponding file index information is written, that is, the file index information that needs to be written back is written to the first In the second index information area, the write identifier of the second index information area is set to write completion, and the write completion identifier is written to the second physical block, that is, after the write back file index information is completed, the write completion identifier is written to In supervisor2 in the second absolute sector;

S1003:在所述文件的记录结束后,对第一索引信息区、第二索引信息区及对应的所有文件索引信息都进行回写。S1003: After the recording of the file ends, the first index information area, the second index information area, and all corresponding file index information are written back.

如果存在超高速存储的需求,则在文件系统加入异常终止检测后,确定出两个头区(文件索引信息)均正确的情况下,选取文件索引信息更多的头区执行诸如更新、加载到内存中等操作。If there is a need for ultra-high-speed storage, after the file system joins the abnormal termination detection and determines that both header areas (file index information) are correct, the header area of the file index information is selected to perform more operations such as updating and loading into the memory. Medium operation.

本发明实施例通过配置两个或者多个索引信息区,引入二次或者多次写入,可以在回写出现异常时较好地保证至少有一个索引信息区中的文件索引信息不会丢失,较为有效地避免了索引信息丢失,以及整盘数据无法恢复的问题,可较好地保证不会出现大量文件的丢失或损坏。加入写开始或写完成标识,在检查硬盘时使用双检测机制,能够简单、有效地实现所有信息是否完整有效的检测,且能够保证所有的索引信息区中具有正常的文件索引信息。In the embodiment of the present invention, by configuring two or more index information areas and introducing two or more times of writing, it is possible to ensure that file index information in at least one index information area is not lost when an exception occurs in the write back. It effectively avoids the loss of index information and the problem that the entire disk data cannot be recovered, and can better ensure that a large number of files are not lost or damaged. The write start or write completion flag is added, and the double detection mechanism is used when checking the hard disk, which can completely and effectively realize whether all the information is completely and effectively detected, and can ensure that all the index information areas have normal file index information.

下面对本发明实施例的文件处理装置、设备及系统进行详细描述。The file processing apparatus, device and system of the embodiments of the present invention are described in detail below.

请参考图11,是本发明实施例的一种文件信息处理装置的结构示意图,本发明实施例的所述装置可设置在诸如带存储设备的相机等文件处理设备中,具体的,所述装置包括:Please refer to FIG. 11 , which is a schematic structural diagram of a file information processing apparatus according to an embodiment of the present invention. The apparatus in the embodiment of the present invention may be disposed in a file processing device such as a camera with a storage device. Specifically, the device include:

确定模块11,用于在检测到向存储器回写文件索引信息时,确定出待回写的文件索引信息;The determining module 11 is configured to determine file index information to be written back when detecting that the file index information is written back to the memory;

回写模块12,用于将确定出的文件索引信息写入到在所述存储器中配置的至少两个索引信息区中。The write back module 12 is configured to write the determined file index information into at least two index information areas configured in the memory.

在某个文件存储到存储器的整个过程中,文件系统会要求将内存中该文件的相关数据周期性地回写到硬盘中,当达到回写的时间间隔要求、或者回写时间点时,会从内存向存储器回写该文件的相关信息,包括文件索引信息,存储器可以为普通的机械硬盘、可以实现超高速存储的SSD等。During the storage of a file to the storage system, the file system will periodically write back the data related to the file in the memory to the hard disk. When the time interval for writing back is reached, or when the time is written back, Write back information about the file from the memory to the memory, including file index information. The memory can be an ordinary mechanical hard disk, an SSD that can realize ultra-high speed storage, and the like.

存储过程中,内存中关于该文件的文件索引信息会更新,文件索引信息可以为该存储该文件的各个数据块block的地址、文件名、创建时间等信息。因此,所述确定模块11在确定待回写的文件索引信息时,可以仅确定出被更新的那部分内容,以便于减小回写开销。During the storage process, the file index information about the file in the memory is updated, and the file index information may be information such as the address, file name, creation time, and the like of each data block block in which the file is stored. Therefore, when determining the file index information to be written back, the determining module 11 may only determine the part of the content that is updated, so as to reduce the write-back overhead.

预先在所述存储器中配置两个或者多个索引信息区,对于由所述确定模块11确定出的文件索引信息,需要分别写入到配置的两个或者多个索引信息区写入。Two or more index information areas are configured in advance in the memory, and for the file index information determined by the determining module 11, two or more index information area writes respectively required to be written are required.

所述回写模块12具体可以按照配置的预置的回写策略回写文件索引信息,包括依次将确定出的文件索引信息写入到对应的索引信息区中。以包括两个索引信息区为例,在需要写入文件索引信息时,所述回写模块12首先将文件索引信息写入到第一索引信息区,完成后,再将文件索引信息写入到第二索引信息区。其中,如果在向第二索引信息区写入文件索引信息时出现异常,例如设备掉电,第二索引信息区所有的文件索引信息可能会丢失,但第一索引信息区的文件索引信息仍然都存在。而如果在写入到第一索引信息区的过程中出现异常,导致第一索引信息区的文件索引信息丢失,但是在上一个回写周期中,写入到第二索引信息区的文件索引信息还存在,没有受到破坏。需要说明的是,在向第一索引信息区写入文件索引信息出现异常,仍然会丢失本次回写的数据,但丢失的文件索引信息并不多,对存储的文件数据的影响不大,更不会出现整盘数据均无法恢复的情况。在存在三个及以上的索引信息区时,可作相同的推理。The write-back module 12 may specifically write back file index information according to the configured preset write-back policy, including sequentially writing the determined file index information into the corresponding index information area. Taking the two index information areas as an example, when the file index information needs to be written, the write-back module 12 first writes the file index information to the first index information area, and then writes the file index information to the file index information. The second index information area. If an abnormality occurs when the file index information is written to the second index information area, for example, the device is powered off, all file index information of the second index information area may be lost, but the file index information of the first index information area is still presence. If an abnormality occurs in the process of writing to the first index information area, the file index information of the first index information area is lost, but in the last write back period, the file index information written to the second index information area is It still exists and has not been damaged. It should be noted that when the file index information is written to the first index information area, the data is still lost, but the lost data is not much, and the impact on the stored file data is not large. There will be no cases where the entire data cannot be recovered. The same reasoning can be made when there are three or more index information areas.

所述回写模块12具体也可以按照预置的来回回写策略进行回写。同样以具有两个索引信息区为例,来回回写策略是基于回写的次数执行,所述回写模块12在第N次回写时,如果N为奇数,将文件索引信息写入到第一索引信息区,而如果N为偶数,则写入第二索引信息区。在此情况下也可以较为有效地避免文件索引信息丢失,数据均无法恢复的情况。The writeback module 12 can also specifically write back according to a preset back and forth write strategy. Similarly, taking two index information areas as an example, the round-trip write-back strategy is executed based on the number of write-backs. When the write-back module 12 writes back the Nth time, if N is an odd number, the file index information is written to the first. The information area is indexed, and if N is an even number, the second index information area is written. In this case, it is also possible to prevent the file index information from being lost and the data cannot be recovered more effectively.

所述回写模块12所执行的回写策略还可以为:同时分别写入各个索引信息区;或者按照随机次序向各索引信息区写入文件索引信息;或者为选择其中的数据量少于阈值的两个或者多个索引信息区,以写入文件索引信息。The write-back strategy executed by the write-back module 12 may also be: writing each index information area separately; or writing file index information to each index information area according to a random order; or selecting a data amount less than a threshold. Two or more index information areas to write file index information.

本发明实施例所述的方法还可以基于当前所处的应用环境,选择不同的回写策略。具体的,如果检测到的应用环境为第一类应用环境(如:720P视频的高速存储的应用环境),则使用的回写策略包括第一类回写策略,如上述提到的按照次序依次写、随机写、选择其中的数据量少于阈值的两个或者多个索引信息区回写等策略;而如果检测到的应用环境为第二类应用环境(如:4K视频的超高速存储的应用环境),则使用第二类回写策略,如上述提到的来回写策略。The method in the embodiment of the present invention may also select different write-back strategies based on the current application environment. Specifically, if the detected application environment is a first-class application environment (for example, a high-speed storage application environment of 720P video), the write-back strategy used includes a first-type write-back strategy, as described above in order. Write, randomly write, select two or more index information area writeback strategies in which the amount of data is less than the threshold; and if the detected application environment is a second type of application environment (eg, 4K video super high speed storage) The application environment) uses a second type of write-back strategy, such as the round-trip strategy mentioned above.

本发明实施例通过配置两个或者多个索引信息区,引入二次或者多次写入,可以在回写出现异常时较好地保证至少有一个索引信息区中的文件索引信息不会丢失,较为有效地避免了索引信息丢失,以及整盘数据无法恢复的问题,可较好地保证不会出现大量文件的丢失或损坏。In the embodiment of the present invention, by configuring two or more index information areas and introducing two or more times of writing, it is possible to ensure that file index information in at least one index information area is not lost when an exception occurs in the write back. It effectively avoids the loss of index information and the problem that the entire disk data cannot be recovered, and can better ensure that a large number of files are not lost or damaged.

进一步地再请参见图12,是本发明实施例的另一种文件信息处理装置的结构示意图,本发明实施例的所述装置可设置在诸如带存储设备的相机等文件处理设备中,所述装置包括上一实施例中的确定模块11和回写模块12,进一步地,在本发明实施例中,所述回写模块12,具体用于根据预置的回写策略,将确定出的文件索引信息写入到在所述存储器中配置的至少两个索引信息区中。Referring to FIG. 12, FIG. 12 is a schematic structural diagram of another file information processing apparatus according to an embodiment of the present invention. The apparatus of the embodiment of the present invention may be disposed in a file processing device such as a camera with a storage device. The device includes the determining module 11 and the write-back module 12 in the previous embodiment. Further, in the embodiment of the present invention, the write-back module 12 is specifically configured to determine the file according to a preset write-back strategy. The index information is written into at least two index information areas configured in the memory.

其中,所述回写策略具体包括上述提到的依次回写、交叉来回回写、随机回写等等。The write-back strategy specifically includes the above-mentioned sequential write back, cross back and forth write, random write back, and the like.

可选地,所述回写模块12,具体用于将确定出的文件索引信息写入到所述存储器中配置的第一索引信息区中;将确定出的文件索引信息写入到所述存储器中配置的第二索引信息区中。Optionally, the write-back module 12 is specifically configured to write the determined file index information into the first index information area configured in the memory; and write the determined file index information to the memory In the second index information area configured in the middle.

其中,具体地,所述回写模块12,具体用于将确定出的文件索引信息写入到所述存储器中配置的第一索引信息区中,在确定出的所述文件索引信息已完全写入到所述第一索引信息区后,再将确定出的文件索引信息写入到所述存储器中配置的第二索引信息区中。即依次回写的策略。Specifically, the write-back module 12 is specifically configured to write the determined file index information into the first index information area configured in the memory, where the determined file index information is completely written. After entering the first index information area, the determined file index information is written into the second index information area configured in the memory. That is, the strategy of writing back in turn.

进一步可选地,所述确定模块11,具体用于按照预置的回写周期,周期性地确定出待回写的文件索引信息,以便于周期性地将确定出的文件索引信息写入到所述存储器对应索引信息区。Further, the determining module 11 is specifically configured to periodically determine file index information to be written back according to a preset writeback period, so as to periodically write the determined file index information to the file index information. The memory corresponds to an index information area.

进一步可选地,所述回写模块12,具体用于若当前的回写次数是奇数次,则将确定出的文件索引信息写入到在所述存储器中配置的第一索引信息区;若当前的回写次数为偶数次,则将确定出的文件索引信息写入到在所述存储器中配置的第二索引信息区。即基于回写次数,交叉来回回写的策略。Further, the writeback module 12 is specifically configured to: if the current number of writeback times is an odd number of times, write the determined file index information to the first index information area configured in the memory; When the current number of writebacks is an even number of times, the determined file index information is written to the second index information area configured in the memory. That is, based on the number of writebacks, the strategy of cross-back writing back.

进一步地,所述回写模块12,还用于若所述文件索引信息所对应的文件在所述存储器中存储结束,则确定出该文件的关联文件索引信息;将确定出的关联文件索引信息分别存储到在所述存储器中配置的至少两个索引信息区中。在来回回写的策略下,还需要最后将全部的文件索引信息均写入到至少两个索引信息区中,以保证每个索引信息区中文件索引信息的完整。Further, the write-back module 12 is further configured to: if the file corresponding to the file index information is stored in the memory, determine the associated file index information of the file; and determine the associated file index information. Stored separately into at least two index information areas configured in the memory. In the strategy of writing back and forth, it is also necessary to finally write all the file index information into at least two index information areas to ensure the integrity of the file index information in each index information area.

进一步可选地,本发明实施例的所述装置还可以包括对各个文件索引区的写状态进行设置更新的模块,具体可以包括:Further, optionally, the apparatus of the embodiment of the present invention may further include: a module for setting and updating a write state of each file index area, which may specifically include:

第一设置模块13,用于在检测到向索引信息区写入文件索引信息时,设置该索引信息区的写状态,并在写入结束后,更新该索引信息区的写状态。可选地,所述第一设置模块13,具体用于在检测到向索引信息区写入文件索引信息时,为该索引信息区配置写开始标识,并在写入结束后,为该索引信息区配置写完成标识。或者所述第一设置模块13,具体用于用于在检测到向索引信息区写入文件索引信息时,将该索引信息区关联的索引标识设置为写开始标识,在写入结束后,将关联的索引标识设置为写完成标识。The first setting module 13 is configured to set a write state of the index information area when detecting the file index information to the index information area, and update the write status of the index information area after the writing ends. Optionally, the first setting module 13 is configured to: when detecting that the file index information is written into the index information area, configure a write start identifier for the index information area, and after the writing ends, the index information is The zone configuration write completion flag. Or the first setting module 13 is configured to: when detecting that the file index information is written to the index information area, set the index identifier associated with the index information area to a write start identifier, and after the writing ends, The associated index ID is set to the write completion ID.

或者,所述对各个文件索引信息区的写状态进行设置更新的模块包括:Alternatively, the module for setting and updating the write status of each file index information area includes:

第二设置模块,用于在检测到向索引信息区写入文件索引信息时,为该索引信息区配置写开始标识,并在写入结束后,为该索引信息区配置写完成标识。The second setting module is configured to: when the file index information is written to the index information area, configure a write start identifier for the index information area, and configure a write completion identifier for the index information area after the writing ends.

或者,所述对各个文件索引信息区的写状态进行设置更新的模块包括:Alternatively, the module for setting and updating the write status of each file index information area includes:

第三设置模块,用于在检测到向索引信息区写入文件索引信息时,将该索引信息区关联的索引标识设置为写开始标识,在写入结束后,将关联的索引标识设置为写完成标识。The third setting module is configured to: when the file index information is written to the index information area, set the index identifier associated with the index information area to a write start identifier, and after the writing ends, set the associated index identifier to write Complete the logo.

进一步可选地,本发明实施例的所述装置还可以包括:Further optionally, the apparatus of the embodiment of the present invention may further include:

更新模块14,用于基于写完成标识判断存储器的各个索引信息区的状态;若存在状态为异常的索引信息区,则以状态为正常的索引信息区中的文件索引信息更新所述状态为异常的索引信息区中的文件索引信息。The update module 14 is configured to determine, according to the write completion identifier, a state of each index information area of the memory; if there is an index information area whose state is abnormal, the status is updated as abnormal by the file index information in the index information area whose status is normal. File index information in the index information area.

进一步可选地,本发明实施例的所述装置还可以包括:Further optionally, the apparatus of the embodiment of the present invention may further include:

选择模块15,用于检测应用环境,识别存储速度等级,所述存储速度等级是基于向所述存储器中写入数据的速度需求来确定的;根据识别的存储速度等级选择回写策略。The selection module 15 is configured to detect an application environment, and identify a storage speed level determined based on a speed requirement of writing data into the memory; and selecting a write back policy according to the identified storage speed level.

具体的,本发明实施例中各个模块的具体实现可参考图1至图10对应实施例中的相关描述。For specific implementations of the various modules in the embodiments of the present disclosure, reference may be made to the related description in the corresponding embodiments in FIG. 1 to FIG.

本发明实施例通过配置两个或者多个索引信息区,引入二次或者多次写入,可以在回写出现异常时较好地保证至少有一个索引信息区中的文件索引信息不会丢失,较为有效地避免了索引信息丢失,以及整盘数据无法恢复的问题,可较好地保证不会出现大量文件的丢失或损坏。加入写开始或写完成标识,在检查硬盘时使用双检测机制,能够简单、有效地实现所有信息是否完整有效的检测,且能够保证所有的索引信息区中具有正常的文件索引信息。In the embodiment of the present invention, by configuring two or more index information areas and introducing two or more times of writing, it is possible to ensure that file index information in at least one index information area is not lost when an exception occurs in the write back. It effectively avoids the loss of index information and the problem that the entire disk data cannot be recovered, and can better ensure that a large number of files are not lost or damaged. The write start or write completion flag is added, and the double detection mechanism is used when checking the hard disk, which can completely and effectively realize whether all the information is completely and effectively detected, and can ensure that all the index information areas have normal file index information.

再请参见图13,是本发明实施例的又一种文件信息处理装置的结构示意图,本发明实施例的所述装置可设置在诸如带存储设备的相机等文件处理设备中,具体的,所述装置包括:Referring to FIG. 13 , it is a schematic structural diagram of another file information processing apparatus according to an embodiment of the present invention. The apparatus of the embodiment of the present invention may be disposed in a file processing device such as a camera with a storage device, specifically, The device includes:

状态设置模块21,用于在检测到向存储器中配置的索引信息区写入确定的文件索引信息时,设置该索引信息区的状态为写开始状态;a state setting module 21, configured to set a state of the index information area to a write start state when detecting that the determined file index information is written to the index information area configured in the memory;

更新模块22,用于在索引信息的写入结束后,更新该索引信息区的状态为写完成状态;其中,所述存储器中配置了至少两个索引信息区。The updating module 22 is configured to update the state of the index information area to a write completion state after the writing of the index information ends; wherein at least two index information areas are configured in the memory.

其中具体的,所述状态设置模块21,具体用于在检测到向存储器中配置的索引信息区写入确定的文件索引信息时,将对应的索引信息区中配置的索引标识设置为写开始标识。Specifically, the state setting module 21 is configured to: when the determined file index information is written to the index information area configured in the memory, set the index identifier configured in the corresponding index information area as the write start identifier. .

其中具体的,所述更新模块22,具体用于在索引信息的写入结束后,在对应的索引信息区中配置的索引标识设置为写完成标识。Specifically, the update module 22 is specifically configured to: after the writing of the index information ends, the index identifier configured in the corresponding index information area is set as a write completion identifier.

其中具体的,所述装置还可以包括:处理模块23,用于基于写完成标识判断存储器的各个索引信息区的状态;若存在状态为异常的索引信息区,则以状态为正常的索引信息区中的文件索引信息更新状态为异常的索引信息区中的文件索引信息。Specifically, the device may further include: a processing module 23, configured to determine, according to the write completion identifier, a state of each index information area of the memory; and if there is an index information area whose state is abnormal, the index information area with the status as normal The file index information update status in the file index information in the abnormal index information area.

具体的,本发明实施例中所涉及的写开始状态、写完成状态的相关内容可参考图8至图10对应实施例中的相关描述。Specifically, relevant content of the write start state and the write completion state involved in the embodiment of the present invention may refer to related descriptions in the corresponding embodiments in FIG. 8 to FIG.

本发明实施例加入写开始或写完成标识,在检查硬盘时使用双检测机制,能够简单、有效地实现所有信息是否完整有效的检测,通过更新操作,能够保证所有的索引信息区中具有正常的文件索引信息。The embodiment of the present invention adds a write start or a write completion identifier, and uses a double detection mechanism when checking a hard disk, which can easily and effectively realize whether all information is completely and effectively detected. Through the update operation, all index information areas can be guaranteed to have normal File index information.

再请参见图14,是本发明实施例的一种文件处理设备的结构示意图,本发明实施例的所述文件处理设备包括输入装置100、输出装置200、处理器300,其中,所述输入装置100用于先所述处理器300输入相关数据、信息,所述处理器300可以通过调用外部或者内置的存储器中存储的文件处理应用程序,执行相关的处理后通过所述输出装置200输出相关数据、信息。具体的,所述处理器300,用于在检测到向相连的存储器回写文件索引信息时,确定出待回写的文件索引信息;将确定出的文件索引信息写入到在所述存储器中配置的至少两个索引信息区中。14 is a schematic structural diagram of a file processing device according to an embodiment of the present invention. The file processing device of the embodiment of the present invention includes an input device 100, an output device 200, and a processor 300, wherein the input device The processor 300 can be used to input related data and information by the processor 300, and the processor 300 can output relevant data through the output device 200 by executing a related processing by calling a file processing application stored in an external or built-in memory. ,information. Specifically, the processor 300 is configured to: when detecting that the file index information is written back to the connected memory, determine file index information to be written back; and write the determined file index information into the memory. Configured in at least two index information areas.

其中可选地,所述处理器300,具体用于根据预置的回写策略,将确定出的文件索引信息写入到在所述存储器中配置的至少两个索引信息区中。Optionally, the processor 300 is configured to write the determined file index information into at least two index information areas configured in the memory according to a preset write-back policy.

其中可选地,所述处理器300,具体用于将确定出的文件索引信息写入到所述存储器中配置的第一索引信息区中;将确定出的文件索引信息写入到所述存储器中配置的第二索引信息区中。Optionally, the processor 300 is specifically configured to write the determined file index information into the first index information area configured in the memory; and write the determined file index information to the memory. In the second index information area configured in the middle.

其中可选地,所述处理器300,具体用于将确定出的文件索引信息写入到所述存储器中配置的第一索引信息区中,并在确定出的所述文件索引信息已完全写入到所述第一索引信息区后,将所述将确定出的文件索引信息写入到在所述存储器中配置的第二索引信息区中。Optionally, the processor 300 is configured to write the determined file index information into the first index information area configured in the memory, and the determined file index information is completely written. After entering the first index information area, the determined file index information is written into the second index information area configured in the memory.

其中可选地,所述处理器300,具体用于按照预置的回写周期,周期性地确定出待回写的文件索引信息,以便于周期性地将确定出的文件索引信息写入到所述存储器对应索引信息区。Optionally, the processor 300 is configured to periodically determine file index information to be written back according to a preset write-back period, so as to periodically write the determined file index information to the file. The memory corresponds to an index information area.

其中可选地,所述处理器300,具体用于若当前的回写次数是奇数次,则将确定出的文件索引信息写入到在所述存储器中配置的第一索引信息区;若当前的回写次数为偶数次,则将确定出的文件索引信息写入到在所述存储器中配置的第二索引信息区。Optionally, the processor 300 is configured to: when the current number of writeback times is an odd number of times, write the determined file index information to the first index information area configured in the memory; The number of writebacks is an even number of times, and the determined file index information is written to the second index information area configured in the memory.

其中可选地,所述处理器300,还用于若所述文件索引信息所对应的文件在所述存储器中存储结束,则确定出该文件的关联文件索引信息;将确定出的关联文件索引信息分别存储到在所述存储器中配置的至少两个索引信息区中。Optionally, the processor 300 is further configured to: if the file corresponding to the file index information is stored in the memory, determine the associated file index information of the file; and determine the associated file index. The information is separately stored into at least two index information areas configured in the memory.

其中可选地,所述处理器300,还用于在检测到向索引信息区写入文件索引信息时,设置该索引信息区的写状态,并在写入结束后,更新该索引信息区的写状态。Optionally, the processor 300 is further configured to: when detecting that the file index information is written into the index information area, set a write status of the index information area, and update the index information area after the end of the writing. Write status.

其中可选地,所述处理器300,还用于在检测到向索引信息区写入文件索引信息时,为该索引信息区配置写开始标识,并在写入结束后,为该索引信息区配置写完成标识。Optionally, the processor 300 is further configured to: when detecting that the file index information is written into the index information area, configure a write start identifier for the index information area, and after the writing ends, the index information area Configure the write completion ID.

其中可选地,所述处理器300,还用于在检测到向索引信息区写入文件索引信息时,将该索引信息区关联的索引标识设置为写开始标识,在写入结束后,将关联的索引标识设置为写完成标识。Optionally, the processor 300 is further configured to: when the file index information is written to the index information area, set the index identifier associated with the index information area to a write start identifier, and after the writing ends, The associated index ID is set to the write completion ID.

其中可选地,所述处理器300,还用于基于写完成标识判断存储器的各个索引信息区的状态;若存在状态为异常的索引信息区,则以状态为正常的索引信息区中的文件索引信息更新所述状态为异常的索引信息区中的文件索引信息。Optionally, the processor 300 is further configured to determine, according to the write completion identifier, a state of each index information area of the memory; and if there is an index information area whose state is abnormal, the file in the index information area whose status is normal The index information updates the file index information in the index information area whose state is abnormal.

其中可选地,所述处理器300,还用于检测应用环境,识别存储速度等级,所述存储速度等级是基于向所述存储器中写入数据的速度需求来确定的;根据识别的存储速度等级选择回写策略。Optionally, the processor 300 is further configured to detect an application environment, and identify a storage speed level, where the storage speed level is determined based on a speed requirement for writing data into the memory; according to the identified storage speed. The level selects the writeback strategy.

所述处理器300执行的各个功能的具体描述可参考图1至图10对应实施例中的相关描述。For a detailed description of the functions performed by the processor 300, reference may be made to the related description in the corresponding embodiments of FIG. 1 to FIG.

本发明实施例通过配置两个或者多个索引信息区,引入二次或者多次写入,可以在回写出现异常时较好地保证至少有一个索引信息区中的文件索引信息不会丢失,较为有效地避免了索引信息丢失,以及整盘数据无法恢复的问题,可较好地保证不会出现大量文件的丢失或损坏。加入写开始或写完成标识,在检查硬盘时使用双检测机制,能够简单、有效地实现所有信息是否完整有效的检测,且能够保证所有的索引信息区中具有正常的文件索引信息。In the embodiment of the present invention, by configuring two or more index information areas and introducing two or more times of writing, it is possible to ensure that file index information in at least one index information area is not lost when an exception occurs in the write back. It effectively avoids the loss of index information and the problem that the entire disk data cannot be recovered, and can better ensure that a large number of files are not lost or damaged. The write start or write completion flag is added, and the double detection mechanism is used when checking the hard disk, which can completely and effectively realize whether all the information is completely and effectively detected, and can ensure that all the index information areas have normal file index information.

再请参见图15,是本发明实施例的另一种文件处理设备的结构示意图,本发明实施例的所述文件处理设备具体可以包括输入装置400、输出装置500以及处理器600,其中,所述输入装置400用于先所述处理器600输入相关数据、信息,所述处理器600可以通过调用外部或者内置的存储器中存储的文件处理应用程序,执行相关的处理后通过所述输出装置500输出相关数据、信息。其中,所述处理器600,用于在检测到向相连的存储器中配置的索引信息区写入确定的文件索引信息时,设置该索引信息区的状态为写开始状态;在索引信息的写入结束后,更新该索引信息区的状态为写完成状态;其中,所述存储器中配置了至少两个索引信息区。15 is a schematic structural diagram of another file processing device according to an embodiment of the present invention. The file processing device of the embodiment of the present invention may specifically include an input device 400, an output device 500, and a processor 600. The input device 400 is configured to input relevant data and information to the processor 600 first, and the processor 600 can execute the related processing and then pass through the output device 500 by calling a file processing application stored in an external or built-in memory. Output relevant data and information. The processor 600 is configured to: when the determined file index information is written into the index information area configured in the connected memory, set the state of the index information area to a write start state; and write the index information. After the end, the state of the index information area is updated to a write completion state; wherein at least two index information areas are configured in the memory.

具体可选地,所述处理器600,具体用于将对应的索引信息区中配置的索引标识设置为写开始标识。Specifically, the processor 600 is specifically configured to set an index identifier configured in the corresponding index information area as a write start identifier.

具体可选地,所述处理器600,具体用于在对应的索引信息区中配置的索引标识设置为写完成标识。Specifically, the processor 600 is configured to set an index identifier configured in the corresponding index information area as a write completion identifier.

具体可选地,所述处理器600,还用于基于写完成标识判断存储器的各个索引信息区的状态;若存在状态为异常的索引信息区,则以状态为正常的索引信息区中的文件索引信息更新状态为异常的索引信息区中的文件索引信息。Specifically, the processor 600 is further configured to determine, according to the write completion identifier, a state of each index information area of the memory; if there is an index information area whose status is abnormal, the file in the index information area whose status is normal The index information update status is file index information in the abnormal index information area.

所述处理器600执行的各个功能的具体描述可参考图1至图10对应实施例中的相关描述。For a detailed description of the functions performed by the processor 600, reference may be made to the related description in the corresponding embodiments of FIG. 1 to FIG.

本发明实施例加入写开始或写完成标识,在检查硬盘时使用双检测机制,能够简单、有效地实现所有信息是否完整有效的检测,通过更新操作,能够保证所有的索引信息区中具有正常的文件索引信息。The embodiment of the present invention adds a write start or a write completion identifier, and uses a double detection mechanism when checking a hard disk, which can easily and effectively realize whether all information is completely and effectively detected. Through the update operation, all index information areas can be guaranteed to have normal File index information.

本发明实施例还提供了一种文件处理系统,如图16所示,所述系统包括:内存1000、存储器2000和处理器3000,所述处理器3000分别与所述内存1000和所述存储器2000相连,所述处理器3000用于在检测到从所述内存1000向存储器2000回写文件索引信息时,确定出待回写的文件索引信息;将确定出的文件索引信息写入到在所述存储器2000中配置的至少两个索引信息区中。其具体用于执行如图1至图4,以及图8至图10的任一实施例中相关方法的各个步骤。The embodiment of the present invention further provides a file processing system. As shown in FIG. 16, the system includes: a memory 1000, a memory 2000, and a processor 3000. The processor 3000 is respectively associated with the memory 1000 and the memory 2000. Connected, the processor 3000 is configured to determine file index information to be written back when detecting that the file index information is written back from the memory 1000 to the memory 2000; writing the determined file index information to the At least two index information areas configured in the memory 2000. It is specifically used to perform the various steps of the related method in any of the embodiments of Figures 1 through 4, and Figures 8-10.

本发明实施例通过配置两个或者多个索引信息区,引入二次或者多次写入,可以在回写出现异常时较好地保证至少有一个索引信息区中的文件索引信息不会丢失,较为有效地避免了索引信息丢失,以及整盘数据无法恢复的问题,可较好地保证不会出现大量文件的丢失或损坏。In the embodiment of the present invention, by configuring two or more index information areas and introducing two or more times of writing, it is possible to ensure that file index information in at least one index information area is not lost when an exception occurs in the write back. It effectively avoids the loss of index information and the problem that the entire disk data cannot be recovered, and can better ensure that a large number of files are not lost or damaged.

本发明实施例还提供了另一种文件处理系统,如图17所示,所述系统包括:内存4000、存储器5000和处理器6000,所述处理器6000分别与所述内存4000和所述存储器5000相连,所述处理器6000用于在检测从所述内存4000到向存储器5000回写文件索引信息时,确定出待回写的文件索引信息;将确定出的文件索引信息写入到在所述存储器5000中配置的至少两个索引信息区中。其具体用于执行如图4的实施例中相关方法的各个步骤。Another embodiment of the present invention further provides a file processing system. As shown in FIG. 17, the system includes: a memory 4000, a memory 5000, and a processor 6000. The processor 6000 and the memory 4000 and the memory are respectively Connected to 5000, the processor 6000 is configured to determine file index information to be written back when detecting the file index information from the memory 4000 to the memory 5000; and writing the determined file index information to the location The at least two index information areas configured in the memory 5000 are described. It is specifically used to perform the various steps of the related method in the embodiment of FIG.

本发明实施例加入写开始或写完成标识,在检查硬盘时使用双检测机制,能够简单、有效地实现所有信息是否完整有效的检测,通过更新操作,能够保证所有的索引信息区中具有正常的文件索引信息。The embodiment of the present invention adds a write start or a write completion identifier, and uses a double detection mechanism when checking a hard disk, which can easily and effectively realize whether all information is completely and effectively detected. Through the update operation, all index information areas can be guaranteed to have normal File index information.

在本发明所提供的几个实施例中,应该理解到,所揭露的相关装置和方法,可以通过其它的方式实现。例如,以上所描述的装置实施例仅仅是示意性的,例如,所述模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性,机械或其它的形式。In the several embodiments provided by the present invention, it should be understood that the related apparatus and method disclosed may be implemented in other manners. For example, the device embodiments described above are merely illustrative. For example, the division of the modules or units is only a logical function division. In actual implementation, there may be another division manner, for example, multiple units or components may be used. Combinations can be integrated into another system, or some features can be ignored or not executed. In addition, the mutual coupling or direct coupling or communication connection shown or discussed may be an indirect coupling or communication connection through some interface, device or unit, and may be in an electrical, mechanical or other form.

所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed to multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of the embodiment.

另外,在本发明各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.

所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得计算机处理器(processor)执行本发明各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。The integrated unit, if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention, which is essential or contributes to the prior art, or all or part of the technical solution, may be embodied in the form of a software product stored in a storage medium. A number of instructions are included to cause a computer processor to perform all or part of the steps of the methods described in various embodiments of the present invention. The foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk, and the like. .

以上所述仅为本发明的实施例,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。The above is only the embodiment of the present invention, and is not intended to limit the scope of the invention, and the equivalent structure or equivalent process transformation of the present invention and the contents of the drawings may be directly or indirectly applied to other related technologies. The fields are all included in the scope of patent protection of the present invention.

Claims (53)

一种文件信息处理方法,其特征在于,包括: A file information processing method, comprising: 在检测到向存储器回写文件索引信息时,确定出待回写的文件索引信息;When it is detected that the file index information is written back to the memory, the file index information to be written back is determined; 将确定出的文件索引信息写入到在所述存储器中配置的至少两个索引信息区中。The determined file index information is written into at least two index information areas configured in the memory. 如权利要求1所述的方法,其特征在于,所述将确定出的文件索引信息写入到在所述存储器中配置的至少两个索引信息区中,包括: The method of claim 1, wherein the writing the determined file index information into the at least two index information areas configured in the memory comprises: 根据预置的回写策略,将确定出的文件索引信息写入到在所述存储器中配置的至少两个索引信息区中。The determined file index information is written into at least two index information areas configured in the memory according to a preset write-back strategy. 如权利要求1或2所述的方法,其特征在于,所述将确定出的文件索引信息写入到在所述存储器中配置的至少两个索引信息区中,包括: The method according to claim 1 or 2, wherein the writing the determined file index information into the at least two index information areas configured in the memory comprises: 将确定出的文件索引信息写入到所述存储器中配置的第一索引信息区中;Writing the determined file index information into the first index information area configured in the memory; 将确定出的文件索引信息写入到所述存储器中配置的第二索引信息区中。The determined file index information is written into the second index information area configured in the memory. 如权利要求3所述的方法,其特征在于,在确定出的所述文件索引信息已完全写入到所述第一索引信息区后,执行所述将确定出的文件索引信息写入到在所述存储器中配置的第二索引信息区中。 The method according to claim 3, wherein after the determined file index information has been completely written into the first index information area, performing the writing of the determined file index information to The second index information area configured in the memory. 如权利要求1或2所述的方法,其特征在于,所述确定出待回写的文件索引信息,包括: The method according to claim 1 or 2, wherein the determining the file index information to be written back comprises: 按照预置的回写周期,周期性地确定出待回写的文件索引信息,以便于周期性地将文件索引信息写入到所述存储器对应索引信息区。The file index information to be written back is periodically determined according to a preset write-back cycle, so that the file index information is periodically written to the memory corresponding index information area. 如权利要求1所述的方法,其特征在于,所述将确定出的文件索引信息写入到在所述存储器中配置的至少两个索引信息区中,包括: The method of claim 1, wherein the writing the determined file index information into the at least two index information areas configured in the memory comprises: 若当前的回写次数是奇数次,则将确定出的文件索引信息写入到在所述存储器中配置的第一索引信息区;If the current number of writebacks is an odd number of times, writing the determined file index information to the first index information area configured in the memory; 若当前的回写次数为偶数次,则将确定出的文件索引信息写入到在所述存储器中配置的第二索引信息区。If the current number of writebacks is an even number of times, the determined file index information is written to the second index information area configured in the memory. 如权利要求1所述的方法,其特征在于,所述将确定出的文件索引信息写入到在所述存储器中配置的至少两个索引信息区中,包括: The method of claim 1, wherein the writing the determined file index information into the at least two index information areas configured in the memory comprises: 若当前的回写次数是偶数次,则将确定出的文件索引信息写入到在所述存储器中配置的第一索引信息区;If the current number of writebacks is an even number of times, writing the determined file index information to the first index information area configured in the memory; 若当前的回写次数为奇数次,则将确定出的文件索引信息写入到在所述存储器中配置的第二索引信息区。If the current number of writebacks is an odd number of times, the determined file index information is written to the second index information area configured in the memory. 如权利要求6或7所述的方法,其特征在于,还包括: The method of claim 6 or claim 7, further comprising: 若所述文件索引信息所对应的文件在所述存储器中存储结束,则确定出该文件的关联文件索引信息;If the file corresponding to the file index information is stored in the memory, determining the associated file index information of the file; 将确定出的关联文件索引信息分别存储到在所述存储器中配置的至少两个索引信息区中。The determined associated file index information is separately stored in at least two index information areas configured in the memory. 如权利要求1所述的方法,其特征在于,还包括: The method of claim 1 further comprising: 在检测到向索引信息区写入文件索引信息时,设置该索引信息区的写状态,并在写入结束后,更新该索引信息区的写状态。When it is detected that the file index information is written to the index information area, the write status of the index information area is set, and after the writing ends, the write status of the index information area is updated. 如权利要求1所述的方法,其特征在于,还包括: The method of claim 1 further comprising: 在检测到向索引信息区写入文件索引信息时,为该索引信息区配置写开始标识,并在写入结束后,为该索引信息区配置写完成标识。When it is detected that the file index information is written to the index information area, a write start identifier is configured for the index information area, and after the writing ends, a write completion identifier is configured for the index information area. 如权利要求1所述的方法,其特征在于,还包括: The method of claim 1 further comprising: 在检测到向索引信息区写入文件索引信息时,将该索引信息区关联的索引标识设置为写开始标识,在写入结束后,将关联的索引标识设置为写完成标识。When the file index information is written to the index information area, the index identifier associated with the index information area is set as the write start identifier, and after the end of the write, the associated index identifier is set as the write completion identifier. 如权利要求8所述的方法,其特征在于,还包括: The method of claim 8 further comprising: 基于写完成标识判断存储器的各个索引信息区的状态;Determining a state of each index information area of the memory based on the write completion flag; 若存在状态为异常的索引信息区,则以状态为正常的索引信息区中的文件索引信息更新所述状态为异常的索引信息区中的文件索引信息。If there is an index information area whose status is abnormal, the file index information in the index information area whose status is abnormal is updated with the file index information in the index information area whose status is normal. 如权利要求1所述的方法,其特征在于,还包括: The method of claim 1 further comprising: 检测应用环境,识别存储速度等级,所述存储速度等级是基于向所述存储器中写入数据的速度需求来确定的;Detecting an application environment, identifying a storage speed level, the storage speed level being determined based on a speed requirement to write data to the memory; 根据识别的存储速度等级选择回写策略。A writeback policy is selected based on the identified storage speed level. 一种文件信息处理方法,其特征在于,包括: A file information processing method, comprising: 在检测到向存储器中配置的索引信息区写入确定的文件索引信息时,设置该索引信息区的状态为写开始状态;When it is detected that the determined file index information is written to the index information area configured in the memory, setting the state of the index information area to a write start state; 在索引信息的写入结束后,更新该索引信息区的状态为写完成状态;After the writing of the index information ends, updating the state of the index information area to a write completion state; 其中,所述存储器中配置了至少两个索引信息区。The memory is configured with at least two index information areas. 如权利要求14所述的方法,其特征在于,所述设置该索引信息区的状态为写开始状态,包括: The method according to claim 14, wherein the setting the state of the index information area to a write start state comprises: 将对应的索引信息区中配置的索引标识设置为写开始标识。Set the index identifier configured in the corresponding index information area to the write start identifier. 如权利要求14所述的方法,其特征在于,所述在所述存储器的索引信息区中配置写完成标识,包括: The method of claim 14, wherein the configuring the write completion identifier in the index information area of the memory comprises: 在对应的索引信息区中配置的索引标识设置为写完成标识。The index identifier configured in the corresponding index information area is set to the write completion identifier. 如权利要求14至16任一项所述的方法,其特征在于,还包括: The method of any of claims 14 to 16, further comprising: 基于写完成标识判断存储器的各个索引信息区的状态;Determining a state of each index information area of the memory based on the write completion flag; 若存在状态为异常的索引信息区,则以状态为正常的索引信息区中的文件索引信息更新状态为异常的索引信息区中的文件索引信息。If there is an index information area whose status is abnormal, the file index information in the index information area whose status is abnormal is updated with the file index information in the index information area whose status is normal. 一种文件信息处理装置,其特征在于,包括: A file information processing device, comprising: 确定模块,用于在检测到向存储器回写文件索引信息时,确定出待回写的文件索引信息;a determining module, configured to determine file index information to be written back when detecting that the file index information is written back to the memory; 回写模块,用于将确定出的文件索引信息写入到在所述存储器中配置的至少两个索引信息区中。And a write back module, configured to write the determined file index information into at least two index information areas configured in the memory. 如权利要求18所述的装置,其特征在于, The device of claim 18, wherein 所述回写模块,具体用于根据预置的回写策略,将确定出的文件索引信息写入到在所述存储器中配置的至少两个索引信息区中。The write-back module is specifically configured to write the determined file index information into at least two index information areas configured in the memory according to a preset write-back policy. 如权利要求18或19所述的装置,其特征在于, A device according to claim 18 or 19, wherein 所述回写模块,具体用于将确定出的文件索引信息写入到所述存储器中配置的第一索引信息区中;将确定出的文件索引信息写入到所述存储器中配置的第二索引信息区中。The write-back module is specifically configured to write the determined file index information into the first index information area configured in the memory; and write the determined file index information to the second configured in the memory In the index information area. 如权利要求20所述的装置,其特征在于, The device of claim 20 wherein: 所述回写模块,具体用于将确定出的文件索引信息写入到所述存储器中配置的第一索引信息区中,在确定出的所述文件索引信息已完全写入到所述第一索引信息区后,再将确定出的文件索引信息写入到所述存储器中配置的第二索引信息区中。The write-back module is specifically configured to write the determined file index information into the first index information area configured in the memory, where the determined file index information is completely written to the first After the information area is indexed, the determined file index information is written into the second index information area configured in the memory. 如权利要求18或19所述的装置,其特征在于, A device according to claim 18 or 19, wherein 所述确定模块,具体用于按照预置的回写周期,周期性地确定出待回写的文件索引信息,以便于周期性地将确定出的文件索引信息写入到所述存储器对应索引信息区。The determining module is specifically configured to periodically determine file index information to be written back according to a preset write-back period, so as to periodically write the determined file index information to the corresponding index information of the memory. Area. 如权利要求18所述的装置,其特征在于, The device of claim 18, wherein 所述回写模块,具体用于若当前的回写次数是奇数次,则将确定出的文件索引信息写入到在所述存储器中配置的第一索引信息区;若当前的回写次数为偶数次,则将确定出的文件索引信息写入到在所述存储器中配置的第二索引信息区。The write-back module is specifically configured to: if the current number of write-backs is an odd number of times, write the determined file index information to the first index information area configured in the memory; if the current number of write-backs is An even number of times, the determined file index information is written to the second index information area configured in the memory. 如权利要求18所述的装置,其特征在于, The device of claim 18, wherein 所述回写模块,具体用于若当前的回写次数是偶数次,则将确定出的文件索引信息写入到在所述存储器中配置的第一索引信息区;若当前的回写次数为奇数次,则将确定出的文件索引信息写入到在所述存储器中配置的第二索引信息区。The write-back module is specifically configured to: if the current number of write-backs is an even number of times, write the determined file index information to the first index information area configured in the memory; if the current number of write-backs is An odd number of times, the determined file index information is written to the second index information area configured in the memory. 如权利要求23或24所述的装置,其特征在于, A device according to claim 23 or 24, wherein 所述回写模块,还用于若所述文件索引信息所对应的文件在所述存储器中存储结束,则确定出该文件的关联文件索引信息;将确定出的关联文件索引信息分别存储到在所述存储器中配置的至少两个索引信息区中。The write-back module is further configured to: if the file corresponding to the file index information is stored in the memory, determine the associated file index information of the file; and store the determined associated file index information separately At least two index information areas configured in the memory. 如权利要求18所述的装置,其特征在于,还包括: The device of claim 18, further comprising: 第一设置模块,用于在检测到向索引信息区写入文件索引信息时,设置该索引信息区的写状态,并在写入结束后,更新该索引信息区的写状态。The first setting module is configured to set a write state of the index information area when detecting the writing of the file index information to the index information area, and update the write status of the index information area after the writing ends. 如权利要求18所述的装置,其特征在于,还包括: The device of claim 18, further comprising: 第二设置模块,用于在检测到向索引信息区写入文件索引信息时,为该索引信息区配置写开始标识,并在写入结束后,为该索引信息区配置写完成标识。The second setting module is configured to: when the file index information is written to the index information area, configure a write start identifier for the index information area, and configure a write completion identifier for the index information area after the writing ends. 如权利要求18所述的装置,其特征在于,还包括: The device of claim 18, further comprising: 第三设置模块,用于在检测到向索引信息区写入文件索引信息时,将该索引信息区关联的索引标识设置为写开始标识,在写入结束后,将关联的索引标识设置为写完成标识。The third setting module is configured to: when the file index information is written to the index information area, set the index identifier associated with the index information area to a write start identifier, and after the writing ends, set the associated index identifier to write Complete the logo. 如权利要求26至28任一项所述的装置,其特征在于,还包括: The device according to any one of claims 26 to 28, further comprising: 更新模块,用于基于写完成标识判断存储器的各个索引信息区的状态;若存在状态为异常的索引信息区,则以状态为正常的索引信息区中的文件索引信息更新所述状态为异常的索引信息区中的文件索引信息。And an update module, configured to determine, according to the write completion identifier, a state of each index information area of the memory; if there is an index information area whose status is abnormal, updating the status with the file index information in the index information area whose status is normal is abnormal. File index information in the index information area. 如权利要求18所述的装置,其特征在于,还包括: The device of claim 18, further comprising: 选择模块,用于检测应用环境,识别存储速度等级,所述存储速度等级是基于向所述存储器中写入数据的速度需求来确定的;根据识别的存储速度等级选择回写策略。A selection module for detecting an application environment, identifying a storage speed level, the storage speed level being determined based on a speed requirement of writing data to the memory; and selecting a writeback policy based on the identified storage speed level. 一种文件信息处理装置,其特征在于,包括: A file information processing device, comprising: 状态设置模块,用于在检测到向存储器中配置的索引信息区写入确定的文件索引信息时,设置该索引信息区的状态为写开始状态;a state setting module, configured to set a state of the index information area to a write start state when detecting that the determined file index information is written to the index information area configured in the memory; 更新模块,用于在索引信息的写入结束后,更新该索引信息区的状态为写完成状态;其中,所述存储器中配置了至少两个索引信息区。And an update module, configured to update the state of the index information area to a write completion state after the writing of the index information ends; wherein at least two index information areas are configured in the memory. 如权利要求31所述的装置,其特征在于, The device of claim 31, wherein 所述状态设置模块,具体用于在检测到向存储器中配置的索引信息区写入确定的文件索引信息时,将对应的索引信息区中配置的索引标识设置为写开始标识。The state setting module is configured to: when the determined file index information is written to the index information area configured in the memory, set the index identifier configured in the corresponding index information area as the write start identifier. 如权利要求31所述的装置,其特征在于, The device of claim 31, wherein 所述更新模块,具体用于在索引信息的写入结束后,在对应的索引信息区中配置的索引标识设置为写完成标识。The update module is specifically configured to set an index identifier configured in the corresponding index information area as a write completion identifier after the end of the writing of the index information. 如权利要求31至33任一项所述的装置,其特征在于,还包括: The device according to any one of claims 31 to 33, further comprising: 处理模块,用于基于写完成标识判断存储器的各个索引信息区的状态;若存在状态为异常的索引信息区,则以状态为正常的索引信息区中的文件索引信息更新状态为异常的索引信息区中的文件索引信息。a processing module, configured to determine, according to the write completion identifier, a state of each index information area of the memory; if there is an index information area whose state is abnormal, update the index information with the abnormality of the file index information in the index information area whose state is normal File index information in the zone. 一种文件处理设备,其特征在于,包括:处理器,其中: A file processing device, comprising: a processor, wherein: 所述处理器,用于在检测到向相连的存储器回写文件索引信息时,确定出待回写的文件索引信息;将确定出的文件索引信息写入到在所述存储器中配置的至少两个索引信息区中。The processor is configured to: determine file index information to be written back when detecting that the file index information is written back to the connected memory; and write the determined file index information to at least two configured in the memory In the index information area. 如权利要求35所述的设备,其特征在于,所述处理器,具体用于根据预置的回写策略,将确定出的文件索引信息写入到在所述存储器中配置的至少两个索引信息区中。 The device according to claim 35, wherein the processor is configured to write the determined file index information to at least two indexes configured in the memory according to a preset write-back policy. In the information area. 如权利要求35或36所述的设备,其特征在于,所述处理器,具体用于将确定出的文件索引信息写入到所述存储器中配置的第一索引信息区中;将确定出的文件索引信息写入到所述存储器中配置的第二索引信息区中。 The device according to claim 35 or claim 36, wherein the processor is specifically configured to write the determined file index information into the first index information area configured in the memory; The file index information is written into the second index information area configured in the memory. 如权利要求37所述的设备,其特征在于,所述处理器,具体用于将确定出的文件索引信息写入到所述存储器中配置的第一索引信息区中,并在确定出的所述文件索引信息已完全写入到所述第一索引信息区后,将所述将确定出的文件索引信息写入到在所述存储器中配置的第二索引信息区中。 The device according to claim 37, wherein the processor is configured to write the determined file index information into the first index information area configured in the memory, and in the determined location After the file index information has been completely written into the first index information area, the determined file index information is written into the second index information area configured in the memory. 如权利要求35或36所述的设备,其特征在于,所述处理器,具体用于按照预置的回写周期,周期性地确定出待回写的文件索引信息,以便于周期性地将确定出的文件索引信息写入到所述存储器对应索引信息区。 The device according to claim 35 or claim 36, wherein the processor is configured to periodically determine file index information to be written back according to a preset writeback period, so as to periodically The determined file index information is written to the memory corresponding index information area. 如权利要求35所述的设备,其特征在于,所述处理器,具体用于若当前的回写次数是奇数次,则将确定出的文件索引信息写入到在所述存储器中配置的第一索引信息区;若当前的回写次数为偶数次,则将确定出的文件索引信息写入到在所述存储器中配置的第二索引信息区。 The device according to claim 35, wherein the processor is configured to: if the current number of writebacks is an odd number of times, write the determined file index information to the first configuration in the memory. An index information area; if the current number of write back times is an even number of times, the determined file index information is written to the second index information area configured in the memory. 如权利要求35所述的设备,其特征在于,所述处理器,具体用于若当前的回写次数是偶数次,则将确定出的文件索引信息写入到在所述存储器中配置的第一索引信息区;若当前的回写次数为奇数次,则将确定出的文件索引信息写入到在所述存储器中配置的第二索引信息区。 The device according to claim 35, wherein the processor is configured to: if the current number of writebacks is an even number of times, write the determined file index information to the first configuration in the memory. An index information area; if the current number of write back times is an odd number of times, the determined file index information is written to the second index information area configured in the memory. 如权利要求40或41所述的设备,其特征在于,所述处理器,还用于若所述文件索引信息所对应的文件在所述存储器中存储结束,则确定出该文件的关联文件索引信息;将确定出的关联文件索引信息分别存储到在所述存储器中配置的至少两个索引信息区中。 The device according to claim 40 or 41, wherein the processor is further configured to: if the file corresponding to the file index information is stored in the memory, determine an associated file index of the file. Information; storing the determined associated file index information into at least two index information areas configured in the memory, respectively. 如权利要求35所述的设备,其特征在于,所述处理器,还用于在检测到向索引信息区写入文件索引信息时,设置该索引信息区的写状态,并在写入结束后,更新该索引信息区的写状态。 The device according to claim 35, wherein the processor is further configured to: when detecting that the file index information is written to the index information area, set a write status of the index information area, and after the writing ends Update the write status of the index information area. 如权利要求35所述的设备,其特征在于,所述处理器,还用于在检测到向索引信息区写入文件索引信息时,为该索引信息区配置写开始标识,并在写入结束后,为该索引信息区配置写完成标识。 The device according to claim 35, wherein the processor is further configured to: when the file index information is written to the index information area, configure a write start identifier for the index information area, and end the writing After that, the write completion identifier is configured for the index information area. 如权利要求35所述的设备,其特征在于,所述处理器,还用于在检测到向索引信息区写入文件索引信息时,将该索引信息区关联的索引标识设置为写开始标识,在写入结束后,将关联的索引标识设置为写完成标识。 The device according to claim 35, wherein the processor is further configured to: when the file index information is written to the index information area, set an index identifier associated with the index information area as a write start identifier, After the write ends, the associated index identifier is set to the write completion ID. 如权利要求43至45任一项所述的设备,其特征在于,所述处理器,还用于基于写完成标识判断存储器的各个索引信息区的状态;若存在状态为异常的索引信息区,则以状态为正常的索引信息区中的文件索引信息更新所述状态为异常的索引信息区中的文件索引信息。 The device according to any one of claims 43 to 45, wherein the processor is further configured to determine a state of each index information area of the memory based on the write completion identifier; and if there is an index information area whose state is abnormal, Then, the file index information in the index information area whose status is abnormal is updated with the file index information in the index information area whose status is normal. 如权利要求35所述的设备,其特征在于,所述处理器,还用于检测应用环境,识别存储速度等级,所述存储速度等级是基于向所述存储器中写入数据的速度需求来确定的;根据识别的存储速度等级选择回写策略。 The device according to claim 35, wherein said processor is further configured to detect an application environment, and identify a storage speed level, said storage speed level being determined based on a speed requirement of writing data to said memory Select a writeback policy based on the identified storage speed level. 一种文件处理设备,其特征在于,包括:处理器,其中: A file processing device, comprising: a processor, wherein: 所述处理器,用于在检测到向相连的存储器中配置的索引信息区写入确定的文件索引信息时,设置该索引信息区的状态为写开始状态;在索引信息的写入结束后,更新该索引信息区的状态为写完成状态;其中,所述存储器中配置了至少两个索引信息区。The processor is configured to: when the determined file index information is written to the index information area configured in the connected memory, set the state of the index information area to a write start state; after the writing of the index information ends, The state of updating the index information area is a write completion state; wherein at least two index information areas are configured in the memory. 如权利要求48所述的设备,其特征在于,所述处理器,具体用于将对应的索引信息区中配置的索引标识设置为写开始标识。 The device according to claim 48, wherein the processor is configured to set an index identifier configured in a corresponding index information area as a write start identifier. 如权利要求48所述的设备,其特征在于,所述处理器,具体用于在对应的索引信息区中配置的索引标识设置为写完成标识。 The device according to claim 48, wherein the processor is configured to set an index identifier configured in the corresponding index information area as a write completion identifier. 如权利要求48至50任一项所述的设备,其特征在于,所述处理器,还用于基于写完成标识判断存储器的各个索引信息区的状态;若存在状态为异常的索引信息区,则以状态为正常的索引信息区中的文件索引信息更新状态为异常的索引信息区中的文件索引信息。 The device according to any one of claims 48 to 50, wherein the processor is further configured to determine a state of each index information area of the memory based on the write completion identifier; and if there is an index information area whose state is abnormal, Then, the file index information in the index information area whose status is abnormal is updated with the file index information in the index information area whose state is normal. 一种文件处理系统,其特征在于,包括:内存、存储器和处理器,所述处理器分别与所述内存和所述存储器相连,所述处理器用于执行如权利要求1至13任一项所述方法的相关步骤。 A file processing system, comprising: a memory, a memory, and a processor, the processor being respectively connected to the memory and the memory, wherein the processor is configured to perform according to any one of claims 1 to The relevant steps of the method. 一种文件处理系统,其特征在于,包括:内存、存储器和处理器,所述处理器分别与所述内存和所述存储器相连,所述处理器用于执行如权利要求14至17任一项所述的装置。 A file processing system, comprising: a memory, a memory, and a processor, the processor being respectively connected to the memory and the memory, wherein the processor is configured to perform according to any one of claims 14 to The device described.
PCT/CN2015/080923 2015-06-05 2015-06-05 File information processing method and device, and file processing apparatus and system Ceased WO2016192110A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201580003155.3A CN105830067B (en) 2015-06-05 2015-06-05 A kind of file information processing method, device and document handling apparatus, system
PCT/CN2015/080923 WO2016192110A1 (en) 2015-06-05 2015-06-05 File information processing method and device, and file processing apparatus and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2015/080923 WO2016192110A1 (en) 2015-06-05 2015-06-05 File information processing method and device, and file processing apparatus and system

Publications (1)

Publication Number Publication Date
WO2016192110A1 true WO2016192110A1 (en) 2016-12-08

Family

ID=56987337

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/080923 Ceased WO2016192110A1 (en) 2015-06-05 2015-06-05 File information processing method and device, and file processing apparatus and system

Country Status (2)

Country Link
CN (1) CN105830067B (en)
WO (1) WO2016192110A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108121696B (en) * 2016-11-30 2021-08-17 北大方正集团有限公司 Method and device for making up dot matrix file
CN111552442A (en) * 2020-05-13 2020-08-18 重庆紫光华山智安科技有限公司 SSD-based cache management system and method
CN114887934B (en) * 2022-03-31 2024-03-22 蜂巢能源科技股份有限公司 Battery cell processing production line

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101482837A (en) * 2009-01-21 2009-07-15 华为技术有限公司 Error correction method and apparatus for flash memory file system
CN101520787A (en) * 2008-03-19 2009-09-02 中国科学院自动化研究所 Method for storing real-time data
US20100241618A1 (en) * 2009-03-19 2010-09-23 Louis Beatty Method for restoring data from a monolithic backup
CN102981779A (en) * 2012-11-22 2013-03-20 华为技术有限公司 Data processing method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101520787A (en) * 2008-03-19 2009-09-02 中国科学院自动化研究所 Method for storing real-time data
CN101482837A (en) * 2009-01-21 2009-07-15 华为技术有限公司 Error correction method and apparatus for flash memory file system
US20100241618A1 (en) * 2009-03-19 2010-09-23 Louis Beatty Method for restoring data from a monolithic backup
CN102981779A (en) * 2012-11-22 2013-03-20 华为技术有限公司 Data processing method and device

Also Published As

Publication number Publication date
CN105830067B (en) 2018-02-02
CN105830067A (en) 2016-08-03

Similar Documents

Publication Publication Date Title
WO2016036192A1 (en) Image display apparatus and image display method
WO2018030618A1 (en) Electronic device including flexible display
WO2022220633A1 (en) Method and apparatus for timed and event triggered updates in scene
WO2016023148A1 (en) Packet control method, switch and controller
WO2017082520A1 (en) Database management system, and data modification and recovery method thereof
WO2015035777A1 (en) Software upgrade method and system for mobile terminal
WO2015093870A1 (en) Method and device for managing data
WO2017164640A1 (en) System and method for editing video contents automatically technical field
WO2015137604A1 (en) Method for testing cloud streaming server, and apparatus and system therefor
WO2014058086A1 (en) Image processing device and image processing method
WO2016192110A1 (en) File information processing method and device, and file processing apparatus and system
WO2017000724A1 (en) Distortion rectification method and terminal
WO2017084302A1 (en) Method for playing boot video of a display terminal and display terminal
WO2016072721A1 (en) Method of transmitting and receiving data of electronic device and electronic device using the method
WO2019127115A1 (en) Data transmission method, terminal device and network device
WO2018076453A1 (en) Associated application display method, device and mobile terminal
WO2017096603A1 (en) Method and system for data connection, transmission, reception and interaction, storage device, and aircraft
WO2018076875A1 (en) Backup data synchronisation method, apparatus, storage medium, electronic device, and server
WO2018014567A1 (en) Method for improving performance of virtual machine, and terminal, device and computer-readable storage medium
WO2016056856A1 (en) Method and system for generating integrity verification data
EP3659061A1 (en) Data encryption method and electronic apparatus performing data encryption method
WO2022154326A1 (en) Method, device, and computer program for managing virtualized resource
WO2017035785A1 (en) Method and apparatus for locating memory leakage
EP2467968A2 (en) Method and system for handling security synchronization for prolonged periods of no-reception of voice frames
WO2016064131A1 (en) Data processing method and device

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

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

Country of ref document: EP

Kind code of ref document: A1