File comparison method and device, electronic equipment, chip and medium

By using file numbers and area numbers in multiple storage media areas, files can be quickly located and compared, which solves the problem of low file batch selection and comparison efficiency in the existing technology, and achieves efficient and accurate file comparison.

CN118798152APending Publication Date: 2024-10-18ZUNYI BRANCH OF CHINA MOBILE GRP GUIZHOU COMPANY +1
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202311125475.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-09-01
Publication Date
2024-10-18

AI Technical Summary

Technical Problem

The existing technology is difficult to effectively select and compare files in batches, resulting in problems such as slow comparison speed and inaccurate comparison results.

Method used

By using the file number and the area number of the storage media area in multiple independent storage media areas, we can quickly locate and obtain the files that need to be compared, and use the differential comparison method to compare batch files, which improves the comparison efficiency and accuracy.

Benefits of technology

It achieves efficient and reliable file comparison, can quickly locate and compare file differences in batch file processing scenarios, and improves the accuracy and efficiency of file comparison.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118798152A_ABST
    Figure CN118798152A_ABST
Patent Text Reader

Abstract

The invention provides a file comparison method and device, electronic equipment, a chip and a medium, and relates to the technical field of computers.The method comprises the steps that a first file and a second file in a first storage medium area are determined according to file numbers corresponding to multiple files and area numbers corresponding to multiple storage medium areas, the file version of the first file is larger than that of the second file; first version data of the first file and second version data of the second file are obtained, the first version data comprise first text data and first document data, and the second version data comprise second text data and second document data; and comparing the first version data with the second version data to obtain a difference comparison result, quickly positioning and obtaining the files needing to be compared in the batch files by using the file numbers and the area numbers of the storage medium areas in the plurality of mutually independent storage medium areas, effectively comparing the contents in the batch files, and improving the comparison efficiency. And the file comparison efficiency and accuracy are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a file comparison method, device, electronic device, chip and medium. Background Art

[0002] With the development of information technology, people need to deal with a large number of files in their daily lives, including documents, pictures, audio, video, etc. In these cases, it becomes very important to accurately compare and match these files. Comparison can detect the differences between files and find out their differences, which helps to ensure the accuracy and consistency of files.

[0003] However, the related technologies mainly split historical version data and current version data according to data types, perform difference comparison of rich text data, or output the results of two text calculations by taking the difference, intersection, union, etc. between the two texts. The file comparison technology in the related technologies is mainly used to compare single files. For large-scale file comparison tasks, it cannot perform batch file selection and comparison well, which easily leads to problems such as slow comparison speed and inaccurate comparison results. Summary of the invention

[0004] The present disclosure provides a file comparison method, device, electronic device, chip and medium to solve the problem in the related art that batch selection and comparison of files cannot be performed. By using file numbers and area numbers of storage medium areas in multiple independent storage medium areas, files that need to be compared in batch files can be quickly located and obtained, and the contents in batch files can be effectively compared, thereby improving the efficiency and accuracy of file comparison.

[0005] A first aspect of the present disclosure provides a file comparison method, the method comprising: determining a first file and a second file in a first storage medium area according to file numbers corresponding to a plurality of files and area numbers corresponding to a plurality of storage medium areas, the file version of the first file being greater than the file version of the second file; obtaining first version data of the first file and second version data of the second file, the first version data comprising first text data and first document data, the second version data comprising second text data and second document data; comparing the first version data and the second version data to obtain a difference comparison result.

[0006] In some embodiments of the present disclosure, a first file and a second file in a first storage medium area are determined based on file numbers corresponding to multiple files and area numbers corresponding to multiple storage medium areas, which includes: dividing the storage medium in a file management device based on preset rules, obtaining multiple storage medium areas and area numbers corresponding to the multiple storage medium areas; uploading multiple files to the multiple storage medium areas respectively; and encoding multiple files in the multiple storage medium areas according to the area numbers corresponding to the multiple storage medium areas to obtain file numbers.

[0007] In some embodiments of the present disclosure, determining a first file and a second file in a first storage medium area based on file numbers corresponding to multiple files and area numbers corresponding to multiple storage medium areas includes: determining a first storage medium area among multiple storage medium areas; obtaining file versions of multiple files in the first storage medium area based on the area numbers; obtaining transmission paths of the multiple files based on the file versions and the file numbers; obtaining historical version data of the multiple files based on the transmission paths and the file numbers; and determining the first file and the second file in the first storage medium area based on the file versions and the historical version data.

[0008] In some embodiments of the present disclosure, comparing a first version of data with a second version of data to obtain a difference comparison result includes: parsing the first version of data and the second version of data, determining a first data type corresponding to the first version of data and a second data type corresponding to the second version of data; determining a difference comparison method based on the first data type and the second data type; and comparing the first version of data with the second version of data based on the difference comparison method to obtain a difference comparison result.

[0009] In some embodiments of the present disclosure, comparing the first version data with the second version data and obtaining the difference comparison result includes: traversing the first file and the second file of multiple files in the first storage medium area, obtaining a difference comparison set, and saving the difference comparison set to a database, wherein the difference comparison set includes multiple difference comparison results.

[0010] In some embodiments of the present disclosure, the first version data and the second version data are compared to obtain a difference comparison result, which then includes: merging a difference comparison set according to the file version; displaying the difference content in the merged difference comparison set according to the first data type and the second data type to obtain a file modification path.

[0011] A second aspect of the present disclosure provides a file comparison device, which includes: a determination unit, used to determine a first file and a second file in a first storage medium area according to file numbers corresponding to multiple files and area numbers corresponding to multiple storage medium areas, wherein the file version of the first file is greater than the file version of the second file; an acquisition unit, used to acquire first version data of the first file and second version data of the second file, wherein the first version data includes first text data and first document data, and the second version data includes second text data and second document data; and a comparison unit, used to compare the first version data and the second version data to obtain a difference comparison result.

[0012] The third aspect embodiment of the present disclosure proposes an electronic device, comprising: a processor and a memory for storing a computer program that can be run on the processor, wherein the processor, when used to run the computer program, executes the method described in the first aspect embodiment of the present disclosure.

[0013] The fourth aspect embodiment of the present disclosure proposes a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable a computer to execute the method described in the first aspect embodiment of the present disclosure.

[0014] The fifth aspect embodiment of the present disclosure proposes a chip, which includes one or more interface circuits and one or more processors; the interface circuit is used to receive signals from a memory of an electronic device and send signals to the processor, the signals including computer instructions stored in the memory, and when the processor executes the computer instructions, the electronic device executes the method described in the first aspect embodiment of the present disclosure.

[0015] In summary, according to the file comparison method proposed in the present invention, according to the file numbers corresponding to multiple files and the area numbers corresponding to multiple storage medium areas, the first file and the second file in the first storage medium area are determined, and the file version of the first file is greater than the file version of the second file; the first version data of the first file and the second version data of the second file are obtained, the first version data includes first text data and first document data, and the second version data includes second text data and second document data; the first version data and the second version data are compared to obtain a difference comparison result, and by using the file numbers and the area numbers of the storage medium areas in multiple independent storage medium areas, the files that need to be compared in the batch files are quickly located and obtained, the contents in the batch files are effectively compared, and the efficiency and accuracy of the file comparison are improved.

[0016] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.

[0018] Figure 1 A flowchart of a file comparison method provided by an embodiment of the present disclosure;

[0019] Figure 2 A flowchart of a file comparison method provided by an embodiment of the present disclosure;

[0020] Figure 3 A schematic diagram of a storage medium area provided in an embodiment of the present disclosure;

[0021] Figure 4 A schematic diagram of a file upload provided in an embodiment of the present disclosure;

[0022] Figure 5 A schematic diagram of file numbering provided in an embodiment of the present disclosure;

[0023] Figure 6 A schematic diagram of file version management provided by an embodiment of the present disclosure;

[0024] Figure 7 A schematic diagram of a file comparison provided in an embodiment of the present disclosure;

[0025] Figure 8 A schematic diagram of a specific batch file comparison device provided by an embodiment of the present disclosure;

[0026] Fig. 9 A schematic diagram of the structure of a file comparison device provided in an embodiment of the present disclosure;

[0027] Fig.10 A schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0028] The embodiments of the present disclosure are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions.

[0029] With the development of information technology, people need to deal with a large number of files in their daily lives, including documents, pictures, audio, video, etc. In these cases, it becomes very important to accurately compare and match these files. Comparison can detect the differences between files and find out their differences, which helps to ensure the accuracy and consistency of files.

[0030] However, the related technologies mainly split the historical version data and the current version data according to the data type, and compare the difference of rich text data, or output the result of the two texts after calculation by taking the difference, intersection, union, etc. of the two texts. The current batch file comparison method fails to provide storage media for partitioning and setting the storage space of the partition, and cannot quickly locate the document storage location according to the partition number, so it is impossible to select and compare documents in batches.

[0031] It can be seen that the file comparison technology in the related art is mainly used to compare single files. For large-scale file comparison tasks, it cannot perform batch selection and comparison of files well, which easily leads to problems such as slow comparison speed and inaccurate comparison results.

[0032] In order to solve the problems existing in the related technology, the present disclosure proposes a file comparison method, which provides multiple independent storage medium areas and combines pointer technology to obtain file numbers and area numbers of storage medium areas, so as to quickly locate and obtain files that need to be compared in batch files, and according to different approval scenarios, process the difference file data from the perspective of modification user, modification time, and modification link, and display the obtained file difference data, so as to effectively compare the contents in batch files and improve the efficiency and accuracy of file comparison.

[0033] The method proposed in the present disclosure can achieve efficient and reliable file comparison, and is mainly used in scenarios of batch file processing, such as various contract reviews, various administrative processes, project processes, medical records, consumption records (return records, revision records of exchanges), etc., which are not limited in the embodiments of the present disclosure.

[0034] The file comparison method provided in this application is described in detail below with reference to the accompanying drawings.

[0035] Figure 1 A flowchart of a file comparison method provided by an embodiment of the present disclosure. Figure 1 As shown, the file comparison method includes steps 101-103.

[0036] Step 101: Determine a first file and a second file in a first storage medium area according to file numbers corresponding to a plurality of files and area numbers corresponding to a plurality of storage medium areas, wherein a file version of the first file is greater than a file version of the second file.

[0037] In the embodiments of the present disclosure, the file number refers to the pointer number obtained after encoding multiple files in multiple storage medium areas, where each file has one and only one file number. The storage medium area refers to the different areas obtained by dividing the storage medium. The storage medium is mainly used for storing file information and document information. The hardware device may also be referred to as a container in the present disclosure. The area number refers to the pointer number of each partition obtained after dividing the storage medium area, where each storage medium area has one and only one area number.

[0038] Pointer number refers to the unique identifier assigned to a pointer in memory. Each pointer has a unique number so that the memory address it points to can be found and accessed through that number.

[0039] The first storage medium area is any one of the plurality of storage medium areas. The first file and the second file are files for comparison among the plurality of files. The first file and the second file are in the same storage medium area. The file version of the first file differs from the file version of the second file by at least two file versions.

[0040] It should be noted that there may be multiple first files and second files, that is, any first file and second file that meets the condition in the first storage medium.

[0041] Step 102: Acquire first version data of a first file and second version data of a second file, wherein the first version data includes first text data and first document data, and the second version data includes second text data and second document data.

[0042] In the embodiment of the present disclosure, in the present disclosure, the version data of the first file and the second file can be determined by the file versions corresponding to the current first file and the second file.

[0043] Text data refers to the text content in a document, which can be obtained through technologies such as reading files and OCR. Document data refers to other content besides text data, such as format information, images, charts, etc., which can be obtained through technologies such as parsing document formats and reading file metadata.

[0044] Step 103: compare the first version data and the second version data to obtain a difference comparison result.

[0045] In an embodiment of the present disclosure, the difference comparison method required for the current comparison can be determined by determining the data types corresponding to the first version data and the second version data, and the comparison can be performed according to the difference comparison method.

[0046] The difference comparison result refers to the difference between the text data and the document data in the first file and the second file.

[0047] It should be noted that since there are multiple storage media areas in the file manager and each storage media area includes multiple files, it is necessary to compare the first file and the second file among the multiple files in the same storage media area, that is, batch file comparison can be performed, and each difference comparison result can be merged to obtain a difference comparison set.

[0048] In addition, in the present disclosure, the difference contents in the difference comparison set can be displayed through certain display processing, and the difference points between the batch comparison files can be quickly located.

[0049] In summary, according to the file comparison method proposed in the present invention, according to the file numbers corresponding to multiple files and the area numbers corresponding to multiple storage medium areas, the first file and the second file in the first storage medium area are determined, and the file version of the first file is greater than the file version of the second file; the first version data of the first file and the second version data of the second file are obtained, the first version data includes first text data and first document data, and the second version data includes second text data and second document data; the first version data and the second version data are compared to obtain a difference comparison result, and by using the file numbers and the area numbers of the storage medium areas in multiple independent storage medium areas, the files that need to be compared in the batch files are quickly located and obtained, the contents in the batch files are effectively compared, and the efficiency and accuracy of the file comparison are improved.

[0050] based on Figure 1 The embodiment shown, Figure 2 A flowchart of a file comparison method proposed in the present disclosure is further shown. Figure 2 based on Figure 1 In the embodiment shown, step 101 and step 103 are further defined. Figure 2 In the embodiment shown, step 101 includes steps 201, 202 and 203, and step 103 includes steps 205, 206 and 207. Figure 2 As shown, the method comprises the following steps:

[0051] Step 201: Based on a preset rule, the storage medium in the file management device is divided to obtain a plurality of storage medium areas and area numbers corresponding to the plurality of storage medium areas.

[0052] In the embodiment of the present disclosure, in the file manager, 1-n storage medium areas are set for the storage medium (ie, container) based on preset rules, and each storage medium area is set with a pointer number, ie, the area number. Figure 3 As shown, the area number can be mapped to the storage medium area through the area number.

[0053] The file manager is pre-created to provide storage media. The preset rule can be a custom division rule to determine the dimension of division.

[0054] Step 202: Upload multiple files to multiple storage medium areas respectively.

[0055] In the embodiments of the present disclosure, Figure 4 As shown, multiple files can be uploaded to multiple storage medium areas according to the upload rules. The upload rules can be customized, for example, files with similar file names can be uploaded to the same storage medium area.

[0056] It should be noted that in the present disclosure, security management of multiple uploaded files is required during the process of uploading multiple files to multiple storage medium areas respectively, specifically including: upload information management, file upload area labeling management and security management based on upload information management.

[0057] Upload information management specifically refers to: for uploaded files, set up a file information record table, including: upload time, upload device number, upload IP address, upload user, upload link, upload process, uploader, modifier, modification time, file reviewer, review time and other fields.

[0058] File upload differentiation and annotation management specifically refers to: annotating file data uploaded by different users, different links, different time periods, and different processes (such as adding highlight annotations based on file information uploaded by different users, adding dotted line annotations for file information uploaded at different links, and adding mouse movement bold marks for files uploaded at different processes). Its purpose is to enable users to clearly locate the track of file upload.

[0059] Security management based on upload information management specifically refers to: adding preset permission control requirements for user file uploads. The main strategies are: controlling user upload times for different users: the main purpose is to control problems such as slow uploads and upload timeouts during peak periods of file uploads. Adding single-location or multi-location area controls for users in special areas: the main purpose is to control that users in different areas can only upload their own file information and cannot upload other people's file information, to ensure that the uploader of the corresponding file is not the uploader. Adding user and device number binding control: the main purpose is to increase the traceability of uploaded information for the security of uploaded files, to ensure that the upload source can be checked, and to prevent your own files from being tampered with by other users through security control for file uploads.

[0060] Step 203: Encode the multiple files in the multiple storage medium areas respectively according to the area numbers corresponding to the multiple storage medium areas to obtain file numbers.

[0061] In the embodiment of the present disclosure, a pointer number, ie, a file number, is set for each file in each storage medium area.

[0062] Specifically, Figure 5 As shown, multiple files are uploaded to multiple storage medium areas respectively, and the multiple files are encoded in the multiple storage medium areas respectively to obtain a file number corresponding to each file.

[0063] It can be understood that the setting rules for the file number and the area number are not limited in the embodiments of the present disclosure, and the file number and the area number are used to distinguish different storage medium areas and different files.

[0064] Step 204 : Determine a first file and a second file in a first storage medium area according to the file numbers corresponding to the plurality of files and the area numbers corresponding to the plurality of storage medium areas.

[0065] In an embodiment of the present disclosure, a first storage medium area among multiple storage medium areas is determined; based on the area number, file versions of multiple files in the first storage medium area are obtained; based on the file version and the file number, the transmission path of the multiple files is obtained; based on the transmission path and the file number, historical version data of the multiple files is obtained; based on the file version and the historical version data, a first file and a second file in the first storage medium area are determined.

[0066] During the file upload process, it is necessary to record the file versions of multiple files in multiple storage media areas according to the area numbers, and track and manage the modification tracks according to the file version of each file, that is, determine the current transmission paths of multiple files.

[0067] The document modification trajectory tracking method disclosed in the present invention is to manage the version number and file number of the file version defined in the storage medium interval, so that when the file version of the file changes multiple times, the historical trajectory of the file, that is, the transmission path of the file, can be clearly located. According to the pre-divided storage medium area, the file storage location is allocated, the file version of the current file is determined, and the file information is saved. Determining the file version can classify the data to be checked for duplicates. According to the document number, the historical record information of the classified file, that is, the historical version data, is queried.

[0068] In an optional embodiment of the present disclosure, Figure 6As shown, the latest file is uploaded to a certain storage medium area, and the file is named file 1.0 as the first upload version number. When the user needs to retransmit the document for file version 1.0, select the file upload button under the corresponding storage and upload the file version 1.1 document. The document data of the last upload in the storage corresponding to file version 1.1 is obtained through the area number corresponding to the storage medium area, and this is repeated until file 1.n. ​​Similarly, the same file version management method is used for files 2 to n.

[0069] Among them, the file uploader uploads files into two parts of version control: system default version and custom version. The system default version is used to locate the user's modification trajectory, and the custom version control based on user behavior habits is set by the user himself. For example, the user may define a file version as 5.0, but when uploading, it is only the second upload, and the actual file version is 2.0, then the file will distinguish between the custom version and the default version marked by the system.

[0070] It should be noted that in the present disclosure, file version management is the basis for batch file comparison, and the comparison principle is to only compare files in the same storage medium area.

[0071] Determining the first file and the second file in the first storage medium area according to the file version and the historical version data specifically includes:

[0072] According to the historical version data of the current file (i.e., the historical submission version number) or the area number of the storage medium area, it is determined that there are at least two file versions between the first file and the second file to be compared. The different version data obtained from multiple different file versions include text data and document data. Select multiple first files and second files in the same storage medium area (container partition) for pairwise comparison to obtain different comparison results respectively, and quickly locate the difference points between the first file and the second file in the same storage medium through difference comparison.

[0073] Step 205: parse the first version data and the second version data to obtain a first data type corresponding to the first version data and a second data type corresponding to the second version data.

[0074] In an embodiment of the present disclosure, a parsing operation is performed on document data and / or text data of a first file and a second file to obtain data types corresponding to version data of different file versions.

[0075] Specifically, the text data and / or document data of multiple file versions are parsed, and data types are divided according to the text data and / or document data. The data type may specifically refer to a category of difference classification, and the difference classification includes a preset new data identifier, a new data identifier, a modified data identifier, a deleted data identifier, a swapped data identifier, and a translated data identifier.

[0076] Step 206: Determine a difference comparison method based on the first data type and the second data type.

[0077] In an embodiment of the present disclosure, the difference comparison method (i.e., difference comparison strategy) to be adopted is determined according to the data type determined in step 205. The data type may refer to a difference data type. The difference comparison method is a difference comparison strategy pre-set according to the data difference result after the file is uploaded. For example, if two segments of data are used, it can be determined through a duplicate checking algorithm that one of the segments of data has been newly added, so that the newly added data can be highlighted and rendered on the display page through a preset newly added identification strategy.

[0078] It is understandable that the difference comparison method can be preset by customization.

[0079] Step 207: compare the first version data and the second version data based on a difference comparison method to obtain a difference comparison result.

[0080] In the embodiments of the present disclosure, Figure 7 As shown, according to the difference comparison method (preset difference comparison strategy) determined in step 206, the version data of the current first file and the second file corresponding to the difference comparison method are compared to obtain the difference comparison result of the first file and the second file. The first file and the second file of the plurality of files in the first storage medium area (i.e., the current storage medium area) are traversed to obtain the difference comparison results respectively to obtain a difference comparison set, and the difference comparison set is saved in the database, and the difference comparison set includes a plurality of difference comparison results.

[0081] In addition, after obtaining the difference comparison results, the difference comparison sets need to be merged according to the file version; the difference contents in the merged difference comparison sets are displayed based on the first data type and the second data type to obtain the file modification path.

[0082] In an optional embodiment of the present disclosure, the difference comparison results of multiple pairwise comparison files are merged to obtain a difference comparison set, and the file version of the first file and the second file are combined to obtain the file modification path (i.e., the document modification track). In other words, rendering comparison is performed based on the data between the file versions of multiple different files in the difference comparison set, including: comparing the difference comparison results with the version data of different files respectively, merging them, obtaining the compared version data, and rendering the merged version data to display the page.

[0083] Specifically, rendering results for different data types in the data are displayed on the execution page, including: highlighting different contents in the result of the difference comparison of file versions of the batch files in different colors according to the different data types.

[0084] In the present disclosure, the difference content can be filtered through a filter, and the fields of the filter can be configured according to the file information record table, including: upload time, upload device number, upload IP address, upload user, upload link, upload process, uploader, modifier, modification time, file reviewer, review time and other fields. If a file has multiple modifiers A / B / C, the filter provides modifier selection. When A is selected, the difference before and after the file modified by A is displayed. If a file has multiple modification times, date 1, date 2, date 3, the filter provides date selection. When date 1 is selected, the file difference modified by date 1 is displayed. If a file has multiple upload links, link 1, link 2, link 3, the filter provides link selection. When link 1 is selected, the file difference modified by link 1 is displayed.

[0085] Among them, different colors are used on different version pages to highlight the difference content in the difference comparison results of the file versions of the batch files, including: highlighting the difference data in the difference content of the difference part. Among them, displaying the difference content of the difference part in the present disclosure specifically includes: displaying the difference content of the difference part in a batch interactive manner, and displaying the difference comparison results after interaction in different file versions, and quickly locating the difference points between the batch comparison files through the difference comparison results. Afterwards, the difference comparison results are saved in a database, for example, the difference comparison results of file versions 1.0-1.1 are saved. Specifically, the comparison result label can be determined by the file version corresponding to the difference comparison result, that is, the comparison result label is added: 1.0-1.1 to save the difference comparison result.

[0086] In summary, through the method provided by the present invention, through the three steps of location management, file upload and modification trajectory tracking management, and batch document selection and comparison, it is possible to quickly locate and obtain the files that need to be compared in the batch files, effectively compare the contents of the batch files, and improve the efficiency and accuracy of file comparison.

[0087] based on Figure 1 , Figure 2 The embodiment shown, as Figure 8 As shown, the present disclosure provides a schematic diagram of a specific batch file comparison device.

[0088] In the disclosed embodiment, the device includes: a batch file version information acquisition module 810, a version file data parsing module 820, a batch file difference comparison module 830, and a batch difference comparison rendering module 840. The device implements batch file comparison through the above four modules.

[0089] In the disclosed embodiment, the module 810 for obtaining batch file version information determines the numbers of multiple file versions of the files currently required to be compared and the area numbers of the storage media, and obtains the version data corresponding to each file version.

[0090] The version file data parsing module 820 is used for comparing the differences between the version data of different file versions to obtain the data types corresponding to the version data of different file versions.

[0091] The file batch difference comparison module 830 is used to compare the version data between different file versions according to the difference comparison method corresponding to the data type to obtain a difference comparison set.

[0092] The batch difference comparison rendering module 840 is used to render the difference contents of different file versions obtained after comparing different file versions according to the difference comparison set, so as to display the difference contents of the difference parts on different file versions according to the rendered difference comparison results, and the difference contents are displayed in a predetermined manner.

[0093] In the disclosed embodiment, the principle of batch document comparison is mainly based on the document duplication detection method, that is, parsing the version data of the first file and the second file that differ by at least two file versions, so as to realize a one-to-many difference comparison of the version data to be compared from 0 to N. Among them, the first file and the second file that differ by at least two file versions are obtained from the same storage medium area (that is, the first storage medium area), and can be obtained from the historical data of the first storage medium area.

[0094] In summary, the method proposed in the present invention, by dividing the storage medium area and numbering it using pointer technology, can quickly determine the location of the files that need to be compared and track the file modification trajectory. At the same time, it presets the file comparison method that only files in the same storage medium area can be compared. It is suitable for batch file comparison scenarios, effectively compares the contents of batch files, and improves the efficiency and accuracy of file comparison.

[0095] Fig. 9FIG. 9 is a schematic diagram of a file comparison device 900 provided in an embodiment of the present disclosure. Fig. 9 As shown, the file comparison device comprises:

[0096] A determining unit 910, configured to determine, according to file numbers corresponding to the plurality of files and area numbers corresponding to the plurality of storage medium areas, a first file and a second file in a first storage medium area, wherein a file version of the first file is greater than a file version of the second file;

[0097] An acquiring unit 920 is configured to acquire first version data of a first file and second version data of a second file, wherein the first version data includes first text data and first document data, and the second version data includes second text data and second document data;

[0098] The comparison unit 930 is used to compare the first version data with the second version data to obtain a difference comparison result.

[0099] In some embodiments, the device 900 also includes: a division unit, which is used to divide the storage medium in the file management device based on preset rules, obtain multiple storage medium areas and area numbers corresponding to the multiple storage medium areas; upload multiple files to the multiple storage medium areas respectively; according to the area numbers corresponding to the multiple storage medium areas, encode the multiple files in the multiple storage medium areas respectively to obtain file numbers.

[0100] In some embodiments, the determination unit 910 is used to: determine a first storage medium area among multiple storage medium areas; obtain file versions of multiple files in the first storage medium area based on the area number; obtain transmission paths of multiple files based on the file versions and file numbers; obtain historical version data of multiple files based on the transmission paths and file numbers; determine the first file and the second file in the first storage medium area based on the file version and the historical version data.

[0101] In some embodiments, the comparison unit 930 is used to: parse the first version data and the second version data, a first data type corresponding to the first version data and a second data type corresponding to the second version data; determine a difference comparison method based on the first data type and the second data type; and compare the first version data and the second version data based on the difference comparison method to obtain a difference comparison result.

[0102] In some embodiments, the comparison unit 930 is used to: traverse the first file and the second file of multiple files in the first storage medium area, obtain a difference comparison set, and save the difference comparison set to a database, where the difference comparison set includes multiple difference comparison results.

[0103] In some embodiments, the device 900 also includes: a display unit, which is used to merge the difference comparison set according to the file version; display the difference content in the merged difference comparison set according to the first data type and the second data type to obtain the file modification path.

[0104] In summary, through the file comparison device, according to the file numbers corresponding to multiple files and the area numbers corresponding to multiple storage medium areas, the first file and the second file in the first storage medium area are determined, and the file version of the first file is greater than the file version of the second file; the first version data of the first file and the second version data of the second file are obtained, the first version data includes first text data and first document data, and the second version data includes second text data and second document data; the first version data and the second version data are compared to obtain the difference comparison result, and by using the file numbers and the area numbers of the storage medium areas in multiple independent storage medium areas, the files that need to be compared in the batch files are quickly located and obtained, the contents in the batch files are effectively compared, and the efficiency and accuracy of the file comparison are improved.

[0105] Corresponding to the methods provided in the above-mentioned embodiments, the present disclosure also provides a file comparison device. Since the device provided in the embodiment of the present disclosure corresponds to the methods provided in the above-mentioned embodiments, the implementation method of the method is also applicable to the device provided in this embodiment and will not be described in detail in this embodiment.

[0106] In the embodiments provided in the present application, the methods and devices provided in the embodiments of the present application are introduced. In order to implement the functions in the methods provided in the embodiments of the present application, the electronic device may include a hardware structure and a software module, and implement the functions in the form of a hardware structure, a software module, or a hardware structure plus a software module. A function of the functions may be executed in the form of a hardware structure, a software module, or a hardware structure plus a software module.

[0107] Fig.10 1 is a block diagram of an electronic device 1000 for implementing the above-mentioned file comparison method according to an exemplary embodiment. For example, the electronic device 1000 may be a mobile phone, a computer, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, etc.

[0108] Reference Fig.10The electronic device 1000 may include a communication interface 1001, which can interact with other devices; a processor 1002, which is connected to the communication interface 1001 to interact with other devices and is used to execute the method provided by one or more of the above technical solutions when running a computer program; and a memory 1003, on which the computer program is stored. Specifically, the specific processing process of the processor 1002 can refer to the file comparison method described in the above embodiment of the present disclosure.

[0109] Of course, in actual application, the various components in the electronic device 1000 are coupled together through the bus system 1004. It can be understood that the bus system 1004 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 1004 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, Fig.10 Various buses are labeled as bus system 1004 .

[0110] The memory 1003 in the embodiment of the present application is used to store various types of data to support the operation of the electronic device 700. Examples of such data include: any computer program used to operate on the electronic device 1000.

[0111] The method disclosed in the above embodiment of the present application can be applied to the processor 1002, or implemented by the processor 1002. The processor 1002 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 1002. The above processor 1002 may be a general-purpose processor, a digital signal processor (DSP, Digital Signal Processor), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The processor 1002 can implement or execute the methods, steps and logic block diagrams disclosed in the embodiments of the present application. The general-purpose processor may be a microprocessor or any conventional processor, etc. In combination with the steps of the method disclosed in the embodiment of the present application, it can be directly embodied as a hardware decoding processor to execute, or it can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium, which is located in the memory 1003, and the processor 1002 reads the information in the memory 1003, and completes the steps of the above method in combination with its hardware.

[0112] In an exemplary embodiment, the electronic device 1000 can be implemented by one or more application specific integrated circuits (ASIC), DSP, programmable logic device (PLD), complex programmable logic device (CPLD), field programmable gate array (FPGA), general processor, controller, microcontroller (MCU), microprocessor, or other electronic components to execute the aforementioned method.

[0113] The embodiments of the present disclosure further provide a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable a computer to execute the file comparison method described in the above embodiments of the present disclosure.

[0114] The embodiments of the present disclosure further provide a computer program product, including a computer program, which executes the file comparison method described in the above embodiments of the present disclosure when a processor is used.

[0115] An embodiment of the present disclosure also proposes a chip, which includes one or more interface circuits and one or more processors; the interface circuit is used to receive signals from a memory of an electronic device and send signals to the processor, the signals include computer instructions stored in the memory, and when the processor executes the computer instructions, the electronic device executes the file comparison method described in the above embodiments of the present disclosure.

[0116] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0117] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples" or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiments or examples are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.

[0118] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present invention belong.

[0119] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processing module, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (control method), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or otherwise processing in a suitable manner if necessary, and then stored in a computer memory.

[0120] It should be understood that the various parts of the embodiments of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.

[0121] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.

[0122] In addition, each functional unit in each embodiment of the present invention may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium. The above-mentioned storage medium may be a read-only memory, a disk or an optical disk, etc.

[0123] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may make changes, modifications, substitutions and variations to the above embodiments within the scope of the present invention.

Claims

1. A file comparison method, characterized in that: The method comprises: Determine, according to file numbers corresponding to the plurality of files and area numbers corresponding to the plurality of storage medium areas, a first file and a second file in the first storage medium area, wherein a file version of the first file is greater than a file version of the second file; Acquire first version data of the first file and second version data of the second file, wherein the first version data includes first text data and first document data, and the second version data includes second text data and second document data; The first version data and the second version data are compared to obtain a difference comparison result.

2. The method according to claim 1, characterized in that The determining, according to the file numbers corresponding to the plurality of files and the area numbers corresponding to the plurality of storage medium areas, the first file and the second file in the first storage medium area comprises: Based on a preset rule, the storage medium in the file management device is divided to obtain a plurality of storage medium areas and area numbers corresponding to the plurality of storage medium areas; Uploading a plurality of files to the plurality of storage medium areas respectively; According to the area numbers corresponding to the multiple storage medium areas, the multiple files in the multiple storage medium areas are respectively encoded to obtain file numbers.

3. The method according to claim 1, characterized in that The determining the first file and the second file in the first storage medium area according to the file numbers corresponding to the plurality of files and the area numbers corresponding to the plurality of storage medium areas comprises: determining a first storage medium area among the plurality of storage medium areas; Acquire file versions of the plurality of files in the first storage medium area according to the area number; According to the file version and the file number, obtaining the transmission path of the multiple files; Acquire historical version data of the plurality of files according to the transmission path and the file number; A first file and a second file in the first storage medium area are determined according to the file version and the historical version data.

4. The method according to claim 3, characterized in that The comparing the first version data and the second version data to obtain a difference comparison result includes: Parsing the first version data and the second version data to obtain a first data type corresponding to the first version data and a second data type corresponding to the second version data; Determine a difference comparison method based on the first data type and the second data type; Based on the difference comparison method, the first version data and the second version data are compared to obtain a difference comparison result.

5. The method according to claim 4, characterized in that The comparing the first version data and the second version data to obtain a difference comparison result includes: A first file and a second file of a plurality of files in the first storage medium area are traversed to obtain a difference comparison set, and the difference comparison set is saved in a database, wherein the difference comparison set includes a plurality of difference comparison results.

6. The method according to claim 5, characterized in that The comparing the first version data and the second version data to obtain a difference comparison result further includes: Merging the difference comparison sets according to the file versions; The difference contents in the merged difference comparison set are displayed according to the first data type and the second data type to obtain a file modification path.

7. A file comparison device, characterized in that: The device comprises: A determining unit, configured to determine, according to file numbers corresponding to the plurality of files and area numbers corresponding to the plurality of storage medium areas, a first file and a second file in a first storage medium area, wherein a file version of the first file is greater than a file version of the second file; an acquiring unit, configured to acquire first version data of the first file and second version data of the second file, wherein the first version data includes first text data and first document data, and the second version data includes second text data and second document data; The comparison unit is used to compare the first version data with the second version data to obtain a difference comparison result.

8. An electronic device, characterized in that: include: a processor and a memory for storing a computer program capable of being executed on the processor, Wherein, when the processor is used to run the computer program, it executes the method described in any one of claims 1-6.

9. A non-transitory computer-readable storage medium storing computer instructions, characterized in that: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-6.

10. A chip, characterized in that: It comprises one or more interface circuits and one or more processors; the interface circuit is used to receive a signal from a memory of an electronic device and send the signal to the processor, the signal includes a computer instruction stored in the memory, and when the processor executes the computer instruction, the electronic device executes the method described in any one of claims 1 to 6.

Citation Information

Cited By

  • Data comparison method and device

    CN121542301A