Electronic archive file rapid verification method, system, device and medium
By constructing hierarchical hash files and directory trees, the problem of being unable to quickly verify and locate tampered files in batches in existing technologies has been solved, enabling rapid verification and traceability of massive electronic archives.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- CHONGQING AOXIONG INFORMATION TECH
- Filing Date
- 2023-03-01
- Publication Date
- 2026-05-19
AI Technical Summary
Existing technologies cannot quickly verify large quantities of electronic archives of various types and sizes, cannot determine whether data has been modified in a short period of time, and cannot quickly locate tampered files.
By constructing a hierarchical hash file, the hash results of the archive package are recorded in the hierarchical hash file of the original archive package, and the hash values of folders and files are calculated layer by layer to generate a hash directory tree, which can quickly locate the tampered files.
It enables rapid batch verification of massive stored files, quickly locates tampered files, and ensures the authenticity and traceability of electronic archives.
Smart Images

Figure CN116150092B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer information processing technology, specifically to an electronic archiving verification method based on HASH calculation. Background Technology
[0002] With the advancement of technology, data has now become an asset. Information-based business processes in different industries generate massive amounts of data. This data is stored in the form of files on the file systems of various computer operating systems, with different types of data files requiring retention periods of 5, 10, 30 years, or even permanent storage; the storage media for these data files also vary, including hard drives, optical discs, floppy disks, and SD cards.
[0003] The unique generation and storage environment of electronic archives gives them distinct technical characteristics compared to traditional paper archives. From the perspective of information recording format, electronic archives are purely digital information, characterized by ease of alteration, permanence, and dependence on computer systems. From the perspective of carrier characteristics, electronic archives also exhibit features such as the separability of carrier and information, and the instability of information storage. These technical characteristics pose significant challenges to the authenticity of electronic archives.
[0004] The authenticity of electronic documents can be divided into two aspects: first, the authenticity of the document during its creation process; and second, the authenticity of the document after its creation, meaning that the document has not been tampered with throughout its entire lifecycle from creation to archiving and preservation, and always maintains its original state at the time of creation. Although electronic signatures and electronic seals can guarantee the authenticity of electronic documents during their creation process to a certain extent, whether the document can be tampered with by technical means after its creation, and whether the electronic document can maintain its authenticity during archiving and transfer, as well as in future preservation, migration, and use, are all problems that urgently need to be solved.
[0005] The requirements for archiving electronic documents are: authenticity, validity, completeness, and availability. Currently, there are no relevant tools or software systems for periodically inspecting archived data files, making it impossible to determine whether the data has been modified. Verifying and calculating the massive amount of archived data requires a significant amount of time, and the hash value verification process cannot be completed within a short period, making it impossible to quickly determine whether the data has been modified. When there are hash anomalies in massive files, it is impossible to quickly and accurately locate and identify the tampered files.
[0006] Publication No. CN113342745A, entitled "A Method, Apparatus, Electronic Device, and Storage Medium for Verifying Image Files," discloses a method for verifying image files. The method involves obtaining the configuration file and each layer file of the image file to be run; calculating a first verification hash value for the configuration file based on a first preset hash algorithm; packaging each layer file into a layer file compressed package; calculating a second verification hash value for the layer file compressed package based on a second preset hash algorithm; comparing the first verification hash value with a first standard hash value pre-stored in a local database corresponding to the configuration file of the target image file; and comparing the second verification hash value with a second standard hash value pre-stored in the local database corresponding to the layer file compressed package of the target image file; if the first verification hash value matches the first standard hash value, and the second verification hash value matches the second standard hash value, then the image file to be run is selected as the target image file.
[0007] Publication number CN106055692A, titled "Automatic Testing Method and System for Comparing Files or Folders," determines whether the content and attributes of all described files are consistent by comparing hash values; it also determines whether the attributes of each file and directory within each directory level of each described folder are consistent by comparing hash values. The method obtains the corresponding hash values by setting up an XML-RPC server framework on the storage computer, and performs the comparison on a third-party computer equipped with the xmlrpcli module, thus determining whether each file or folder is consistent.
[0008] The aforementioned existing technologies use separate databases or files to record the hashes of files and folders. The original document and the hash record are two separate parts, which raises the possibility that the document and hash record cannot prove their association. Furthermore, they cannot migrate with the document or be verified outside the database. Calculating the hash value of a single file across multiple files in an archive folder requires calculating the hash value of each file multiple times, storing them in the hash value database, and then verifying the hash value of a single file step by step. This cannot support rapid verification of various types of data packets and large amounts of data files, nor can it support the verification of a large number of files in a short-period, rapid inspection of the archive. Summary of the Invention
[0009] This invention addresses the limitations of existing technologies that cannot quickly and batch verify massive amounts of stored files of various types and sizes. Furthermore, it fails to help quickly locate files at different levels that have become abnormal when data files are modified or damaged due to physical, human, or other factors.
[0010] This invention proposes a fast verification method for electronic archive files. The HASH record result of the archive package is recorded in the hierarchical HASH file of the original archive package. At the same time, the hierarchical HASH file itself will also participate in the HASH calculation of the parent folder, forming a self-protection. It can quickly verify whether the massive amount of stored files has caused data file modification or damage, and quickly locate the abnormal files at different levels.
[0011] Based on one aspect of this application, a method for rapid verification of electronic archive files is proposed, comprising: obtaining and decompressing compressed electronic archive file packages archived by various business systems; constructing a first-level folder named after the file package; placing all decompressed subfiles and subfolders into the first-level folder; obtaining data access permissions for the first-level folder; arranging the order of all subfiles and subfolders under the first-level folder according to the character order of the filenames; using server resources to determine the number of CPU cores, allocating corresponding thread resources to calculate and arrange the HASH strings of all files and subfolders in order from the bottom-level folder upwards, generating a hierarchical HASH file for each level of folder; associating the hierarchical HASH file with the corresponding subfolders and their contained subfiles to construct a HASH directory tree; packaging and storing the HASH file package as an electronic archive file package; obtaining the electronic archive file package and access path, decompressing it to generate a folder to be verified; calculating the HASH values of all subfiles and subfolders in the folder to be verified level by level from bottom to top; comparing the HASH values with those recorded in the hierarchical HASH file; locating and determining the tampered file; and generating the hierarchical and location information of the tampered file.
[0012] Further preferably, the construction of the hierarchical HASH file includes: using the names of the files and folders under the current folder as keys, and the file HASH and folder HASH as values, and storing the keys and values to form the hierarchical HASH file of the current layer.
[0013] Further preferred, the construction of the HASH directory tree includes: starting from the lowest level sub-file, the thread resource calculates the HASH string of the same level sub-file in parallel from bottom to top, concatenates the HASH strings of the same level subfolders and sub-files, adds the name string of the parent folder as the hash value of the parent folder, and so on upwards until the hash value of the first level folder is obtained, and associates all hash values with the file name string to build a HASH directory tree.
[0014] Further preferably, the arrangement order further includes arranging all subfiles and subfolders in the first-level folder according to the character order in the UTF-8 encoding table, comparing the strings one by one, if the first character is the same, then comparing the second character, until all strings have been compared, and arranging the subfiles and subfolders according to the string order. If the characters are completely the same, then arranging the subfiles and subfolders in ascending order according to the file creation time.
[0015] Further preferably, the arrangement order further includes comparing the HASH value strings of each subfile and subfolder in turn. If the first character is the same, the second character is compared, and so on, until all strings are compared. The subfiles and subfolders are arranged in the order of the strings. If the characters are completely the same, the subfiles and subfolders are arranged in ascending order of file creation time.
[0016] Further optimization involves concatenating the generated hierarchical HASH file name and the corresponding folder's HASH value into a string. The HASH value of the concatenated string is then used as the HASH value of the subfolder, and the file name of this layer is associated with it to form the hierarchical HASH file for this layer.
[0017] According to another aspect of this application, a rapid verification system for electronic archive files is proposed, comprising: a storage unit acquiring and decompressing compressed electronic archive file packages archived by various business systems, constructing a first-level folder named after the file package, and placing all decompressed sub-files and sub-folders into the first-level folder, and acquiring data access permissions for the first-level folder; a file sorting unit determining the sorting order based on the characters of each sub-file and sub-folder calculated by the calculation unit; a tool server resource allocating thread resources according to the number of CPU cores, and the calculation unit calculating and arranging the HASH strings of all sub-files and sub-folders sequentially from the bottom-level folder upwards, generating a hierarchical HASH file for each level of folder, associating the hierarchical HASH file with the corresponding sub-folders and their contained sub-files, constructing a HASH directory tree, and packaging and storing it as an electronic archive file package; a verification unit acquiring the electronic archive file package and access path, decompressing it to generate a folder to be verified; the calculation unit calculating the HASH value of each level of sub-folder in the folder to be verified from bottom to top; and the verification unit comparing the calculated HASH value with the HASH value recorded in the corresponding hierarchical HASH file, locating and determining the tampered file, and generating the hierarchical and location information of the tampered file.
[0018] Further preferably, the construction of the hierarchical HASH file includes: using the names of the sub-files and sub-folders under the current level as keys, and the file HASH and folder HASH as values, storing the keys and values to form the hierarchical HASH file of that level; the construction of the HASH directory tree includes: starting from the lowest level sub-file, the thread resources calculate the HASH strings of the same level sub-files and sub-folders in parallel from bottom to top, concatenate the same level HASH strings, add the name string of the parent folder as the hash value of the parent folder, and so on upwards until the hash value of the first level folder is obtained, and associate all hash values with the file name strings to build a HASH directory tree.
[0019] Further optimization involves arranging all subfiles and their names within the first-level folder according to the character order in the UTF-8 encoding table, comparing the strings sequentially, comparing the second character if the first character is the same, and so on, until all strings have been compared. The subfiles and subfolders are then arranged according to the string order. If the characters are completely identical, the subfiles and subfolders are arranged in ascending order of their file creation time.
[0020] Further optimization involves comparing the hash values of each subfile and subfolder in turn. If the first character is the same, the second character is compared, and so on, until all strings have been compared. The subfiles and subfolders are then arranged in the order of the strings. If the characters are completely identical, the subfiles and subfolders are arranged in ascending order of their file creation time.
[0021] According to another aspect of this application, an electronic device is proposed, comprising: a processor; and a memory storing a program, wherein the program includes instructions that, when executed by the processor, cause the processor to perform the above-described method for rapid verification of electronic archive documents.
[0022] According to another aspect of this application, a non-transitory computer-readable storage medium storing computer instructions is proposed, wherein the computer instructions are used to cause the computer to execute the rapid verification method for electronic archive documents as described above.
[0023] This application arranges all files in the electronic archive according to rules. Based on the arrangement order determined by the folder and file characters, it calculates the hash values of all electronic files, associates them with the original files and their hashes, and constructs a hierarchical hash file. Verification data migrates with the documents, enabling traceability throughout the entire electronic file preservation process and ensuring the authenticity of the preserved electronic archives. Based on the constructed hierarchical hash file, it can achieve rapid verification and inspection of massive amounts of data and a large number of files of different types. Attached Figure Description
[0024] Further details, features, and advantages of this application will be described in detail below with reference to the accompanying drawings and exemplary embodiments.
[0025] Figure 1 Flowchart of the HASH-based massive data folder verification method in this exemplary embodiment;
[0026] Figure 2 This is a schematic diagram illustrating folder nesting and hash value representation in this exemplary embodiment;
[0027] Figure 3 A schematic diagram of the folder HASH verification method in this exemplary embodiment;
[0028] Figure 4 Examples of hardware devices that can be applied to various aspects of this application. Detailed Implementation
[0029] Embodiments of this application will now be described in more detail with reference to the accompanying drawings. While some embodiments of this application are shown in the drawings, it should be understood that this application can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this application. It should be understood that the drawings and embodiments of this application are for illustrative purposes only and are not intended to limit the scope of protection of this application.
[0030] It should be understood that the steps described in the method embodiments of this application may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this application is not limited in this respect.
[0031] The term "comprising" and its variations as used herein are open-ended, meaning "including but not limited to". The term "based on" means "at least partially based on". The term "one embodiment" means "at least one embodiment"; the term "some embodiments" means "at least some embodiments". Definitions of other terms will be given in the following description. It should be noted that the concepts of "first", "second", etc., mentioned in this application are used only to distinguish different devices, modules, or units, and are not intended to limit the order of functions performed by these devices, modules, or units or their interdependencies.
[0032] It should be noted that the terms "a" and "a plurality of" used in this application are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0033] The names of the messages or information exchanged between multiple devices in the embodiments of this application are for illustrative purposes only and are not intended to limit the scope of these messages or information.
[0034] Each file can be hashed to obtain a hash value, and the resulting hash value is fixed and unique. If a file has been modified, the resulting hash value will definitely be different. By performing hash calculations and verification on files and folders, it is possible to determine whether a file is complete (whether it has been modified).
[0035] This invention provides a rapid verification method for electronic archive files. In the evidence preservation stage, subfiles and subfolders within a compressed file package are sorted sequentially according to a name string rule. The tool server allocates CPU cores and thread resources based on the number of CPU cores. The calculation unit starts from the bottom-level folder and proceeds upwards, sequentially calculating and concatenating the hash strings of all subfiles and subfolders. The calculation results are awaited hierarchically, generating a hierarchical hash file for each folder level. This hierarchical hash file is associated with its corresponding subfolder and its contained subfiles, constructing a hash directory tree, and packaging it into an electronic archive file package. Alternatively, corresponding thread resources are allocated to calculate file hash values from the bottom-level folder upwards, constructing a layer hash file and associating related files within the current layer, building a hash directory tree, and packaging it into an archived electronic archive package. In the verification stage, files and concatenated strings are arranged sequentially according to the verification stage's arrangement. The hash value of each subfolder is calculated from top to bottom and compared with the saved hierarchical hash files. This generates the hierarchical and location information of abnormal files, locating the changed files and their positions within the electronic archive. This application enables traceable electronic record storage, ensuring the authenticity of the stored electronic records.
[0036] like Figure 1 The diagram shows the flowchart of the massive data folder HASH verification method in an exemplary embodiment of this application. The method reads the compressed electronic archive file from the operating system, decompresses it to generate a folder, and generates name strings for all subfiles and subfolders. UTF-8 encoding allows for fast reading and writing via masking bits and shift operations. Since strcmp() and wcscmp() return the same result during string comparison, sorting becomes easier. In one exemplary embodiment, the name strings in the generated subfiles and subfolders are arranged according to the character order in the UTF-8 encoding table, preferably by arranging the file order first and then the folder order. If the first character of the strings in two files or folders being compared is the same, the second character is compared, and so on, until all strings have been compared. If the characters and order in two files or folders are completely identical, the subfiles and subfolders in the folders are sorted in ascending order of creation time. For the sorted data folder, the HASH values of the subfiles and subfolders are calculated starting from the bottom-level subfolder. A hierarchical HASH file is generated for each level of folder, recording the HASH values of the files and folders at each level. This process continues upwards until the HASH values of the first level of folders are calculated and a hierarchical HASH file is generated.
[0037] The following is a specific embodiment, including:
[0038] A001 transmits the compressed data package to be archived to the electronic archive file storage system via storage media such as portable hard drives, USB flash drives, and network shared disks. The computing unit reads the compressed file package to be archived from the file system by calling the open and read methods of the file storage system.
[0039] A002, the computing unit can determine the compression format of a compressed file by its file extension and binary format header file, decompress the data package, and generate a folder named after the data package. For compressed files of different formats, the files are decompressed into different folders, with the filenames in the folders appended with the format attribute. For example, files decompressed from RAR, ZIP, 7Z, GZ, and TAR compressed files are placed into their respective folders.
[0040] B001. Obtain the data package folder, determine whether the current folder contains subfolders, and if so, enter the subfolders until the bottom-level folder is reached.
[0041] B002. Starting from the bottom-level folder, within that folder, calculate the string representation of all subfile names based on filename, attributes, and extensions. Sort the subfile name strings, either according to the character order of the UTF-8 encoding table, or by comparing the first character of two filename strings if they are identical, comparing the second character, and so on, until all strings are compared. Sort the subfile name strings in ascending order if the number of characters and the character content are exactly the same. Alternatively, other methods can be used to sort the filenames in the folder.
[0042] B003. Starting from the bottom-level folder, create hierarchical hash files level by level upwards. In the bottom-level folder, calculate the hash value of each file in each subfolder according to the ordered subfilename strings. Concatenate the filename and file hash value into a string and write it to the hierarchical hash file. Include the hash strings of subfolders and files at the same level. The current hierarchical hash file does not contain itself. Continue upwards until the hash value of the first-level folder is obtained, thus constructing the hierarchical hash file.
[0043] B004. Enter the parent folder and sort all subfiles and subfolders contained in this folder according to the character order of the string concatenated by the file name and file hash value in the UTF-8 encoding table. For two subfiles, if the first character of the string is the same, compare the second character. If the number of characters and the character content are exactly the same, sort them in ascending order according to the file creation time. You can also sort them uniformly according to the strings of subfiles and subfolders, or you can give priority to the subfile strings. After sorting the subfiles, sort the subfolders according to the subfolder strings.
[0044] The hash values of subfiles and subfolders within a folder are calculated sequentially based on their arrangement. A unified hash algorithm is used to output the hash value of each file. The folder hash calculation method concatenates the hash values of the subfolders, subfiles, and the folder's own hierarchical hash files into a string, calculates the string, and outputs the hash value of the file.
[0045] One method for calculating the HASH value of a subfolder in this embodiment is as follows:
[0046] The sorted files and subfolders are concatenated with the generated hierarchical hash file name and its corresponding hash value into a string. The hash value of the concatenated string is used as the hash value of the subfolder. A hierarchical hash file is created in the current folder, which is written in the order of file name plus the hash value of the subfolder.
[0047] B005. Use the directory access command of the file storage system to enter the parent folder, continue to calculate the HASH values of the subfolders and subfiles directly under this folder, concatenate the strings, and write them to the hierarchical HASH file until the first-level folder HASH operation is completed, and obtain the hierarchical HASH file of the decompressed data package folder.
[0048] The process continues until the hash values of all subfolders and subfiles in the first-level folder are obtained and written to the hierarchical hash file of the first-level folder.
[0049] Example 1: For subfiles and subfolders at the same level, the order of subfiles and subfolders at this level is arranged according to the character order of the UTF-8 encoding table based on the file name string. If the first character of the name string of two files is the same, the second character is compared. If the number of characters and the character content of the names of two files are exactly the same, the files are arranged in ascending order according to the file creation time.
[0050] Example 2: For subfiles and subfolders at the same level, the order of subfiles and subfolders can be arranged according to the alphabetical order of their names or the order of their Chinese pinyin. If two files have the same filename, they can be arranged in ascending order of file creation time and alphabetical order of file attributes.
[0051] Example 3: For subfiles and subfolders at the same level, calculate the hash string for each subfile and subfolder, check all strings in all subfiles and subfolders, compare all strings, and sequentially compare the corresponding numbers and letters in the hash strings of all subfiles and subfolders according to the principle of numbers first and letters last. If they are the same number, they are arranged in ascending order; if they are the same letter, they are arranged in alphabetical order. If the first digit is the same, the second digit is compared, until all hash strings of subfolders and subfiles have been compared, and the relevant subfolders and subfiles are arranged according to the string order.
[0052] Example 4: For subfiles and subfolders at the same level, calculate the hash string for each subfile and subfolder. Check all strings in all subfiles and subfolders, compare all strings, and sequentially compare the corresponding English letters and numbers in the hash strings of all subfiles and subfolders according to the principle of English letters first and numbers last. If they are the same English letters, arrange them in alphabetical order; if they are the same numbers, arrange them in ascending order. If the first digit is the same, compare the second digit, until all hash strings of subfolders and subfiles have been compared, and arrange the relevant subfolders and subfiles according to the string order.
[0053] Starting from the bottom level of each data packet folder, calculate the hash value of each subfile in order of arrangement, and then concatenate the hash values of the files at that level. Continue this process upwards, calculating the hash values of all subfolders and subfiles in the order of arrangement, until the hash calculation of all subfiles and subfolders in the decompressed data packet folder is completed. Construct a layer hash file and save it in the current layer.
[0054] The following specific example further illustrates the method of concatenating file hash strings.
[0055] like Figure 2 The diagram shown is a schematic diagram of folder nesting and hash values in an exemplary embodiment of this application.
[0056] For a file package containing nested subfolders and subfiles, start from the bottom-level subfile and calculate the hash of each subfolder and subfile sequentially upwards until all subfiles and subfolders in the file package have been calculated. Then, concatenate the hash values of all subfolders and subfiles to obtain the hash value of the file package.
[0057] For example, folder 2 contains folder 1, file 3, and file 4, and folder 1 contains file 1 and file 2. First, starting from the bottom layer of the folder, calculate the hash values of file 1 and file 2: HASH1 and HASH2. Then calculate the hash values of the filenames of file 1 and file 2. Next, according to the order of file 1 and file 2, concatenate the hash value of file 1 or file 2 with the corresponding filename hash value to obtain the hash values of file 1 and file 2. Then, sort the hash values of file 1 and file 2 according to the character concatenation method. Concatenate the hash values HASH1 and HASH2 in order to obtain the hash value HASH5 of folder 1. Next, calculate the hash values of file 3 and file 4 in sequence to obtain HASH3 and HASH4. Concatenate HASH5, HASH3, and HASH4 in order to obtain the hash value of folder 2. Finally, concatenate the hash value of folder 2 with the hash value of the folder 2 name to obtain the total hash value HASH6 of folder 2.
[0058] HASH 5=HASH(HASH1+HASH2+HASH(Name1)),
[0059] HASH 6=HASH(HASH3+HASH4+HASH5+HASH(Name2)),
[0060] In this context, Name1 and Name2 represent the filenames of folder 1 and folder 2, and "+" indicates string concatenation.
[0061] HASH5 = HASH(subfile1HASH1 string concatenated with file2HASH2 string concatenated with subfolder1 nameHASH string)
[0062] HASH value of folder 2 = HASH(HASH value of subfile 3, string concatenation of subfile HASH value of subfile 4, string concatenation of subfolder HASH value of subfolder 5, string concatenation of folder 2 name HASH value of subfolder 2).
[0063] For example, the hash values of each subfolder and subfile in the folder are:
[0064] HASH1: 167afd
[0065] HASH2: a67bcf
[0066] HASH3: ab7927
[0067] HASH4: 15adfb
[0068] HASH5: b786cd
[0069] Example 1: Following the principle of numbers first and letters last, starting from the lowest-level sub-file, first compare files at the same level and concatenate their hash strings sequentially. Continue this process upwards, concatenating the strings of sub-files and subfolders at the same level until the top-level file data packet is reached, thus obtaining the folder's hash value. In the example above, the concatenation order is: HASH1, HASH2, HASH4, HASH3, HASH5, resulting in the folder's hash value: 167afd a67bcf15adfb ab7927 b786cd.
[0070] Example 2: Sort all file hash value strings, and compare the corresponding numbers and letters in the hash strings of all subfiles and subfolders in order according to the principle of numbers first and letters last. The order of the hash value concatenation rules is: HASH4, HASH1, HASH2, HASH3, HASH5. The resulting hash value of the folder is: 15adfb167afda67bcf ab7927 b786cd.
[0071] For cases with multiple data packet folders, calculate the hash value of each folder to obtain the hash value of each data packet, and then calculate the total hash value of the file packet according to the relevant sorting rules and calculation methods.
[0072] To verify the integrity of all files in folder 2, starting with folder 2, calculate the hash value of each file within the folder, and then verify all files in the folder and its subfolders level by level to determine whether any files have been modified or tampered with.
[0073] like Figure 3 The diagram shown is a schematic of the folder HASH verification method in this exemplary embodiment.
[0074] Determining whether a file has been tampered with includes: obtaining and decompressing the electronic archive file package, arranging its subfolders and subfiles according to the encoding order of the file names, calculating the hash strings of sibling subfolders and subfiles from bottom to top, concatenating the hash strings of sibling subfolders and subfiles with the hash strings of hierarchical files to obtain the hash value of the folder, and so on up the hierarchy until the hash value of the first-level folder is obtained, comparing the calculated hash value with the hierarchical hash file associated with the file name stored in the evidence storage unit, and locating and determining the tampered file in the folder.
[0075] C001. The system administrator transmits the archive compressed data package to be verified to the file verification system through storage media such as external hard drives, USB flash drives, and network shared disks. The computing unit reads the archive compressed package to be verified from the file system by calling the file verification system's open and read methods, and begins to verify and locate the modified files in the archive file package.
[0076] C002. The computing unit can determine the compression format of a compressed file by its file extension and binary format header file. It then decompresses the data package and places the files and folders within it into a first-level folder named after the data package. This method can be used to verify folders obtained from decompressing RAR, ZIP, 7Z, GZ, and TAR format compressed files. In the rapid inspection and verification of massive amounts of electronic archive data, the data package files to be inspected can be quickly narrowed down by their file extensions. Based on the file package format, the corresponding hierarchical hash file of the file package in the evidence storage system can be quickly retrieved.
[0077] C003. Read the decompressed data packet of the file to be verified. Calculate the hash value of the subfiles and subfolders in the data packet folder according to the arrangement during evidence storage. Concatenate the relevant strings according to the arrangement during evidence storage. Starting from the top-level folder, obtain the verification hash value of each level of folder. Compare the verification hash value with the hash value recorded in the corresponding level hash file. If the hash values are the same, it means that all files in the data packet are the same as the original files and have not been tampered with.
[0078] C004. If the verification hash value differs from the hash value recorded in the hierarchical file hash, it indicates that a file in the folder has been modified. Locate the folder where the file was modified and record its filename. Further compare the hash value of the file in that folder with the corresponding hash value in the hierarchical hash file to identify the tampered file. Calculate and verify the hash values of subfiles and subfolders level by level to see if they match the records in the hierarchical hash file. Compare the hash values of all hierarchical files in the folder to find files with different hash values, locate the modified file, and confirm that the file has been modified.
[0079] C005. Continue until all folders at all levels have been checked.
[0080] refer to Figure 4The present invention describes a structural block diagram of an electronic device 300 that can serve as a server or client of this application, which is an example of a hardware device that can be applied to various aspects of this application. The electronic device is intended to represent various forms of digital electronic computer devices, such as desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the application described and / or claimed herein.
[0081] like Figure 4 As shown, the electronic device 300 includes a computing unit 301, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 302 or a computer program loaded from a storage unit 308 into a random access memory (RAM) 303. The RAM 303 may also store various programs and data required for the operation of the device 300. The computing unit 301, ROM 302, and RAM 303 are interconnected via a bus 304. An input / output (I / O) interface 305 is also connected to the bus 304.
[0082] Multiple components in electronic device 300 are connected to I / O interface 305, including: input unit 306, output unit 307, storage unit 308, and communication unit 309. Input unit 306 can be any type of device capable of inputting information to electronic device 300. Input unit 306 can receive input digital or character information and generate key signal inputs related to user settings and / or function control of electronic device. Output unit 307 can be any type of device capable of presenting information and may include, but is not limited to, a display, speaker, video / audio output terminal, vibrator, and / or printer. Storage unit 308 may include, but is not limited to, disk and optical disk. Communication unit 309 allows electronic device 300 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks, and may include, but is not limited to, modems, network cards, infrared communication devices, wireless communication transceivers, and / or chipsets, such as Bluetooth devices, WiFi devices, WiMax devices, cellular communication devices, and / or the like.
[0083] The computing unit 301 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 301 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 301 performs the various methods and processes described above. For example, in some embodiments, the reconstruction and decomposition of the muscle movement trajectory of the signature stroke based on the original trajectory, and the decomposition of its logarithmic velocity curve, can be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as storage unit 308. In some embodiments, part or all of the computer program can be loaded and / or installed on the electronic device 300 via ROM 302 and / or communication unit 309. In some embodiments, the computing unit 301 can be configured by any other suitable means (e.g., by means of firmware) to perform a signature handwriting dynamic acquisition implementation method.
[0084] The program code used to implement the methods of this application may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing device, such that when executed by the processor or controller, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0085] In the context of this application, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0086] As used in this application, the terms "machine-readable medium" and "computer-readable medium" refer to any computer program product, device, and / or apparatus (e.g., disk, optical disk, memory, programmable logic device (PLD)) for providing machine instructions and / or data to a programmable processor, including machine-readable media that receive machine instructions as machine-readable signals. The term "machine-readable signal" refers to any signal for providing machine instructions and / or data to a programmable processor.
[0087] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0088] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.
[0089] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other.
Claims
1. A method for rapid verification of electronic archival documents, characterized in that, Evidence preservation stage: Obtain and decompress the compressed electronic archive files from each business system, and construct a first-level folder named after the file package; obtain data access permissions for the first-level folder, and sort all subfiles and subfolders under the first-level folder according to the character order of the file names; use the tool server resources to determine the number of CPU cores, allocate the corresponding thread resources to calculate and concatenate the HASH strings of all files and subfolders in parallel, starting from the bottom-level folder and ascending layer by layer according to the sorting order; Using the names of files and folders under this level as keys, and the file hash and folder hash as values, store the keys and values in a hierarchical hash file that constitutes this level. Starting from the lowest-level subfile, the thread resource calculates the hash string of the sibling subfile in parallel from bottom to top, concatenates the hash strings of the sibling subfolders and subfiles, adds the name string of the parent folder as the hash value of the parent folder, and so on up level by level until the hash value of the first-level folder is obtained. All hash values are associated with the file name strings to build a hash directory tree, and packaged and stored as an electronic archive file package. Verification phase: Obtain the electronic archive file package and access path, decompress to generate a folder to be verified, calculate the HASH value of each subfolder in the folder to be verified layer by layer from top to bottom according to the arrangement order of the evidence preservation stage and the string concatenation method, compare it with the HASH value recorded in the hierarchy HASH file, locate and determine the tampered file, and generate the hierarchy and location information of the tampered file.
2. The method according to claim 1, characterized in that, The sorting order further includes arranging all subfiles and their name strings in the first-level folder according to the character order in the UTF-8 encoding table, comparing the strings one by one, comparing the second character if the first character is the same, and so on until all the strings have been compared, and arranging the subfiles and subfolders according to the string order. If the characters are completely identical, the subfiles and subfolders are arranged in ascending order according to the file creation time.
3. The method according to claim 1 or 2, characterized in that, The sorting order further includes comparing the HASH value strings of each subfile and subfolder in turn. If the first character is the same, the second character is compared, and so on, until all strings are compared. The subfiles and subfolders are sorted according to the string order. If the characters are completely the same, the subfiles and subfolders are sorted in ascending order according to the file creation time.
4. The method according to claim 1 or 2, characterized in that, The filename and file hash value are concatenated into a string and written to the hierarchical hash file in sequence. The hash strings of sibling subfolders and subfiles, as well as the current hierarchical hash file, do not include the hierarchical hash file itself. The hash value of the concatenated string is used as the hash value of the subfolder, and the filename of the current level is associated with it as the hierarchical hash file of the current level.
5. A rapid verification system for electronic archival documents, characterized in that, The evidence storage unit obtains and decompresses the compressed electronic archive files from each business system, constructs a first-level folder named after the file package, and obtains data access permissions for the first-level folder; the file sorting unit determines the sorting order based on the characters of each sub-file and sub-folder calculated by the calculation unit. The tool server allocates thread resources based on the number of CPU cores. The computing unit starts from the bottom-level folder and works upwards layer by layer, calculating and concatenating the hash strings of all sub-files and sub-folders in parallel according to the order, generating a hierarchical hash file for each level of folder. The hierarchical hash file is associated with the corresponding sub-folders and their contained sub-files to construct a hash directory tree, which is then packaged and stored as an electronic archive file package. The verification unit obtains the electronic archive file package and access path, decompresses it to generate a folder to be verified. The computing unit calculates the hash value of each sub-folder in the folder to be verified layer by layer from top to bottom according to the arrangement order of the evidence preservation stage and the string concatenation method. The verification unit compares the calculated hash value with the hash value recorded in the hierarchical hash file to locate and determine the tampered file, and generates the hierarchical and location information of the tampered file. Constructing a hierarchical hash file involves: using the names of subfiles and subfolders under the current level as keys, and the file hash and folder hash as values, storing these keys and values to form the hierarchical hash file for that level. The current level's hash file does not contain itself. Constructing a hash directory tree involves: starting with the lowest-level subfile, using thread resources to compute the hash strings of sibling files and subfolders in parallel from bottom to top, concatenating the sibling hash strings, adding the name string of the parent folder as its hash value, and so on upwards until the hash value of the first-level folder is obtained. Finally, all hash values are associated with filename strings to build a hash directory tree.
6. The system according to claim 5, characterized in that, Sort all subfiles and subfolders in the first-level folder according to the character order in the UTF-8 encoding table, and compare the strings one by one. If the first character is the same, compare the second character, and so on, until all strings have been compared. Sort the subfiles and subfolders according to the string order. If the characters are completely the same, sort the subfiles and subfolders in ascending order of file creation time.
7. The system according to claim 6, characterized in that, Compare the hash values of each subfile and subfolder in turn. If the first character is the same, compare the second character, and so on, until all strings have been compared. Arrange the subfiles and subfolders in the order of the strings. If the characters are completely identical, arrange the subfiles and subfolders in ascending order of their file creation time.
8. An electronic device, comprising: processor; And a memory for storing a program, characterized in that the program includes instructions that, when executed by the processor, cause the processor to perform the rapid verification method for electronic archive documents according to any one of claims 1-4.
9. A non-transitory computer-readable storage medium storing computer instructions, characterized in that, in, The computer instructions are used to cause the computer to execute the rapid verification method for electronic archive documents according to any one of claims 1-4.