File comparison method, device, electronic device and storage medium

By using different matching degrees to compare titles and text content multiple times in document comparison, and combining hierarchical relationships and sequences, rich comparison results are generated, which solves the problem of single comparison results in the existing technology and improves document quality. Comparison efficiency and accuracy.

CN113901780BActive Publication Date: 2024-09-10TRAFFIC CONTROL TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202111042400.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-09-07
Publication Date
2024-09-10
Estimated Expiration
2041-09-07

AI Technical Summary

Technical Problem

Existing document comparison methods have a single output result and cannot provide users with richer comparison results. Especially when comparing multiple versions of documents, key information is easily missed and it consumes a lot of labor costs.

Method used

By obtaining the title and text content of the file to be compared, based on the hierarchical relationship between each title and the order of the text content, multiple comparisons are performed using different matching degrees to obtain the comparison results of the title and text, and combine the two Generate file comparison results that provide content differences between the first degree of matching and the second degree of matching.

Benefits of technology

It realizes the comparison of similar but poorly matched content in documents, provides richer comparison results, improves user experience, reduces the risk of missing key information, and reduces labor costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113901780B
    Figure CN113901780B
Patent Text Reader

Abstract

The present application provides a file comparison method, device, electronic device and storage medium. First, the original file and target file to be compared are obtained; then, according to the hierarchical relationship between each title, different matching degrees are used to compare the titles of the original file and the target file for multiple times to obtain the title comparison result; if there is text content under the title, different matching degrees are used to compare the text content for multiple times to obtain the text comparison result; finally, according to the title comparison result and the text comparison result, the file comparison result of the original file and the target file to be compared is obtained. The present application compares in sequence according to the hierarchical relationship between each title and the order of the text content. At the same time, by using different matching degrees for multiple comparisons, it can also compare the content of two documents that are similar but have a lower matching degree for users, provide users with richer comparison results, and enhance the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to data processing technology, and in particular, to a file comparison method, device, electronic device and storage medium. Background Art

[0002] When comparing the contents of documents that may have multiple versions, such as contracts, papers, templates, etc., for example, when comparing tender documents with bidding documents, most of them are done manually, which not only consumes more manpower costs but also easily misses key information.

[0003] In addition to manual comparison, you can also use a comparison algorithm to compare document differences. Commonly used comparison algorithms are mostly based on text lines. After obtaining the text lines of the two documents to be compared through document parsing technology, they are sorted from left to right and from top to bottom to form a sentence set, and then concatenated to form a string, and then compared character by character. This method can usually only compare whether the two documents are the same or different, and the output results are relatively simple, which cannot provide users with richer comparison results. Summary of the invention

[0004] The embodiments of the present application provide a file comparison method, device, electronic device and storage medium for solving the problem that the output results of current document comparison methods are relatively simple and cannot provide users with richer comparison results.

[0005] According to a first aspect of an embodiment of the present application, a file comparison method is provided, which is applied to an electronic device, and the method includes:

[0006] Obtain the original file and target file to be compared;

[0007] According to the hierarchical relationship between the titles, the titles of the original file and the target file are compared multiple times using different matching degrees to obtain title comparison results;

[0008] If there is text content under the title, multiple comparisons are performed on the text content under the title using different matching degrees to obtain a text comparison result of the title;

[0009] A file comparison result between the original file and the target file is obtained based on the title comparison result and the title text comparison result, wherein the file comparison result includes content between the original file and the target file that is between a first matching degree and a second matching degree.

[0010] According to a second aspect of an embodiment of the present application, a file comparison device is provided, which is applied to an electronic device, and the device includes:

[0011] A file acquisition module, used to acquire the original file and target file to be compared;

[0012] A title comparison module is used to compare the titles of the original file and the target file multiple times using different matching degrees according to the hierarchical relationship between the titles to obtain a title comparison result;

[0013] A text comparison module, used to compare the text content under the title multiple times using different matching degrees when there is text content under the title, to obtain the text comparison result of the title;

[0014] A comparison result acquisition module is used to obtain a comparison result between the original file and the target file based on the title comparison result and the title text comparison result, wherein the file comparison result includes content between the original file and the target file that is between a first matching degree and a second matching degree.

[0015] According to a third aspect of an embodiment of the present application, there is provided an electronic device, comprising: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the file comparison method provided in the first aspect is executed.

[0016] According to a fourth aspect of an embodiment of the present application, a storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the file comparison method provided in the first aspect is executed.

[0017] The present application provides a file comparison method, device, electronic device and storage medium. The method is applied to an electronic device, firstly obtaining an original file and a target file to be compared; then, according to the hierarchical relationship between each title, using different matching degrees to compare each title of the original file and the target file multiple times, obtaining a title comparison result; if there is text content under the title, using different matching degrees to compare the text content under the title multiple times, obtaining a title text comparison result; finally, according to the title comparison result and the title text comparison result, obtaining a file comparison result of the original file and the target file to be compared. The present application is based on the structure of the document, and compares in sequence according to the hierarchical relationship between each title and the order of the text content, and can obtain the comparison results between the titles and the comparison results between the text contents. At the same time, by using different matching degrees for multiple comparisons, it can also compare the content between the first matching degree and the second matching degree in the two documents for the user, that is, similar but with a smaller matching degree, to provide the user with richer comparison results and enhance the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:

[0019] Figure 1 A flowchart of a file comparison method provided in an embodiment of the present application;

[0020] Figure 2 A schematic diagram of the structural design of the document table provided in the embodiment of the present application;

[0021] Figure 3 A schematic diagram of the structural design of the title table provided in the embodiment of the present application;

[0022] Figure 4 A schematic diagram of the structural design of the text table provided in the embodiment of the present application;

[0023] Figure 5 A flowchart of sub-steps of step S12 provided in an embodiment of the present application;

[0024] Figure 6 A functional module diagram of a file comparison device provided in an embodiment of the present application;

[0025] Figure 7 A schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0026] In the process of implementing this application, the inventors found that when comparing the contents of documents that may have multiple versions, such as contracts, papers, templates, etc., for example, when comparing tender documents with tender documents, most of them are done manually. This method not only consumes a lot of manpower costs but also easily misses key information.

[0027] In addition to manual comparison, you can also use a comparison algorithm to compare document differences. Commonly used comparison algorithms are mostly based on text lines. After obtaining the text lines of the two documents to be compared through document parsing technology, they are sorted from left to right and from top to bottom to form a sentence set, and then concatenated to form a string, and then compared character by character. This method can usually only compare whether the two documents are the same or different, and the output results are relatively simple, which cannot provide users with richer comparison results.

[0028] In view of the above problems, the present application provides a file comparison method, device, electronic device and storage medium. The method is applied to an electronic device, firstly obtaining the original file and the target file to be compared; then, according to the hierarchical relationship between each title, using different matching degrees to compare the titles of the original file and the target file for multiple times, obtaining the title comparison result; if there is text content under the title, using different matching degrees to compare the text content under the title for multiple times, obtaining the text comparison result of the title; finally, according to the title comparison results of each title and the text comparison results of the title, the file comparison results of the original file and the target file to be compared are obtained. Based on the structure of the document, the present application compares in sequence according to the hierarchical relationship between each title and the order of the text content, and can obtain the comparison results between the titles and the comparison results between the text contents. At the same time, by using different matching degrees for multiple comparisons, it can also compare the content between the first matching degree and the second matching degree, that is, similar but with a smaller matching degree, in the two documents for the user, providing the user with richer comparison results and improving the user experience.

[0029] The solutions in the embodiments of the present application can be implemented using various computer languages, for example, the object-oriented programming language Java and the interpreted scripting language JavaScript.

[0030] In order to make the technical solutions and advantages in the embodiments of the present application more clearly understood, the exemplary embodiments of the present application are further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than an exhaustive list of all the embodiments. It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other without conflict.

[0031] Please refer to Figure 1 , Figure 1 A flowchart of a file comparison method provided in an embodiment of the present application. In this embodiment, the method includes:

[0032] Step S11, obtaining the original file and the target file to be compared.

[0033] Step S12, according to the hierarchical relationship between the titles, the titles of the original file and the target file are compared multiple times using different matching degrees to obtain title comparison results.

[0034] Step S13, after each title comparison is completed, if there is text content under the title, the text content under the title is compared multiple times using different matching degrees to obtain the text comparison result of the title.

[0035] Step S14, obtaining a file comparison result between the original file and the target file according to the title comparison result and the title text comparison result.

[0036] The file comparison result includes the content between the original file and the target file that is between a first matching degree and a second matching degree.

[0037] In the above steps, this embodiment compares the documents in sequence according to the hierarchical relationship between the titles and the order of the text contents based on the structure of the document, and can obtain the comparison results between the titles and the comparison results between the text contents. At the same time, by using different matching degrees for multiple comparisons, it can also compare the contents of two documents that are similar but have a lower matching degree for users, provide users with richer comparison results, and enhance the user experience.

[0038] Optionally, in this embodiment, the comparison method includes: comparing the title and the text content under the title through Elasticsearch.

[0039] Elasticsearch is a distributed, scalable, real-time search and analysis engine, a search engine built on the full-text search engine Apache Lucene. In addition to full-text search, Elasticsearch can also perform distributed real-time file storage and index each field so that it can be searched; a distributed search engine for real-time analysis; and it can be expanded to hundreds of servers and process PB-level structured or unstructured data.

[0040] It is worth noting that Elasticsearch essentially segments the Chinese in the input search conditions through a word segmenter, and then searches for multiple words. The default word segmenter in Elasticsearch is the standard word segmenter, which segments words according to single Chinese characters and is not friendly to Chinese. In order to solve this problem, the embodiment of the present application uses the IK word segmenter as the word segmenter of Elasticsearch.

[0041] Optionally, in this embodiment, before comparing the title and the text content under the title through Elasticsearch, the document to be compared needs to be stored in a relational database. When storing the document, three tables are established according to the structure of the document, namely, a document table, a title table, and a text table.

[0042] Please refer to Figures 2 to 4 , Figure 2 A schematic diagram of the structural design of the document table provided in the embodiment of the present application, Figure 3 A schematic diagram of the structural design of the title table provided in the embodiment of the present application, Figure 4A schematic diagram of the structural design of the text table provided for the embodiment of the present application. In this embodiment, the document table is used to store the basic information of the document; the title table is used to store the title information of the document. Since a document usually includes a first-level title, a second-level title, a third-level title or a higher-level title, a parent_id needs to be set in the title table to indicate the ID of its parent title, and in order to indicate that the current title belongs to a certain document, a document_id needs to be set; the text table is used to store the text information under each title of the document. Since the text belongs to a certain title of the document, a chapter_id needs to be set in the text table to indicate the ID of the subordinate title, and a document_id also needs to be set.

[0043] It is worth mentioning that when importing document data into a relational database, the created index also needs to be stored in Elasticsearch.

[0044] Optionally, in this embodiment, when files are compared, since there are many nested levels of documents, it is necessary to perform data comparison recursively, and the data needs to be packaged in advance. Specifically, after obtaining the original file and the target file to be compared, all the titles (defined as chapters) and texts (defined as content) of the original file need to be extracted from the relational database, and the extracted titles and texts are packaged into a document object. The target file is also packaged as a document object in the same way, so as to obtain the two document objects that need to be compared.

[0045] Optionally, in this embodiment, file comparison needs to be performed in a two-way comparison, that is, the original file can be compared with the target file first, and then the target file can be compared with the original file, so that three types of different content can be found. One type is the content that the original file has but the target document does not have; the second type is the content that the original document does not have but the target document does; the third type is the content that the original document and the target document have similar content, but the degree of match is small (that is, the degree of match is between the first degree of match and the second degree of match).

[0046] Specifically, in this embodiment, both the title comparison and the text comparison can be performed using a two-way comparison method. Figure 5 , Figure 5 A flowchart of sub-steps of step S12 provided in an embodiment of the present application. In this embodiment, step S12 includes:

[0047] Step S121, based on the hierarchical relationship between the titles, each title of the original file is used as a comparison standard, and each title of the original file is matched with each title of the target file for multiple times to obtain a first matching result.

[0048] Step S122, based on the hierarchical relationship between the various titles, each title of the target file is used as a comparison standard, and each title of the target file is matched with each title of the original file for multiple times to obtain a second matching result.

[0049] Step S123, obtaining a title comparison result according to the first matching result and the second matching result.

[0050] In the above steps, when performing title comparison, each title of the original file can be first matched with the title of the target file to obtain a first matching result for each title in the original file; then each title of the target file can be matched with the title of the original file to obtain a second matching result for each title of the target file. The title comparison result of the original file and the target file can be obtained by combining the first matching result and the second matching result.

[0051] The following is an example of matching each title of the original file with the title of the target file, and the process of title matching is described in detail. After this, each title of the target file can be matched with the title of the original file in the same way, which will not be repeated here.

[0052] In this embodiment, step S121, based on the hierarchical relationship between the titles, takes each title of the original file as a comparison standard, matches each title of the original file with each title of the target file for multiple times, and obtains a first matching result, including:

[0053] For each title to be matched of the original file, searching among all the titles of the target file whether there is a first target title, wherein the matching degree between the first target title and the title to be matched is greater than a first matching degree;

[0054] If the first target title exists, determining that the first target title matches the title to be matched;

[0055] If the first target title does not exist, searching among all titles of the target file whether a second target title exists, wherein the matching degree between the second target title and the title to be matched is greater than a second matching degree, and the second matching degree is less than the first matching degree;

[0056] If the second target title exists, determining that the second target title does not completely match the title to be matched, and marking the title to be matched by a first mark;

[0057] If the second target title does not exist, it is determined that the title to be matched has no matching result in the target file, and the title to be matched is marked by a second mark;

[0058] Repeat the above steps to match each title of the original file according to the hierarchical order of each title of the original file until all titles of the original file are matched, thereby obtaining a first matching result.

[0059] In the above steps, the original file and the target file usually include multiple titles of different levels. When performing title comparison, it is necessary to compare them in sequence according to the title levels. For example, if the original file includes two first-level titles A1 and A2, the first-level title A1 also includes a second-level title B1, and the first-level title A2 also includes a second-level title B2. When comparing titles, first match the first-level title A1, set the matching degree to the first matching degree (for example, 90%), and then search the title of the target file for the first target title whose matching degree with the first-level title A1 is greater than the first matching degree. If the first target title exists, it means that the first-level title A1 matches the first target title.

[0060] If the first target title is not found, the matching degree is set to the second matching degree (for example, 70%), and then the second target title whose matching degree with the first-level title A1 is greater than the second matching degree is searched in the title of the target file. If the second target title is found, it is considered that the second target title matches the first-level title A1, but there are certain differences. At this time, the first-level title A1 can be marked with the first mark (for example, yellow highlight). If the second target title is not found, it means that there is no title matching the first-level title A1 in the target file. At this time, the first-level title A1 can be marked with the second mark (for example, red highlight), so that the color of the mark can be used to quickly understand whether there is a matching title for the title, or whether there is a similar title.

[0061] After the first-level title A1 is matched, the second-level title B1 of the first-level title A1 is matched in the same way as above. After B1 is matched, if B1 has subtitles, the subtitles of B1 are matched until all subtitles under the first-level title A1 are matched.

[0062] Then the first-level title A2 is matched in the same way as the first-level title A1. After the first-level title A2 is matched, the second-level title B2 of the first-level title A2 is matched. After B2 is matched, if B2 has a subtitle, the subtitle of B2 is matched until all subtitles under the first-level title A2 are matched.

[0063] Through the above-mentioned hierarchical relationship, each title of the original file is matched to obtain the first matching result of each title.

[0064] It is worth noting that if the first-level title A1 has a matching first target title, but the second-level title B1 of A1 does not have a matching first target title or second target title, the first-level title A1 needs to be marked with the first mark (such as yellow highlight).

[0065] It is worth noting that, in this embodiment, step S122, based on the hierarchical relationship between each title, takes each title of the target file as a comparison standard, and matches each title of the target file with each title of the original file for multiple times. The specific implementation steps for obtaining the second matching result are similar to the above steps, which is to search the original file for titles that match each title of the target file, which will not be repeated here.

[0066] Optionally, in this embodiment, for each title of the original file, the text of the title needs to be matched. Specifically, if there is text content under the title, the text content under the title is compared multiple times using different matching degrees to obtain the text comparison results of the title, including:

[0067] For each title of the original file, determine whether there is text content under the title; if there is text content, determine whether there is a matching first target title or second target title for the title; if the first target title or the second target title does not exist, match the text content of the title with all the text content of the target file to obtain a text comparison result of the title; if the first target title or the second target title exists, match the text content of the title with the text content under the first target title or the second target title to obtain a text comparison result.

[0068] For example, if the first-level title A1 is matched, first determine whether there is text content under the first-level title A1. If so, determine whether there is a first target title or a second target title matching the first-level title A1. If there is no first target title or a second target title, match the text content of the first-level title A1 with all the text contents of the target file to obtain the text comparison result of the first-level title A1. If there is a first target title or a second target title, compare the text content of the first-level title A1 with the text content under the first target title or the second target title.

[0069] It is worth noting that in this embodiment, when comparing the text content, multiple matching degrees are also required. Specifically, taking the matching of the text content of the title with all the text contents of the target file as an example, the specific method of text matching is described.

[0070] In this embodiment, matching the text content of the title with all the text content of the target file includes:

[0071] Searching among all the text contents of the target file whether there is a first target text, wherein the matching degree between the first target text and the text content of the title is greater than a first matching degree; if the first target text exists, determining that the first target text matches the text content of the title; if the first target text does not exist, searching among all the text contents of the target file whether there is a second target text, wherein the matching degree between the second target text and the text content of the title is greater than a second matching degree; if the second target text exists, determining that the second target text does not completely match the text content of the title, and marking the text content of the title by the first mark; if the second target text does not exist, determining that the text content to be matched has no matching result in the target file, and marking the text content of the title by the second mark.

[0072] In the above steps, it is assumed that the text content of the first-level title A1 is Z. First, the matching degree is set to the first matching degree (for example, 90%), and then a search is made in all the texts of the target file to determine whether there is a first target text whose matching degree with the text content Z is greater than the first matching degree. If so, it is determined that the first target text matches the text content Z. If the first target text does not exist, the matching degree is set to the second matching degree (for example, 70%), and the target file is searched again to determine whether there is a second target text whose matching degree with the text content Z is greater than the second matching degree. If the second target text exists, it is considered that the second target text is similar to the text content Z, and the text content Z can be marked by the first mark (for example, yellow highlight). If the second target text does not exist, the text content Z is marked by the second mark (for example, red highlight).

[0073] It is worth noting that when matching the text content of the first-level title A1 with the text content under the first target title or the second target title of A1, multiple matches are also required with different matching degrees, which is similar to the above steps and will not be repeated here.

[0074] For each title of the original file, if there is a matching first target title for the title, and the body content of the title is different from the body content of the first target title, the title is marked with the first tag.

[0075] In the above steps, two parallel threads can be used to simultaneously match the title and the text under the title. For example, if thread 1 is used to match the title and thread 2 is used to match the text, when thread 1 is comparing the title, the comparison task of the text content of the title is sent to thread 2 for execution. Assume that when thread 1 is matching the first-level title A1, if there is no text content under the first-level title A1, thread 2 is in an idle state at this time.

[0076] After thread 1 and thread 2 have completed matching the title and the text content of the title, the return values ​​(i.e., matching results) of thread 1 and thread 2 may be merged. If the two titles are the same (i.e., the matching degree is greater than the first matching degree), but the text content under the titles is not the same (i.e., the matching degree is less than or equal to the first matching degree), the title may be marked with a first mark (e.g., yellow highlight).

[0077] In this embodiment, the first mark is used to indicate that two files have similar contents but with a small matching degree, and the second mark is used to indicate that there is no matching result.

[0078] Optionally, in this embodiment, the method further includes:

[0079] The file comparison results are stored hierarchically to obtain title layer differences and content layer differences, so as to display differences at different levels.

[0080] In the above steps, the file comparison results usually include the differences between titles at different levels and the differences between the texts under each title. After these differences are stored in a hierarchical manner, it is convenient to display the differences at different levels in a hierarchical manner, which greatly improves work efficiency and accuracy and reduces the risk of missing key information.

[0081] In summary, the embodiment of the present application provides a file comparison method, which is applied to an electronic device, first obtaining an original file to be compared and a target file; then, according to the hierarchical relationship between each title, using different matching degrees to compare each title of the original file and the target file for multiple times, obtaining a title comparison result; if there is a text content under the title, using different matching degrees to compare the text content under the title for multiple times, obtaining a text comparison result of the title; finally, according to the title comparison results of each title and the text comparison results of the title, the file comparison results of the original file to be compared and the target file are obtained. The present application is based on the structure of the document, and compares in sequence according to the hierarchical relationship between each title and the order of the text content, and can obtain the comparison results between the titles and the comparison results between the text contents. At the same time, by using different matching degrees for multiple comparisons, it can also compare the content between the first matching degree and the second matching degree in the two documents for the user, that is, similar but with a smaller matching degree, to provide users with richer comparison results and enhance the user experience.

[0082] Please refer to Figure 6 , Figure 6 This is a functional module diagram of a file comparison device provided in an embodiment of the present application. In this embodiment, the file comparison device 110 is applied to an electronic device, and the device includes:

[0083] The file acquisition module 1101 is used to acquire the original file and the target file to be compared;

[0084] The title comparison module 1102 is used to compare the titles of the original file and the target file multiple times using different matching degrees according to the hierarchical relationship between the titles to obtain title comparison results;

[0085] The text comparison module 1103 is used to compare the text content under the title multiple times with different matching degrees when there is text content under the title, so as to obtain the text comparison result of the title;

[0086] The comparison result acquisition module 1104 is used to obtain the comparison result between the original file and the target file based on the title comparison result and the text comparison result of the title, wherein the file comparison result includes the content between the original file and the target file between the first matching degree and the second matching degree.

[0087] The present application also provides an electronic device. Figure 7 , Figure 7A schematic diagram of an electronic device 10 provided in an embodiment of the present application. In this embodiment, the electronic device 10 includes: a processor 11, a memory 12 and a bus 13, the memory 12 stores machine-readable instructions executable by the processor 11, when the electronic device 10 is running, the processor 11 communicates with the memory 12 via the bus 13, and when the machine-readable instructions are executed by the processor 11, the file comparison method provided in the embodiment of the present application is executed.

[0088] Optionally, the embodiment of the present application further provides a storage medium, on which a computer program is stored, and when the computer program is run by the processor 11, the file comparison method provided in the embodiment of the present application is executed.

[0089] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0090] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0091] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0092] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0093] Although the preferred embodiments of the present application have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications falling within the scope of the present application.

[0094] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A file comparison method, characterized in that: Applied to electronic equipment, the method comprises: Obtain the original file and target file to be compared; According to the hierarchical relationship between the titles, the titles of the original file and the target file are compared multiple times using different matching degrees to obtain title comparison results; If there is text content under the title, multiple comparisons are performed on the text content under the title using different matching degrees to obtain a text comparison result of the title; Obtaining a file comparison result between the original file and the target file according to the title comparison result and the title text comparison result, wherein the file comparison result includes content between the original file and the target file that is between a first matching degree and a second matching degree; Wherein, according to the hierarchical relationship between each title, each title of the original file and each title of the target file are compared multiple times with different matching degrees to obtain a title comparison result, including: according to the hierarchical relationship between each title, taking each title of the original file as a comparison standard, each title of the original file is matched multiple times with each title of the target file to obtain a first matching result; according to the hierarchical relationship between each title, taking each title of the target file as a comparison standard, each title of the target file is matched multiple times with each title of the original file to obtain a second matching result; obtaining the title comparison result according to the first matching result and the second matching result; If there is text content under the title, the text content under the title is compared multiple times using different matching degrees to obtain the text comparison result of the title, including: for each title of the original file, determine whether there is text content under the title; if there is text content, determine whether there is a matching first target title or second target title for the title; if the first target title or the second target title does not exist, match the text content of the title with all the text contents of the target file to obtain the text comparison result of the title; if the first target title or the second target title exists, match the text content of the title with the text content under the first target title or the second target title to obtain the text comparison result.

2. The method according to claim 1, characterized in that The title and the text content under the title are compared through Elasticsearch.

3. The method according to claim 1, characterized in that According to the hierarchical relationship between the titles, each title of the original file is used as a comparison standard, and each title of the original file is matched with each title of the target file for multiple times to obtain a first matching result, including: For each title to be matched of the original file, searching among all the titles of the target file whether there is a first target title, wherein the matching degree between the first target title and the title to be matched is greater than a first matching degree; If the first target title exists, determining that the first target title matches the title to be matched; If the first target title does not exist, searching among all titles of the target file whether a second target title exists, wherein the matching degree between the second target title and the title to be matched is greater than a second matching degree, and the second matching degree is less than the first matching degree; If the second target title exists, determining that the second target title does not completely match the title to be matched, and marking the title to be matched by a first mark; If the second target title does not exist, it is determined that the title to be matched has no matching result in the target file, and the title to be matched is marked by a second mark; Repeat the above steps to match each title of the original file according to the hierarchical order of each title of the original file until all titles of the original file are matched, thereby obtaining a first matching result.

4. The method according to claim 3, characterized in that Match the body content of the title with all the body content of the target file, including: Searching whether a first target text exists in all text contents of the target file, wherein the matching degree between the first target text and the text content of the title is greater than a first matching degree; If the first target text exists, determining that the first target text matches the text content of the title; If the first target text does not exist, searching all the text contents of the target file for a second target text, wherein the matching degree between the second target text and the text content of the title is greater than a second matching degree; If the second target text exists, determining that the second target text does not completely match the text content of the title, and marking the text content of the title by using the first mark; If the second target text does not exist, it is determined that the text content of the title has no matching result in the target file, and the text content of the title is marked by the second mark.

5. The method according to claim 3, characterized in that: Matching the body content of the title with the body content under the first target title or the second target title, including: Determine whether the matching degree between the body content of the title and the body content under the first target title or the second target title is greater than a first matching degree; If it is not greater than the first matching degree, determining whether the matching degree between the body content of the title and the body content under the first target title or the second target title is greater than a second matching degree; If the matching degree is greater than the second matching degree, marking the body content of the title by using the first mark; If it is not greater than the second matching degree, the body content of the title is marked by the second mark.

6. The method according to claim 5, characterized in that The method further comprises: For each title of the original file, if there is a matching first target title for the title, and the body content of the title is different from the body content of the first target title, the title is marked with the first tag.

7. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: The file comparison results are stored hierarchically to obtain title layer differences and content layer differences, so as to display differences at different levels.

8. A file comparison device, characterized in that: Applied to electronic equipment, the device comprises: A file acquisition module, used to acquire the original file and target file to be compared; A title comparison module is used to compare the titles of the original file and the target file multiple times using different matching degrees according to the hierarchical relationship between the titles to obtain a title comparison result; A text comparison module, used to compare the text content under the title multiple times using different matching degrees when there is text content under the title, to obtain the text comparison result of the title; A comparison result acquisition module, used to obtain a file comparison result between the original file and the target file according to the title comparison result and the title text comparison result, wherein the file comparison result includes content between the original file and the target file that is between a first matching degree and a second matching degree; The title comparison module is specifically used to match each title of the original file with each title of the target file multiple times according to the hierarchical relationship between the titles, taking each title of the original file as a comparison standard, to obtain a first matching result; according to the hierarchical relationship between the titles, taking each title of the target file as a comparison standard, matching each title of the target file with each title of the original file multiple times to obtain a second matching result; and obtaining the title comparison result according to the first matching result and the second matching result; The text comparison module is specifically used to determine whether there is text content under each title of the original file; if there is text content, determine whether there is a matching first target title or second target title for the title; if the first target title or the second target title does not exist, match the text content of the title with all the text contents of the target file to obtain a text comparison result of the title; if the first target title or the second target title exists, match the text content of the title with the text content under the first target title or the second target title to obtain a text comparison result.

9. An electronic device, characterized in that: include: A processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor and the memory communicate via the bus, and when the machine-readable instructions are executed by the processor, the method according to any one of claims 1 to 7 is performed.

10. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is executed.