CN112948389B - MD 5-based database table data comparison method and device - Google Patents

MD 5-based database table data comparison method and device Download PDF

Info

Publication number
CN112948389B
CN112948389B CN202110246545.0A CN202110246545A CN112948389B CN 112948389 B CN112948389 B CN 112948389B CN 202110246545 A CN202110246545 A CN 202110246545A CN 112948389 B CN112948389 B CN 112948389B
Authority
CN
China
Prior art keywords
value
time point
database table
new
records
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110246545.0A
Other languages
Chinese (zh)
Other versions
CN112948389A (en
Inventor
任养超
马佩
王倪彬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Suninfo Technology Co ltd
Original Assignee
Shanghai Suninfo Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Suninfo Technology Co ltd filed Critical Shanghai Suninfo Technology Co ltd
Priority to CN202110246545.0A priority Critical patent/CN112948389B/en
Publication of CN112948389A publication Critical patent/CN112948389A/en
Application granted granted Critical
Publication of CN112948389B publication Critical patent/CN112948389B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2228Indexing structures
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention aims to provide a database table data comparison method and device based on MD5, which are used for generating an MD5 encryption result by comparing each piece of data in a database table with a primary key (or a unique index) and realizing the comparison function of the data in the database table by comparing the MD5 result. When a user wants to compare records in the current database table with records of any previous historical time point, the comparison of the records in the current database table and the records in the database table of any previous time point can be realized only by selecting the comparison MD5 value copy of the corresponding historical time point and the record MD5 value in the database table of the current time point. The MD 5-based database table data comparison function can rapidly perform database table data comparison, and can list the functions of adding, deleting and modifying the data in the table, so that the problems of complexity and inaccuracy in database table comparison can be solved.

Description

MD 5-based database table data comparison method and device
Technical Field
The invention relates to the field of computers, in particular to a database table data comparison method and device based on MD 5.
Background
Currently, with the widespread use of database technology, database data is increasingly used. In the process of using database data, the data in the table is continuously added, deleted and updated, and a user always needs to know which data in the current database table and the previous data at a certain time point have the operations of adding and deleting, and the traditional comparison method always needs to be participated manually and needs to compare the two table data information of the version database, so that the whole data comparison process is tedious and easy to cause comparison errors.
Disclosure of Invention
An object of the present invention is to provide a method and apparatus for MD 5-based database table data comparison.
According to an aspect of the present invention, there is provided a database table data comparison method based on MD5, the method comprising:
generating MD5 replica data of a database table at a historical point in time, wherein the MD5 replica data comprises: MD5 values corresponding to each whole row of records in the database table and MD5 values of unique indexes corresponding to each whole row of records;
querying each whole row of records in a database table at the current time point, and respectively generating a corresponding new MD5 value and a new MD5 value of a unique index corresponding to each whole row of records according to each whole row of records in the current database table;
obtaining a new MD5 value corresponding to a whole line of records in a database table at the current time point and a new MD5 value of a unique index corresponding to the whole line of records, searching whether the MD5 value which is the same as the new MD5 value of the unique index obtained in the database table at the current time point exists in MD5 copy data at the historical time point,
if the MD5 value identical to the new MD5 value of the unique index obtained in the database table at the current time point is found in the MD5 copy data of the database table at the historical time point, and the MD5 value of the whole row of records corresponding to the MD5 value of the identical unique index in the MD5 copy data of the database table at the historical time point is identical to the new MD5 value of the whole row of records obtained in the database table at the current time point, the MD5 value of the whole row of records obtained in the database table at the current time point is represented unchanged, the current time point is taken as the next historical time point, the new MD5 value corresponding to the whole row of records obtained and the new MD5 value of the unique index obtained are saved to the MD5 copy data of the database table at the next historical time point, and then the new MD5 value identical to the MD5 value of the whole row of records obtained in the MD5 copy data of the database table at the previous historical time point and the MD5 value identical to the MD5 value of the unique index obtained at the current time point are deleted.
Further, in the above method, after obtaining a new MD5 value corresponding to a whole row of records in the database table at the current time point and a new MD5 value of a unique index corresponding to the whole row of records, searching whether the MD5 value which is the same as the new MD5 value of the unique index obtained in the database table at the current time point exists in the MD5 copy data at the historical time point, the method further includes:
if the MD5 value of the unique index identical to the new MD5 value of the unique index currently acquired is found in the MD5 copy data of the database table at the historical time point, but the MD5 value of the whole row of records corresponding to the MD5 value of the identical unique index in the MD5 copy data of the database table at the historical time point is not equal to the new MD5 value of the whole row of records acquired in the database table at the current time point, the MD5 value of the whole row of records acquired in the database table at the current time point is updated, the new MD5 value of the whole row of records acquired and the new MD5 value of the unique index acquired are stored in the change table, the current time point is taken as the next historical time point, and after the new MD5 value of the whole row of records acquired and the new MD5 value of the unique index acquired are stored in the MD5 copy data of the database table at the next historical time point, the MD5 value of the whole row of the database table at the previous time point is deleted, and the new MD5 value of the whole row of records corresponding to the MD5 value identical to the new MD5 value of the unique index acquired.
Further, in the above method, after obtaining a new MD5 value corresponding to a whole row of records in the database table at the current time point and a new MD5 value of a unique index corresponding to the whole row of records, searching whether the MD5 value which is the same as the new MD5 value of the unique index obtained in the database table at the current time point exists in the MD5 copy data at the historical time point, the method further includes:
if the MD5 value of the unique index identical to the new MD5 value of the unique index acquired currently is not found in the MD5 copy data of the database table at the historical time point, the MD5 value of the whole row of records acquired in the database table at the current time point is the newly added data, the new MD5 value corresponding to the acquired whole row of records and the new MD5 value of the unique index acquired are stored into the change table, the current time point is taken as the next historical time point, and the new MD5 value corresponding to the acquired whole row of records and the new MD5 value of the unique index acquired are stored into the MD5 copy data of the database table at the next historical time point.
Further, in the above method, after obtaining a new MD5 value corresponding to a whole row of records in the database table at the current time point and a new MD5 value of a unique index corresponding to the whole row of records, searching whether the MD5 value which is the same as the new MD5 value of the unique index obtained in the database table at the current time point exists in the MD5 copy data at the historical time point, the method further includes:
if each acquired unique-index new MD5 value in the database table at the current time point is searched in the MD5 copy data at the historical time point, and at least one MD5 value corresponding to the whole row of records and the unique-index MD5 value corresponding to the whole row of records also exist in the MD5 copy data at the historical time point, the record in the MD5 copy data of the database table at the historical time point is the deleted MD5 value of the whole row of records in the database table, and the deleted MD5 value of the unique index corresponding to the MD5 value of the whole row of records is stored in the change table.
According to another aspect of the present invention, there is also provided an MD 5-based database table data alignment apparatus, wherein the apparatus includes:
a first means for generating MD5 replica data of a database table at a historical point in time, wherein the MD5 replica data comprises: MD5 values corresponding to each whole row of records in the database table and MD5 values of unique indexes corresponding to each whole row of records;
the second device is used for inquiring each whole row of records in the database table at the current time point, and respectively generating a corresponding new MD5 value and a new MD5 value of a unique index corresponding to each whole row of records according to each whole row of records in the current database table;
and a third means for acquiring a new MD5 value corresponding to a whole row of records in the database table at the current time point and a new MD5 value of the unique index corresponding to the whole row of records, searching whether the MD5 value identical to the new MD5 value of the unique index acquired in the database table at the current time point exists in the MD5 copy data at the history time point, if the MD5 value identical to the new MD5 value of the unique index acquired in the database table at the current time point is found in the MD5 copy data at the history time point, and if the MD5 value of the whole row of records corresponding to the MD5 value of the unique index in the MD5 copy data at the history time point is equal to the new MD5 value of the whole row of records acquired in the database table at the current time point, then indicating that the MD5 value of the whole row of records acquired in the database table at the current time point does not change, then taking the current time point as the next history time point, and deleting the MD5 value of the whole row of records corresponding to the MD5 value of the unique index corresponding to the MD5 value of the whole row of records acquired in the database table at the current time point to the MD5 copy data corresponding to the MD5 value of the unique index acquired in the whole row of MD5 table at the current time point is deleted.
Further, in the above apparatus, if the MD5 copy data of the database table at the historical time point finds the MD5 value of the unique index that is the same as the new MD5 value of the unique index that is currently acquired, but the MD5 value of the entire row of records corresponding to the MD5 value of the unique index that is the same in the database table at the historical time point is not equal to the new MD5 value of the entire row of records that is acquired in the database table at the current time point, the third means is further configured to store the new MD5 value of the entire row of records that is acquired and the new MD5 value of the unique index that is acquired in the change table, take the current time point as the next historical time point, store the new MD5 value of the entire row of records that is acquired and the new MD5 value of the unique index that is acquired in the database table at the next historical time point, delete the new MD5 value of the entire row of records that is the MD5 value that is the unique index that is the same as the MD5 value of the MD5 table at the current time point, and store the new MD5 value that is the unique index that is acquired in the database table at the current time point.
Further, in the above apparatus, the third means is further configured to store, if the MD5 value of the unique index that is the same as the new MD5 value of the unique index that is currently acquired is not found in the MD5 copy data of the database table at the historical time point, the new MD5 value of the entire row of records that is acquired in the database table at the current time point and the new MD5 value of the unique index that is acquired into the change table, and store, with the current time point as the next historical time point, the new MD5 value of the entire row of records that is acquired and the new MD5 value of the unique index that is acquired into the MD5 copy data of the database table at the next historical time point.
Further, in the above device, the third means is further configured to, if each acquired new MD5 value of the unique index in the database table at the current time point is found in the MD5 replica data at the historical time point, and the MD5 replica data at the historical time point further has at least one MD5 value corresponding to the whole row record and an MD5 value of the unique index corresponding to the whole row record, record in the MD5 replica data of the database table at the historical time point is the MD5 value of the deleted whole row record in the database table, and store the MD5 value of the unique index corresponding to the MD5 value of the deleted whole row record in the change table.
According to another aspect of the present invention there is also provided a computer readable medium having stored thereon computer readable instructions executable by a processor to implement the method of any one of the above.
According to another aspect of the present invention there is also provided an apparatus for information processing at a network device, the apparatus comprising a memory for storing computer program instructions and a processor for executing the program instructions, wherein the computer program instructions, when executed by the processor, trigger the apparatus to perform the method of any of the preceding claims.
Compared with the prior art, the method and the device generate the MD5 encryption result through each piece of data and the primary key (or the unique index) in the database table, and realize the function of comparing the data in the database table through the comparison of the MD5 result. When a user wants to compare records in the current database table with records of any previous historical time point, the comparison of the records in the current database table and the records in the database table of any previous time point can be realized only by selecting the comparison MD5 value copy of the corresponding historical time point and the record MD5 value in the database table of the current time point. The MD 5-based database table data comparison function can rapidly perform database table data comparison, and can list the functions of adding, deleting and modifying the data in the table, so that the problems of complexity and inaccuracy in database table comparison can be solved.
Drawings
Other features, objects and advantages of the present invention will become more apparent upon reading of the detailed description of non-limiting embodiments, made with reference to the accompanying drawings in which:
FIG. 1 illustrates a flow chart of generating MD5 replica data in accordance with an embodiment of the present invention;
FIG. 2 is a flow chart of data alignment and MD5 replica data update according to an embodiment of the present invention.
The same or similar reference numbers in the drawings refer to the same or similar parts.
Detailed Description
The invention is described in further detail below with reference to the accompanying drawings.
In one typical configuration of the present application, the terminal, the device of the service network, and the trusted party each include one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer readable media, as defined herein, does not include non-transitory computer readable media (transmission media), such as modulated data signals and carrier waves.
As shown in fig. 1 and 2, the present invention provides a method for comparing database table data based on MD5, the method comprising:
step S1, MD5 copy data of a database table at a historical time point is generated, wherein the MD5 copy data comprises: MD5 values corresponding to each whole row of records in the database table and MD5 values of unique indexes corresponding to each whole row of records;
the user firstly generates MD5 copy data corresponding to the content of the database table at the current time point, wherein the MD5 copy data mainly comprises MD5 value data generated by each whole row of records in the table and MD5 value data generated by a main key (or a unique index) in the table, namely, the MD5 value of the whole row in the data table and the MD5 value of the corresponding main key (or the unique index) are generated and stored as MD5 value copies;
step S2, inquiring each whole row of records in a database table at the current time point, and respectively generating a corresponding new MD5 value and a new MD5 value of a unique index corresponding to each whole row of records according to each whole row of records in the current database table;
when the data in the database table is to be compared at the current time point after the historical time point to judge whether the data in the database table is changed, the MD5 copy data generated by the database table at the historical time point before the current time point is loaded first, the MD5 copy information is stored in the system in a key value pair mode, the key is an MD5 value generated by a main key (or a unique index), and the value is an MD5 value generated by a whole row of records. And then, inquiring each whole row of records in the database table at the current time point, and respectively generating a corresponding new MD5 value and a new MD5 value of a main key (or a unique index) according to each whole row of records in the current database table.
Step S3, obtaining a new MD5 value corresponding to a whole line of records in the database table at the current time point and a new MD5 value of a unique index corresponding to the whole line of records, searching whether the MD5 value which is the same as the new MD5 value of the unique index obtained in the database table at the current time point exists in the MD5 copy data at the history time point,
here, the MD5 value corresponding to the primary key (or unique index) may be found from the key value pair of the loaded MD5 replica data;
and S4, if the MD5 value which is the same as the new MD5 value of the unique index acquired in the database table of the current time point is found in the MD5 copy data of the database table of the historical time point, and the MD5 value of the whole row of records corresponding to the MD5 value of the same unique index in the MD5 copy data of the database table of the historical time point is equal to the new MD5 value which is the same as the MD5 value of the whole row of records acquired in the database table of the current time point, the MD5 value which is the whole row of records acquired in the database table of the current time point is unchanged, the current time point is taken as the next historical time point, and the new MD5 value which is the whole row of records acquired and the new MD5 value of the unique index acquired are saved to the MD5 copy data of the database table of the next historical time point, and then the new MD5 value which is the MD5 value of the whole row of records acquired in the database table of the previous historical time point is deleted and the MD5 copy data which is the MD5 value which is the same as the MD5 value of the whole row of the whole records acquired and the MD5 value which is the MD5 value of the unique index which is the same as the MD5 value acquired.
The invention generates MD5 encryption results through each data and the primary key (or the unique index) in the database table, and realizes the function of comparing the data in the database table through the comparison of the MD5 results. When a user wants to compare records in the current database table with records of any previous historical time point, the comparison of the records in the current database table and the records in the database table of any previous time point can be realized only by selecting the comparison MD5 value copy of the corresponding historical time point and the record MD5 value in the database table of the current time point. The MD 5-based database table data comparison function can rapidly perform database table data comparison, and can list the functions of adding, deleting and modifying the data in the table, so that the problems of complexity and inaccuracy in database table comparison can be solved.
In an embodiment of the MD 5-based database table data comparison method of the present invention, step S3, after obtaining a new MD5 value corresponding to a whole row of records in the database table at the current time point and a new MD5 value of a unique index corresponding to the whole row of records, searches for whether there is an MD5 value identical to the new MD5 value of the unique index obtained in the database table at the current time point in the MD5 copy data at the historical time point, further includes:
and S5, if the MD5 copy data of the database table at the historical time point find the MD5 value of the unique index identical to the new MD5 value of the unique index acquired at present, but the MD5 value of the whole row record corresponding to the MD5 value of the unique index in the MD5 copy data of the database table at the historical time point is not equal to the new MD5 value of the whole row record acquired in the database table at the current time point, the MD5 value of the whole row record acquired in the database table at the current time point is updated, the new MD5 value of the whole row record acquired at the current time point and the new MD5 value of the unique index acquired at the current time point are stored in a change table, the new MD5 value of the whole row record corresponding to the current time point is taken as the historical time point of the next time point, and the new MD5 value of the unique index acquired at the current time point is stored in the MD5 copy data of the database table at the next time point, and the MD5 value of the MD5 copy data of the whole row record corresponding to the unique index acquired at the current time point is deleted.
In an embodiment of the MD 5-based database table data comparison method of the present invention, step S3, after obtaining a new MD5 value corresponding to a whole row of records in the database table at the current time point and a new MD5 value of a unique index corresponding to the whole row of records, searches for whether there is an MD5 value identical to the new MD5 value of the unique index obtained in the database table at the current time point in the MD5 copy data at the historical time point, further includes:
step S6, if the MD5 value of the unique index identical to the new MD5 value of the unique index obtained currently is not found in the MD5 copy data of the database table at the historical time point, the MD5 value of the whole row of records obtained in the database table at the current time point is the newly added data, the new MD5 value corresponding to the whole row of records obtained and the new MD5 value of the unique index obtained are stored into the change table, the current time point is taken as the next historical time point, and the new MD5 value corresponding to the whole row of records obtained and the new MD5 value of the unique index obtained are stored into the MD5 copy data of the database table at the next historical time point.
In an embodiment of the MD 5-based database table data comparison method of the present invention, step S3, after obtaining a new MD5 value corresponding to a whole row of records in the database table at the current time point and a new MD5 value of a unique index corresponding to the whole row of records, searches for whether there is an MD5 value identical to the new MD5 value of the unique index obtained in the database table at the current time point in the MD5 copy data at the historical time point, further includes:
step S7, if each acquired unique index new MD5 value in the database table at the current time point is searched in the MD5 copy data at the historical time point, and at least one MD5 value corresponding to the whole row record and at least one MD5 value of the unique index corresponding to the whole row record exist in the MD5 copy data at the historical time point, the record in the MD5 copy data of the database table at the historical time point is the MD5 value of the deleted whole row record in the database table, and the MD5 value of the unique index corresponding to the MD5 value of the deleted whole row record is stored in the change table.
After the comparison of all the whole row records is completed, if the MD5 copy data of the database table at the historical time point is not empty, the record in the MD5 copy data of the database table at the historical time point is the MD5 value of the deleted whole row record in the database table, and the primary key (or the unique index) is updated into the change table.
According to another aspect of the present invention, there is also provided an MD 5-based database table data alignment apparatus, wherein the apparatus includes:
a first means for generating MD5 replica data of a database table at a historical point in time, wherein the MD5 replica data comprises: MD5 values corresponding to each whole row of records in the database table and MD5 values of unique indexes corresponding to each whole row of records;
the second device is used for inquiring each whole row of records in the database table at the current time point, and respectively generating a corresponding new MD5 value and a new MD5 value of a unique index corresponding to each whole row of records according to each whole row of records in the current database table;
and a third means for acquiring a new MD5 value corresponding to a whole row of records in the database table at the current time point and a new MD5 value of the unique index corresponding to the whole row of records, searching whether the MD5 value identical to the new MD5 value of the unique index acquired in the database table at the current time point exists in the MD5 copy data at the history time point, if the MD5 value identical to the new MD5 value of the unique index acquired in the database table at the current time point is found in the MD5 copy data at the history time point, and if the MD5 value of the whole row of records corresponding to the MD5 value of the unique index in the MD5 copy data at the history time point is equal to the new MD5 value of the whole row of records acquired in the database table at the current time point, then indicating that the MD5 value of the whole row of records acquired in the database table at the current time point does not change, then taking the current time point as the next history time point, and deleting the MD5 value of the whole row of records corresponding to the MD5 value of the unique index corresponding to the MD5 value of the whole row of records acquired in the database table at the current time point to the MD5 copy data corresponding to the MD5 value of the unique index acquired in the whole row of MD5 table at the current time point is deleted.
Further, in the above apparatus, if the MD5 copy data of the database table at the historical time point finds the MD5 value of the unique index that is the same as the new MD5 value of the unique index that is currently acquired, but the MD5 value of the entire row of records corresponding to the MD5 value of the unique index that is the same in the database table at the historical time point is not equal to the new MD5 value of the entire row of records that is acquired in the database table at the current time point, the third means is further configured to store the new MD5 value of the entire row of records that is acquired and the new MD5 value of the unique index that is acquired in the change table, take the current time point as the next historical time point, store the new MD5 value of the entire row of records that is acquired and the new MD5 value of the unique index that is acquired in the database table at the next historical time point, delete the new MD5 value of the entire row of records that is the MD5 value that is the unique index that is the same as the MD5 value of the MD5 table at the current time point, and store the new MD5 value that is the unique index that is acquired in the database table at the current time point.
Further, in the above apparatus, the third means is further configured to store, if the MD5 value of the unique index that is the same as the new MD5 value of the unique index that is currently acquired is not found in the MD5 copy data of the database table at the historical time point, the new MD5 value of the entire row of records that is acquired in the database table at the current time point and the new MD5 value of the unique index that is acquired into the change table, and store, with the current time point as the next historical time point, the new MD5 value of the entire row of records that is acquired and the new MD5 value of the unique index that is acquired into the MD5 copy data of the database table at the next historical time point.
Further, in the above device, the third means is further configured to, if each acquired new MD5 value of the unique index in the database table at the current time point is found in the MD5 replica data at the historical time point, and the MD5 replica data at the historical time point further has at least one MD5 value corresponding to the whole row record and an MD5 value of the unique index corresponding to the whole row record, record in the MD5 replica data of the database table at the historical time point is the MD5 value of the deleted whole row record in the database table, and store the MD5 value of the unique index corresponding to the MD5 value of the deleted whole row record in the change table.
According to another aspect of the present invention there is also provided a computer readable medium having stored thereon computer readable instructions executable by a processor to implement the method of any one of the above.
According to another aspect of the present invention there is also provided an apparatus for information processing at a network device, the apparatus comprising a memory for storing computer program instructions and a processor for executing the program instructions, wherein the computer program instructions, when executed by the processor, trigger the apparatus to perform the method of any of the preceding claims.
Details of each device and storage medium embodiment of the present invention may refer to corresponding parts of each method embodiment, and are not described herein.
It will be apparent to those skilled in the art that various modifications and variations can be made in the present application without departing from the spirit or scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims and the equivalents thereof, the present application is intended to cover such modifications and variations.
It should be noted that the present invention may be implemented in software and/or a combination of software and hardware, e.g., using Application Specific Integrated Circuits (ASIC), a general purpose computer or any other similar hardware device. In one embodiment, the software program of the present invention may be executed by a processor to perform the steps or functions described above. Likewise, the software programs of the present invention (including associated data structures) may be stored on a computer readable recording medium, such as RAM memory, magnetic or optical drive or diskette and the like. In addition, some steps or functions of the present invention may be implemented in hardware, for example, as circuitry that cooperates with the processor to perform various steps or functions.
Furthermore, portions of the present invention may be implemented as a computer program product, such as computer program instructions, which when executed by a computer, may invoke or provide methods and/or techniques in accordance with the present invention by way of operation of the computer. Program instructions for invoking the inventive methods may be stored in fixed or removable recording media and/or transmitted via a data stream in a broadcast or other signal bearing medium and/or stored within a working memory of a computer device operating according to the program instructions. An embodiment according to the invention comprises an apparatus comprising a memory for storing computer program instructions and a processor for executing the program instructions, wherein the computer program instructions, when executed by the processor, trigger the apparatus to operate a method and/or a solution according to the embodiments of the invention as described above.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential characteristics thereof. The present embodiments are, therefore, to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference sign in a claim should not be construed as limiting the claim concerned. Furthermore, it is evident that the word "comprising" does not exclude other elements or steps, and that the singular does not exclude a plurality. A plurality of units or means recited in the apparatus claims can also be implemented by means of one unit or means in software or hardware. The terms first, second, etc. are used to denote a name, but not any particular order.

Claims (10)

1. A database table data comparison method based on MD5, wherein the method comprises:
generating MD5 replica data of a database table at a historical point in time, wherein the MD5 replica data comprises: MD5 values corresponding to each whole row of records in the database table and MD5 values of unique indexes corresponding to each whole row of records;
querying each whole row of records in a database table at the current time point, and respectively generating a corresponding new MD5 value and a new MD5 value of a unique index corresponding to each whole row of records according to each whole row of records in the current database table;
obtaining a new MD5 value corresponding to a whole line of records in a database table at the current time point and a new MD5 value of a unique index corresponding to the whole line of records, searching whether the MD5 value which is the same as the new MD5 value of the unique index obtained in the database table at the current time point exists in MD5 copy data at the historical time point,
if the MD5 value identical to the new MD5 value of the unique index obtained in the database table at the current time point is found in the MD5 copy data of the database table at the historical time point, and the MD5 value of the whole row of records corresponding to the MD5 value of the identical unique index in the MD5 copy data of the database table at the historical time point is identical to the new MD5 value of the whole row of records obtained in the database table at the current time point, the MD5 value of the whole row of records obtained in the database table at the current time point is represented unchanged, the current time point is taken as the next historical time point, the new MD5 value corresponding to the whole row of records obtained and the new MD5 value of the unique index obtained are saved to the MD5 copy data of the database table at the next historical time point, and then the new MD5 value identical to the MD5 value of the whole row of records obtained in the MD5 copy data of the database table at the previous historical time point and the MD5 value identical to the MD5 value of the unique index obtained at the current time point are deleted.
2. The method of claim 1, wherein obtaining a new MD5 value corresponding to a whole row of records in the database table at the current time point and a new MD5 value of a unique index corresponding to the whole row of records, and searching for whether the MD5 value identical to the new MD5 value of the unique index obtained in the database table at the current time point exists in the MD5 replica data at the history time point, further comprises:
if the MD5 value of the unique index identical to the new MD5 value of the unique index currently acquired is found in the MD5 copy data of the database table at the historical time point, but the MD5 value of the whole row of records corresponding to the MD5 value of the identical unique index in the MD5 copy data of the database table at the historical time point is not equal to the new MD5 value of the whole row of records acquired in the database table at the current time point, the MD5 value of the whole row of records acquired in the database table at the current time point is updated, the new MD5 value of the whole row of records acquired and the new MD5 value of the unique index acquired are stored in the change table, the current time point is taken as the next historical time point, and after the new MD5 value of the whole row of records acquired and the new MD5 value of the unique index acquired are stored in the MD5 copy data of the database table at the next historical time point, the MD5 value of the whole row of the database table at the previous time point is deleted, and the new MD5 value of the whole row of records corresponding to the MD5 value identical to the new MD5 value of the unique index acquired.
3. The method of claim 1, wherein obtaining a new MD5 value corresponding to a whole row of records in the database table at the current time point and a new MD5 value of a unique index corresponding to the whole row of records, and searching for whether the MD5 value identical to the new MD5 value of the unique index obtained in the database table at the current time point exists in the MD5 replica data at the history time point, further comprises:
if the MD5 value of the unique index identical to the new MD5 value of the unique index acquired currently is not found in the MD5 copy data of the database table at the historical time point, the MD5 value of the whole row of records acquired in the database table at the current time point is the newly added data, the new MD5 value corresponding to the acquired whole row of records and the new MD5 value of the unique index acquired are stored into the change table, the current time point is taken as the next historical time point, and the new MD5 value corresponding to the acquired whole row of records and the new MD5 value of the unique index acquired are stored into the MD5 copy data of the database table at the next historical time point.
4. The method of claim 1, wherein obtaining a new MD5 value corresponding to a whole row of records in the database table at the current time point and a new MD5 value of a unique index corresponding to the whole row of records, and searching for whether the MD5 value identical to the new MD5 value of the unique index obtained in the database table at the current time point exists in the MD5 replica data at the history time point, further comprises:
if each acquired unique-index new MD5 value in the database table at the current time point is searched in the MD5 copy data at the historical time point, and at least one MD5 value corresponding to the whole row of records and the unique-index MD5 value corresponding to the whole row of records also exist in the MD5 copy data at the historical time point, the record in the MD5 copy data of the database table at the historical time point is the deleted MD5 value of the whole row of records in the database table, and the deleted MD5 value of the unique index corresponding to the MD5 value of the whole row of records is stored in the change table.
5. An MD 5-based database table data alignment apparatus, wherein the apparatus comprises:
a first means for generating MD5 replica data of a database table at a historical point in time, wherein the MD5 replica data comprises: MD5 values corresponding to each whole row of records in the database table and MD5 values of unique indexes corresponding to each whole row of records;
the second device is used for inquiring each whole row of records in the database table at the current time point, and respectively generating a corresponding new MD5 value and a new MD5 value of a unique index corresponding to each whole row of records according to each whole row of records in the current database table;
and a third means for acquiring a new MD5 value corresponding to a whole row of records in the database table at the current time point and a new MD5 value of the unique index corresponding to the whole row of records, searching whether the MD5 value identical to the new MD5 value of the unique index acquired in the database table at the current time point exists in the MD5 copy data at the history time point, if the MD5 value identical to the new MD5 value of the unique index acquired in the database table at the current time point is found in the MD5 copy data at the history time point, and if the MD5 value of the whole row of records corresponding to the MD5 value of the unique index in the MD5 copy data at the history time point is equal to the new MD5 value of the whole row of records acquired in the database table at the current time point, then indicating that the MD5 value of the whole row of records acquired in the database table at the current time point does not change, then taking the current time point as the next history time point, and deleting the MD5 value of the whole row of records corresponding to the MD5 value of the unique index corresponding to the MD5 value of the whole row of records acquired in the database table at the current time point to the MD5 copy data corresponding to the MD5 value of the unique index acquired in the whole row of MD5 table at the current time point is deleted.
6. The apparatus of claim 5, wherein the third means is further configured to, if the MD5 copy data of the database table at the historical time point finds the MD5 value of the unique index that is the same as the new MD5 value of the unique index that is currently acquired, but the MD5 value of the entire row of records corresponding to the MD5 value of the same unique index in the MD5 copy data of the database table at the historical time point is not equal to the new MD5 value of the entire row of records that is acquired in the database table at the current time point, store the new MD5 value of the entire row of records that is acquired and the new MD5 value of the unique index that is acquired in the change table, take the current time point as the historical time point of the next time point, and save the new MD5 value of the entire row of records that is acquired to the new MD5 value of the unique index that is acquired in the database table at the next time point, delete the new MD5 value of the entire row of records that is acquired to the MD5 value that is the same as the MD5 copy data of the entire row of the MD5 table at the current time point that is acquired.
7. The apparatus according to claim 5, wherein the third means is further configured to store the new MD5 value corresponding to the obtained whole row record and the new MD5 value of the obtained unique index into the change table if the MD5 value of the unique index identical to the new MD5 value of the currently obtained unique index is not found in the MD5 replica data of the database table at the historical time point, which represents that the MD5 value of the obtained whole row record in the database table at the current time point is newly added data, and save the new MD5 value corresponding to the obtained whole row record and the new MD5 value of the obtained unique index into the MD5 replica data of the database table at the next historical time point with the current time point as the next historical time point.
8. The apparatus according to claim 5, wherein the third means is further configured to, if each acquired new MD5 value of the unique index in the database table at the current time point is found in the MD5 replica data at the historical time point, and the MD5 replica data at the historical time point further has at least one MD5 value corresponding to the entire row record and an MD5 value of the unique index corresponding to the entire row record, store the MD5 value of the unique index corresponding to the MD5 value of the deleted entire row record in the change table as the MD5 value of the deleted entire row record in the database table in the MD5 replica data of the database table at the historical time point.
9. A computer readable medium having stored thereon computer readable instructions executable by a processor to implement the method of any one of claims 1 to 4.
10. An apparatus for information processing at a network device, the apparatus comprising a memory for storing computer program instructions and a processor for executing the program instructions, wherein the computer program instructions, when executed by the processor, trigger the apparatus to perform the method of any one of claims 1 to 4.
CN202110246545.0A 2021-03-05 2021-03-05 MD 5-based database table data comparison method and device Active CN112948389B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110246545.0A CN112948389B (en) 2021-03-05 2021-03-05 MD 5-based database table data comparison method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110246545.0A CN112948389B (en) 2021-03-05 2021-03-05 MD 5-based database table data comparison method and device

Publications (2)

Publication Number Publication Date
CN112948389A CN112948389A (en) 2021-06-11
CN112948389B true CN112948389B (en) 2023-07-25

Family

ID=76247937

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110246545.0A Active CN112948389B (en) 2021-03-05 2021-03-05 MD 5-based database table data comparison method and device

Country Status (1)

Country Link
CN (1) CN112948389B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113449505A (en) * 2021-07-01 2021-09-28 浪潮天元通信信息系统有限公司 File comparison method

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20110102555A (en) * 2010-03-11 2011-09-19 이너비트 주식회사 Synchronization method for specific data of dbms mounted in embedded terminal device
CN109977082A (en) * 2019-03-12 2019-07-05 福建省农村信用社联合社 A kind of method and computer readable storage medium of high-volume data automatic comparison
CN111078672A (en) * 2019-12-20 2020-04-28 中国建设银行股份有限公司 Data comparison method and device for database
CN111143368A (en) * 2019-12-27 2020-05-12 瀚高基础软件股份有限公司 Relational database data comparison method and system
CN112416907A (en) * 2020-12-03 2021-02-26 厦门市美亚柏科信息股份有限公司 Database table data importing and exporting method, terminal equipment and storage medium

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US11429935B2 (en) * 2012-11-01 2022-08-30 Red Hat Israel, Ltd. Retrieving historical tags hierarchy plus related objects
US10671642B2 (en) * 2016-11-11 2020-06-02 International Business Machines Corporation Copying data changes to a target database
CN107682436A (en) * 2017-10-09 2018-02-09 武汉斗鱼网络科技有限公司 A kind of method, apparatus and equipment of more new file
CN111382334B (en) * 2020-03-11 2022-05-13 腾讯科技(深圳)有限公司 Data processing method and device, computer and readable storage medium
CN111651453B (en) * 2020-04-30 2024-02-06 中国平安财产保险股份有限公司 User history behavior query method and device, electronic equipment and storage medium
CN112256715B (en) * 2020-11-12 2024-04-19 微医云(杭州)控股有限公司 Index updating method and device, electronic equipment and storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20110102555A (en) * 2010-03-11 2011-09-19 이너비트 주식회사 Synchronization method for specific data of dbms mounted in embedded terminal device
CN109977082A (en) * 2019-03-12 2019-07-05 福建省农村信用社联合社 A kind of method and computer readable storage medium of high-volume data automatic comparison
CN111078672A (en) * 2019-12-20 2020-04-28 中国建设银行股份有限公司 Data comparison method and device for database
CN111143368A (en) * 2019-12-27 2020-05-12 瀚高基础软件股份有限公司 Relational database data comparison method and system
CN112416907A (en) * 2020-12-03 2021-02-26 厦门市美亚柏科信息股份有限公司 Database table data importing and exporting method, terminal equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Database system comparison based on spatiotemporal functionality;Antonios Makris 等;ACM;第1-7页 *
一种融入MD5的影子表算法研究;袁满;康峰峰;黄刚;;计算机应用研究(01);第149-151页 *

Also Published As

Publication number Publication date
CN112948389A (en) 2021-06-11

Similar Documents

Publication Publication Date Title
JP6419319B2 (en) Synchronize shared folders and files
US8938430B2 (en) Intelligent data archiving
CN111352902A (en) Log processing method and device, terminal equipment and storage medium
CN107704202B (en) Method and device for quickly reading and writing data
WO2018097846A1 (en) Edge store designs for graph databases
US11153071B2 (en) Citation and attribution management methods and systems
CN111324665B (en) Log playback method and device
CN106547646B (en) Data backup and recovery method and data backup and recovery device
CN112948389B (en) MD 5-based database table data comparison method and device
US20130290301A1 (en) Efficient file path indexing for a content repository
CN115168362A (en) Data processing method and device, readable medium and electronic equipment
WO2023083237A1 (en) Graph data management
WO2019228009A1 (en) Lsm tree optimization method and device and computer equipment
US20190384825A1 (en) Method and device for data protection and computer readable storage medium
CN115795187A (en) Resource access method, device and equipment
US11500837B1 (en) Automating optimizations for items in a hierarchical data store
CN111625397B (en) Service log backup method, cluster, device, electronic equipment and storage medium
CN112632211A (en) Semantic information processing method and equipment for mobile robot
US9330130B1 (en) Get row index of record in dynamic data table
CN112699129A (en) Data processing system, method and device
CN106155837B (en) method and device for restoring data of main and standby databases
CN114443777B (en) Multi-data aggregation management method, device, equipment and system
US10521314B2 (en) Cross-referenced irregular field storage in databases
US11681740B2 (en) Probabilistic indices for accessing authoring streams
CN116701545A (en) Audit data analysis method, audit data analysis device, storage medium and audit data processor

Legal Events

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