WO2021159639A1 - Checking method, apparatus, and device for data migration, and storage medium - Google Patents

Checking method, apparatus, and device for data migration, and storage medium Download PDF

Info

Publication number
WO2021159639A1
WO2021159639A1 PCT/CN2020/093187 CN2020093187W WO2021159639A1 WO 2021159639 A1 WO2021159639 A1 WO 2021159639A1 CN 2020093187 W CN2020093187 W CN 2020093187W WO 2021159639 A1 WO2021159639 A1 WO 2021159639A1
Authority
WO
WIPO (PCT)
Prior art keywords
verified
sub
file
hash value
migrated
Prior art date
Application number
PCT/CN2020/093187
Other languages
French (fr)
Chinese (zh)
Inventor
兰东平
Original Assignee
平安科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2021159639A1 publication Critical patent/WO2021159639A1/en

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/11File system administration, e.g. details of archiving or snapshots
    • G06F16/119Details of migration of 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/1004Adding special bits or symbols to the coded information, e.g. parity check, casting out 9's or 11's to protect a block of data words, e.g. CRC or checksum

Definitions

  • This application relates to the field of data processing technology, and in particular to a proofreading method, device, device, and computer-readable storage medium for migrating data.
  • the inventor realizes that although the above-mentioned method of file-by-file comparison can ensure the accuracy, because data calibration is performed on a file-by-file basis, the file size and MD5 must be transmitted through the network for each data calibration, which not only reduces the efficiency of data calibration, but also increases data calibration. cost. Therefore, how to solve the technical problems of low efficiency of data proofreading and high cost of data proofreading has become a technical problem to be solved urgently at present.
  • the main purpose of this application is to provide a proofreading method, device, device, and computer-readable storage medium for migrating data, aiming to solve the existing technical problems of low data proofreading efficiency and high data proofing cost.
  • this application provides a proofreading method for migrated data, and the proofreading method for migrated data includes the following steps:
  • the files to be migrated before migration and the files to be verified after migration in the cloud are obtained from the source;
  • the document to be verified is collated according to the total standard digest hash value and the total digest hash value to be verified, if the total standard digest hash value and the total digest hash value to be verified If they are the same, it is determined that the file to be verified is successfully migrated, and a corresponding file migration successful reminder message is generated.
  • the present application also provides a proofreading device for migrated data, and the proofreading device for migrated data includes:
  • the migration file determination module is used to obtain the files to be migrated before migration and the files to be verified after migration in the cloud when the data migration instruction is detected;
  • the first MD5 calculation module is used to calculate the sub-standard digest hash value corresponding to each sub-file to be migrated in the file to be migrated, and calculate the to-be-migrated sub-file based on the hash value of each sub-standard digest and the size of each sub-file to be migrated.
  • the second MD5 calculation module is used to calculate the sub-to-be-verified digest hash value corresponding to each sub-file to be verified in the file to be verified, and based on the hash value of each sub-to-be-verified digest and each to-be-verified Sub-file size, calculating the total hash value of the digest to be verified corresponding to the file to be verified;
  • the migration data proofreading module is used to proofread the file to be verified according to the total standard digest hash value and the total digest hash value to be verified. If the total standard digest hash value is compared with the total If the hash value of the digest to be verified is the same, it is determined that the file to be verified is successfully migrated, and a corresponding file migration success reminder message is generated.
  • the present application also provides a proofreading device for migrated data.
  • the proofreading device for migrated data includes a processor, a memory, and migrated data that is stored on the memory and can be executed by the processor.
  • the proofreading program of the migration data wherein when the proofreading program of the migration data is executed by the processor, the following steps of the proofreading method of the migration data are implemented:
  • the files to be migrated before migration and the files to be verified after migration in the cloud are obtained from the source;
  • the document to be verified is collated according to the total standard digest hash value and the total digest hash value to be verified, if the total standard digest hash value and the total digest hash value to be verified If they are the same, it is determined that the file to be verified is successfully migrated, and a corresponding file migration successful reminder message is generated.
  • this application also provides a computer-readable storage medium on which a proofreading program for migration data is stored, wherein the proofreading program for migration data is executed by a processor.
  • the above-mentioned proofreading method of migration data has the following steps: when a data migration instruction is detected, the file to be migrated before migration and the file to be verified after migration in the cloud are obtained from the source end;
  • the document to be verified is collated according to the total standard digest hash value and the total digest hash value to be verified, if the total standard digest hash value and the total digest hash value to be verified If they are the same, it is determined that the file to be verified is successfully migrated, and a corresponding file migration successful reminder message is generated.
  • This application provides a proofreading method for migration data, by obtaining the files to be migrated before migration and the files to be verified after migration in the cloud when the data migration instruction is detected; calculating each of the files to be migrated The sub-standard summary hash value corresponding to the sub-file to be migrated is calculated, and the total standard summary hash value corresponding to the file to be migrated is calculated based on the hash value of each sub-standard summary and the size of each sub-file to be migrated; Verify the hash value of the sub-to-be-verified digest corresponding to each sub-file to be verified, and calculate the corresponding sub-file to be verified based on the hash value of each sub-to-be-verified digest and the size of each sub-file to be verified The total hash value of the digest to be verified; the document to be verified is collated according to the hash value of the total standard digest and the hash value of the total digest to be verified.
  • this application uses the hash value of each sub-standard digest of each sub-file to be migrated in the file to be migrated in the source and the value of each sub-file to be verified in the file to be verified after migration in the cloud.
  • the standard MD5 value of each sub-file to be verified is respectively spliced and calculated to generate the total standard digest hash value corresponding to the file to be migrated and the total digest hash value to be verified corresponding to the file to be verified, and through direct comparison
  • the total standard summary hash value and the total pending summary hash value are used to determine whether the file migration is abnormal, reduce the number of file comparisons, improve the efficiency of file migration, reduce migration costs, and solve the inefficiency of existing data proofreading.
  • FIG. 1 is a schematic diagram of the hardware structure of a proofreading device for migrating data involved in a solution of an embodiment of the application;
  • FIG. 2 is a schematic flowchart of a first embodiment of a method for proofreading migrated data in an application
  • FIG. 3 is a schematic flowchart of a second embodiment of a method for proofreading migrated data in an application
  • FIG. 4 is a schematic flowchart of a third embodiment of a method for proofreading migrated data in an application
  • FIG. 5 is a schematic diagram of the functional modules of the first embodiment of the proofreading device for migrating data according to this application.
  • the proofreading method of migrated data involved in the embodiments of this application is mainly applied to proofreading equipment for migrated data.
  • the proofreading equipment for migrated data may be devices with display and processing functions such as PCs, portable computers, and mobile terminals.
  • FIG. 1 is a schematic diagram of the hardware structure of the proofreading device for migrating data involved in the solution of the embodiment of the application.
  • the proofreading device for migrating data may include a processor 1001 (for example, a CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005.
  • the communication bus 1002 is used to realize the connection and communication between these components;
  • the user interface 1003 may include a display (Display), an input unit such as a keyboard (Keyboard);
  • the network interface 1004 may optionally include a standard wired interface, a wireless interface (Such as WI-FI interface);
  • the memory 1005 can be a high-speed RAM memory, or a non-volatile memory (non-volatile memory), such as a disk memory.
  • the memory 1005 can optionally be a storage device independent of the aforementioned processor 1001 .
  • FIG. 1 does not constitute a limitation on the proofreading device for migrating data, and may include more or less components than shown in the figure, or a combination of certain components, or different components Layout.
  • the memory 1005 as a computer-readable storage medium in FIG. 1 may include an operating system, a network communication module, and a proofreading program for migrating data.
  • the network communication module is mainly used to connect to the server and perform data communication with the server; and the processor 1001 can call the proofreading program of the migration data stored in the memory 1005, and execute the proofreading method of the migration data provided in the embodiment of the application .
  • the embodiment of the present application provides a proofreading method for migrated data.
  • FIG. 2 is a schematic flowchart of a first embodiment of a method for proofreading migrated data in this application.
  • the proofreading method of the migration data includes the following steps:
  • Step S10 when the data migration instruction is detected, the files to be migrated before migration and the files to be verified after migration in the cloud are obtained from the source end;
  • the traditional method of data reconciliation often compares the data before and after the upload one by one. In different scenarios, the method of comparison is also different. If you compare the file size and MD5 (Message-Digest Algorithm) one by one, once a file is found to be incorrect, you need to re-upload the original file and repeat the above data proofreading steps again until all are completed. Although the above-mentioned file-by-file comparison method can ensure accuracy, the file size and MD5 must be transmitted through the network for each file-by-file data calibration, which not only has low efficiency in data calibration, but also increases the cost of data calibration.
  • MD5 Message-Digest Algorithm
  • this application adopts the standard MD5 value of each sub-file of each sub-file to be migrated in the file to be migrated in the source end, that is, the sub-standard digest hash value and the file to be verified after migration in the cloud.
  • the MD5 value of each sub-file to be verified standard of each sub-file to be verified is respectively spliced and calculated to generate the total standard MD5 corresponding to the file to be migrated, that is, the total standard digest hash value and the total standard MD5 value corresponding to the file to be verified.
  • Verify MD5 which is the total hash value of the digest to be verified
  • step S10 further includes:
  • the sub-files to be migrated in the source end are arranged in order, and the arranged sub-files to be migrated are sequentially uploaded to the cloud.
  • the sub-files to be migrated in the source end are sequentially arranged, and the arranged sub-files to be migrated are sequentially uploaded to the cloud.
  • MD5 Message-Digest Algorithm, MD5 message digest algorithm
  • MD5 message digest algorithm is a widely used cryptographic hash function that can generate a 128-bit (16-byte) hash value to ensure Information transmission is complete and consistent.
  • There are many ways to arrange the files to be migrated For example, if the files to be migrated are in various directories, that is, the file storage paths are different, they are sorted in lexicographical order of individual file names. For example, file file1 is ranked before file2. According to the sequence of the arranged files, the migration procedure of the files to be migrated is executed, that is, the files to be migrated are uploaded to the cloud one by one on demand from the source for storage.
  • Step S20 Calculate the hash value of the sub-standard summary corresponding to each sub-file to be migrated in the file to be migrated, and calculate the total corresponding to the file to be migrated based on the hash value of each sub-standard summary and the size of each sub-file to be migrated.
  • Standard digest hash value
  • the source end calculates the sub-file standard MD5 corresponding to each sub-file to be migrated in the file to be migrated, that is, the sub-standard digest hash value, and saves each sub-file to be migrated sub-file Corresponding standard MD5.
  • the standard MD5 corresponding to the sub-file to be migrated may be that the MD5 is calculated only based on the size of the file to be migrated, or it may be that the MD5 is calculated according to the size of the file to be migrated, and then according to the size of the file to be migrated and The corresponding MD5 is further calculated to calculate the standard MD5 and the MD5 to be verified.
  • Step S30 Calculate the sub-to-be-verified digest hash value corresponding to each sub-file to be verified in the file to be verified, and calculate based on the hash value of each sub-to-be-verified digest and the size of each sub-file to be verified The total hash value of the digest to be verified corresponding to the file to be verified;
  • the file to be verified migrated to the cloud is calculated with reference to the calculation step of step S20, and the sub-to-be-verified digest hash value corresponding to each sub-file to be verified in the file to be verified is calculated. And save the MD5 to be verified corresponding to each sub-file to be verified.
  • Step S40 the document to be verified is collated according to the total standard digest hash value and the total digest hash value to be verified, if the total standard digest hash value and the total digest hash value to be verified If the hash value is the same, it is determined that the file to be verified is successfully migrated, and a corresponding file migration successful reminder message is generated.
  • the total standard MD5 of the source and the cloud is directly compared, that is, the total standard digest hash value and the total MD5 to be verified, that is, the total digest hash value to be verified. If the two values are exactly the same , It proves that all migrated correctly. Otherwise, the sub-file verification is further performed.
  • This embodiment provides a proofreading method for migrated data.
  • the file to be migrated before migration and the file to be verified after migration in the cloud are obtained from the source end; and the file to be migrated is calculated
  • Each sub-standard digest hash value corresponding to each sub-file to be migrated is calculated, and the total standard digest hash value corresponding to the file to be migrated is calculated based on the digest hash value of each sub-standard and the size of each sub-file to be migrated;
  • the hash value of the sub-to-be-verified summary corresponding to each sub-file to be verified in the verification file is calculated, and the corresponding to the file to be verified is calculated based on the hash value of each sub-to-be-verified summary and the size of each sub-file to be verified
  • the total digest hash value to be verified; the document to be verified is collated according to the total standard digest hash value and the total digest hash value to be verified, if the total standard digest hash value is equal to If the total hash value of the
  • this application uses the hash value of each sub-standard digest of each sub-file to be migrated in the file to be migrated in the source and the value of each sub-file to be verified in the file to be verified after migration in the cloud.
  • the standard MD5 value of each sub-file to be verified is respectively spliced and calculated to generate the total standard digest hash value corresponding to the file to be migrated and the total digest hash value to be verified corresponding to the file to be verified, and through direct comparison
  • the total standard summary hash value and the total pending summary hash value are used to determine whether the file migration is abnormal, reduce the number of file comparisons, improve the efficiency of file migration, reduce migration costs, and solve the inefficiency of existing data proofreading.
  • FIG. 3 is a schematic flowchart of a second embodiment of a method for proofreading migrated data in this application.
  • the step S20 specifically includes:
  • Step S21 Calculate the sub-standard digest hash value corresponding to each sub-file to be migrated in the file to be migrated, and set the size of the sub-file to be migrated corresponding to the sub-file to be migrated and the hash value of the sub-standard digest as The sub-standard meta information corresponding to the sub-file to be migrated;
  • Step S22 according to the arrangement order of the sub-files, the preset number of sub-standard meta-information corresponding to the sub-files to be migrated are sequentially spliced to generate standard batch meta-information;
  • Step S23 Calculate the batch standard digest hash value corresponding to the standard batch meta information, and calculate the total standard digest hash value corresponding to the file to be migrated based on the batch standard digest hash value.
  • step S23 specifically includes:
  • the processing process of the MD5 algorithm is: processing the file to be migrated, setting the initial value, cyclic processing, and splicing the result.
  • the MD5 algorithm is specifically described as follows:
  • Step 1 Process the files to be migrated
  • the filling method is to fill the first bit with 1 and the remaining bits with 0. After filling, the length of the file to be migrated is 512*N+448.
  • Step 2 Set the initial value
  • the length of the MD5 hash result is 128 bits, divided into one group for each 32 bits, a total of 4 groups. These 4 sets of results are obtained through continuous evolution of 4 initial values A, B, C, and D.
  • the initial values of A, B, C, and D are as follows (hexadecimal):
  • the third step cycle processing
  • A, B, C, and D are the four groups of hash values. Each cycle will cause the old ABCD to produce a new ABCD. How many cycles do you go through? Determined by the length of the file to be migrated after processing.
  • the fourth step splicing results
  • the MD5 calculated for each file is used as the meta-information of the file, and the preset number of meta-information is spliced one by one in the file sort order according to the preset splicing unit.
  • the meta information of every 1000 files is spliced into a total file (according to the specific number of files to be migrated, it can be adjusted appropriately.
  • the minimum is 10, the maximum is 1000)
  • the total file that is, the accumulated meta information is added
  • the total is further calculated Standard MD5, that is, the total standard digest hash value and the total MD5 to be verified, that is, the total digest hash value to be verified, namely MD5_1000. It is described in detail as follows.
  • the first file file1, MD5 value is MD5_file1;
  • MD5 value is MD5_file2
  • the third file file3, MD5 value is MD5_file3;
  • the splicing meta information of MD5_1000 is: MD5_file1MD5_file2MD5_file3...MD5_file1000. Then, the MD5_1000 of the 1000 files are gradually spliced and accumulated, and the MD5_1000 is calculated every 1000 MD5_1000 to generate MD5_1000_1000. After the above repeated steps, the source and the cloud will finally generate an MD5 value calculated after a finite number of splicing and accumulation. It is assumed to be MD5_1000_1000_1000 (corresponding to 1 million file migration scenarios), that is, the general standard MD5, that is, the general standard digest hash value and MD5 always to be verified, that is, the digest hash value of the total to be verified.
  • step S30 specifically includes:
  • the MD5 of each batch to be verified (that is, the digest hash value of the batch to be verified) is sequentially spliced for a preset number of times to calculate the MD5 of a file to be verified, that is, the digest hash value of the file to be verified, as the all
  • the total to-be-verified MD5 corresponding to the file to be verified is the hash value of the total to-be-verified digest.
  • the total to-be-verified digest hash value corresponding to the file to be verified is calculated through the above steps, that is, the total-to-be-verified MD5.
  • FIG. 4 is a schematic flowchart of a third embodiment of a method for proofreading migrated data in this application.
  • the step S40 specifically includes:
  • Step S41 judging whether the total standard digest hash value is the same as the total digest hash value to be verified, so as to perform file verification on the files to be verified after migration in the cloud;
  • Step S42 If the total standard digest hash value is different from the total digest hash value to be verified, compare the batch standard digest hash value with the corresponding batch digest hash value to be verified Yes, to verify the sub-files in batches with migration exceptions;
  • Step S43 If the total standard digest hash value is the same as the total digest hash value to be verified, it is determined that the file to be verified is successfully migrated, and a corresponding file migration success reminder message is generated.
  • the probability of file migration errors is small, and the first three are more likely to appear. That is, the efficiency is increased by nearly 1000 times. Moreover, most of the comparisons are on the migration server, which only needs to go through a limited number of network transmissions. .
  • the embodiment of the present application also provides a proofreading device for migrated data.
  • FIG. 5 is a schematic diagram of the functional modules of the first embodiment of the proofreading device for migrating data in this application.
  • the proofreading device for migration data includes:
  • the migration file determination module 10 is used to obtain the files to be migrated before the migration and the files to be verified after the migration in the cloud when the data migration instruction is detected;
  • the first MD5 calculation module 20 is configured to calculate the sub-standard digest hash value corresponding to each sub-file to be migrated in the file to be migrated, and calculate the hash value of each sub-standard digest hash value and the size of each sub-file to be migrated The total standard digest hash value corresponding to the file to be migrated;
  • the second MD5 calculation module 30 is configured to calculate the sub-to-be-verified digest hash value corresponding to each sub-file to be verified in the file to be verified, and based on the hash value of each sub-to-be-verified digest and each sub-file to be verified Verify the size of the sub-file, and calculate the total hash value of the digest to be verified corresponding to the file to be verified;
  • the migration data proofreading module 40 is configured to proofread the document to be verified according to the total standard digest hash value and the total digest hash value to be verified. If the total standard digest hash value is equal to the If the total hash value of the digest to be verified is the same, it is determined that the file to be verified is successfully migrated, and a corresponding file migration success reminder message is generated.
  • the proofreading device for the migrated data further includes:
  • the file order module is used to arrange the sub-files to be migrated in the source terminal in order according to preset arranging rules, and upload the arranged sub-files to be migrated to the cloud in order.
  • the first MD5 calculation module 20 specifically includes:
  • the first standard calculation unit is used to calculate the hash value of the sub-standard summary corresponding to each sub-file to be migrated in the file to be migrated, and to compare the size of the sub-file to be migrated corresponding to the sub-file to be migrated and the sub-standard summary
  • the hash value is set as the sub-standard meta information corresponding to the sub-file to be migrated;
  • the second standard calculation unit is configured to sequentially splice the predetermined number of substandard meta information corresponding to the sub files to be migrated according to the arrangement order of the sub files to generate standard batch meta information;
  • the third standard calculation unit is used to calculate the batch standard digest hash value corresponding to the batch meta information of the standard, and calculate the total standard digest corresponding to the file to be migrated based on the batch standard digest hash value Hash value.
  • the third standard calculation unit is also used for:
  • the second MD5 calculation module 30 specifically includes:
  • the first to-be-verified calculation unit is used to calculate the sub-to-be-verified digest hash value corresponding to each of the to-be-verified sub-files in the to-be-verified file, and to compare the to-be-verified sub-file corresponding to the syndrome to be verified
  • the size and the hash value of the sub-to-be-verified digest are set to the sub-to-be-verified meta information corresponding to the sub-file to be verified;
  • the second to-be-verified calculation unit is configured to sequentially splice the sub-to-be-verified meta information corresponding to the preset number of the sub-files to be verified according to the arrangement order of the sub-files to generate batches of sub-to-be Check meta information;
  • the third to-be-verified calculation unit is used to calculate the batch-to-be-verified digest hash value corresponding to the batch of sub-to-be-verified meta-information, and based on the batch-to-be-verified digest hash value, and to compare each sub-to-be-verified digest hash value
  • the batch of digest hash values to be verified are sequentially spliced for a preset number of times, and a digest hash value of a file to be verified is calculated as the total digest hash value to be verified corresponding to the file to be verified.
  • the migration data proofreading module 40 specifically includes:
  • the first MD5 proofreading unit is configured to determine whether the total standard digest hash value is the same as the total digest hash value to be verified, so as to perform file proofreading on the files to be verified after migration in the cloud;
  • the second MD5 proofreading unit is configured to, if the hash value of the total standard digest is different from the hash value of the total digest to be verified, compare the hash value of the batch of standard digests with the corresponding batch of digests to be verified The hash value is compared to verify the batch of sub-files with migration abnormalities;
  • the migration success reminder unit is configured to, if the total standard digest hash value is the same as the total digest hash value to be verified, determine that the file to be verified is successfully migrated, and generate a corresponding file migration success reminder message.
  • each module in the above-mentioned migrating data proofreading device corresponds to each step in the above-mentioned migrating data proofreading method embodiment, and its functions and implementation processes will not be repeated here.
  • the embodiments of the present application also provide a computer-readable storage medium.
  • the computer-readable storage medium may be non-volatile or volatile.
  • the computer-readable storage medium of the present application stores a proofreading program for migrated data, where the proofreading program for migrated data is executed by a processor to implement the steps of the above-mentioned proofreading method for migrated data.
  • the method implemented when the proofreading program of migrated data is executed can refer to the various embodiments of the proofreading method for migrated data of this application, which will not be repeated here.
  • the technical solution of this application essentially or the part that contributes to the existing technology can be embodied in the form of a software product, and the computer software product is stored in a storage medium (such as ROM/RAM) as described above. , Magnetic disks, optical disks), including several instructions to make a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) execute the method described in each embodiment of the present application.
  • a terminal device which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.

Abstract

A checking method, apparatus, and device for data migration, and a storage medium. The method comprises: when a data migration instruction is detected, obtaining a file to be migrated before migration in a source and a file to be verified after migration in a cloud (S10); calculating sub-standard digest hash values corresponding to sub-files to be migrated in the file to be migrated, and calculating, on the basis of the sub-standard digest hash values and the sizes of the sub-files to be migrated, a total standard digest hash value corresponding to the file to be migrated (S20); calculating sub-digest hash values to be verified corresponding to sub-files to be verified in the file to be verified, and calculating, on the basis of the sub-digest hash values to be verified and the sizes of the sub-files to be verified, a total digest hash value to be verified corresponding to the file to be verified (S30); and checking the file to be verified according to the total standard digest hash value and the total digest hash value to be verified, if the total standard digest hash value and the total digest hash value to be verified are the same, determining that the file to be verified is successfully migrated, and generating a corresponding file migration success prompt message (S40). The method reduces the number of file comparisons, improves the file migration efficiency, and reduces the migration cost.

Description

迁移数据的校对方法、装置、设备及存储介质Proofreading method, device, equipment and storage medium of migrated data
相关申请的交叉引用Cross-references to related applications
本申请申明享有2020年02月12日递交的申请号为CN202010091715.8、名称为“迁移数据的校对方法、装置、设备及存储介质”的中国专利申请的优先权,该中国专利申请的整体内容以参考的方式结合在本申请中。This application affirms that it enjoys the priority of the Chinese patent application with the application number CN202010091715.8 filed on February 12, 2020, and the title of "The proofreading method, device, equipment and storage medium of migrated data", and the overall content of the Chinese patent application Incorporated in this application by reference.
技术领域Technical field
本申请涉及数据处理技术领域,尤其涉及一种迁移数据的校对方法、装置、设备及计算机可读存储介质。This application relates to the field of data processing technology, and in particular to a proofreading method, device, device, and computer-readable storage medium for migrating data.
背景技术Background technique
随着云计算的推广,越来越多的用户需要将数据迁移到云端进行存储,特别是对象存储。迁移的数据量很大,达到TB甚至PB级。数据上传到对象存储过程中,可能会出现漏迁、误迁,网络传输丢失数据包等错误。为了保证数据的完备性,一定需要做数据对账。传统做数据对账的办法,往往把上传前、上传后的数据一一进行对比。不同的场景下,对比的方法也不同。如逐个对比文件的大小、MD5(Message-Digest Algorithm,消息摘要算法),一旦发现有一个文件不对,则需将原文件重新上传,并再次重复上述数据校对步骤,直到全部完成。发明人意识到,上述逐个文件对比的办法虽然能保证准确性,但因为逐个文件进行数据校对,每次数据校对都要经过网络传输文件大小、MD5,不仅数据校对效率低下,而且增加了数据校对成本。因此,如何解决现有数据校对效率低下以及数据校对成本较高的技术问题,成为了目前亟待解决的技术问题。With the promotion of cloud computing, more and more users need to migrate data to the cloud for storage, especially object storage. The amount of migrated data is very large, reaching terabytes or even petabytes. In the process of uploading data to object storage, there may be errors such as missed migration, wrong migration, and loss of data packets during network transmission. In order to ensure the completeness of the data, data reconciliation must be done. The traditional method of data reconciliation often compares the data before and after the upload one by one. In different scenarios, the method of comparison is also different. If you compare the file size and MD5 (Message-Digest Algorithm) one by one, once a file is found to be incorrect, you need to re-upload the original file and repeat the above data proofreading steps again until all are completed. The inventor realizes that although the above-mentioned method of file-by-file comparison can ensure the accuracy, because data calibration is performed on a file-by-file basis, the file size and MD5 must be transmitted through the network for each data calibration, which not only reduces the efficiency of data calibration, but also increases data calibration. cost. Therefore, how to solve the technical problems of low efficiency of data proofreading and high cost of data proofreading has become a technical problem to be solved urgently at present.
发明内容Summary of the invention
本申请的主要目的在于提供一种迁移数据的校对方法、装置、设备及计算机可读存储介质,旨在解决现有数据校对效率低下以及数据校对成本较高的技术问题。The main purpose of this application is to provide a proofreading method, device, device, and computer-readable storage medium for migrating data, aiming to solve the existing technical problems of low data proofreading efficiency and high data proofing cost.
为实现上述目的,本申请提供一种迁移数据的校对方法,所述迁移数据的校对方法包括以下步骤:In order to achieve the above objective, this application provides a proofreading method for migrated data, and the proofreading method for migrated data includes the following steps:
在检测到数据迁移指令时,在源端中获取迁移前的待迁移文件以及云端中迁移后的待校验文件;When the data migration instruction is detected, the files to be migrated before migration and the files to be verified after migration in the cloud are obtained from the source;
计算所述待迁移文件中各个待迁移子文件对应的子标准摘要散列值,并基于各个子标准摘要散列值以及各个待迁移子文件大小,计算所述待迁移文件对应的总标准摘要散列值;Calculate the sub-standard digest hash value corresponding to each sub-file to be migrated in the file to be migrated, and calculate the total standard digest hash value corresponding to the file to be migrated based on the hash value of each sub-standard digest and the size of each sub-file to be migrated Column value
计算所述待校验文件中的各个待校验子文件对应的子待校验摘要散列值,并基于各个子待校验摘要散列值以及各个待校验子文件大小,计算所述待校验文件对应的总待校验摘要散列值;Calculate the sub-to-be-verified digest hash value corresponding to each sub-file to be verified in the file to be verified, and calculate the to-be-verified sub-file based on the hash value of each sub-to-be-verified digest and the size of each sub-file to be verified The total hash value of the digest to be verified corresponding to the verification file;
根据所述总标准摘要散列值与所述总待校验摘要散列值对所述待校验文件进行校对,若所述总标准摘要散列值与所述总待校验摘要散列值相同,则判定所述待校验文件迁移成功,并生成对应的文件迁移成功提醒消息。The document to be verified is collated according to the total standard digest hash value and the total digest hash value to be verified, if the total standard digest hash value and the total digest hash value to be verified If they are the same, it is determined that the file to be verified is successfully migrated, and a corresponding file migration successful reminder message is generated.
此外,为实现上述目的,本申请还提供一种迁移数据的校对装置,所述迁移数据的校对装置包括:In addition, in order to achieve the above objective, the present application also provides a proofreading device for migrated data, and the proofreading device for migrated data includes:
迁移文件确定模块,用于在检测到数据迁移指令时,在源端中获取迁移前的待迁移文件以及云端中迁移后的待校验文件;The migration file determination module is used to obtain the files to be migrated before migration and the files to be verified after migration in the cloud when the data migration instruction is detected;
第一MD5计算模块,用于计算所述待迁移文件中各个待迁移子文件对应的子标准摘要散列值,并基于各个子标准摘要散列值以及各个待迁移子文件大小,计算所述待迁移文件对应的总标准摘要散列值;The first MD5 calculation module is used to calculate the sub-standard digest hash value corresponding to each sub-file to be migrated in the file to be migrated, and calculate the to-be-migrated sub-file based on the hash value of each sub-standard digest and the size of each sub-file to be migrated. The total standard digest hash value corresponding to the migration file;
第二MD5计算模块,用于计算所述待校验文件中的各个待校验子文件对应的子待校验摘要散列值,并基于各个子待校验摘要散列值以及各个待校验子文件大小,计算所述待校验文件对应的总待校验摘要散列值;The second MD5 calculation module is used to calculate the sub-to-be-verified digest hash value corresponding to each sub-file to be verified in the file to be verified, and based on the hash value of each sub-to-be-verified digest and each to-be-verified Sub-file size, calculating the total hash value of the digest to be verified corresponding to the file to be verified;
迁移数据校对模块,用于根据所述总标准摘要散列值与所述总待校验摘要散列值对所述待校验文件进行校对,若所述总标准摘要散列值与所述总待校验摘要散列值相同,则判定所述待校验文件迁移成功,并生成对应的文件迁移成功提醒消息。The migration data proofreading module is used to proofread the file to be verified according to the total standard digest hash value and the total digest hash value to be verified. If the total standard digest hash value is compared with the total If the hash value of the digest to be verified is the same, it is determined that the file to be verified is successfully migrated, and a corresponding file migration success reminder message is generated.
此外,为实现上述目的,本申请还提供一种迁移数据的校对设备,所述迁移数据的校对设备包括处理器、存储器、以及存储在所述存储器上并可被所述处理器执行的迁移数据的校对程序,其中所述迁移数据的校对程序被所述处理器执 行时,实现上述的迁移数据的校对方法的如下步骤:In addition, in order to achieve the above-mentioned object, the present application also provides a proofreading device for migrated data. The proofreading device for migrated data includes a processor, a memory, and migrated data that is stored on the memory and can be executed by the processor. The proofreading program of the migration data, wherein when the proofreading program of the migration data is executed by the processor, the following steps of the proofreading method of the migration data are implemented:
在检测到数据迁移指令时,在源端中获取迁移前的待迁移文件以及云端中迁移后的待校验文件;When the data migration instruction is detected, the files to be migrated before migration and the files to be verified after migration in the cloud are obtained from the source;
计算所述待迁移文件中各个待迁移子文件对应的子标准摘要散列值,并基于各个子标准摘要散列值以及各个待迁移子文件大小,计算所述待迁移文件对应的总标准摘要散列值;Calculate the sub-standard digest hash value corresponding to each sub-file to be migrated in the file to be migrated, and calculate the total standard digest hash value corresponding to the file to be migrated based on the hash value of each sub-standard digest and the size of each sub-file to be migrated Column value
计算所述待校验文件中的各个待校验子文件对应的子待校验摘要散列值,并基于各个子待校验摘要散列值以及各个待校验子文件大小,计算所述待校验文件对应的总待校验摘要散列值;Calculate the sub-to-be-verified digest hash value corresponding to each sub-file to be verified in the file to be verified, and calculate the to-be-verified sub-file based on the hash value of each sub-to-be-verified digest and the size of each sub-file to be verified The total hash value of the digest to be verified corresponding to the verification file;
根据所述总标准摘要散列值与所述总待校验摘要散列值对所述待校验文件进行校对,若所述总标准摘要散列值与所述总待校验摘要散列值相同,则判定所述待校验文件迁移成功,并生成对应的文件迁移成功提醒消息。The document to be verified is collated according to the total standard digest hash value and the total digest hash value to be verified, if the total standard digest hash value and the total digest hash value to be verified If they are the same, it is determined that the file to be verified is successfully migrated, and a corresponding file migration successful reminder message is generated.
此外,为实现上述目的,本申请还提供一种计算机可读存储介质,所述计算机可读存储介质上存储有迁移数据的校对程序,其中所述迁移数据的校对程序被处理器执行时,实现上述的迁移数据的校对方法的如下步骤:在检测到数据迁移指令时,在源端中获取迁移前的待迁移文件以及云端中迁移后的待校验文件;In addition, in order to achieve the above object, this application also provides a computer-readable storage medium on which a proofreading program for migration data is stored, wherein the proofreading program for migration data is executed by a processor. The above-mentioned proofreading method of migration data has the following steps: when a data migration instruction is detected, the file to be migrated before migration and the file to be verified after migration in the cloud are obtained from the source end;
计算所述待迁移文件中各个待迁移子文件对应的子标准摘要散列值,并基于各个子标准摘要散列值以及各个待迁移子文件大小,计算所述待迁移文件对应的总标准摘要散列值;Calculate the sub-standard digest hash value corresponding to each sub-file to be migrated in the file to be migrated, and calculate the total standard digest hash value corresponding to the file to be migrated based on the hash value of each sub-standard digest and the size of each sub-file to be migrated Column value
计算所述待校验文件中的各个待校验子文件对应的子待校验摘要散列值,并基于各个子待校验摘要散列值以及各个待校验子文件大小,计算所述待校验文件对应的总待校验摘要散列值;Calculate the sub-to-be-verified digest hash value corresponding to each sub-file to be verified in the file to be verified, and calculate the to-be-verified sub-file based on the hash value of each sub-to-be-verified digest and the size of each sub-file to be verified The total hash value of the digest to be verified corresponding to the verification file;
根据所述总标准摘要散列值与所述总待校验摘要散列值对所述待校验文件进行校对,若所述总标准摘要散列值与所述总待校验摘要散列值相同,则判定所述待校验文件迁移成功,并生成对应的文件迁移成功提醒消息。The document to be verified is collated according to the total standard digest hash value and the total digest hash value to be verified, if the total standard digest hash value and the total digest hash value to be verified If they are the same, it is determined that the file to be verified is successfully migrated, and a corresponding file migration successful reminder message is generated.
本申请提供一种迁移数据的校对方法,通过在检测到数据迁移指令时,在源端中获取迁移前的待迁移文件以及云端中迁移后的待校验文件;计算所述待迁移 文件中各个待迁移子文件对应的子标准摘要散列值,并基于各个子标准摘要散列值以及各个待迁移子文件大小,计算所述待迁移文件对应的总标准摘要散列值;计算所述待校验文件中的各个待校验子文件对应的子待校验摘要散列值,并基于各个子待校验摘要散列值以及各个待校验子文件大小,计算所述待校验文件对应的总待校验摘要散列值;根据所述总标准摘要散列值与所述总待校验摘要散列值对所述待校验文件进行校对,若所述总标准摘要散列值与所述总待校验摘要散列值相同,则判定所述待校验文件迁移成功,并生成对应的文件迁移成功提醒消息。通过上述方式,本申请通过所述源端中待迁移文件中各个待迁移子文件的各个子标准摘要散列值值以及所述云端中迁移后的待校验文件中各个待校验子文件的各个子文件待校验标准MD5值,分别拼接计算生成所述待迁移文件对应的总标准摘要散列值以及所述待校验文件对应的总待校验摘要散列值,并通过直接比对总标准摘要散列值以及总待校验摘要散列值,确定文件迁移是否发生异常,减少了文件比对次数,提升了文件迁移效率,降低了迁移成本,解决了现有数据校对效率低下以及数据校对成本较高的技术问题。This application provides a proofreading method for migration data, by obtaining the files to be migrated before migration and the files to be verified after migration in the cloud when the data migration instruction is detected; calculating each of the files to be migrated The sub-standard summary hash value corresponding to the sub-file to be migrated is calculated, and the total standard summary hash value corresponding to the file to be migrated is calculated based on the hash value of each sub-standard summary and the size of each sub-file to be migrated; Verify the hash value of the sub-to-be-verified digest corresponding to each sub-file to be verified, and calculate the corresponding sub-file to be verified based on the hash value of each sub-to-be-verified digest and the size of each sub-file to be verified The total hash value of the digest to be verified; the document to be verified is collated according to the hash value of the total standard digest and the hash value of the total digest to be verified. If the total hash value of the digest to be verified is the same, it is determined that the file to be verified is successfully migrated, and a corresponding file migration success reminder message is generated. In the above manner, this application uses the hash value of each sub-standard digest of each sub-file to be migrated in the file to be migrated in the source and the value of each sub-file to be verified in the file to be verified after migration in the cloud. The standard MD5 value of each sub-file to be verified is respectively spliced and calculated to generate the total standard digest hash value corresponding to the file to be migrated and the total digest hash value to be verified corresponding to the file to be verified, and through direct comparison The total standard summary hash value and the total pending summary hash value are used to determine whether the file migration is abnormal, reduce the number of file comparisons, improve the efficiency of file migration, reduce migration costs, and solve the inefficiency of existing data proofreading. The technical problem of the high cost of data proofreading.
发明概述Summary of the invention
技术问题technical problem
问题的解决方案The solution to the problem
发明的有益效果The beneficial effects of the invention
对附图的简要说明Brief description of the drawings
附图说明Description of the drawings
图1为本申请实施例方案中涉及的迁移数据的校对设备的硬件结构示意图;FIG. 1 is a schematic diagram of the hardware structure of a proofreading device for migrating data involved in a solution of an embodiment of the application;
图2为本申请迁移数据的校对方法第一实施例的流程示意图;2 is a schematic flowchart of a first embodiment of a method for proofreading migrated data in an application;
图3为本申请迁移数据的校对方法第二实施例的流程示意图;FIG. 3 is a schematic flowchart of a second embodiment of a method for proofreading migrated data in an application;
图4为本申请迁移数据的校对方法第三实施例的流程示意图;4 is a schematic flowchart of a third embodiment of a method for proofreading migrated data in an application;
图5为本申请迁移数据的校对装置第一实施例的功能模块示意图。FIG. 5 is a schematic diagram of the functional modules of the first embodiment of the proofreading device for migrating data according to this application.
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The realization, functional characteristics, and advantages of the purpose of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings.
具体实施方式Detailed ways
应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。It should be understood that the specific embodiments described here are only used to explain the present application, and are not used to limit the present application.
本申请实施例涉及的迁移数据的校对方法主要应用于迁移数据的校对设备,该迁移数据的校对设备可以是PC、便携计算机、移动终端等具有显示和处理功能的设备。The proofreading method of migrated data involved in the embodiments of this application is mainly applied to proofreading equipment for migrated data. The proofreading equipment for migrated data may be devices with display and processing functions such as PCs, portable computers, and mobile terminals.
参照图1,图1为本申请实施例方案中涉及的迁移数据的校对设备的硬件结构示意图。本申请实施例中,迁移数据的校对设备可以包括处理器1001(例如CPU),通信总线1002,用户接口1003,网络接口1004,存储器1005。其中,通信总线1002用于实现这些组件之间的连接通信;用户接口1003可以包括显示屏(Display)、输入单元比如键盘(Keyboard);网络接口1004可选的可以包括标准的有线接口、无线接口(如WI-FI接口);存储器1005可以是高速RAM存储器,也可以是稳定的存储器(non-volatile memory),例如磁盘存储器,存储器1005可选的还可以是独立于前述处理器1001的存储装置。Referring to FIG. 1, FIG. 1 is a schematic diagram of the hardware structure of the proofreading device for migrating data involved in the solution of the embodiment of the application. In the embodiment of the present application, the proofreading device for migrating data may include a processor 1001 (for example, a CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components; the user interface 1003 may include a display (Display), an input unit such as a keyboard (Keyboard); the network interface 1004 may optionally include a standard wired interface, a wireless interface (Such as WI-FI interface); the memory 1005 can be a high-speed RAM memory, or a non-volatile memory (non-volatile memory), such as a disk memory. The memory 1005 can optionally be a storage device independent of the aforementioned processor 1001 .
本领域技术人员可以理解,图1中示出的硬件结构并不构成对迁移数据的校对设备的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置。Those skilled in the art can understand that the hardware structure shown in FIG. 1 does not constitute a limitation on the proofreading device for migrating data, and may include more or less components than shown in the figure, or a combination of certain components, or different components Layout.
继续参照图1,图1中作为一种计算机可读存储介质的存储器1005可以包括操作系统、网络通信模块以及迁移数据的校对程序。Continuing to refer to FIG. 1, the memory 1005 as a computer-readable storage medium in FIG. 1 may include an operating system, a network communication module, and a proofreading program for migrating data.
在图1中,网络通信模块主要用于连接服务器,与服务器进行数据通信;而处理器1001可以调用存储器1005中存储的迁移数据的校对程序,并执行本申请实施例提供的迁移数据的校对方法。In FIG. 1, the network communication module is mainly used to connect to the server and perform data communication with the server; and the processor 1001 can call the proofreading program of the migration data stored in the memory 1005, and execute the proofreading method of the migration data provided in the embodiment of the application .
本申请实施例提供了一种迁移数据的校对方法。The embodiment of the present application provides a proofreading method for migrated data.
参照图2,图2为本申请迁移数据的校对方法第一实施例的流程示意图。Referring to FIG. 2, FIG. 2 is a schematic flowchart of a first embodiment of a method for proofreading migrated data in this application.
本实施例中,所述迁移数据的校对方法包括以下步骤:In this embodiment, the proofreading method of the migration data includes the following steps:
步骤S10,在检测到数据迁移指令时,在源端中获取迁移前的待迁移文件以及云端中迁移后的待校验文件;Step S10, when the data migration instruction is detected, the files to be migrated before migration and the files to be verified after migration in the cloud are obtained from the source end;
传统做数据对账的办法,往往把上传前、上传后的数据一一进行对比。不同的场景下,对比的方法也不同。如逐个对比文件的大小、MD5(Message-Digest  Algorithm,消息摘要算法),一旦发现有一个文件不对,则需将原文件重新上传,并再次重复上述数据校对步骤,直到全部完成。上述逐个文件对比的办法虽然能保证准确性,但因为逐个文件进行数据校对,每次数据校对都要经过网络传输文件大小、MD5,不仅数据校对效率低下,而且增加了数据校对成本。为了解决上述问题,本申请通过所述源端中待迁移文件中各个待迁移子文件的各个子文件标准MD5值,即子标准摘要散列值以及所述云端中迁移后的待校验文件中各个待校验子文件的各个子文件待校验标准MD5值,分别拼接计算生成所述待迁移文件对应的总标准MD5,即总标准摘要散列值以及所述待校验文件对应的总待校验MD5,即总待校验摘要散列值,并通过直接比对总标准MD5,即总标准摘要散列值以及总待校验MD5,即总待校验摘要散列值,确定文件迁移是否发生异常,减少了文件比对次数,提升了文件迁移效率,降低了迁移成本。The traditional method of data reconciliation often compares the data before and after the upload one by one. In different scenarios, the method of comparison is also different. If you compare the file size and MD5 (Message-Digest Algorithm) one by one, once a file is found to be incorrect, you need to re-upload the original file and repeat the above data proofreading steps again until all are completed. Although the above-mentioned file-by-file comparison method can ensure accuracy, the file size and MD5 must be transmitted through the network for each file-by-file data calibration, which not only has low efficiency in data calibration, but also increases the cost of data calibration. In order to solve the above problems, this application adopts the standard MD5 value of each sub-file of each sub-file to be migrated in the file to be migrated in the source end, that is, the sub-standard digest hash value and the file to be verified after migration in the cloud. The MD5 value of each sub-file to be verified standard of each sub-file to be verified is respectively spliced and calculated to generate the total standard MD5 corresponding to the file to be migrated, that is, the total standard digest hash value and the total standard MD5 value corresponding to the file to be verified. Verify MD5, which is the total hash value of the digest to be verified, and determine the file migration by directly comparing the total standard MD5, which is the total standard digest hash value and the total to be verified MD5, which is the digest hash value of the total to be verified Whether there is an abnormality, the number of file comparisons is reduced, the file migration efficiency is improved, and the migration cost is reduced.
其中,所述步骤S10之前,还包括:Wherein, before the step S10, it further includes:
根据预设排列规则,将所述源端中的各个待迁移子文件进行顺序排列,并将排列后的各个待迁移子文件顺序上传至所述云端。According to a preset arrangement rule, the sub-files to be migrated in the source end are arranged in order, and the arranged sub-files to be migrated are sequentially uploaded to the cloud.
其中,根据文件名的字典序顺序,将所述源端中的各个待迁移子文件进行顺序排列,并将排列后的各个待迁移子文件顺序上传至所述云端。Wherein, according to the lexicographic order of the file name, the sub-files to be migrated in the source end are sequentially arranged, and the arranged sub-files to be migrated are sequentially uploaded to the cloud.
具体地,MD5(Message-Digest Algorithm,MD5消息摘要算法)是一种被广泛使用的密码散列函数,可以产生出一个128位(16字节)的散列值(hash value),用于确保信息传输完整一致。将待迁移文件顺序排列的方式很多,例如,如果待迁移文件是在各个目录下的,即文件存储路径不同,则分按照别文件名的字典序排序,例如,文件file1排名在file2之前。按照排列的文件顺序,执行待迁移文件的迁移程序,即将待迁移文件由源端按需逐个依次上传到云端进行存储。Specifically, MD5 (Message-Digest Algorithm, MD5 message digest algorithm) is a widely used cryptographic hash function that can generate a 128-bit (16-byte) hash value to ensure Information transmission is complete and consistent. There are many ways to arrange the files to be migrated. For example, if the files to be migrated are in various directories, that is, the file storage paths are different, they are sorted in lexicographical order of individual file names. For example, file file1 is ranked before file2. According to the sequence of the arranged files, the migration procedure of the files to be migrated is executed, that is, the files to be migrated are uploaded to the cloud one by one on demand from the source for storage.
步骤S20,计算所述待迁移文件中各个待迁移子文件对应的子标准摘要散列值,并基于各个子标准摘要散列值以及各个待迁移子文件大小,计算所述待迁移文件对应的总标准摘要散列值;Step S20: Calculate the hash value of the sub-standard summary corresponding to each sub-file to be migrated in the file to be migrated, and calculate the total corresponding to the file to be migrated based on the hash value of each sub-standard summary and the size of each sub-file to be migrated. Standard digest hash value;
本实施例中,在上传过程中,在源端中计算所述待迁移文件中各个待迁移子文 件对应的子文件标准MD5,即子标准摘要散列值,并保存各个子文件待迁移子文件对应的标准MD5。其中,所述待迁移子文件对应的标准MD5可以为仅根据所述待迁移文件大小计算出MD5,还可以为根据所述待迁移文件大小计算出MD5之后,再根据所述待迁移文件大小及其对应的MD5进一步计算出所述标准MD5以及所述待校验MD5。In this embodiment, during the upload process, the source end calculates the sub-file standard MD5 corresponding to each sub-file to be migrated in the file to be migrated, that is, the sub-standard digest hash value, and saves each sub-file to be migrated sub-file Corresponding standard MD5. Wherein, the standard MD5 corresponding to the sub-file to be migrated may be that the MD5 is calculated only based on the size of the file to be migrated, or it may be that the MD5 is calculated according to the size of the file to be migrated, and then according to the size of the file to be migrated and The corresponding MD5 is further calculated to calculate the standard MD5 and the MD5 to be verified.
步骤S30,计算所述待校验文件中的各个待校验子文件对应的子待校验摘要散列值,并基于各个子待校验摘要散列值以及各个待校验子文件大小,计算所述待校验文件对应的总待校验摘要散列值;Step S30: Calculate the sub-to-be-verified digest hash value corresponding to each sub-file to be verified in the file to be verified, and calculate based on the hash value of each sub-to-be-verified digest and the size of each sub-file to be verified The total hash value of the digest to be verified corresponding to the file to be verified;
本实施例中,参照步骤S20的计算步骤计算出迁移至所述云端中的待校验文件,计算所述待校验文件中各个待校验子文件对应的子待校验摘要散列值,并保存各个子文件待校验子文件对应的待校验MD5。In this embodiment, the file to be verified migrated to the cloud is calculated with reference to the calculation step of step S20, and the sub-to-be-verified digest hash value corresponding to each sub-file to be verified in the file to be verified is calculated. And save the MD5 to be verified corresponding to each sub-file to be verified.
步骤S40,根据所述总标准摘要散列值与所述总待校验摘要散列值对所述待校验文件进行校对,若所述总标准摘要散列值与所述总待校验摘要散列值相同,则判定所述待校验文件迁移成功,并生成对应的文件迁移成功提醒消息。Step S40, the document to be verified is collated according to the total standard digest hash value and the total digest hash value to be verified, if the total standard digest hash value and the total digest hash value to be verified If the hash value is the same, it is determined that the file to be verified is successfully migrated, and a corresponding file migration successful reminder message is generated.
本实施例中,通过直接比对源端、云端的总标准MD5,即总标准摘要散列值与所述总待校验MD5,即总待校验摘要散列值,如果两个值完全相同,则证明全部正确迁移。否则进一步进行子文件的校验。In this embodiment, the total standard MD5 of the source and the cloud is directly compared, that is, the total standard digest hash value and the total MD5 to be verified, that is, the total digest hash value to be verified. If the two values are exactly the same , It proves that all migrated correctly. Otherwise, the sub-file verification is further performed.
本实施例提供一种迁移数据的校对方法,通过在检测到数据迁移指令时,在源端中获取迁移前的待迁移文件以及云端中迁移后的待校验文件;计算所述待迁移文件中各个待迁移子文件对应的子标准摘要散列值,并基于各个子标准摘要散列值以及各个待迁移子文件大小,计算所述待迁移文件对应的总标准摘要散列值;计算所述待校验文件中的各个待校验子文件对应的子待校验摘要散列值,并基于各个子待校验摘要散列值以及各个待校验子文件大小,计算所述待校验文件对应的总待校验摘要散列值;根据所述总标准摘要散列值与所述总待校验摘要散列值对所述待校验文件进行校对,若所述总标准摘要散列值与所述总待校验摘要散列值相同,则判定所述待校验文件迁移成功,并生成对应的文件迁移成功提醒消息。通过上述方式,本申请通过所述源端中待迁移文件中各个待迁移子文件的各个子标准摘要散列值值以及所述云端中迁移后的待校验文件 中各个待校验子文件的各个子文件待校验标准MD5值,分别拼接计算生成所述待迁移文件对应的总标准摘要散列值以及所述待校验文件对应的总待校验摘要散列值,并通过直接比对总标准摘要散列值以及总待校验摘要散列值,确定文件迁移是否发生异常,减少了文件比对次数,提升了文件迁移效率,降低了迁移成本,解决了现有数据校对效率低下以及数据校对成本较高的技术问题。This embodiment provides a proofreading method for migrated data. When a data migration instruction is detected, the file to be migrated before migration and the file to be verified after migration in the cloud are obtained from the source end; and the file to be migrated is calculated Each sub-standard digest hash value corresponding to each sub-file to be migrated is calculated, and the total standard digest hash value corresponding to the file to be migrated is calculated based on the digest hash value of each sub-standard and the size of each sub-file to be migrated; The hash value of the sub-to-be-verified summary corresponding to each sub-file to be verified in the verification file is calculated, and the corresponding to the file to be verified is calculated based on the hash value of each sub-to-be-verified summary and the size of each sub-file to be verified The total digest hash value to be verified; the document to be verified is collated according to the total standard digest hash value and the total digest hash value to be verified, if the total standard digest hash value is equal to If the total hash value of the digest to be verified is the same, it is determined that the file to be verified is successfully migrated, and a corresponding file migration success reminder message is generated. In the above manner, this application uses the hash value of each sub-standard digest of each sub-file to be migrated in the file to be migrated in the source and the value of each sub-file to be verified in the file to be verified after migration in the cloud. The standard MD5 value of each sub-file to be verified is respectively spliced and calculated to generate the total standard digest hash value corresponding to the file to be migrated and the total digest hash value to be verified corresponding to the file to be verified, and through direct comparison The total standard summary hash value and the total pending summary hash value are used to determine whether the file migration is abnormal, reduce the number of file comparisons, improve the efficiency of file migration, reduce migration costs, and solve the inefficiency of existing data proofreading. The technical problem of the high cost of data proofreading.
参照图3,图3为本申请迁移数据的校对方法第二实施例的流程示意图。Referring to FIG. 3, FIG. 3 is a schematic flowchart of a second embodiment of a method for proofreading migrated data in this application.
基于上述图2所示实施例,本实施例中,所述步骤S20具体包括:Based on the embodiment shown in FIG. 2 above, in this embodiment, the step S20 specifically includes:
步骤S21,计算所述待迁移文件中各个待迁移子文件对应的子标准摘要散列值,并将所述待迁移子文件对应的待迁移子文件大小以及所述子标准摘要散列值设为所述待迁移子文件对应的子标准元信息;Step S21: Calculate the sub-standard digest hash value corresponding to each sub-file to be migrated in the file to be migrated, and set the size of the sub-file to be migrated corresponding to the sub-file to be migrated and the hash value of the sub-standard digest as The sub-standard meta information corresponding to the sub-file to be migrated;
步骤S22,根据子文件排列顺序,将预设个数的所述待迁移子文件对应的子标准元信息进行顺序拼接,生成标准的分批元信息;Step S22, according to the arrangement order of the sub-files, the preset number of sub-standard meta-information corresponding to the sub-files to be migrated are sequentially spliced to generate standard batch meta-information;
步骤S23,计算所述标准的分批元信息对应的分批标准摘要散列值,并基于所述分批标准摘要散列值,计算所述待迁移文件对应的总标准摘要散列值。Step S23: Calculate the batch standard digest hash value corresponding to the standard batch meta information, and calculate the total standard digest hash value corresponding to the file to be migrated based on the batch standard digest hash value.
其中,所述步骤S23具体包括:Wherein, the step S23 specifically includes:
计算所述标准的分批元信息对应的分批标准摘要散列值,并将各个分批标准摘要散列值顺序拼接预设次数,计算出一个文件标准MD5,作为所述待迁移文件对应的总标准摘要散列值。Calculate the batch standard digest hash value corresponding to the standard batch meta-information, and concatenate each batch standard digest hash value for a preset number of times to calculate a file standard MD5 as the corresponding file to be migrated The total standard digest hash value.
本实施例中,其中,MD5算法的处理过程为:处理待迁移文件,设置初始值,循环加工,拼接结果。MD5算法具体说明如下:In this embodiment, the processing process of the MD5 algorithm is: processing the file to be migrated, setting the initial value, cyclic processing, and splicing the result. The MD5 algorithm is specifically described as follows:
第一步:处理待迁移文件;Step 1: Process the files to be migrated;
首先,我们计算出待迁移文件长度(bit)对512求余的结果,如果不等于448,就需要填充待迁移文件使得待迁移文件长度对512求余的结果等于448。填充的方法是第一位填充1,其余位填充0。填充完后,待迁移文件的长度就是512*N+448。First, we calculate the remainder of the length (bit) of the file to be migrated to 512. If it is not equal to 448, the file to be migrated needs to be filled so that the length of the file to be migrated is equal to 448 for the remainder of 512. The filling method is to fill the first bit with 1 and the remaining bits with 0. After filling, the length of the file to be migrated is 512*N+448.
然后,用剩余的位置(512-448=64位)记录待迁移文件的真正长度,把长度的二进制值补在最后。这样处理后的待迁移文件长度就是512*(N+1)。Then, use the remaining position (512-448=64 bits) to record the true length of the file to be migrated, and add the binary value of the length to the end. The length of the file to be migrated after such processing is 512*(N+1).
第二步:设置初始值;Step 2: Set the initial value;
MD5的哈希结果长度为128位,按每32位分成一组共4组。这4组结果是由4个初始值A、B、C、D经过不断演变得到。MD5的官方实现中,A、B、C、D的初始值如下(16进制):The length of the MD5 hash result is 128 bits, divided into one group for each 32 bits, a total of 4 groups. These 4 sets of results are obtained through continuous evolution of 4 initial values A, B, C, and D. In the official implementation of MD5, the initial values of A, B, C, and D are as follows (hexadecimal):
A=0x01234567、B=0x89ABCDEF、C=0xFEDCBA98、D=0x76543210A=0x01234567, B=0x89ABCDEF, C=0xFEDCBA98, D=0x76543210
第三步:循环加工;The third step: cycle processing;
A,B,C,D就是哈希值的四个分组。每一次循环都会让旧的ABCD产生新的ABCD。一共进行多少次循环呢?由处理后的待迁移文件长度决定。A, B, C, and D are the four groups of hash values. Each cycle will cause the old ABCD to produce a new ABCD. How many cycles do you go through? Determined by the length of the file to be migrated after processing.
假设处理后的待迁移文件长度是M,主循环次数=M/512,每个主循环中包含512/32*4=64次子循环。Assuming that the length of the file to be migrated after processing is M, the number of main loops=M/512, and each main loop contains 512/32*4=64 sub-loops.
第四步:拼接结果;The fourth step: splicing results;
把循环加工最终产生的A,B,C,D四个值拼接在一起,转换成字符串即可。The four values A, B, C and D finally produced by the cycle processing are spliced together and converted into a string.
将每个文件计算出的MD5,作为文件的元信息,并根据预先设置的拼接单位,将预设个数各元信息逐个按文件排序顺序拼接。如,每1000个文件的元信息拼接为一个总文件(根据待迁移文件的具体数量,可适当调整。最小为10,最大为1000),将总文件,即追加累积的元信息,进一步计算总标准MD5,即总标准摘要散列值以及总待校验MD5,即总待校验摘要散列值,即MD5_1000。如下详细描述。The MD5 calculated for each file is used as the meta-information of the file, and the preset number of meta-information is spliced one by one in the file sort order according to the preset splicing unit. For example, the meta information of every 1000 files is spliced into a total file (according to the specific number of files to be migrated, it can be adjusted appropriately. The minimum is 10, the maximum is 1000), the total file, that is, the accumulated meta information is added, and the total is further calculated Standard MD5, that is, the total standard digest hash value and the total MD5 to be verified, that is, the total digest hash value to be verified, namely MD5_1000. It is described in detail as follows.
第一个文件file1,MD5值为MD5_file1;The first file file1, MD5 value is MD5_file1;
第二个文件file2,MD5值为MD5_file2;The second file file2, MD5 value is MD5_file2;
第三个文件file3,MD5值为MD5_file3;The third file file3, MD5 value is MD5_file3;
等等,直到1000个文件。Wait until 1000 files.
而MD5_1000的拼接元信息为:MD5_file1MD5_file2MD5_file3...MD5_file1000。然后,将1000个文件的MD5_1000逐步拼接累加,每1000个MD5_1000再进行计算生成MD5_1000_1000。经过上述重复步骤,源端、云端都会最终生成一个经过有限多次拼接累加计算的MD5值,假设为MD5_1000_1000_1000(对应100万个文件迁移场景),即总标准MD5,即总标准摘要散列值以及总待校验MD5,即总待校验摘要散列值。The splicing meta information of MD5_1000 is: MD5_file1MD5_file2MD5_file3...MD5_file1000. Then, the MD5_1000 of the 1000 files are gradually spliced and accumulated, and the MD5_1000 is calculated every 1000 MD5_1000 to generate MD5_1000_1000. After the above repeated steps, the source and the cloud will finally generate an MD5 value calculated after a finite number of splicing and accumulation. It is assumed to be MD5_1000_1000_1000 (corresponding to 1 million file migration scenarios), that is, the general standard MD5, that is, the general standard digest hash value and MD5 always to be verified, that is, the digest hash value of the total to be verified.
进一步地,当完成所有待迁移文件的数据迁移后,即开始进行数据对账操作。此时只有两种结果,数据全部正确迁移(大概率)、数据迁移过程有错误。Further, when the data migration of all files to be migrated is completed, the data reconciliation operation is started. At this time, there are only two results: all the data is migrated correctly (high probability), and there is an error in the data migration process.
进一步地,所述步骤S30具体包括:Further, the step S30 specifically includes:
计算所述待校验文件中各个待校验子文件对应的子待校验摘要散列值,并将所述校验子文件对应的待校验子文件大小以及所述子待校验摘要散列值设为所述待校验子文件对应的子待校验元信息;Calculate the hash value of the sub-file to be verified corresponding to each sub-file to be verified in the file to be verified, and hash the size of the sub-file to be verified corresponding to the sub-file to be verified and the digest of the sub-file to be verified. The column value is set as the sub-to-be-verified meta information corresponding to the sub-file to be verified;
根据所述子文件排列顺序,将所述预设个数的所述待校验子文件对应的子待校验元信息进行顺序拼接,生成分批子待校验元信息;According to the arrangement order of the sub-files, sequentially splicing the sub-to-be-verified meta information corresponding to the preset number of the sub-files to be verified to generate batches of sub-to-be-verified meta information;
计算所述分批子待校验元信息对应的分批待校验MD5,即分批待校验摘要散列值,基于所述分批待校验MD5,即分批待校验摘要散列值,并将各个分批待校验MD5(即分批待校验摘要散列值)顺序拼接预设次数,计算出一个文件待校验MD5,即文件待校验摘要散列值,作为所述待校验文件对应的总待校验MD5,即总待校验摘要散列值。Calculate the batch-to-be-verified MD5 corresponding to the batch-to-be-verified meta-information, that is, the batch-to-be-verified digest hash value, based on the batch-to-be-verified MD5, that is, the batch-to-be-verified digest hash The MD5 of each batch to be verified (that is, the digest hash value of the batch to be verified) is sequentially spliced for a preset number of times to calculate the MD5 of a file to be verified, that is, the digest hash value of the file to be verified, as the all The total to-be-verified MD5 corresponding to the file to be verified is the hash value of the total to-be-verified digest.
本实施例中,通过上述步骤计算出所述待校验文件对应的总待校验摘要散列值,即总待校验MD5。In this embodiment, the total to-be-verified digest hash value corresponding to the file to be verified is calculated through the above steps, that is, the total-to-be-verified MD5.
参照图4,图4为本申请迁移数据的校对方法第三实施例的流程示意图。Referring to FIG. 4, FIG. 4 is a schematic flowchart of a third embodiment of a method for proofreading migrated data in this application.
基于上述图3所示实施例,本实施例中,所述步骤S40具体包括:Based on the embodiment shown in FIG. 3, in this embodiment, the step S40 specifically includes:
步骤S41,判断所述总标准摘要散列值与所述总待校验摘要散列值是否相同,以对所述云端中迁移后的待校验文件进行文件校对;Step S41, judging whether the total standard digest hash value is the same as the total digest hash value to be verified, so as to perform file verification on the files to be verified after migration in the cloud;
步骤S42,若所述总标准摘要散列值与所述总待校验摘要散列值不同,则将所述分批标准摘要散列值与对应的分批待校验摘要散列值进行比对,以对发生迁移异常的分批子文件进行验证;Step S42: If the total standard digest hash value is different from the total digest hash value to be verified, compare the batch standard digest hash value with the corresponding batch digest hash value to be verified Yes, to verify the sub-files in batches with migration exceptions;
步骤S43,若所述总标准摘要散列值与所述总待校验摘要散列值相同,则判定所述待校验文件迁移成功,并生成对应的文件迁移成功提醒消息。Step S43: If the total standard digest hash value is the same as the total digest hash value to be verified, it is determined that the file to be verified is successfully migrated, and a corresponding file migration success reminder message is generated.
本实施例中,通过直接比对源端的对待迁移文件以及云端的待校验文件MD5_1000_1000_1000,如果两个值完全相同,则证明全部正确迁移。此时对账只发生了一次请求。如果两个值不相同,则需要快速找出错误文件。查找错误文件的过程,需要反着来进行。即在对比MD5_1000_1000_1000不同后,再下一层,比 较1000个MD5_1000_1000,找出源端、云端不相同的值。为了提高效率,这1000个MD5_1000_1000可以批量对账,发到对账程序来比对。如此循环,即可以快速找到MD5值不相同的文件,即迁移过程迁移错误的文件。并快速进行重传。In this embodiment, by directly comparing the file to be migrated at the source end and the file to be verified MD5_1000_1000_1000 in the cloud, if the two values are exactly the same, it is proved that all are migrated correctly. At this time, there was only one request for reconciliation. If the two values are not the same, you need to quickly find the error file. The process of finding the wrong file needs to be reversed. That is, after comparing the differences in MD5_1000_1000_1000, go to the next level and compare 1000 MD5_1000_1000 to find out the different values between the source and the cloud. In order to improve efficiency, these 1000 MD5_1000_1000 can be reconciled in batches and sent to the reconciliation program for comparison. In this cycle, you can quickly find files with different MD5 values, that is, files that have been migrated incorrectly during the migration process. And quickly retransmit.
由此,在保证正确率的前提下,可以实现快速对账;同时,如果一旦有文件迁移错误,也可以快速找出,并完成迁移;网络成本是很高的,如此可大量减少网络传输,降低成本。As a result, under the premise of ensuring the correct rate, quick reconciliation can be achieved; at the same time, if there is a file migration error, it can also be quickly found and completed; the network cost is very high, so network transmission can be greatly reduced. reduce costs.
例如,当待迁移的文件数量为100万个。For example, when the number of files to be migrated is 1 million.
传统做法,需要将源端、云端的文件MD5比对100万次。Traditionally, the MD5 of the source and cloud files needs to be compared 1 million times.
使用本高效做法,分几种情况:Use this efficient approach, divided into several situations:
1、如果迁移完全正确,则需比较1次;1. If the migration is completely correct, a comparison is required;
2、如果迁移过程有1个文件错误,则需比较1000次MD5_1000+N次,则找出错误文件。(N<=1000)2. If there is a file error in the migration process, you need to compare MD5_1000+N times 1000 times to find the wrong file. (N<=1000)
3、同理,如果迁移过程有2个文件失败,则需要比较1000+2N次,找出错误文件。(N<=1000)3. In the same way, if two files fail during the migration process, you need to compare 1000+2N times to find the wrong file. (N<=1000)
4、同理,如果迁移过程文件失败更多,比较的次数更多。约为n个文件失败,则比较1000+nN次。4. In the same way, if there are more file failures in the migration process, the number of comparisons will be more. About n files fail, then compare 1000+nN times.
一般,文件迁移错误的概率小,出现前三种的可能性更大。即效率提升近1000倍。并且,多数对比是在迁移服务器上,只需经过有限次网络传输。。Generally, the probability of file migration errors is small, and the first three are more likely to appear. That is, the efficiency is increased by nearly 1000 times. Moreover, most of the comparisons are on the migration server, which only needs to go through a limited number of network transmissions. .
此外,本申请实施例还提供一种迁移数据的校对装置。In addition, the embodiment of the present application also provides a proofreading device for migrated data.
参照图5,图5为本申请迁移数据的校对装置第一实施例的功能模块示意图。Referring to FIG. 5, FIG. 5 is a schematic diagram of the functional modules of the first embodiment of the proofreading device for migrating data in this application.
本实施例中,所述迁移数据的校对装置包括:In this embodiment, the proofreading device for migration data includes:
迁移文件确定模块10,用于在检测到数据迁移指令时,在源端中获取迁移前的待迁移文件以及云端中迁移后的待校验文件;The migration file determination module 10 is used to obtain the files to be migrated before the migration and the files to be verified after the migration in the cloud when the data migration instruction is detected;
第一MD5计算模块20,用于计算所述待迁移文件中各个待迁移子文件对应的子标准摘要散列值,并基于各个子标准摘要散列值以及各个待迁移子文件大小,计算所述待迁移文件对应的总标准摘要散列值;The first MD5 calculation module 20 is configured to calculate the sub-standard digest hash value corresponding to each sub-file to be migrated in the file to be migrated, and calculate the hash value of each sub-standard digest hash value and the size of each sub-file to be migrated The total standard digest hash value corresponding to the file to be migrated;
第二MD5计算模块30,用于计算所述待校验文件中的各个待校验子文件对应的子待校验摘要散列值,并基于各个子待校验摘要散列值以及各个待校验子文件 大小,计算所述待校验文件对应的总待校验摘要散列值;The second MD5 calculation module 30 is configured to calculate the sub-to-be-verified digest hash value corresponding to each sub-file to be verified in the file to be verified, and based on the hash value of each sub-to-be-verified digest and each sub-file to be verified Verify the size of the sub-file, and calculate the total hash value of the digest to be verified corresponding to the file to be verified;
迁移数据校对模块40,用于根据所述总标准摘要散列值与所述总待校验摘要散列值对所述待校验文件进行校对,若所述总标准摘要散列值与所述总待校验摘要散列值相同,则判定所述待校验文件迁移成功,并生成对应的文件迁移成功提醒消息。The migration data proofreading module 40 is configured to proofread the document to be verified according to the total standard digest hash value and the total digest hash value to be verified. If the total standard digest hash value is equal to the If the total hash value of the digest to be verified is the same, it is determined that the file to be verified is successfully migrated, and a corresponding file migration success reminder message is generated.
进一步地,所述迁移数据的校对装置还包括:Further, the proofreading device for the migrated data further includes:
文件顺序模块,用于根据预设排列规则,将所述源端中的各个待迁移子文件进行顺序排列,并将排列后的各个待迁移子文件顺序上传至所述云端。The file order module is used to arrange the sub-files to be migrated in the source terminal in order according to preset arranging rules, and upload the arranged sub-files to be migrated to the cloud in order.
进一步地,所述第一MD5计算模块20具体包括:Further, the first MD5 calculation module 20 specifically includes:
第一标准计算单元,用于计算所述待迁移文件中各个待迁移子文件对应的子标准摘要散列值,并将所述待迁移子文件对应的待迁移子文件大小以及所述子标准摘要散列值设为所述待迁移子文件对应的子标准元信息;The first standard calculation unit is used to calculate the hash value of the sub-standard summary corresponding to each sub-file to be migrated in the file to be migrated, and to compare the size of the sub-file to be migrated corresponding to the sub-file to be migrated and the sub-standard summary The hash value is set as the sub-standard meta information corresponding to the sub-file to be migrated;
第二标准计算单元,用于根据子文件排列顺序,将预设个数的所述待迁移子文件对应的子标准元信息进行顺序拼接,生成标准的分批元信息;The second standard calculation unit is configured to sequentially splice the predetermined number of substandard meta information corresponding to the sub files to be migrated according to the arrangement order of the sub files to generate standard batch meta information;
第三标准计算单元,用于计算所述标准的分批元信息对应的分批标准摘要散列值,并基于所述分批标准摘要散列值,计算所述待迁移文件对应的总标准摘要散列值。The third standard calculation unit is used to calculate the batch standard digest hash value corresponding to the batch meta information of the standard, and calculate the total standard digest corresponding to the file to be migrated based on the batch standard digest hash value Hash value.
进一步地,所述第三标准计算单元还用于:Further, the third standard calculation unit is also used for:
计算所述标准的分批元信息对应的分批标准摘要散列值,并将各个分批标准摘要散列值顺序拼接预设次数,计算出一个文件标准MD5,作为所述待迁移文件对应的总标准摘要散列值。Calculate the batch standard digest hash value corresponding to the standard batch meta-information, and concatenate each batch standard digest hash value for a preset number of times to calculate a file standard MD5 as the corresponding file to be migrated The total standard digest hash value.
进一步地,所述第二MD5计算模块30具体包括:Further, the second MD5 calculation module 30 specifically includes:
第一待校验计算单元,用于计算所述待校验文件中各个待校验子文件对应的子待校验摘要散列值,并将所述校验子文件对应的待校验子文件大小以及所述子待校验摘要散列值设为所述待校验子文件对应的子待校验元信息;The first to-be-verified calculation unit is used to calculate the sub-to-be-verified digest hash value corresponding to each of the to-be-verified sub-files in the to-be-verified file, and to compare the to-be-verified sub-file corresponding to the syndrome to be verified The size and the hash value of the sub-to-be-verified digest are set to the sub-to-be-verified meta information corresponding to the sub-file to be verified;
第二待校验计算单元,用于根据所述子文件排列顺序,将所述预设个数的所述待校验子文件对应的子待校验元信息进行顺序拼接,生成分批子待校验元信息;The second to-be-verified calculation unit is configured to sequentially splice the sub-to-be-verified meta information corresponding to the preset number of the sub-files to be verified according to the arrangement order of the sub-files to generate batches of sub-to-be Check meta information;
第三待校验计算单元,用于计算所述分批子待校验元信息对应的分批待校验摘要散列值,基于所述分批待校验摘要散列值,并将各个分批待校验摘要散列值顺序拼接预设次数,计算出一个文件待校验摘要散列值,作为所述待校验文件对应的总待校验摘要散列值。The third to-be-verified calculation unit is used to calculate the batch-to-be-verified digest hash value corresponding to the batch of sub-to-be-verified meta-information, and based on the batch-to-be-verified digest hash value, and to compare each sub-to-be-verified digest hash value The batch of digest hash values to be verified are sequentially spliced for a preset number of times, and a digest hash value of a file to be verified is calculated as the total digest hash value to be verified corresponding to the file to be verified.
进一步地,所述迁移数据校对模块40具体包括:Further, the migration data proofreading module 40 specifically includes:
第一MD5校对单元,用于判断所述总标准摘要散列值与所述总待校验摘要散列值是否相同,以对所述云端中迁移后的待校验文件进行文件校对;The first MD5 proofreading unit is configured to determine whether the total standard digest hash value is the same as the total digest hash value to be verified, so as to perform file proofreading on the files to be verified after migration in the cloud;
第二MD5校对单元,用于若所述总标准摘要散列值与所述总待校验摘要散列值不同,则将所述分批标准摘要散列值与对应的分批待校验摘要散列值进行比对,以对发生迁移异常的分批子文件进行验证;The second MD5 proofreading unit is configured to, if the hash value of the total standard digest is different from the hash value of the total digest to be verified, compare the hash value of the batch of standard digests with the corresponding batch of digests to be verified The hash value is compared to verify the batch of sub-files with migration abnormalities;
迁移成功提醒单元,用于若所述总标准摘要散列值与所述总待校验摘要散列值相同,则判定所述待校验文件迁移成功,并生成对应的文件迁移成功提醒消息。The migration success reminder unit is configured to, if the total standard digest hash value is the same as the total digest hash value to be verified, determine that the file to be verified is successfully migrated, and generate a corresponding file migration success reminder message.
其中,上述迁移数据的校对装置中各个模块与上述迁移数据的校对方法实施例中各步骤相对应,其功能和实现过程在此处不再一一赘述。Among them, each module in the above-mentioned migrating data proofreading device corresponds to each step in the above-mentioned migrating data proofreading method embodiment, and its functions and implementation processes will not be repeated here.
此外,本申请实施例还提供一种计算机可读存储介质,所述计算机可读存储介质可以是非易失性,也可以是易失性。In addition, the embodiments of the present application also provide a computer-readable storage medium. The computer-readable storage medium may be non-volatile or volatile.
本申请计算机可读存储介质上存储有迁移数据的校对程序,其中所述迁移数据的校对程序被处理器执行时,实现如上述的迁移数据的校对方法的步骤。The computer-readable storage medium of the present application stores a proofreading program for migrated data, where the proofreading program for migrated data is executed by a processor to implement the steps of the above-mentioned proofreading method for migrated data.
其中,迁移数据的校对程序被执行时所实现的方法可参照本申请迁移数据的校对方法的各个实施例,此处不再赘述。Among them, the method implemented when the proofreading program of migrated data is executed can refer to the various embodiments of the proofreading method for migrated data of this application, which will not be repeated here.
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者系统不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者系统所固有的要素。在没有更多限制的情况下,由语句“包括一个......”限定的要素,并不排除在包括该要素的过程、方法、物品或者系统中还存在另外的相同要素。It should be noted that in this article, the terms "include", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements not only includes those elements, It also includes other elements that are not explicitly listed, or elements inherent to the process, method, article, or system. Without more restrictions, the element defined by the sentence "including a..." does not exclude the existence of other identical elements in the process, method, article, or system that includes the element.
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。The serial numbers of the foregoing embodiments of the present application are for description only, and do not represent the superiority or inferiority of the embodiments.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在如上所述的一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本申请各个实施例所述的方法。Through the description of the above implementation manners, those skilled in the art can clearly understand that the above-mentioned embodiment method can be implemented by means of software plus the necessary general hardware platform, of course, it can also be implemented by hardware, but in many cases the former is better.的实施方式。 Based on this understanding, the technical solution of this application essentially or the part that contributes to the existing technology can be embodied in the form of a software product, and the computer software product is stored in a storage medium (such as ROM/RAM) as described above. , Magnetic disks, optical disks), including several instructions to make a terminal device (which can be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) execute the method described in each embodiment of the present application.
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。The above are only the preferred embodiments of the application, and do not limit the scope of the patent for this application. Any equivalent structure or equivalent process transformation made using the content of the description and drawings of the application, or directly or indirectly applied to other related technical fields , The same reason is included in the scope of patent protection of this application.

Claims (20)

  1. 一种迁移数据的校对方法,其中,所述迁移数据的校对方法包括以下步骤:A proofreading method for migrated data, wherein the proofreading method for migrated data includes the following steps:
    在检测到数据迁移指令时,在源端中获取迁移前的待迁移文件以及云端中迁移后的待校验文件;When the data migration instruction is detected, the files to be migrated before migration and the files to be verified after migration in the cloud are obtained from the source;
    计算所述待迁移文件中各个待迁移子文件对应的标准的子摘要散列值,并基于各个标准的子摘要散列值以及各个待迁移子文件大小,计算所述待迁移文件对应的标准的总摘要散列值;Calculate the standard sub-digest hash value of each sub-file to be migrated in the file to be migrated, and calculate the standard sub-digest hash value corresponding to the file to be migrated based on the sub-digest hash value of each standard and the size of each sub-file to be migrated Total digest hash value;
    计算所述待校验文件中的各个待校验子文件对应的子待校验摘要散列值,并基于各个待校验的子摘要散列值以及各个待校验子文件大小,计算所述待校验文件对应的待校验的总摘要散列值;Calculate the hash value of the sub-digest to be verified corresponding to each sub-file to be verified in the file to be verified, and calculate the hash value of each sub-digest to be verified and the size of each sub-file to be verified The hash value of the total digest to be verified corresponding to the file to be verified;
    根据所述总标准摘要散列值与所述总待校验摘要散列值对所述待校验文件进行校对,若所述总标准摘要散列值与所述总待校验摘要散列值相同,则判定所述待校验文件迁移成功,并生成对应的文件迁移成功提醒消息。The document to be verified is collated according to the total standard digest hash value and the total digest hash value to be verified, if the total standard digest hash value and the total digest hash value to be verified If they are the same, it is determined that the file to be verified is successfully migrated, and a corresponding file migration successful reminder message is generated.
  2. 如权利要求1所述的迁移数据的校对方法,其中,所述在检测到数据迁移指令时,在源端中获取迁移前的待迁移文件以及云端中迁移后的待校验文件的步骤之前,还包括:The method for proofreading migrated data according to claim 1, wherein, when the data migration instruction is detected, before the step of acquiring the files to be migrated before migration and the files to be verified after migration in the cloud in the source end, Also includes:
    根据预设排列规则,将所述源端中的各个待迁移子文件进行顺序排列,并将排列后的各个待迁移子文件顺序上传至所述云端。According to a preset arrangement rule, the sub-files to be migrated in the source end are arranged in order, and the arranged sub-files to be migrated are sequentially uploaded to the cloud.
  3. 如权利要求2所述的迁移数据的校对方法,其中,所述计算所述待迁移文件中各个待迁移子文件对应的子标准摘要散列值,并基于各个子标准摘要散列值以及各个待迁移子文件大小,计算所述待迁移文件对应的总标准摘要散列值的步骤具体包括:The method for proofreading migration data according to claim 2, wherein the calculation of the sub-standard digest hash value corresponding to each sub-file to be migrated in the file to be migrated is based on the hash value of each sub-standard digest and each sub-file to be migrated. The steps of migrating the size of the sub-file and calculating the total standard digest hash value corresponding to the file to be migrated specifically include:
    计算所述待迁移文件中各个待迁移子文件对应的子标准摘要散列值,并将所述待迁移子文件对应的待迁移子文件大小以及所述子标准摘要散列值设为所述待迁移子文件对应的子标准元信息;Calculate the sub-standard summary hash value corresponding to each sub-file to be migrated in the file to be migrated, and set the size of the sub-file to be migrated corresponding to the sub-file to be migrated and the hash value of the sub-standard summary as the Sub-standard meta-information corresponding to the migration sub-file;
    根据所述待迁移子文件的排列顺序,将预设个数的所述待迁移子 文件对应的子标准元信息进行顺序拼接,生成标准的分批元信息;According to the arrangement sequence of the sub-files to be migrated, the preset number of sub-standard meta-information corresponding to the sub-files to be migrated are sequentially spliced to generate standard batch meta-information;
    计算所述标准的分批元信息对应的分批标准摘要散列值,并基于所述标准的分批摘要散列值,计算所述待迁移文件对应的标准的总摘要散列值。Calculate the batch standard digest hash value corresponding to the batch meta-information of the standard, and calculate the standard total digest hash value of the standard corresponding to the file to be migrated based on the standard batch digest hash value.
  4. 如权利要求3所述的迁移数据的校对方法,其中,计算所述待校验文件中的各个待校验子文件对应的子待校验摘要散列值,并基于各个子待校验摘要散列值以及各个待校验子文件大小,计算所述待校验文件对应的总待校验摘要散列值的步骤具体包括:The verification method of migration data according to claim 3, wherein the hash value of the sub-to-be-verified digest corresponding to each sub-file to be verified in the to-be-verified file is calculated, and the hash value of the sub-to-be-verified digest is hashed based on each sub-file to be verified. The column value and the size of each sub-file to be verified, and the step of calculating the total digest hash value to be verified corresponding to the file to be verified specifically includes:
    计算所述待校验文件中各个待校验子文件对应的子待校验摘要散列值,并将所述校验子文件对应的待校验子文件大小以及所述子待校验摘要散列值设为所述待校验子文件对应的子待校验元信息;Calculate the hash value of the sub-file to be verified corresponding to each sub-file to be verified in the file to be verified, and hash the size of the sub-file to be verified corresponding to the sub-file to be verified and the digest of the sub-file to be verified. The column value is set as the sub-to-be-verified meta information corresponding to the sub-file to be verified;
    根据所述子文件排列顺序,将所述预设个数的所述待校验子文件对应的子待校验元信息进行顺序拼接,生成分批子待校验元信息;According to the arrangement order of the sub-files, sequentially splicing the sub-to-be-verified meta information corresponding to the preset number of the sub-files to be verified to generate batches of sub-to-be-verified meta information;
    计算所述分批子待校验元信息对应的分批待校验摘要散列值,基于所述分批待校验摘要散列值,并将各个分批待校验摘要散列值顺序拼接预设次数,计算出一个文件待校验摘要散列值,作为所述待校验文件对应的总待校验摘要散列值。Calculate the hash values of the digests to be verified in batches corresponding to the meta-information of the sub-to-be-verified batches, based on the hash values of the digests to be verified in the batches, and sequentially concatenate the hash values of the digests to be verified in each batch For a preset number of times, the digest hash value of a file to be verified is calculated as the total digest hash value to be verified corresponding to the file to be verified.
  5. 如权利要求4所述的迁移数据的校对方法,其中,所述根据所述总标准摘要散列值与所述总待校验摘要散列值对所述待校验文件进行校对,若所述总标准摘要散列值与所述总待校验摘要散列值相同,则判定所述待校验文件迁移成功,并生成对应的文件迁移成功提醒消息的步骤具体包括:The method for proofreading migration data according to claim 4, wherein the document to be verified is proofread according to the total standard digest hash value and the total digest hash value to be verified, if the If the total standard digest hash value is the same as the total digest hash value to be verified, it is determined that the file to be verified is successfully migrated, and the steps of generating a corresponding file migration success reminder message specifically include:
    判断所述总标准摘要散列值与所述总待校验摘要散列值是否相同,以对所述云端中迁移后的待校验文件进行文件校对;Judging whether the total standard digest hash value is the same as the total digest hash value to be verified, so as to perform file proofreading on the files to be verified after migration in the cloud;
    若所述总标准摘要散列值与所述总待校验摘要散列值不同,则将 所述分批标准摘要散列值与对应的分批待校验摘要散列值进行比对,以对发生迁移异常的分批子文件进行验证;If the total standard digest hash value is different from the total digest hash value to be verified, the batch standard digest hash value is compared with the corresponding batch digest hash value to be verified to Verify the sub-files in batches with migration exceptions;
    若所述总标准摘要散列值与所述总待校验摘要散列值相同,则判定所述待校验文件迁移成功,并生成对应的文件迁移成功提醒消息。If the total standard digest hash value is the same as the total digest hash value to be verified, it is determined that the file to be verified is successfully migrated, and a corresponding file migration success reminder message is generated.
  6. 如权利要求1至5任意一项所述的迁移数据的校对方法,其中,所述根据预设排列规则,将所述源端中的各个待迁移子文件进行顺序排列,并将排列后的各个待迁移子文件顺序上传至所述云端的步骤具体包括:The method for proofreading migrated data according to any one of claims 1 to 5, wherein, according to a preset arrangement rule, the sub-files to be migrated in the source end are arranged in order, and each of the arranged sub-files The steps of sequentially uploading the sub-files to be migrated to the cloud specifically include:
    根据文件名的字典序顺序,将所述源端中的各个待迁移子文件进行顺序排列,并将排列后的各个待迁移子文件顺序上传至所述云端。According to the lexicographic order of the file names, the sub-files to be migrated in the source end are sequentially arranged, and the arranged sub-files to be migrated are sequentially uploaded to the cloud.
  7. 一种迁移数据的校对装置,其中,所述迁移数据的校对装置包括:A proofreading device for migrated data, wherein the proofreading device for migrated data includes:
    迁移文件确定模块,用于在检测到数据迁移指令时,在源端中获取迁移前的待迁移文件以及云端中迁移后的待校验文件;The migration file determination module is used to obtain the files to be migrated before migration and the files to be verified after migration in the cloud when the data migration instruction is detected;
    第一MD5计算模块,用于计算所述待迁移文件中各个待迁移子文件对应的子标准摘要散列值,并基于各个子标准摘要散列值以及各个待迁移子文件大小,计算所述待迁移文件对应的总标准摘要散列值;The first MD5 calculation module is used to calculate the sub-standard digest hash value corresponding to each sub-file to be migrated in the file to be migrated, and calculate the to-be-migrated sub-file based on the hash value of each sub-standard digest and the size of each sub-file to be migrated. The total standard digest hash value corresponding to the migration file;
    第二MD5计算模块,用于计算所述待校验文件中的各个待校验子文件对应的子待校验摘要散列值,并基于各个子待校验摘要散列值以及各个待校验子文件大小,计算所述待校验文件对应的总待校验摘要散列值;The second MD5 calculation module is used to calculate the sub-to-be-verified digest hash value corresponding to each sub-file to be verified in the file to be verified, and based on the hash value of each sub-to-be-verified digest and each to-be-verified Sub-file size, calculating the total hash value of the digest to be verified corresponding to the file to be verified;
    迁移数据校对模块,用于根据所述总标准摘要散列值与所述总待校验摘要散列值对所述待校验文件进行校对,若所述总标准摘要散列值与所述总待校验摘要散列值相同,则判定所述待校验文件迁移成功,并生成对应的文件迁移成功提醒消息。The migration data proofreading module is used to proofread the file to be verified according to the total standard digest hash value and the total digest hash value to be verified. If the total standard digest hash value is compared with the total If the hash value of the digest to be verified is the same, it is determined that the file to be verified is successfully migrated, and a corresponding file migration success reminder message is generated.
  8. 如权利要求7所述的迁移数据的校对装置,其中,所述迁移数据的校对装置还包括迁移文件拼接模块,所述迁移文件拼接模块用于:7. The proofreading device for migration data according to claim 7, wherein the proofreading device for migration data further comprises a migration file splicing module, and the migration file splicing module is used for:
    根据预设排列规则,将所述源端中的各个待迁移子文件进行顺序排列,并将排列后的各个待迁移子文件顺序上传至所述云端;According to a preset arrangement rule, arrange the sub-files to be migrated in the source end in order, and upload the arranged sub-files to be migrated to the cloud in order;
    计算所述待迁移文件中各个待迁移子文件对应的子标准摘要散列值,并将所述待迁移子文件对应的待迁移子文件大小以及所述子标准摘要散列值设为所述待迁移子文件对应的子标准元信息;Calculate the sub-standard summary hash value corresponding to each sub-file to be migrated in the file to be migrated, and set the size of the sub-file to be migrated corresponding to the sub-file to be migrated and the hash value of the sub-standard summary as the Sub-standard meta-information corresponding to the migration sub-file;
    根据所述待迁移子文件的排列顺序,将预设个数的所述待迁移子文件对应的子标准元信息进行顺序拼接,生成标准的分批元信息;According to the arrangement order of the sub-files to be migrated, the preset number of sub-standard meta-information corresponding to the sub-files to be migrated are sequentially spliced to generate standard batch meta-information;
    计算所述标准的分批元信息对应的分批标准摘要散列值,并基于所述分批标准摘要散列值,计算所述待迁移文件对应的总标准摘要散列值。Calculate the batch standard digest hash value corresponding to the standard batch meta information, and calculate the total standard digest hash value corresponding to the file to be migrated based on the batch standard digest hash value.
  9. 一种迁移数据的校对设备,其中,所述迁移数据的校对设备包括处理器、存储器、以及存储在所述存储器上并可被所述处理器执行的迁移数据的校对程序,其中所述迁移数据的校对程序被所述处理器执行时,实现迁移数据的校对方法的如下步骤:A proofreading device for migrating data, wherein the proofreading device for migrating data includes a processor, a memory, and a proofreading program for migrating data stored on the memory and executable by the processor, wherein the migrating data When the proofreading program of is executed by the processor, the following steps of the proofreading method of migrated data are realized:
    在检测到数据迁移指令时,在源端中获取迁移前的待迁移文件以及云端中迁移后的待校验文件;When the data migration instruction is detected, the files to be migrated before migration and the files to be verified after migration in the cloud are obtained from the source;
    计算所述待迁移文件中各个待迁移子文件对应的标准的子摘要散列值,并基于各个标准的子摘要散列值以及各个待迁移子文件大小,计算所述待迁移文件对应的标准的总摘要散列值;Calculate the standard sub-digest hash value corresponding to each sub-file to be migrated in the file to be migrated, and calculate the standard sub-digest hash value corresponding to the file to be migrated based on the sub-digest hash value of each standard and the size of each sub-file to be migrated Total digest hash value;
    计算所述待校验文件中的各个待校验子文件对应的子待校验摘要散列值,并基于各个待校验的子摘要散列值以及各个待校验子文件大小,计算所述待校验文件对应的待校验的总摘要散列值;Calculate the hash value of the sub-digest to be verified corresponding to each sub-file to be verified in the file to be verified, and calculate the hash value of each sub-digest to be verified and the size of each sub-file to be verified The hash value of the total digest to be verified corresponding to the file to be verified;
    根据所述总标准摘要散列值与所述总待校验摘要散列值对所述待校验文件进行校对,若所述总标准摘要散列值与所述总待校验摘 要散列值相同,则判定所述待校验文件迁移成功,并生成对应的文件迁移成功提醒消息。The document to be verified is collated according to the total standard digest hash value and the total digest hash value to be verified, if the total standard digest hash value and the total digest hash value to be verified If they are the same, it is determined that the file to be verified is successfully migrated, and a corresponding file migration successful reminder message is generated.
  10. 如权利要求9所述的迁移数据的校对设备,其中,所述在检测到数据迁移指令时,在源端中获取迁移前的待迁移文件以及云端中迁移后的待校验文件的步骤之前,还包括:9. The proofreading device for migrating data according to claim 9, wherein when the data migration instruction is detected, before the step of acquiring the files to be migrated before migration and the files to be verified after migration in the cloud in the source end, Also includes:
    根据预设排列规则,将所述源端中的各个待迁移子文件进行顺序排列,并将排列后的各个待迁移子文件顺序上传至所述云端。According to a preset arrangement rule, the sub-files to be migrated in the source end are arranged in order, and the arranged sub-files to be migrated are sequentially uploaded to the cloud.
  11. 如权利要求10所述的迁移数据的校对设备,其中,所述计算所述待迁移文件中各个待迁移子文件对应的子标准摘要散列值,并基于各个子标准摘要散列值以及各个待迁移子文件大小,计算所述待迁移文件对应的总标准摘要散列值的步骤具体包括:The proofreading device for migration data according to claim 10, wherein the calculation of the sub-standard digest hash value corresponding to each sub-file to be migrated in the file to be migrated is based on the hash value of each sub-standard digest and each sub-file to be migrated. The steps of migrating the size of the sub-file and calculating the total standard digest hash value corresponding to the file to be migrated specifically include:
    计算所述待迁移文件中各个待迁移子文件对应的子标准摘要散列值,并将所述待迁移子文件对应的待迁移子文件大小以及所述子标准摘要散列值设为所述待迁移子文件对应的子标准元信息;Calculate the sub-standard summary hash value corresponding to each sub-file to be migrated in the file to be migrated, and set the size of the sub-file to be migrated corresponding to the sub-file to be migrated and the hash value of the sub-standard summary as the Sub-standard meta-information corresponding to the migration sub-file;
    根据所述待迁移子文件的排列顺序,将预设个数的所述待迁移子文件对应的子标准元信息进行顺序拼接,生成标准的分批元信息;According to the arrangement order of the sub-files to be migrated, the preset number of sub-standard meta-information corresponding to the sub-files to be migrated are sequentially spliced to generate standard batch meta-information;
    计算所述标准的分批元信息对应的分批标准摘要散列值,并基于所述标准的分批摘要散列值,计算所述待迁移文件对应的标准的总摘要散列值。Calculate the batch standard digest hash value corresponding to the batch meta-information of the standard, and calculate the standard total digest hash value of the standard corresponding to the file to be migrated based on the standard batch digest hash value.
  12. 如权利要求11所述的迁移数据的校对设备,其中,计算所述待校验文件中的各个待校验子文件对应的子待校验摘要散列值,并基于各个子待校验摘要散列值以及各个待校验子文件大小,计算所述待校验文件对应的总待校验摘要散列值的步骤具体包括:The verification device for migration data according to claim 11, wherein the hash value of the sub-to-be-verified digest corresponding to each sub-file to be verified in the file to be verified is calculated, and the hash value is calculated based on each sub-to-be-verified digest. The column value and the size of each sub-file to be verified, and the step of calculating the total digest hash value to be verified corresponding to the file to be verified specifically includes:
    计算所述待校验文件中各个待校验子文件对应的子待校验摘要散列值,并将所述校验子文件对应的待校验子文件大小以及所述子待校验摘要散列值设为所述待校验子文件对应的子待校验元信息;Calculate the hash value of the sub-file to be verified corresponding to each sub-file to be verified in the file to be verified, and hash the size of the sub-file to be verified corresponding to the sub-file to be verified and the digest of the sub-file to be verified. The column value is set as the sub-to-be-verified meta information corresponding to the sub-file to be verified;
    根据所述子文件排列顺序,将所述预设个数的所述待校验子文件对应的子待校验元信息进行顺序拼接,生成分批子待校验元信息;According to the arrangement order of the sub-files, sequentially splicing the sub-to-be-verified meta information corresponding to the preset number of the sub-files to be verified to generate batches of sub-to-be-verified meta information;
    计算所述分批子待校验元信息对应的分批待校验摘要散列值,基于所述分批待校验摘要散列值,并将各个分批待校验摘要散列值顺序拼接预设次数,计算出一个文件待校验摘要散列值,作为所述待校验文件对应的总待校验摘要散列值。Calculate the hash values of the digests to be verified in batches corresponding to the meta-information of the sub-to-be-verified batches, based on the hash values of the digests to be verified in the batches, and sequentially concatenate the hash values of the digests to be verified in each batch For a preset number of times, the digest hash value of a file to be verified is calculated as the total digest hash value to be verified corresponding to the file to be verified.
  13. 如权利要求12所述的迁移数据的校对设备,其中,所述根据所述总标准摘要散列值与所述总待校验摘要散列值对所述待校验文件进行校对,若所述总标准摘要散列值与所述总待校验摘要散列值相同,则判定所述待校验文件迁移成功,并生成对应的文件迁移成功提醒消息的步骤具体包括:The proofreading device for migration data according to claim 12, wherein the document to be verified is proofread according to the total standard digest hash value and the total digest hash value to be verified, if the If the total standard digest hash value is the same as the total digest hash value to be verified, it is determined that the file to be verified is successfully migrated, and the steps of generating a corresponding file migration success reminder message specifically include:
    判断所述总标准摘要散列值与所述总待校验摘要散列值是否相同,以对所述云端中迁移后的待校验文件进行文件校对;Judging whether the total standard digest hash value is the same as the total digest hash value to be verified, so as to perform file proofreading on the files to be verified after migration in the cloud;
    若所述总标准摘要散列值与所述总待校验摘要散列值不同,则将所述分批标准摘要散列值与对应的分批待校验摘要散列值进行比对,以对发生迁移异常的分批子文件进行验证;If the total standard digest hash value is different from the total digest hash value to be verified, the batch standard digest hash value is compared with the corresponding batch digest hash value to be verified to Verify the sub-files in batches with migration exceptions;
    若所述总标准摘要散列值与所述总待校验摘要散列值相同,则判定所述待校验文件迁移成功,并生成对应的文件迁移成功提醒消息。If the total standard digest hash value is the same as the total digest hash value to be verified, it is determined that the file to be verified is successfully migrated, and a corresponding file migration success reminder message is generated.
  14. 如权利要求9至13任意一项所述的迁移数据的校对设备,其中,所述根据预设排列规则,将所述源端中的各个待迁移子文件进行顺序排列,并将排列后的各个待迁移子文件顺序上传至所述云端的步骤具体包括:The proofreading device for migrated data according to any one of claims 9 to 13, wherein the sub-files to be migrated in the source end are sequentially arranged according to a preset arrangement rule, and each of the arranged sub-files The steps of sequentially uploading the sub-files to be migrated to the cloud specifically include:
    根据文件名的字典序顺序,将所述源端中的各个待迁移子文件进行顺序排列,并将排列后的各个待迁移子文件顺序上传至所述云端。According to the lexicographic order of the file names, the sub-files to be migrated in the source end are sequentially arranged, and the arranged sub-files to be migrated are sequentially uploaded to the cloud.
  15. 一种计算机可读存储介质,其中,所述计算机可读存储介质上存 储有迁移数据的校对程序,其中所述迁移数据的校对程序被处理器执行时,实现迁移数据的校对方法的如下步骤:A computer-readable storage medium, wherein a proofreading program for migration data is stored on the computer-readable storage medium, and when the proofreading program for migration data is executed by a processor, the following steps of the proofreading method for migration data are implemented:
    在检测到数据迁移指令时,在源端中获取迁移前的待迁移文件以及云端中迁移后的待校验文件;When the data migration instruction is detected, the files to be migrated before migration and the files to be verified after migration in the cloud are obtained from the source;
    计算所述待迁移文件中各个待迁移子文件对应的标准的子摘要散列值,并基于各个标准的子摘要散列值以及各个待迁移子文件大小,计算所述待迁移文件对应的标准的总摘要散列值;Calculate the standard sub-digest hash value corresponding to each sub-file to be migrated in the file to be migrated, and calculate the standard sub-digest hash value corresponding to the file to be migrated based on the sub-digest hash value of each standard and the size of each sub-file to be migrated Total digest hash value;
    计算所述待校验文件中的各个待校验子文件对应的子待校验摘要散列值,并基于各个待校验的子摘要散列值以及各个待校验子文件大小,计算所述待校验文件对应的待校验的总摘要散列值;Calculate the hash value of the sub-digest to be verified corresponding to each sub-file to be verified in the file to be verified, and calculate the hash value of each sub-digest to be verified and the size of each sub-file to be verified The hash value of the total digest to be verified corresponding to the file to be verified;
    根据所述总标准摘要散列值与所述总待校验摘要散列值对所述待校验文件进行校对,若所述总标准摘要散列值与所述总待校验摘要散列值相同,则判定所述待校验文件迁移成功,并生成对应的文件迁移成功提醒消息。The document to be verified is collated according to the total standard digest hash value and the total digest hash value to be verified, if the total standard digest hash value and the total digest hash value to be verified If they are the same, it is determined that the file to be verified is successfully migrated, and a corresponding file migration successful reminder message is generated.
  16. 如权利要求15所述的计算机可读存储介质,其中,所述在检测到数据迁移指令时,在源端中获取迁移前的待迁移文件以及云端中迁移后的待校验文件的步骤之前,还包括:15. The computer-readable storage medium according to claim 15, wherein, when the data migration instruction is detected, before the step of obtaining the file to be migrated before migration and the file to be verified after migration in the cloud in the source end, Also includes:
    根据预设排列规则,将所述源端中的各个待迁移子文件进行顺序排列,并将排列后的各个待迁移子文件顺序上传至所述云端。According to a preset arrangement rule, the sub-files to be migrated in the source end are arranged in order, and the arranged sub-files to be migrated are sequentially uploaded to the cloud.
  17. 如权利要求16所述的计算机可读存储介质,其中,所述计算所述待迁移文件中各个待迁移子文件对应的子标准摘要散列值,并基于各个子标准摘要散列值以及各个待迁移子文件大小,计算所述待迁移文件对应的总标准摘要散列值的步骤具体包括:The computer-readable storage medium according to claim 16, wherein the calculation of the sub-standard digest hash value corresponding to each sub-file to be migrated in the file to be migrated is based on the hash value of each sub-standard digest and each sub-file to be migrated. The steps of migrating the size of the sub-file and calculating the total standard digest hash value corresponding to the file to be migrated specifically include:
    计算所述待迁移文件中各个待迁移子文件对应的子标准摘要散列值,并将所述待迁移子文件对应的待迁移子文件大小以及所述子标准摘要散列值设为所述待迁移子文件对应的子标准元信息;Calculate the sub-standard summary hash value corresponding to each sub-file to be migrated in the file to be migrated, and set the size of the sub-file to be migrated corresponding to the sub-file to be migrated and the hash value of the sub-standard summary as the Sub-standard meta-information corresponding to the migration sub-file;
    根据所述待迁移子文件的排列顺序,将预设个数的所述待迁移子文件对应的子标准元信息进行顺序拼接,生成标准的分批元信息 ;According to the arrangement order of the sub-files to be migrated, the preset number of sub-standard meta-information corresponding to the sub-files to be migrated are sequentially spliced to generate standard batch meta-information;
    计算所述标准的分批元信息对应的分批标准摘要散列值,并基于所述标准的分批摘要散列值,计算所述待迁移文件对应的标准的总摘要散列值。Calculate the batch standard digest hash value corresponding to the batch meta-information of the standard, and calculate the standard total digest hash value of the standard corresponding to the file to be migrated based on the standard batch digest hash value.
  18. 如权利要求17所述的计算机可读存储介质,其中,计算所述待校验文件中的各个待校验子文件对应的子待校验摘要散列值,并基于各个子待校验摘要散列值以及各个待校验子文件大小,计算所述待校验文件对应的总待校验摘要散列值的步骤具体包括:The computer-readable storage medium according to claim 17, wherein the hash value of the sub-to-be-verified digest corresponding to each sub-file to be verified in the file to be verified is calculated, and the hash value of the sub-to-be-verified digest is hashed based on each sub-file to be verified. The column value and the size of each sub-file to be verified, and the step of calculating the total digest hash value to be verified corresponding to the file to be verified specifically includes:
    计算所述待校验文件中各个待校验子文件对应的子待校验摘要散列值,并将所述校验子文件对应的待校验子文件大小以及所述子待校验摘要散列值设为所述待校验子文件对应的子待校验元信息;Calculate the hash value of the sub-file to be verified corresponding to each sub-file to be verified in the file to be verified, and hash the size of the sub-file to be verified corresponding to the sub-file to be verified and the digest of the sub-file to be verified. The column value is set as the sub-to-be-verified meta information corresponding to the sub-file to be verified;
    根据所述子文件排列顺序,将所述预设个数的所述待校验子文件对应的子待校验元信息进行顺序拼接,生成分批子待校验元信息;According to the arrangement order of the sub-files, sequentially splicing the sub-to-be-verified meta information corresponding to the preset number of the sub-files to be verified to generate batches of sub-to-be-verified meta information;
    计算所述分批子待校验元信息对应的分批待校验摘要散列值,基于所述分批待校验摘要散列值,并将各个分批待校验摘要散列值顺序拼接预设次数,计算出一个文件待校验摘要散列值,作为所述待校验文件对应的总待校验摘要散列值。Calculate the hash values of the digests to be verified in batches corresponding to the meta-information of the sub-to-be-verified batches, based on the hash values of the digests to be verified in the batches, and sequentially concatenate the hash values of the digests to be verified in each batch For a preset number of times, the digest hash value of a file to be verified is calculated as the total digest hash value to be verified corresponding to the file to be verified.
  19. 如权利要求18所述的计算机可读存储介质,其中,所述根据所述总标准摘要散列值与所述总待校验摘要散列值对所述待校验文件进行校对,若所述总标准摘要散列值与所述总待校验摘要散列值相同,则判定所述待校验文件迁移成功,并生成对应的文件迁移成功提醒消息的步骤具体包括:18. The computer-readable storage medium of claim 18, wherein the document to be verified is collated according to the total standard digest hash value and the total digest hash value to be verified, if the If the total standard digest hash value is the same as the total digest hash value to be verified, it is determined that the file to be verified is successfully migrated, and the steps of generating a corresponding file migration success reminder message specifically include:
    判断所述总标准摘要散列值与所述总待校验摘要散列值是否相同,以对所述云端中迁移后的待校验文件进行文件校对;Judging whether the total standard digest hash value is the same as the total digest hash value to be verified, so as to perform file proofreading on the files to be verified after migration in the cloud;
    若所述总标准摘要散列值与所述总待校验摘要散列值不同,则将所述分批标准摘要散列值与对应的分批待校验摘要散列值进行比 对,以对发生迁移异常的分批子文件进行验证;If the total standard digest hash value is different from the total digest hash value to be verified, the batch standard digest hash value is compared with the corresponding batch digest hash value to be verified to Verify the sub-files in batches with migration exceptions;
    若所述总标准摘要散列值与所述总待校验摘要散列值相同,则判定所述待校验文件迁移成功,并生成对应的文件迁移成功提醒消息。If the total standard digest hash value is the same as the total digest hash value to be verified, it is determined that the file to be verified is successfully migrated, and a corresponding file migration success reminder message is generated.
  20. 如权利要求15至19任意一项所述的计算机可读存储介质,其中,The computer-readable storage medium according to any one of claims 15 to 19, wherein:
    所述根据预设排列规则,将所述源端中的各个待迁移子文件进行顺序排列,并将排列后的各个待迁移子文件顺序上传至所述云端的步骤具体包括:The step of sequentially arranging the sub-files to be migrated in the source end according to a preset arrangement rule, and uploading the arranged sub-files to be migrated to the cloud in order specifically includes:
    根据文件名的字典序顺序,将所述源端中的各个待迁移子文件进行顺序排列,并将排列后的各个待迁移子文件顺序上传至所述云端。According to the lexicographic order of the file names, the sub-files to be migrated in the source end are sequentially arranged, and the arranged sub-files to be migrated are sequentially uploaded to the cloud.
PCT/CN2020/093187 2020-02-12 2020-05-29 Checking method, apparatus, and device for data migration, and storage medium WO2021159639A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010091715.8 2020-02-12
CN202010091715.8A CN111290998A (en) 2020-02-12 2020-02-12 Method, device and equipment for calibrating migration data and storage medium

Publications (1)

Publication Number Publication Date
WO2021159639A1 true WO2021159639A1 (en) 2021-08-19

Family

ID=71018436

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/093187 WO2021159639A1 (en) 2020-02-12 2020-05-29 Checking method, apparatus, and device for data migration, and storage medium

Country Status (2)

Country Link
CN (1) CN111290998A (en)
WO (1) WO2021159639A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112286910B (en) * 2020-11-23 2024-04-12 中国农业银行股份有限公司 Data verification method and device
CN112714155A (en) * 2020-12-14 2021-04-27 国电南瑞科技股份有限公司 Electric power operation data consistency verification method and device based on end cloud cooperative service
CN115426290A (en) * 2022-09-23 2022-12-02 中国农业银行股份有限公司 Data migration and verification method and device, computer equipment and storage medium

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103646082A (en) * 2013-12-12 2014-03-19 北京奇虎科技有限公司 Method and device for checking files
CN106484690A (en) * 2015-08-24 2017-03-08 阿里巴巴集团控股有限公司 A kind of verification method of Data Migration and device
CN110457628A (en) * 2019-07-05 2019-11-15 平安国际智慧城市科技股份有限公司 Webpage edition correcting method, device, equipment and storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104731792B (en) * 2013-12-19 2018-09-21 中国银联股份有限公司 The method and system of data base consistency(-tance) method of calibration and system, location database difference
CN107037978B (en) * 2016-10-31 2019-11-05 福建亿榕信息技术有限公司 Data Migration bearing calibration and system
CN110413441A (en) * 2019-06-18 2019-11-05 平安科技(深圳)有限公司 Active and standby storage volume synchrodata method of calibration, device, equipment and storage medium

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103646082A (en) * 2013-12-12 2014-03-19 北京奇虎科技有限公司 Method and device for checking files
CN106484690A (en) * 2015-08-24 2017-03-08 阿里巴巴集团控股有限公司 A kind of verification method of Data Migration and device
CN110457628A (en) * 2019-07-05 2019-11-15 平安国际智慧城市科技股份有限公司 Webpage edition correcting method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN111290998A (en) 2020-06-16

Similar Documents

Publication Publication Date Title
WO2021159639A1 (en) Checking method, apparatus, and device for data migration, and storage medium
WO2021238527A1 (en) Digital signature generation method and apparatus, computer device, and storage medium
US20200128075A1 (en) System and method for service level agreement based data verification
WO2018177190A1 (en) Method and device for synchronizing blockchain data
WO2021036810A1 (en) Evidence verification method, system, apparatus and device, and readable storage medium
WO2020253083A1 (en) Synchronization data verification method for primary and secondary storage volume, device, apparatus, and storage medium
CN109635256B (en) Method and device for verifying data
US10523244B2 (en) Device and associated methodoloy for encoding and decoding of data for an erasure code
US11874790B1 (en) System and method for checking data to be processed or stored
WO2022116088A1 (en) Firmware data processing method and apparatus
WO2007118421A1 (en) Virus scan system and method thereof
CN111078672B (en) Data comparison method and device for database
CN111737230A (en) Data verification method and device, electronic equipment and readable storage medium
CN112131609A (en) Merkle tree-based electric energy quality data exchange format file integrity verification method and system
TWI762851B (en) Data verification method, system, device and equipment in blockchain ledger
CN113157651B (en) Method, system, equipment and medium for renaming resource files of android project in batches
CN113312338A (en) Data consistency checking method, device, equipment, medium and program product
CN111339551B (en) Data verification method and related device and equipment
CN115795560A (en) Method, device, equipment and medium for checking integrity of file across systems
CN111694502A (en) Block chain data storage method, device, equipment and storage medium
CN111464258B (en) Data verification method, device, computing equipment and medium
CN111835871A (en) Method and device for transmitting data file and method and device for receiving data file
CN113448764A (en) Check code generation method and device, electronic equipment and computer storage medium
WO2015100932A1 (en) Network data transmission method, device and system
CN106326310B (en) Resource encryption updating method for mobile phone client software

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20919113

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20919113

Country of ref document: EP

Kind code of ref document: A1