CN110852058A - List comparison method and device - Google Patents

List comparison method and device Download PDF

Info

Publication number
CN110852058A
CN110852058A CN201910903744.7A CN201910903744A CN110852058A CN 110852058 A CN110852058 A CN 110852058A CN 201910903744 A CN201910903744 A CN 201910903744A CN 110852058 A CN110852058 A CN 110852058A
Authority
CN
China
Prior art keywords
list
ciphertext
target data
data
reference data
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.)
Pending
Application number
CN201910903744.7A
Other languages
Chinese (zh)
Inventor
李晓鹏
易昕
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guiyang Longmaster Information and Technology Co ltd
Original Assignee
Guiyang Longmaster Information and 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 Guiyang Longmaster Information and Technology Co ltd filed Critical Guiyang Longmaster Information and Technology Co ltd
Priority to CN201910903744.7A priority Critical patent/CN110852058A/en
Publication of CN110852058A publication Critical patent/CN110852058A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/30Information retrieval; Database structures therefor; File system structures therefor of unstructured textual data
    • G06F16/33Querying
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/602Providing cryptographic facilities or services

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Computational Linguistics (AREA)
  • Health & Medical Sciences (AREA)
  • Bioethics (AREA)
  • General Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a method and a device for comparing lists, wherein target data and reference data are imported into a first list and a second list by acquiring the target data and the reference data; if the lengths of the target data and the reference data are not consistent, respectively encrypting the target data and the reference data to obtain a corresponding third list and a corresponding fourth list; respectively sorting the target data encrypted text in the third list and the reference data encrypted text in the fourth list to obtain a fifth list and a sixth list; and corresponding the rows of the fifth list and the sixth list, and comparing the target data encryption text in the fifth list with the reference data encryption text in the sixth list line by line to obtain a comparison result. The method and the device can reduce circulation, enable one list file to be compared one by one line, have small processed data amount, can compare lists quickly, and improve comparison efficiency.

Description

List comparison method and device
Technical Field
The present application relates to the field of computer technologies, and in particular, to a method and an apparatus for comparing lists.
Background
List comparison is often used to compare order numbers, names, place names, book names, etc. For example, if there are two manifest files a and B, a list that exists in manifest a but does not exist in B, or a list that exists in manifest B but does not exist in manifest a is to be listed, if the manifest record volume of the two files is large, a certain amount of work is required for comparison. The common practice is to search in a loop, for example, two manifest files a and B, take a line from the file a, search for the presence of the line in B, and after the line is completed, extract the downlink from a, and continue searching for the presence of the line in B. If there are 10 records in the file a and 20 records in the file B, 10W × 20W is required for one comparison cycle, which is 200W cycles, and the larger the data size is, the more the number of invalid cycles is, and the waste of resources is generated.
Disclosure of Invention
The application provides a method and a device for list comparison, which aim to solve the problems of large data volume and large number of invalid cycles of the existing list comparison.
In a first aspect, to achieve the above object, the present application provides a method for comparing lists, where the method includes:
acquiring target data and reference data, importing the target data into a first list, and importing the reference data into a second list;
if the lengths of the target data and the reference data are not consistent, respectively encrypting the target data in the first list and the reference data in the second list to obtain a corresponding third list and a corresponding fourth list; the third list comprises original target data and corresponding target data plus ciphertext, and the fourth list comprises original reference data and corresponding reference data plus ciphertext;
respectively sorting the target data encrypted text in the third list and the reference data encrypted text in the fourth list to obtain a fifth list and a sixth list;
and corresponding each line of the fifth list and each line of the sixth list, and comparing the target data ciphertext in the fifth list with the reference data ciphertext in the sixth list line by line to obtain a list comparison result.
Further, the sorting includes ascending or descending.
Further, if the sorting is ascending, the corresponding of the rows of the fifth list and the sixth list, and comparing the target data ciphertext in the fifth list with the reference data ciphertext in the sixth list row by row to obtain a list comparison result, include:
comparing the first target data ciphertext in the fifth list with the first reference data ciphertext in the sixth list, and if the comparison result is less than 0, supplementing the first target data and the corresponding first target data ciphertext in the sixth list;
if the comparison result is greater than 0, supplementing first reference data and corresponding first reference data plus ciphertext in the fifth list;
and if the comparison result is equal to 0, the comparison is consistent, and the fifth list or the sixth list does not need to supplement data.
Further, if the sorting is a descending order, the corresponding rows of the fifth list and the sixth list are compared with each other line by line to obtain a list comparison result, where the comparing includes:
comparing the first target data ciphertext in the fifth list with the first reference data ciphertext in the sixth list, and if the comparison result is less than 0, supplementing the fifth list with the first reference data and the corresponding first reference data ciphertext;
if the comparison result is greater than 0, supplementing first target data and the corresponding first target data plus ciphertext in the sixth list;
and if the comparison result is equal to 0, the comparison is consistent, and the fifth list or the sixth list does not need to supplement data.
Further, if the fifth list or the sixth list is a blank line when aligned line by line, supplementing the data in the corresponding line of the sixth list or the fifth list in the blank line.
In a second aspect, the present application further provides an apparatus for list comparison, the apparatus includes:
the acquisition unit is used for acquiring target data and reference data, importing the target data into a first list and importing the reference data into a second list;
an encrypting unit, configured to encrypt the target data in the first list and the reference data in the second list if the lengths of the target data and the reference data are inconsistent, to obtain a third list and a fourth list; the third list comprises original target data and corresponding target data plus ciphertext, and the fourth list comprises original reference data and corresponding reference data plus ciphertext;
a sorting unit, configured to sort the target data ciphertext in the third list and the reference data ciphertext in the fourth list, respectively, to obtain a fifth list and a sixth list corresponding to the target data ciphertext and the reference data ciphertext;
and the comparison unit is used for corresponding each line of the fifth list and the sixth list, and comparing the target data ciphertext in the fifth list with the reference data ciphertext in the sixth list line by line to obtain a comparison result.
Further, the sorting unit includes an ascending order or a descending order.
Further, if the sorting is ascending, the alignment unit is configured to:
comparing the first target data ciphertext in the fifth list with the first reference data ciphertext in the sixth list, and if the comparison result is less than 0, supplementing the first target data and the corresponding first target data ciphertext in the sixth list;
if the comparison result is greater than 0, supplementing first reference data and corresponding first reference data plus ciphertext in the fifth list;
and if the comparison result is equal to 0, the comparison is consistent, and the fifth list or the sixth list does not need to supplement data.
Further, if the sorting is descending, the alignment unit is configured to:
comparing the first target data ciphertext in the fifth list with the first reference data ciphertext in the sixth list, and if the comparison result is less than 0, supplementing the fifth list with the first reference data and the corresponding first reference data ciphertext;
if the comparison result is greater than 0, supplementing first target data and the corresponding first target data plus ciphertext in the sixth list;
and if the comparison result is equal to 0, the comparison is consistent, and the fifth list or the sixth list does not need to supplement data.
Further, the alignment unit is further configured to: and if the fifth list or the sixth list is a blank line when the rows are aligned line by line, supplementing the data in the corresponding line of the sixth list or the fifth list in the blank line.
In a third aspect, to achieve the above object, the present application provides a computer-readable storage medium, on which a computer program is stored, which when executed by a processor, implements the steps of the method for matching a manifest according to any one of the first aspect.
In a fourth aspect, to achieve the above object, the present application provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the computer program to implement the steps of the method for comparing lists according to any one of the first aspect.
According to the technical scheme, the method and the device for list comparison provided by the embodiment of the application have the advantages that target data and reference data are obtained, the target data are imported into a first list, and the reference data are imported into a second list; if the lengths of the target data and the reference data are not consistent, respectively encrypting the target data in the first list and the reference data in the second list to obtain a corresponding third list and a corresponding fourth list; the third list comprises original target data and corresponding target data plus ciphertext, and the fourth list comprises original reference data and corresponding reference data plus ciphertext; respectively sorting the target data encrypted text in the third list and the reference data encrypted text in the fourth list to obtain a fifth list and a sixth list; and corresponding each line of the fifth list and each line of the sixth list, and comparing the target data ciphertext in the fifth list with the reference data ciphertext in the sixth list line by line to obtain a comparison result. The method for comparing the list files line by line is adopted, circulation is reduced, one list file is compared line by line one to one, the processed data volume is small, list comparison can be performed quickly, and comparison efficiency is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the application.
Drawings
In order to more clearly describe the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without inventive exercise.
Fig. 1 is a schematic flowchart of a method for comparing lists according to an embodiment of the present disclosure;
fig. 2 is a schematic structural diagram of a first list provided in an embodiment of the present application;
fig. 3 is a schematic structural diagram of a second list provided in an embodiment of the present application;
fig. 4 is a schematic structural diagram of a third list provided in an embodiment of the present application;
fig. 5 is a schematic structural diagram of a fourth list provided in an embodiment of the present application;
fig. 6 is a schematic structural diagram of a fifth list provided in an embodiment of the present application;
fig. 7 is a schematic structural diagram of a sixth list provided in an embodiment of the present application;
fig. 8 is a schematic flowchart of a comparison result of an acquired list according to a first embodiment of the present application;
fig. 9 is a schematic structural diagram of a comparison between first row data of a fifth list and a sixth list according to the first embodiment of the present application;
fig. 10 is a schematic structural diagram of a comparison of first row data with supplemental data according to a first embodiment of the present application;
fig. 11 is a schematic structural diagram of the third row of data after comparing the supplementary data provided in the first embodiment of the present application;
fig. 12 is a schematic structural diagram of a list comparison result provided in the first embodiment of the present application;
fig. 13 is a schematic flowchart of a comparison result of an acquired list according to a first embodiment of the present application;
fig. 14 is a schematic structural diagram of an apparatus for list comparison according to an embodiment of the present disclosure.
Detailed Description
The features and advantages of the present application will become more apparent and appreciated from the following detailed description of the application.
The word "exemplary" is used exclusively herein to mean "serving as an example, embodiment, or illustration. Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments. While the various aspects of the embodiments are presented in drawings, the drawings are not necessarily drawn to scale unless specifically indicated.
In the description of the present application, it should be noted that the terms "upper", "lower", "inner", "outer", "front", "rear", "left" and "right" and the like indicate orientations or positional relationships based on operational states of the present application, and are only used for convenience of description and simplification of description, but do not indicate or imply that the referred device or element must have a specific orientation, be constructed in a specific orientation and be operated, and thus, should not be construed as limiting the present application. Furthermore, the terms "first," "second," "third," and "fourth" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.
To solve the above problems, the present application provides a method and an apparatus for comparing lists, and the following describes in detail a specific embodiment of the present application with reference to the accompanying drawings.
Fig. 1 is a flowchart illustrating a method for list comparison according to a first embodiment of the present application, and as shown in fig. 1, the method includes steps S101 to S104.
S101: target data and reference data are acquired, the target data are imported into a first list, and the reference data are imported into a second list.
For example, two existing files need to be compared, the file a includes 10 rows of records, namely the target data, and the content is a place name; the file B also includes 10 records, i.e., the reference data, the content is the place name, and different contents in the file a and the file B need to be found. Firstly, the place name of the file A and the place name of the file B are determined as the comparison and comparison contents. And importing the target data corresponding to the file A into a first list, as shown in FIG. 2. The reference data corresponding to document B is imported into a second list, as shown in fig. 3.
S102: if the lengths of the target data and the reference data are not consistent, respectively encrypting the target data in the first list and the reference data in the second list to obtain a corresponding third list and a corresponding fourth list; the third list includes original target data and corresponding target data plus ciphertext, and the fourth list includes original reference data and corresponding reference data plus ciphertext.
In specific implementation, if the lengths of the target data and the reference data are consistent and are both numbers or both character strings, the sequencing step can be directly performed without encryption processing. However, if the comparison shows that the place names are complex and the place names are inconsistent in length and Chinese exists, the MD5 encryption is carried out, and the encrypted ciphertext is 32 bits in length and can be used for sequencing in the subsequent steps. If the target data in the first list is encrypted, a corresponding third list is obtained, where the third list includes the original target data and the corresponding target data plus the ciphertext, as shown in fig. 4. And encrypting the reference data in the second list to obtain a corresponding fourth list, wherein the fourth list comprises the original reference data and the corresponding reference data plus encrypted text, as shown in fig. 5.
S103: and respectively sorting the target data encrypted text in the third list and the reference data encrypted text in the fourth list to obtain a fifth list and a sixth list corresponding to the target data encrypted text and the reference data encrypted text.
In this step, the sorting includes ascending or descending operation, the sorted data may be compared to obtain a corresponding list, for example, after the ascending operation, a fifth list is shown in fig. 6, and a sixth list is shown in fig. 7.
And if the lengths of the target data and the reference data are consistent and are both numbers or both character strings, directly sequencing the lists where the target data and the reference data are located, namely respectively sequencing the target data and the reference data.
S104: and corresponding each line of the fifth list and each line of the sixth list, and comparing the target data ciphertext in the fifth list with the reference data ciphertext in the sixth list line by line to obtain a list comparison result. In a first embodiment, the sorting is ascending, and the step of obtaining the list comparison result is shown in fig. 8:
s401: and comparing the first target data ciphertext in the fifth list with the first reference data ciphertext in the sixth list, and if the comparison result is less than 0, supplementing the first target data and the corresponding first target data ciphertext into the sixth list.
S402: and if the comparison result is greater than 0, supplementing the first reference data and the corresponding first reference data plus the ciphertext in the fifth list.
S403: and if the comparison result is equal to 0, the comparison is consistent, and the fifth list or the sixth list does not need to supplement data.
In this embodiment, if the data in the first row of the fifth list and the sixth list are compared, it can be known whether data needs to be supplemented in the fifth list and the sixth list according to a comparison rule and a row data comparison result. And if the target data plus ciphertext and the reference data plus ciphertext are the character strings, subtracting can be carried out, and if the target data plus ciphertext and the reference data plus ciphertext are numbers, subtracting can also be carried out to obtain corresponding list comparison results.
After the rows of the fifth list and the sixth list are aligned, the data of the first row are compared, as shown in fig. 9, that is, the first target data ciphertext corresponding to the national island city of Shandong province and the first reference data ciphertext corresponding to the national Guangzhou city of Guangdong province are compared in size, and the comparison result is less than 0, which indicates that in an ascending scene, the data of the first row corresponding to the first target data does not exist in the sixth list, the data of the first row in the fifth list is labeled, the data of the sixth list lacking the national island city of Shandong province is supplemented, and the remaining data in the sixth list are sequentially moved downward and are shown in fig. 10 after being supplemented. The data supplemented in the first row size comparison is the content difference between the fifth list and the sixth list, i.e. the list comparison result.
After the data in the first row is compared, the data in the second row is compared again, as shown in fig. 10, the data in the second row are all "Guangzhou City, Guangdong province", that is, the comparison result is equal to 0, the comparison is consistent, and the data does not need to be supplemented in the fifth list or the sixth list. And then, continuously comparing the third line of data, comparing a third target data ciphertext corresponding to the "Tianjin City" with a third reference data ciphertext corresponding to the "Inmony autonomous region Eldos City quasi-Guelder station", wherein the comparison result is greater than 0, indicating that the line of data corresponding to the third reference data does not exist in the fifth list in an ascending scene, labeling the line of data in the sixth list, supplementing the line of data in the fifth list lacking the "Inmony autonomous region Eldos City quasi-Guelder station", and sequentially moving the rest lines of data in the fifth list downwards, wherein the supplemented data are shown in FIG. 11. The above steps are repeated, and the list comparison result can be shown in fig. 12. And if the fifth list or the sixth list is a blank line when the line-by-line comparison is carried out to the end of the list, supplementing and marking the data in the corresponding line of the sixth list or the fifth list in the blank line.
In a second embodiment, the sorting is descending order, and the step of obtaining the list comparison result is shown in fig. 13:
s404: and comparing the first target data ciphertext in the fifth list with the first reference data ciphertext in the sixth list, and if the comparison result is less than 0, supplementing the first reference data and the corresponding first reference data ciphertext in the fifth list.
S405: and if the comparison result is greater than 0, supplementing the first target data and the corresponding first target data plus ciphertext in the sixth list.
S406: and if the comparison result is equal to 0, the comparison is consistent, and the fifth list or the sixth list does not need to supplement data.
And if the lengths of the target data and the reference data are consistent, comparing the target data and the reference data in the list line by line to obtain a list comparison result.
The method for comparing the list files line by line is adopted, circulation is reduced, one list file is compared line by line one to one, the processed data volume is small, list comparison can be performed quickly, and comparison efficiency is improved.
Corresponding to the embodiment of the method for list comparison provided by the application, the application also provides an embodiment of a device for list comparison. Referring to fig. 14, a schematic structural diagram of an apparatus for list comparison provided in an embodiment of the present application is shown, where the apparatus includes:
an obtaining unit 101, configured to obtain target data and reference data, import the target data into a first list, and import the reference data into a second list;
an encrypting unit 102, configured to encrypt the target data in the first list and the reference data in the second list to obtain a third list and a fourth list, respectively, if the lengths of the target data and the reference data are inconsistent; the third list includes original target data and corresponding target data plus ciphertext, and the fourth list includes original reference data and corresponding reference data plus ciphertext. If the target data and the reference data are identical in length, the encryption unit 102 is not required.
A sorting unit 103, configured to sort the target data ciphertext in the third list and the reference data ciphertext in the fourth list, respectively, so as to obtain a fifth list and a sixth list corresponding to the target data ciphertext and the reference data ciphertext; the sorting unit comprises an ascending order or a descending order. If the lengths of the target data and the reference data are consistent and both are numbers or both are character strings, the sorting unit 103 directly sorts the list where the target data and the reference data are located, that is, sorts the target data and the reference data respectively.
A comparing unit 104, configured to correspond to each line of the fifth list and the sixth list, and compare the target data ciphertext in the fifth list with the reference data ciphertext in the sixth list line by line, so as to obtain a list comparison result.
Specifically, if the sequence is ascending, the alignment unit 104 is configured to:
comparing the first target data ciphertext in the fifth list with the first reference data ciphertext in the sixth list, and if the comparison result is less than 0, supplementing the first target data and the corresponding first target data ciphertext in the sixth list;
if the comparison result is greater than 0, supplementing first reference data and corresponding first reference data plus ciphertext in the fifth list;
and if the comparison result is equal to 0, the comparison is consistent, and the fifth list or the sixth list does not need to supplement data.
Specifically, if the sequence is descending, the alignment unit 104 is further configured to:
comparing the first target data ciphertext in the fifth list with the first reference data ciphertext in the sixth list, and if the comparison result is less than 0, supplementing the fifth list with the first reference data and the corresponding first reference data ciphertext;
if the comparison result is greater than 0, supplementing first target data and the corresponding first target data plus ciphertext in the sixth list;
and if the comparison result is equal to 0, the comparison is consistent, and the fifth list or the sixth list does not need to supplement data.
Further, the alignment unit 104 is further configured to: and if the fifth list or the sixth list is a blank line when the rows are aligned line by line, supplementing the data in the corresponding line of the sixth list or the fifth list in the blank line.
According to the method and the device for list comparison, target data and reference data are obtained, the target data are imported into a first list, and the reference data are imported into a second list; if the lengths of the target data and the reference data are not consistent, respectively encrypting the target data in the first list and the reference data in the second list to obtain a corresponding third list and a corresponding fourth list; the third list comprises original target data and corresponding target data plus ciphertext, and the fourth list comprises original reference data and corresponding reference data plus ciphertext; respectively sorting the target data encrypted text in the third list and the reference data encrypted text in the fourth list to obtain a fifth list and a sixth list; and corresponding each line of the fifth list and each line of the sixth list, and comparing the target data ciphertext in the fifth list with the reference data ciphertext in the sixth list line by line to obtain a comparison result. The method for comparing the list files line by line is adopted, circulation is reduced, one list file is compared line by line one to one, the processed data volume is small, list comparison can be performed quickly, and comparison efficiency is improved.
According to the above list comparison method, the embodiment of the present application further provides a readable storage medium and a computer device. The readable storage medium is stored with an executable program, and the program realizes the steps of the list comparison method when being executed by the processor; the computer device comprises a memory, a processor and an executable program stored on the memory and capable of running on the processor, and the steps of the list comparison method are realized when the processor executes the program.
The present application has been described in detail with reference to specific embodiments and illustrative examples, but the description is not intended to limit the application. Those skilled in the art will appreciate that various equivalent substitutions, modifications or improvements may be made to the presently disclosed embodiments and implementations thereof without departing from the spirit and scope of the present disclosure, and these fall within the scope of the present disclosure. The protection scope of this application is subject to the appended claims.

Claims (10)

1. A method for inventory comparison, the method comprising:
acquiring target data and reference data, importing the target data into a first list, and importing the reference data into a second list;
if the lengths of the target data and the reference data are not consistent, respectively encrypting the target data in the first list and the reference data in the second list to obtain a corresponding third list and a corresponding fourth list; the third list comprises original target data and corresponding target data plus ciphertext, and the fourth list comprises original reference data and corresponding reference data plus ciphertext;
respectively sorting the target data encrypted text in the third list and the reference data encrypted text in the fourth list to obtain a fifth list and a sixth list;
and corresponding each line of the fifth list and each line of the sixth list, and comparing the target data ciphertext in the fifth list with the reference data ciphertext in the sixth list line by line to obtain a list comparison result.
2. The method of claim 1, wherein the sorting comprises ascending or descending.
3. The method of claim 2, wherein if the sorting is ascending, the comparing the target data ciphertext in the fifth list with the reference data ciphertext in the sixth list line by line to obtain the list comparison result comprises:
comparing the first target data ciphertext in the fifth list with the first reference data ciphertext in the sixth list, and if the comparison result is less than 0, supplementing the first target data and the corresponding first target data ciphertext in the sixth list;
if the comparison result is greater than 0, supplementing first reference data and corresponding first reference data plus ciphertext in the fifth list;
and if the comparison result is equal to 0, the comparison is consistent, and the fifth list or the sixth list does not need to supplement data.
4. The method of claim 3, wherein if the sorting is descending order, the comparing the target data ciphertext in the fifth list with the reference data ciphertext in the sixth list line by line to obtain the list comparison result comprises:
comparing the first target data ciphertext in the fifth list with the first reference data ciphertext in the sixth list, and if the comparison result is less than 0, supplementing the fifth list with the first reference data and the corresponding first reference data ciphertext;
if the comparison result is greater than 0, supplementing first target data and the corresponding first target data plus ciphertext in the sixth list;
and if the comparison result is equal to 0, the comparison is consistent, and the fifth list or the sixth list does not need to supplement data.
5. The method according to any one of claims 2-3, wherein if the fifth list or the sixth list is a blank line when aligned row by row, the blank line is supplemented with data in the corresponding line of the sixth list or the fifth list.
6. An apparatus for matching lists, the apparatus comprising:
the acquisition unit is used for acquiring target data and reference data, importing the target data into a first list and importing the reference data into a second list;
an encrypting unit, configured to encrypt the target data in the first list and the reference data in the second list if the lengths of the target data and the reference data are inconsistent, to obtain a third list and a fourth list; the third list comprises original target data and corresponding target data plus ciphertext, and the fourth list comprises original reference data and corresponding reference data plus ciphertext;
a sorting unit, configured to sort the target data ciphertext in the third list and the reference data ciphertext in the fourth list, respectively, to obtain a fifth list and a sixth list corresponding to the target data ciphertext and the reference data ciphertext;
and the comparison unit is used for corresponding each line of the fifth list and the sixth list, and comparing the target data ciphertext in the fifth list with the reference data ciphertext in the sixth list line by line to obtain a list comparison result.
7. The apparatus of claim 6, wherein the sorting unit comprises ascending or descending.
8. The apparatus of claim 7, wherein the alignment unit is configured to, if the sorting is ascending:
comparing the first target data ciphertext in the fifth list with the first reference data ciphertext in the sixth list, and if the comparison result is less than 0, supplementing the first target data and the corresponding first target data ciphertext in the sixth list;
if the comparison result is greater than 0, supplementing first reference data and corresponding first reference data plus ciphertext in the fifth list;
and if the comparison result is equal to 0, the comparison is consistent, and the fifth list or the sixth list does not need to supplement data.
9. The apparatus of claim 8, wherein if the sorting is descending, the comparing unit is configured to:
comparing the first target data ciphertext in the fifth list with the first reference data ciphertext in the sixth list, and if the comparison result is less than 0, supplementing the fifth list with the first reference data and the corresponding first reference data ciphertext;
if the comparison result is greater than 0, supplementing first target data and the corresponding first target data plus ciphertext in the sixth list;
and if the comparison result is equal to 0, the comparison is consistent, and the fifth list or the sixth list does not need to supplement data.
10. The apparatus according to any one of claims 7-8, wherein the alignment unit is further configured to: and if the fifth list or the sixth list is a blank line when the rows are aligned line by line, supplementing the data in the corresponding line of the sixth list or the fifth list in the blank line.
CN201910903744.7A 2019-09-24 2019-09-24 List comparison method and device Pending CN110852058A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910903744.7A CN110852058A (en) 2019-09-24 2019-09-24 List comparison method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910903744.7A CN110852058A (en) 2019-09-24 2019-09-24 List comparison method and device

Publications (1)

Publication Number Publication Date
CN110852058A true CN110852058A (en) 2020-02-28

Family

ID=69595968

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910903744.7A Pending CN110852058A (en) 2019-09-24 2019-09-24 List comparison method and device

Country Status (1)

Country Link
CN (1) CN110852058A (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103218398A (en) * 2013-03-13 2013-07-24 江苏省电力公司电力科学研究院 Intelligent substation SCL (substation configuration description language) file difference comparison method
CN104252481A (en) * 2013-06-27 2014-12-31 阿里巴巴集团控股有限公司 Dynamic check method and device for consistency of main and salve databases
CN104731792A (en) * 2013-12-19 2015-06-24 中国银联股份有限公司 Method and system for verifying database consistency and method and system for positioning data difference
CN106815326A (en) * 2016-12-28 2017-06-09 中国民航信息网络股份有限公司 A kind of system and method for detecting dereliction key data table uniformity
CN107066303A (en) * 2017-05-04 2017-08-18 深圳市欧瑞博电子有限公司 Firmware comparison method and device
CN107784102A (en) * 2017-10-27 2018-03-09 中国电子科技集团公司第二十八研究所 A kind of data difference comparative approach based on oracle database
CN109101603A (en) * 2018-08-01 2018-12-28 上海达梦数据库有限公司 A kind of data comparison method, device, equipment and storage medium
CN109783815A (en) * 2018-12-28 2019-05-21 华南理工大学 A kind of various dimensions network public-opinion big data comparative analysis method

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103218398A (en) * 2013-03-13 2013-07-24 江苏省电力公司电力科学研究院 Intelligent substation SCL (substation configuration description language) file difference comparison method
CN104252481A (en) * 2013-06-27 2014-12-31 阿里巴巴集团控股有限公司 Dynamic check method and device for consistency of main and salve databases
CN104731792A (en) * 2013-12-19 2015-06-24 中国银联股份有限公司 Method and system for verifying database consistency and method and system for positioning data difference
CN106815326A (en) * 2016-12-28 2017-06-09 中国民航信息网络股份有限公司 A kind of system and method for detecting dereliction key data table uniformity
CN107066303A (en) * 2017-05-04 2017-08-18 深圳市欧瑞博电子有限公司 Firmware comparison method and device
CN107784102A (en) * 2017-10-27 2018-03-09 中国电子科技集团公司第二十八研究所 A kind of data difference comparative approach based on oracle database
CN109101603A (en) * 2018-08-01 2018-12-28 上海达梦数据库有限公司 A kind of data comparison method, device, equipment and storage medium
CN109783815A (en) * 2018-12-28 2019-05-21 华南理工大学 A kind of various dimensions network public-opinion big data comparative analysis method

Similar Documents

Publication Publication Date Title
US9792340B2 (en) Identifying data items
CN103473289A (en) Device and method for completing communication addresses
JP5930496B2 (en) Method and apparatus for acquiring structured information in layout file
CN111143368B (en) Relational database data comparison method and system
CN105589894B (en) Document index establishing method and device and document retrieval method and device
CN102981884A (en) Serializing device and serializing method
CN108734110A (en) Text fragment identification control methods based on longest common subsequence and system
CN104811742A (en) Video data storage method and device
CN111191079B (en) Document content acquisition method, device, equipment and storage medium
CN107315817B (en) Electronic drawing text matching method and device, storage medium and computer equipment
CN105338073A (en) File directory processing method, server and system
CN105786843A (en) Multi-language implementation method for applications and multi-language information query method and device
CN106161193B (en) Mail processing method, device and system
CN104079623A (en) Method and system for controlling multilevel cloud storage synchrony
CN105488471A (en) Character pattern recognition method and device
CN105183950A (en) Mobile terminal based method and system for referring to engineering drawing
CN116126997B (en) Document deduplication storage method, system, device and storage medium
CN110852058A (en) List comparison method and device
EP2506540B1 (en) Enhanced contact information
CN108241639A (en) A kind of data duplicate removal method
CN104636384B (en) A kind of method and device handling document
CN111046077A (en) Data acquisition method and device, storage medium and terminal
CN105260423A (en) Duplicate removal method and apparatus for electronic cards
CN106569986A (en) Character string replacement method and device
CN104750846A (en) Method and device for finding substring

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