CN112445761B - File checking method and device and storage medium - Google Patents

File checking method and device and storage medium Download PDF

Info

Publication number
CN112445761B
CN112445761B CN201910817324.7A CN201910817324A CN112445761B CN 112445761 B CN112445761 B CN 112445761B CN 201910817324 A CN201910817324 A CN 201910817324A CN 112445761 B CN112445761 B CN 112445761B
Authority
CN
China
Prior art keywords
file
verified
checked
state information
check code
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.)
Active
Application number
CN201910817324.7A
Other languages
Chinese (zh)
Other versions
CN112445761A (en
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.)
China Mobile Communications Group Co Ltd
China Mobile Suzhou Software Technology Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Suzhou Software 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 China Mobile Communications Group Co Ltd, China Mobile Suzhou Software Technology Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN201910817324.7A priority Critical patent/CN112445761B/en
Publication of CN112445761A publication Critical patent/CN112445761A/en
Application granted granted Critical
Publication of CN112445761B publication Critical patent/CN112445761B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/08Error detection or correction by redundancy in data representation, e.g. by using checking codes
    • G06F11/10Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's
    • G06F11/1008Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's in individual solid state devices
    • G06F11/1048Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's in individual solid state devices using arrangements adapted for a specific error detection or correction feature
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Quality & Reliability (AREA)
  • Human Computer Interaction (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a file checking method, which comprises the steps of reading state information of a file to be checked at a first moment; based on the state information of the file to be verified, if the file to be verified is not opened, verifying the file to be verified, and generating a second verification code; and comparing the second check code with the stored first check code of the file to be checked to obtain a comparison result, and determining whether the file to be checked is complete or not based on the comparison result. The invention also discloses a file checking device and a storage medium. Here, the file to be verified is always in an unopened state in the whole verification process, but not in a read-write state, so that waste of resources in the verification process can be reduced. Further, if the file to be verified is opened, the verification process is ended, so that the upper layer service is not influenced.

Description

File checking method and device and storage medium
Technical Field
The present invention relates to the field of information processing, and in particular, to a file verification method, device and storage medium.
Background
In the prior art, in order to check the integrity of file data, check codes for multiple copies are generally generated by starting an inspection process, and then whether a file to be checked is complete is determined by comparing the check codes. If the check codes are consistent, the file to be checked is complete; and if the check codes are not consistent, the file to be checked is not complete, and the file to be checked is repaired.
Due to the fact that bit attenuation, bad blocks of a disk and the like are main factors causing file incompleteness, the general file incompleteness condition mostly occurs in files which are not opened frequently, and the existing file verification method is used for verifying all files, so that waste of resources is caused. In addition, in the prior art, when a file is checked, in order to ensure the correctness of the check code, the normal input and output operations of the file are generally blocked, and thus the normal service is affected.
Disclosure of Invention
In view of the above, embodiments of the present invention are intended to provide a file checking method, device and storage medium, which are used to solve the above problems in the prior art.
In order to achieve the above purpose, the technical solution of the embodiment of the present invention is implemented as follows:
the embodiment of the invention provides a file checking method, which comprises the following steps:
reading the state information of a file to be verified at a first moment;
based on the state information of the file to be verified, if the file to be verified is not opened, verifying the file to be verified, and generating a second verification code;
and comparing the second check code with the stored first check code of the file to be checked to obtain a comparison result, and determining whether the file to be checked is complete or not based on the comparison result.
In the foregoing solution, the determining whether the file to be verified is complete based on the comparison result includes:
if the first check code is consistent with the second check code, determining that the file to be checked is complete;
if the first check code is inconsistent with the second check code, determining that the file to be checked is incomplete, and repairing the file to be checked.
In the foregoing solution, the method further includes:
reading the state information of the target file at a second moment; wherein the second time is earlier than the first time;
based on the state information of the target file, if the target file is determined not to be opened, opening a window for the target file;
after the window for the target file is finished, reading the state information of the target file;
and when the state information of the target file represents that the target file is kept in an unopened state, determining the target file as a file to be verified.
In the above scheme, the method further comprises:
reading the state information of the file to be verified at a third moment; wherein the third time is earlier than the first time, and the third time is later than the second time;
and if the file to be checked is determined not to be opened based on the state information of the file to be checked, checking the file to be checked to generate the first check code, and storing the first check code as attribute information of the file to be checked.
An embodiment of the present invention further provides a file verification apparatus, where the apparatus includes: the device comprises a reading module, a first generating module and a judging module; wherein the content of the first and second substances,
the reading module is used for reading the state information of the file to be verified at the first moment;
the first generation module is used for verifying the file to be verified and generating a second verification code if the file to be verified is not opened based on the state information of the file to be verified;
the judging module is used for comparing the second check code with the stored first check code of the file to be checked to obtain a comparison result, and determining whether the file to be checked is complete or not based on the comparison result.
In the above scheme, the determining module is specifically configured to determine that the file to be verified is complete if the first check code is consistent with the second check code; and if the first check code is inconsistent with the second check code, determining that the file to be checked is incomplete, and repairing the file to be checked.
In the above solution, the apparatus further includes a determining module, configured to read the state information of the target file at a second time; wherein the second time is earlier than the first time; based on the state information of the target file, if the target file is determined not to be opened, opening a window for the target file; after the window for the target file is finished, reading the state information of the target file; and when the state information of the target file represents that the target file is kept in an unopened state, determining the target file as a file to be verified.
In the above solution, the apparatus further includes a second generating module, configured to read the state information of the file to be verified at a third time; wherein the third time is earlier than the first time, and the third time is later than the second time; and if the file to be verified is not opened based on the state information of the file to be verified, verifying the file to be verified, generating a first verification code, and storing the first verification code as attribute information of the file to be verified.
The embodiment of the present invention further provides a storage medium, on which an executable program is stored, and the executable program implements the steps in the above technical solution when executed by a processor.
The embodiment of the invention also provides a file checking device, which comprises a memory, a processor and an executable program which is stored on the memory and can be run by the processor, and is characterized in that the steps in the technical scheme are executed when the processor runs the executable program.
According to the file verification method, the file verification device and the storage medium provided by the embodiment of the invention, the target file which is still in an unopened state after the window of the target file is determined as the file to be verified. When the file to be verified is in an unopened state, verifying the file to be verified to generate a second verification code, further comparing the second verification code with the stored first verification code of the file to be verified, and determining whether the file to be verified is complete according to the comparison result. Here, the file to be verified is always in an unopened state in the whole verification process of the file to be verified. And if the file to be verified is in an open state, ending the verification process. That is to say, the file verification method of this example is directed to unopened files, not to files being read and written, and therefore waste of resources in the verification process is reduced. Further, in the verification process, if the file to be verified is opened, the verification process is ended. Therefore, the file verification method of the embodiment does not influence upper-layer services and block normal input and output operations of the file to be verified.
Drawings
Fig. 1 is a first schematic flow chart illustrating an implementation of a file verification method according to an embodiment of the present invention;
fig. 2 is a schematic diagram of an implementation flow of a file verification method according to an embodiment of the present invention;
fig. 3 is a schematic view illustrating a process of determining a file to be verified according to the file verification method in the embodiment of the present invention;
fig. 4 is a schematic diagram of a first check code generation process of the file checking method according to the embodiment of the present invention;
FIG. 5 is a schematic diagram illustrating a comparison process of check codes of the file checking method according to the embodiment of the present invention;
FIG. 6 is a first schematic structural diagram illustrating a file verification apparatus according to an embodiment of the present invention;
FIG. 7 is a schematic diagram of a second exemplary embodiment of a file verification apparatus;
fig. 8 is a schematic diagram of a hardware structure of the file verification apparatus according to the embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
The first embodiment,
In the embodiment of the present invention, a schematic flow chart of an implementation of the file verification method is shown in fig. 1, and includes the following steps:
step 101: reading state information of a file to be checked at a first moment;
step 102: if the file to be checked is determined not to be opened based on the state information of the file to be checked, checking the file to be checked to generate a second check code;
step 103: and comparing the second check code with the stored first check code of the file to be checked to obtain a comparison result, and determining whether the file to be checked is complete or not based on the comparison result.
In step 101 in the embodiment of the present invention, the state information of the file to be verified includes a state that the file is opened, a state that the file is not opened, and the like. Here, each file has a descriptor, and when the descriptor is in an opened state, the file is in an opened state. Further, reading the descriptor of the file to be checked. And determining the state information of the file to be checked according to the state of the descriptor of the file to be checked.
And the first moment is used for representing a certain moment for reading the state information of the file to be verified.
Further, the process of determining the file to be verified is as follows: reading the state information of the target file at a second moment; wherein the second time is earlier than the first time; based on the state information of the target file, if the target file is determined not to be opened, opening a window for the target file; after the window for the target file is finished, reading the state information of the target file; and when the state information of the target file represents that the target file is kept in an unopened state, determining the target file as a file to be verified.
Specifically, reading the state information of a target file at a second moment, determining that the file is opened based on the state information of the target file, and then opening a window for the target file; and if the file is determined to be opened based on the state of the target file, ending the verification process. Further, the target file maintains an unopened state in the window, and after the window for the target file is ended, the state information of the target file is read. When the state information of the target file represents that the target file is kept in an unopened state, determining the target file as a file to be verified; if the target file is in the opened state, ending the verification process, moving the target file out of the window, and recording the current state information of the target file.
Further, after determining the file to be verified, the method further includes: reading the state information of the file to be verified at a third moment; wherein the third time is earlier than the first time, and the third time is later than the second time; and the second time and the third time are respectively used for representing a certain time for reading the state information of the file to be verified. And if the file to be checked is determined not to be opened based on the state information of the file to be checked, checking the file to be checked to generate the first check code, and storing the first check code as attribute information of the file to be checked.
Specifically, the state information of the file to be verified is read at the third moment. Based on the state information of the file to be verified, if the file to be verified is not opened, verifying the file to be verified, generating a first verification code, and storing the first verification code as attribute information of the file to be verified; and determining that the file to be verified is opened based on the state information of the file to be verified, and ending the verification process. Here, the first check code is used as attribute information of the file to be checked, and is saved in an attribute information list of the file to be checked. And the state information of the file to be verified is also stored in the attribute information list of the file to be verified.
In step 102, based on the state information of the file to be verified, if it is determined that the file to be verified is not opened, the file to be verified is verified, and a second verification code is generated. Specifically, after the file to be checked is determined not to be opened, the second check code is obtained by performing hash calculation on the file to be checked. Wherein, the hash calculation may adopt a Message Digest (MD 5) Algorithm, and the value of the hash calculation has uniqueness.
In step 103, the second check code is compared with the first check code of the saved file to be checked to obtain a comparison result, and whether the file to be checked is complete is determined based on the comparison result.
Here, a first check code of the file to be checked is stored in the attribute information list of the file to be checked, after the second check code is generated, the first check code and the second check code are compared, and whether the file to be checked is complete is determined according to a comparison result. Specifically, if the first check code is consistent with the second check code, the file to be checked is determined to be complete; and if the first check code is inconsistent with the second check code, determining that the file to be checked is incomplete, and repairing the file to be checked.
However, in the prior art, the following method is generally adopted to check whether the file is complete:
firstly, triggering a verification process according to a starting node of a file primary copy;
then, extracting the check codes of the main copy and other copies of the file, and comparing the check codes. Wherein, the data of the copy cannot be modified in the comparison process. Also, there may be differences in the time each primary and other copies are actually written to the underlying storage. The verification process requires maintaining version information between several copies at the same time until the copies have the same version.
Further, if the check codes are consistent, the file is determined to be complete; and if the check codes are not consistent, determining that the file is incomplete, and repairing the file.
Therefore, in the prior art, when a file is checked, in order to ensure the correctness of the check code, the normal input and output operations of the file are generally blocked, and thus the normal service is influenced. Moreover, all files are checked, resulting in a waste of resources. Furthermore, the method is simple. In the prior art, if the distributed file system is enabled to be in a double copy mode, under the condition that the check codes are inconsistent, due to the fact that no relatively original check code exists, a correct suggestion for an effective copy of a server or a client cannot be given. If the sequential reading and writing sequence exists among the copies of each file in the distributed file system, the versions of the master copy and other copies need to be maintained to be uniform, and additional overhead is increased. The distributed file system is used for representing that different server nodes are aggregated into a uniform storage resource pool through a network, and providing file system service of a uniform name space for applications.
Therefore, the existing file verification method has obvious defects, and compared with the existing file verification method, the file verification method adopted by the embodiment has some obvious progress.
In this embodiment, the target file which is still unopened after the window for the target file is determined as the file to be verified, and the file to be verified is determined to be in the unopened state according to the state information of the file to be verified by reading the state information of the file to be verified for many times, so as to continue the subsequent verification process. After a first check code and a second check code are generated, the first check code and the second check code are compared, and whether the file to be checked is complete or not is determined according to a comparison result. That is to say, the file verification method of the embodiment verifies the unopened file, so that the waste of resources can be reduced. And under the condition that the file to be verified is in an open state, ending the verification process. Therefore, the upper layer service cannot be influenced, and the normal input and output operation of the file to be checked cannot be blocked. In addition, the file verification method of the embodiment stores the verification code of the file to be verified as attribute information of the file to be verified, so that the problem that correct copy reference cannot be provided is avoided.
Example II,
In this embodiment, an implementation flow diagram of the verification method for the file X to be verified is shown in fig. 2, and includes the following steps:
step 201: reading the state information of the target file X at the moment A; based on the state information of the target file X, if the target file X is determined not to be opened, opening a window for the target file X; after the window for the target file X is finished, reading the state information of the target file X; when the state information of the target file X represents that the target file X is kept in an unopened state, determining the target file X as a file X to be checked;
step 202: reading the state information of the file X to be checked at the moment B; wherein the time B is later than the time A; based on the state information of the file X to be verified, if the file X to be verified is not opened, verifying the file X to be verified to generate a first verification code, and storing the first verification code as attribute information of the file X to be verified;
step 203: reading the state information of the file X to be checked at the moment C; wherein the time C is later than the time B; based on the state information of the file X to be verified, if the file X to be verified is not opened, verifying the file X to be verified to generate a second verification code; and comparing the second check code with the stored first check code of the file X to be checked to obtain a comparison result, and determining whether the file X to be checked is complete or not based on the comparison result.
In step 201, as shown in fig. 3, the service module reads the state information of the target file X at time a; determining that the target file X is not opened based on the state information of the target file X, sending the state information that the target file X is not opened to the verification module 1, and after receiving the state information that the target file X is not opened, the verification module 1 opens a window for the target file X. And if the target file X is opened, the service module ends the verification process. Here, the service module reads the descriptor of the target file X. And determining the state information of the target file X according to the state of the descriptor of the target file X. Specifically, when the descriptor of the target file X is in an unopened state, the target file X is also in an unopened state.
Further, after the window for the target file X is finished, the service module reads the state information of the target file X; when the state information of the target file X represents that the target file X is kept in an unopened state, the service module sends the unopened state information of the target file X to the verification module 1, and the verification module 1 determines the target file X as a file X to be verified. Further, after the window for the target file X is ended, the service module reads the state information of the target file X. And if the target file X is in an open state, the service module ends the verification process.
In step 202, as shown in fig. 4, the service module reads the state information of the file X to be verified at time B; wherein the time B is later than the time A. And if the service module determines that the file X to be verified is opened, ending the verification process. If the service module determines that the file X to be verified is not opened based on the state information of the file X to be verified, the service module sends the state information that the file X to be verified is not opened to the verification module 1, the verification module 1 adds the file X to be verified into a verification queue, the file X to be verified is verified, the first verification code is generated and sent to the service module, and the service module stores the first verification code as attribute information of the file X to be verified.
In step 203, as shown in fig. 5, the service module reads the status information of the file X to be checked at time C; wherein the time C is later than the time B; based on the state information of the file X to be verified, if the file X to be verified is opened, the service module ends the verification process; if the file X to be verified is determined not to be opened, the service module sends the unopened state information of the file X to be verified to the verification module 2, and the verification module 2 verifies the file X to be verified to generate a second verification code. Further, the verification module 2 obtains the second verification code by performing hash calculation on the file X to be verified, where the hash calculation value has uniqueness.
Further, the checking module 2 obtains the first check code of the file X to be checked stored in the attribute list from the service module, compares the second check code with the first check code to obtain a comparison result, determines whether the file X to be checked is complete based on the comparison result, and records the comparison result. Specifically, if the first check code is consistent with the second check code, it is determined that the file X to be checked is complete; and if the first check code is inconsistent with the second check code, determining that the file X to be checked is incomplete, and repairing the file X to be checked.
In this embodiment, in the process of checking the file X to be checked, a window is set, the target file X which remains unopened after the window is determined as the file X to be checked, and the state information of the file X to be checked is read for multiple times, so as to ensure that the file X to be checked remains unopened. That is to say, the file verification method in this embodiment is directed to files that are not opened, so that waste of resources can be reduced, and normal services of an upper layer are not affected.
Example III,
In order to implement the foregoing file verification method, an embodiment of the present invention further provides a file verification apparatus, where a schematic structural diagram of the apparatus is shown in fig. 6, and the apparatus includes: a reading module 61, a first generating module 62 and a judging module 63; wherein, the first and the second end of the pipe are connected with each other,
the reading module 61 is configured to read state information of a file to be verified at a first time;
the first generating module 62 is configured to determine, based on the state information of the file to be verified, that the file to be verified is not opened, verify the file to be verified, and generate a second verification code;
the judging module 63 is configured to compare the second check code with the stored first check code of the file to be checked to obtain a comparison result, and determine whether the file to be checked is complete based on the comparison result.
Specifically, the determining module 63 obtains the second check code by performing hash calculation on the file to be checked after determining that the file to be checked is not opened. Wherein, the hash calculation may adopt an MD5 algorithm, and the value of the hash calculation has uniqueness.
Here, the judging module 63 is specifically configured to determine that the file to be verified is complete if the first check code is consistent with the second check code; and if the first check code is inconsistent with the second check code, determining that the file to be checked is incomplete, and repairing the file to be checked.
Here, the reading module 61 reads the descriptor of the file to be checked. And determining the state information of the file to be verified according to the state of the descriptor of the file to be verified.
Further, the apparatus further includes a determining module 64, configured to read the state information of the target file at a second time; wherein the second time is earlier than the first time; based on the state information of the target file, if the target file is determined not to be opened, opening a window for the target file; after the window for the target file is finished, reading the state information of the target file; and when the state information of the target file represents that the target file is kept in an unopened state, determining the target file as a file to be verified.
Specifically, the determining module 64 reads the state information of the target file at the second time, and if it is determined that the file is opened based on the state information of the target file, opens a window for the target file; and if the file is determined to be opened based on the state of the target file, ending the verification process. Further, after the window for the target file is finished, the state information of the target file is read. When the state information of the target file represents that the target file is kept in an unopened state, determining the target file as a file to be verified; and if the target file is in the opened state, ending the verification process, moving the target file out of the window, and recording the current state information of the target file.
Further, the apparatus further includes a second generating module 65, configured to read the state information of the file to be verified at a third time; wherein the third time is earlier than the first time, and the third time is later than the second time; and if the file to be checked is determined not to be opened based on the state information of the file to be checked, checking the file to be checked to generate the first check code, and storing the first check code as attribute information of the file to be checked.
Specifically, the second generating module 65 reads the status information of the file to be verified at the third time. If the file to be checked is determined not to be opened based on the state information of the file to be checked, checking the file to be checked to generate a first check code, and storing the first check code as attribute information of the file to be checked; and determining that the file to be verified is opened based on the state information of the file to be verified, and ending the verification process. And the first check code is used as attribute information of the file to be checked and is stored in an attribute information list of the file to be checked.
Further, the structural components of the file verification apparatus in fig. 6 are also applied to the structural components shown in fig. 7, and specifically include: the reading module 61, the first generating module 62, the judging module 63, the determining module 64 and the second generating module 65.
In addition, the specific implementation process of this embodiment has been set forth in detail in the foregoing technical solutions, and is not described here again.
In practical applications, the reading module 61, the first generating module 62, the determining module 63, the determining module 64, and the second generating module 65 may be implemented by a Central Processing Unit (CPU), a microprocessor Unit (MPU), a Digital Signal Processor (DSP), or a Field Programmable Gate Array (FPGA) located on a server or a terminal.
It should be noted that: in the file verification apparatus provided in the above embodiment, only the division of each program module is exemplified when performing file verification, and in practical applications, the above processing may be distributed to different program modules according to needs, that is, the internal structure of the apparatus may be divided into different program modules to complete all or part of the above-described processing. In addition, the file verification apparatus and the file verification method provided by the above embodiments belong to the same concept, and specific implementation processes thereof are detailed in the method embodiments and are not described herein again.
In order to implement the foregoing method, another file checking apparatus is further provided in an embodiment of the present invention, where the apparatus includes a memory, a processor, and an executable program that is stored in the memory and can be executed by the processor, and when the processor executes the executable program, the following operations are performed:
reading state information of a file to be checked at a first moment;
if the file to be checked is determined not to be opened based on the state information of the file to be checked, checking the file to be checked to generate a second check code;
and comparing the second check code with the stored first check code of the file to be checked to obtain a comparison result, and determining whether the file to be checked is complete or not based on the comparison result.
The processor is further configured to, when running the executable program, perform the following:
if the first check code is consistent with the second check code, determining that the file to be checked is complete;
and if the first check code is inconsistent with the second check code, determining that the file to be checked is incomplete, and repairing the file to be checked.
The processor is further configured to, when running the executable program, perform the following:
reading the state information of the target file at a second moment; wherein the second time is earlier than the first time;
based on the state information of the target file, if the target file is determined not to be opened, opening a window for the target file;
after the window for the target file is finished, reading the state information of the target file;
and when the state information of the target file represents that the target file is kept in an unopened state, determining the target file as a file to be verified.
The processor is further configured to, when running the executable program, perform the following:
reading the state information of the file to be verified at a third moment; wherein the third time is earlier than the first time, and the third time is later than the second time;
and if the file to be verified is not opened based on the state information of the file to be verified, verifying the file to be verified, generating a first verification code, and storing the first verification code as attribute information of the file to be verified.
The following takes the file verification apparatus as a server or a terminal for file verification as an example, and further describes the hardware structure of the file verification apparatus.
Fig. 8 is a schematic diagram of a hardware structure of a file verification apparatus according to an embodiment of the present invention, where the file verification apparatus 800 shown in fig. 8 includes: at least one processor 801, memory 802, a user interface 803, and at least one network interface 804. The various components of the file checking apparatus 800 are coupled together by a bus system 805. It is understood that the bus system 805 is used to enable communications among the components of the connection. The bus system 805 includes a power bus, a control bus, and a status signal bus in addition to a data bus. For clarity of illustration, however, the various buses are labeled as bus system 805 in fig. 8.
The user interface 803 may include, among other things, a display, a keyboard, a mouse, a trackball, a click wheel, a key, a button, a touch pad, or a touch screen.
It will be appreciated that the memory 802 can be either volatile memory or nonvolatile memory, and can include both volatile and nonvolatile memory.
The memory 802 in the embodiment of the present invention is used to store various types of data to support the operation of the file verifying apparatus 800. Examples of such data include: any computer program for operating on file verification device 800, such as executable program 8021, may be included in executable program 8021 for implementing methods of embodiments of the present invention.
The methods disclosed in the embodiments of the present invention described above may be implemented in the processor 801 or implemented by the processor 801. The processor 801 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 801. The processor 801 described above may be a general purpose processor, a DSP, or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, or the like. Processor 801 may implement or perform the methods, steps, and logic blocks disclosed in embodiments of the present invention. The general purpose processor may be a microprocessor or any conventional processor or the like. The steps of the method disclosed by the embodiment of the invention can be directly implemented by a hardware decoding processor, or can be implemented by combining hardware and software modules in the decoding processor. The software modules may be located in a storage medium that is located in the memory 802, and the processor 801 reads the information in the memory 802 to perform the steps of the aforementioned methods in conjunction with its hardware.
In an exemplary embodiment, an embodiment of the present invention further provides a storage medium, on which an executable program is stored, and when the executable program is executed by a processor, the executable program performs the foregoing method.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or executable program product. Accordingly, the present invention may take the form of a hardware embodiment, a software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of an executable program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, optical storage, and the like) having computer-usable program code embodied therein.
The present invention has been described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and executable program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by executable program instructions. These executable program instructions may be provided to a general purpose computer, special purpose computer, embedded processor, or processor with reference to a programmable data processing apparatus to produce a machine, such that the instructions, which execute via the computer or processor with reference to the programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These executable program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These executable program instructions may also be loaded onto a computer or reference programmable data processing apparatus to cause a series of operational steps to be performed on the computer or reference programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or reference programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above description is only a preferred embodiment of the present invention, and is not intended to limit the scope of the present invention.

Claims (6)

1. A method for file verification, the method comprising:
reading the state information of the target file at a second moment;
based on the state information of the target file, if the target file is determined not to be opened, opening a window for the target file;
reading the state information of the target file after the window aiming at the target file is finished;
when the state information of the target file represents that the target file is kept in an unopened state, determining the target file as a file to be verified;
reading the state information of the file to be verified at a third moment which is later than the second moment;
if the file to be checked is determined not to be opened based on the state information of the file to be checked, checking the file to be checked to generate a first check code, and storing the first check code as attribute information of the file to be checked;
reading the state information of the file to be verified at a first moment; wherein the first time is later than the third time;
based on the state information of the file to be verified, if the file to be verified is not opened, verifying the file to be verified, and generating a second verification code;
and comparing the second check code with the first check code of the saved file to be checked to obtain a comparison result, and determining whether the file to be checked is complete or not based on the comparison result.
2. The method of claim 1, wherein the determining whether the file to be verified is complete based on the comparison comprises:
if the first check code is consistent with the second check code, determining that the file to be checked is complete;
and if the first check code is inconsistent with the second check code, determining that the file to be checked is incomplete, and repairing the file to be checked.
3. A document verification apparatus, comprising: the device comprises a determining module, a second generating module, a reading module, a first generating module and a judging module; wherein, the first and the second end of the pipe are connected with each other,
the determining module is used for reading the state information of the target file at a second moment; based on the state information of the target file, if the target file is determined not to be opened, opening a window for the target file; after the window for the target file is finished, reading the state information of the target file; when the state information of the target file represents that the target file is kept in an unopened state, determining the target file as a file to be verified;
the second generation module is used for reading the state information of the file to be verified at a third moment which is later than the second moment; based on the state information of the file to be verified, if the file to be verified is not opened, verifying the file to be verified to generate a first verification code, and storing the first verification code as attribute information of the file to be verified;
the reading module is used for reading the state information of the file to be verified at a first moment; wherein the first time is later than the third time;
the first generating module is used for verifying the file to be verified and generating a second verification code if the file to be verified is not opened based on the state information of the file to be verified;
the judging module is used for comparing the second check code with the first check code of the saved file to be checked to obtain a comparison result, and determining whether the file to be checked is complete or not based on the comparison result.
4. The apparatus according to claim 3, wherein the determining module is specifically configured to determine that the file to be verified is complete if the first check code and the second check code are identical; and if the first check code is inconsistent with the second check code, determining that the file to be checked is incomplete, and repairing the file to be checked.
5. A storage medium having stored thereon an executable program, wherein the executable program, when executed by a processor, performs the steps of the method of claim 1 or 2.
6. A file checking apparatus comprising a memory, a processor and an executable program stored on the memory and executable by the processor, wherein the steps of the method of claim 1 or 2 are performed when the executable program is executed by the processor.
CN201910817324.7A 2019-08-30 2019-08-30 File checking method and device and storage medium Active CN112445761B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910817324.7A CN112445761B (en) 2019-08-30 2019-08-30 File checking method and device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910817324.7A CN112445761B (en) 2019-08-30 2019-08-30 File checking method and device and storage medium

Publications (2)

Publication Number Publication Date
CN112445761A CN112445761A (en) 2021-03-05
CN112445761B true CN112445761B (en) 2023-04-07

Family

ID=74735184

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910817324.7A Active CN112445761B (en) 2019-08-30 2019-08-30 File checking method and device and storage medium

Country Status (1)

Country Link
CN (1) CN112445761B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090199039A1 (en) * 2008-02-06 2009-08-06 Inventec Corporation File data restoring system and method of computer operating system and software thereof
CN108108260A (en) * 2016-11-25 2018-06-01 沈阳美行科技有限公司 The method of calibration and device of a kind of resource file
CN109582907A (en) * 2018-12-06 2019-04-05 深圳前海微众银行股份有限公司 Method of calibration, device, equipment and the readable storage medium storing program for executing of web page resources integrality

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090199039A1 (en) * 2008-02-06 2009-08-06 Inventec Corporation File data restoring system and method of computer operating system and software thereof
CN108108260A (en) * 2016-11-25 2018-06-01 沈阳美行科技有限公司 The method of calibration and device of a kind of resource file
CN109582907A (en) * 2018-12-06 2019-04-05 深圳前海微众银行股份有限公司 Method of calibration, device, equipment and the readable storage medium storing program for executing of web page resources integrality

Also Published As

Publication number Publication date
CN112445761A (en) 2021-03-05

Similar Documents

Publication Publication Date Title
CN108681565B (en) Block chain data parallel processing method, device, equipment and storage medium
CN107391628B (en) Data synchronization method and device
US20090187546A1 (en) Method, System and Computer Program Product for Duplicate Detection
US20120296878A1 (en) File set consistency verification system, file set consistency verification method, and file set consistency verification program
US11210003B2 (en) Method, device and computer program product for restoring data based on replacing child node identifiers with parent node identifier
CN111880740A (en) Data processing method, device, computer system and readable storage medium
CN112087530B (en) Method, device, equipment and medium for uploading data to block chain system
CN105302924A (en) File management method and device
US9280453B1 (en) Method and system for test automation framework for backup and recovery applications
CN115237444A (en) Concurrent control method, device and equipment based on version number and storage medium
WO2016127557A1 (en) Method for re-establishing standby database, and apparatus thereof
CN112231403B (en) Consistency verification method, device, equipment and storage medium for data synchronization
CN112445761B (en) File checking method and device and storage medium
KR101968544B1 (en) Method and apparatus for detecting vulnerability of software
CN109154880B (en) Consistent storage data in a decentralized storage network
CN115495286A (en) Test method, system, equipment and storage medium for timed backup of configuration file
WO2021139443A1 (en) Data access control method and apparatus, and data access device and system
US8554522B2 (en) Detection of design redundancy
CN111352764B (en) Chip repairing method, device, equipment and storage medium
CN112114811A (en) Compiling method, device and equipment
CN113297318A (en) Data processing method and device, electronic equipment and storage medium
CN110765193A (en) Method and device for exporting block chain data
CN106293897B (en) Automatic scheduling system of subassembly
US20220207438A1 (en) Automatic creation and execution of a test harness for workflows
JP6949440B2 (en) Vector generator and vector generator program

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant