CN110580243A - file comparison method and device, electronic equipment and storage medium - Google Patents

file comparison method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN110580243A
CN110580243A CN201910813971.0A CN201910813971A CN110580243A CN 110580243 A CN110580243 A CN 110580243A CN 201910813971 A CN201910813971 A CN 201910813971A CN 110580243 A CN110580243 A CN 110580243A
Authority
CN
China
Prior art keywords
comparison
file
compared
group
files
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910813971.0A
Other languages
Chinese (zh)
Inventor
乔佳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
OneConnect Smart Technology Co Ltd
Original Assignee
OneConnect Smart Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by OneConnect Smart Technology Co Ltd filed Critical OneConnect Smart Technology Co Ltd
Priority to CN201910813971.0A priority Critical patent/CN110580243A/en
Publication of CN110580243A publication Critical patent/CN110580243A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems

Abstract

the embodiment of the application provides a file comparison method, a file comparison device, electronic equipment and a storage medium, wherein the method can comprise the following steps: acquiring an identifier of each file to be compared in at least two files to be compared; determining target comparison templates corresponding to the at least two files to be compared according to the identification of each file to be compared and the corresponding relation between the comparison template of each service scene and the file list of the service scene; determining target comparison points corresponding to the at least two files to be compared from the target comparison template; identifying a content item corresponding to the target comparison point from the at least two files to be compared according to a preset identification rule; and comparing the content items corresponding to the target comparison point according to a preset comparison rule to obtain comparison results of the at least two files to be compared. By the adoption of the method and the device, the efficiency of file comparison can be improved.

Description

File comparison method and device, electronic equipment and storage medium
Technical Field
The present application relates to the field of computer technologies, and in particular, to a file comparison method and apparatus, an electronic device, and a storage medium.
Background
The file comparison is used as an important means for measuring the similarity and dissimilarity of two files, and the file comparison is required under the service scenes of software performance test, file correctness verification and the like. For example, when the correctness of the file is verified, the file to be verified can be compared with a preset standard file, and if the comparison is not consistent, the file to be verified is incorrect. In the current file comparison, a manual comparison method is generally adopted, that is, each data in a file is manually checked and compared with data in another file or files. Obviously, the efficiency of file comparison is extremely low due to the manual comparison method.
disclosure of Invention
the embodiment of the application provides a file comparison method and device, electronic equipment and a storage medium, which can realize an automatic and intelligent file comparison process and further improve the file comparison efficiency.
in a first aspect, an embodiment of the present application provides a file comparison method, including:
acquiring an identifier of each file to be compared in at least two files to be compared;
Determining target comparison templates corresponding to the at least two files to be compared according to the identification of each file to be compared and the corresponding relation between the comparison template of each service scene and the file list of the service scene; each file list comprises information of each file group in at least one file group under a corresponding service scene, and the information of each file group comprises an identifier of each file in at least two files to be compared in the file group; each comparison template is generated according to a comparison point corresponding to each file group in a corresponding service scene; the comparison point corresponding to each file group comprises a comparison point between at least two files to be compared in the file group;
Determining target comparison points corresponding to the at least two files to be compared from the target comparison template;
Identifying a content item corresponding to the target comparison point from the at least two files to be compared according to a preset identification rule; the identification rule includes at least one of: setting a rule according to the position of the comparison point in the file to be compared, setting a rule according to the position range information of the content item corresponding to the comparison point in the file with the same identifier, setting a rule according to the corresponding relation between the comparison point and the content item, and setting a rule according to the semantic analysis result corresponding to the file to be compared;
and comparing the content items corresponding to the target comparison point according to a preset comparison rule to obtain comparison results of the at least two files to be compared.
optionally, the determining, from the target comparison template, the target comparison points corresponding to the at least two files to be compared includes:
Determining a file group corresponding to the at least two files to be compared;
Determining comparison points corresponding to the file groups corresponding to the at least two files to be compared from the target comparison template;
and determining the comparison points corresponding to the file groups corresponding to the at least two files to be compared as target comparison points corresponding to the at least two files to be compared.
Optionally, the file groups corresponding to the at least two files to be compared include a first file group, the information of the first file group includes an identifier of each file to be compared in the at least two files to be compared, and the target comparison point includes a comparison point corresponding to the first file group; or the like, or, alternatively,
the file groups corresponding to the at least two files to be compared comprise a second file group and a third file group, the information of the second file group comprises the identification of each file to be compared in the first comparison group of the at least two files to be compared, the information of the third file group comprises the identification of each file to be compared in the second comparison group of the at least two files to be compared, and the target comparison point comprises a comparison point corresponding to the second file group and a comparison point corresponding to the third file group.
optionally, the file groups corresponding to the at least two files to be compared include a second file group and a third file group, the target comparison point includes a comparison point corresponding to the second file group and a comparison point corresponding to the third file group, the identification rule includes a rule set according to position range information of content items corresponding to the comparison points in files with the same identifier, and the identifying, according to a preset identification rule, a content item corresponding to the target comparison point from the at least two files to be compared includes:
acquiring a first file with the same identification as any one or more files to be compared in the first comparison group, and acquiring a second file with the same identification as any one or more files to be compared in the second comparison group;
determining first position range information of content items corresponding to the comparison points corresponding to the second file group in the first file, and determining second position range information of content items corresponding to the comparison points corresponding to the third file group in the second file;
And searching the content items corresponding to the comparison points corresponding to the second file group from the first comparison group according to the first position range information, and searching the content items corresponding to the comparison points corresponding to the third file group from the second comparison group according to the second position range information. Optionally, the file groups corresponding to the at least two files to be compared include a second file group and a third file group, the target comparison point includes a comparison point corresponding to the second file group and a comparison point corresponding to the third file group, the identification rule includes a rule set according to a semantic analysis result corresponding to the file to be compared, and identifying, according to a preset identification rule, a content item corresponding to the target comparison point from the at least two files to be compared includes:
Performing semantic analysis on each content item included in each file to be compared in the first comparison group to obtain a semantic analysis result corresponding to each content item included in each file to be compared in the first comparison group, determining a first semantic analysis result matched with a comparison point corresponding to the second file group from the semantic analysis result corresponding to each content item included in each file to be compared in the first comparison group, and determining the content item corresponding to the first semantic analysis result in each content item included in each file to be compared in the first comparison group as the content item corresponding to the comparison point corresponding to the second file group;
performing semantic analysis on each content item included in each file to be compared in the second comparison group to obtain a semantic analysis result corresponding to each content item included in each file to be compared in the second comparison group, determining a second semantic analysis result matched with the comparison point corresponding to the third file group from the semantic analysis result corresponding to each content item included in each file to be compared in the second comparison group, and determining the content item corresponding to the second semantic analysis result in each content item included in each file to be compared in the second comparison group as the content item corresponding to the comparison point corresponding to the third file group.
Optionally, the comparing, according to a preset comparison rule, content items corresponding to the target comparison point to obtain comparison results of the at least two files to be compared includes:
Comparing the content items corresponding to the comparison points corresponding to the second file group to obtain a first comparison result corresponding to the first comparison group;
and comparing the content items corresponding to the comparison points corresponding to the third file group to obtain a second comparison result corresponding to the second comparison group.
Optionally, the method further comprises:
Acquiring a file list of each service scene in a plurality of service scenes;
determining a corresponding comparison point for each file group in at least one file group under the service scene corresponding to the file list of each service scene;
Generating a comparison template of each service scene by using a comparison point corresponding to each file group in at least one file group in each service scene;
And establishing a corresponding relation between the comparison template of each service scene and the file list of the service scene.
In a second aspect, an embodiment of the present application provides a file comparison apparatus, including:
The acquisition module is used for acquiring the identifier of each file to be compared in at least two files to be compared;
the first determining template is used for determining target comparison templates corresponding to the at least two files to be compared according to the identification of each file to be compared and the corresponding relation between the comparison template of each service scene and the file list of the service scene; each file list comprises information of each file group in at least one file group under a corresponding service scene, and the information of each file group comprises an identifier of each file in at least two files to be compared in the file group; each comparison template is generated according to a comparison point corresponding to each file group in a corresponding service scene; the comparison point corresponding to each file group comprises a comparison point between at least two files to be compared in the file group;
The second determining module is used for determining target comparison points corresponding to the at least two files to be compared from the target comparison template;
the identification module is used for identifying a content item corresponding to the target comparison point from the at least two files to be compared according to a preset identification rule; the identification rule includes at least one of: setting a rule according to the position of the comparison point in the file to be compared, setting a rule according to the position range information of the content item corresponding to the comparison point in the file with the same identifier, setting a rule according to the corresponding relation between the comparison point and the content item, and setting a rule according to the semantic analysis result corresponding to the file to be compared;
and the comparison module is used for comparing the content items corresponding to the target comparison points according to a preset comparison rule to obtain comparison results of the at least two files to be compared.
In a third aspect, an embodiment of the present application provides an electronic device, including a processor and a memory, where the processor and the memory are connected to each other, where the memory is used to store a computer program, and the computer program includes program instructions, and the processor is configured to call the program instructions to execute the method according to the first aspect.
in a fourth aspect, the present application provides a computer-readable storage medium, which stores a computer program, where the computer program is executed by a processor to implement the method according to the second aspect.
In summary, the electronic device may determine, according to the identifier of each of the at least two files to be compared and the correspondence between the comparison template of each service scene and the file list of the service scene, a target comparison template corresponding to the at least two files to be compared, and determine, from the target comparison template, a target comparison point corresponding to the at least two files to be compared; the electronic equipment can identify the corresponding content items of the target comparison points from the at least two files to be compared according to a preset identification rule, compares the corresponding content items of the target comparison points according to the preset comparison rule, obtains comparison results of the at least two files to be compared, can realize an automatic and intelligent file comparison process, and further improves the file comparison efficiency.
drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
fig. 1 is a schematic flowchart of a file comparison method according to an embodiment of the present application;
fig. 2 is a schematic flowchart of another file comparison method provided in the embodiment of the present application;
Fig. 3 is a schematic structural diagram of a file comparison apparatus according to an embodiment of the present application;
Fig. 4 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
Please refer to fig. 1, which is a flowchart illustrating a file comparison method according to an embodiment of the present disclosure. The method can be applied to electronic devices. The electronic device may be a terminal or a server. The terminal can be an intelligent terminal such as a smart phone, a tablet computer, a notebook computer and a desktop computer. The server may be a server or a cluster of servers. Specifically, the method may comprise the steps of:
s101, obtaining the identification of each file to be compared in at least two files to be compared.
wherein, the identifier of the file to be compared includes but is not limited to at least one of the following items: file name, file title, file attributes, information such as file category, etc.
In an embodiment, the electronic device may obtain the at least two files to be compared, and obtain an identifier of each of the at least two files to be compared according to the at least two files to be compared.
In one embodiment, the electronic device may directly obtain the identifier of the file to be compared, in addition to obtaining the identifier of the file to be compared according to the file to be compared. For example, when the electronic device is a terminal, the electronic device may obtain an identifier of each of the at least two files to be compared. For another example, the electronic device may display at least two file identifier input boxes, and the electronic device may obtain an identifier of each of the at least two files to be compared, which is input by the at least two file identifier input boxes.
in an embodiment, in addition to obtaining the identifier of the file to be compared in the above manner, when the electronic device is a server, the electronic device may receive the identifier of each of the at least two files to be compared, which is sent by the corresponding terminal.
in one embodiment, the electronic device may identify a file title in the file content of each of the at least two files to be compared.
In an embodiment, the electronic device may obtain a file attribute, such as a file category, of each of the at least two files to be compared in a deep learning manner.
S102, determining target comparison templates corresponding to the at least two files to be compared according to the identification of each file to be compared and the corresponding relation between the comparison template of each service scene and the file list of the service scene.
Each file list comprises information of each file group in at least one file group under a corresponding service scene, and the information of each file group comprises an identifier of each file in at least two files to be compared in the file group. Each comparison template is generated according to the comparison point corresponding to each file group in the corresponding service scene. In one embodiment, each alignment template may include alignment points corresponding to each document group in the corresponding service scenario. For example, the alignment point can include at least one alignment term. The comparison point corresponding to each file group comprises a comparison point between at least two files to be compared in the file group.
For example, the correspondence between the comparison template of each service scenario and the file list of the service scenario includes a correspondence between the comparison template of a software test scenario and the file list of the software test scenario. The file list of the software test scenario includes information of the test file group 1 in the software test scenario. The test file group 1 includes a test file a and a test expected file b that need to be compared with each other in a software test scenario. The test expected file b is used to verify whether the data in the test file a meets the test expectation. Accordingly, the information of the test file group 1 includes an identification 1 of the test file a and an identification 2 of the test expected file b. The comparison template of the software test scenario includes comparison points corresponding to the test file group 1, such as a load test result and a pressure test result. The comparison point corresponding to the test file group 1 is a comparison point between the test file a and the test expected file b in the test file group 1, such as a load test result and a stress test result. It should be noted that the software test scenario may also be subdivided according to test types, test software, and the like, and the file bill of materials, the comparison template, and the correspondence may be different according to different actual service scenarios, which is only one example and does not limit the present application.
Step S102 will be illustrated below with reference to the above example. For example, the at least two files to be compared include a test file 1 of a certain software and a test expected file 2 of the certain software. The electronic device may determine the comparison template of the software test scenario corresponding to the two files to be compared according to the identifier 1 of the test file 1, the identifier 2 of the test file 2, and the correspondence between the comparison template of each service scenario and the file list of the service scenario. In one embodiment, the test file 1 may be the test file a, and the test expected file 2 may be the test expected file b.
In an embodiment, the determining, by the electronic device, the target comparison templates corresponding to the at least two files to be compared according to the identifier of each file to be compared and the correspondence between the comparison template of each service scenario and the file list of the service scenario may include: the electronic equipment determines a target file list where the identifier of each file to be compared is located, wherein the target file list is a file list of a target service scene; and the electronic equipment determines a target comparison template corresponding to the target file list according to the corresponding relation between the comparison template of each service scene and the file list of the service scene.
for example, the electronic device may obtain an identification 1 of the test file 1 and an identification 2 of the test expected file 2. The file list where the identifier 1 and the identifier 2 are located can be inquired and is a file list of a software test scene; the electronic device may query the comparison template of the software test scenario corresponding to the file list of the software test scenario according to the correspondence between the comparison template of each service scenario and the file list of the service scenario.
in an embodiment, considering that the same file group may correspond to different comparison templates in different service scenarios, that is, the same file group may have different comparison points in different service scenarios, therefore, when the target service scenario is a plurality of service scenarios, the determining, by the electronic device, the target comparison template corresponding to the target file list may include: and the electronic equipment determines a target comparison template from the comparison templates of the plurality of service scenes corresponding to the target file list.
In an embodiment, the determining, by the electronic device, a target comparison template from comparison templates of the plurality of service scenes corresponding to the target file list may include: the electronic equipment outputs comparison templates of the plurality of service scenes, and when a selection instruction of the comparison template of any one service scene in the comparison templates of the plurality of service scenes is detected, the comparison template of any one service scene is determined as a target comparison template; and/or the electronic device outputs the identifiers of the multiple service scenes, and when the selection operation aiming at the identifier of any one of the multiple service scenes is detected, the comparison template of any one service scene is determined as the target comparison template.
In an embodiment, the determining, by the electronic device, a target comparison template from comparison templates of the plurality of service scenes corresponding to the target file list may include: the electronic equipment can acquire a historical comparison record, wherein the historical comparison record comprises an identifier of a comparison template used in a preset time range; and the electronic equipment determines a comparison template with the highest use frequency in comparison templates of the plurality of service scenes according to the historical comparison records, and determines the comparison template with the highest use frequency as a target comparison template. By adopting the mode, the automatic intelligent selection process of the template can be realized, and the template matching efficiency is improved.
S103, determining target comparison points corresponding to the at least two files to be compared from the target comparison template.
In this embodiment, the electronic device may determine, from the target comparison template, the target comparison points corresponding to the at least two files to be compared. The target comparison template may include comparison points corresponding to a document group. Or, the target comparison template includes a comparison point corresponding to each of a plurality of document groups. In an embodiment, the target comparison template may include an identifier of a corresponding file group, a file list corresponding to the target comparison template, or an identifier of a corresponding file group, and the identifier of each file group may be used to distinguish the file group.
In an embodiment, the file groups corresponding to the at least two files to be compared may include a first file group, the information of the first file group may include an identifier of each of the at least two files to be compared, and the target comparison point may include a comparison point corresponding to the first file group. For example, the at least two files to be compared include a file 1 and a file 2, a file group corresponding to the at least two files to be compared is a file group 1, the information of the file group 1 includes an identifier of the file 1 and an identifier of the file 2, and the target comparison point includes a comparison point corresponding to the file group 1. Wherein, the comparison points included in the document group 1 include a comparison term 1 and a comparison term 2.
In an embodiment, the file groups corresponding to the at least two files to be compared may include a second file group and a third file group, the information of the second file group may include an identifier of each file to be compared in a first comparison group of the at least two files to be compared, the information of the third file group may include an identifier of each file to be compared in a second comparison group of the at least two files to be compared, and the target matching point includes a matching point corresponding to the second file group and a matching point corresponding to the third file group. For example, the at least two files to be compared include a file 1, a file 2, a file 3, and a file 4, the file group corresponding to the at least two compared files includes a file group 1 and a file group 2, the information of the file group 1 includes the identifier of the file 1 and the identifier of the file 2, the information of the file group 2 includes the identifier of the file 3 and the identifier of the file 4, and the target comparison point includes a comparison point corresponding to the file group 1 and a comparison point corresponding to the file group 2. Wherein, the comparison points included in the document group 1 include a comparison term 1 and a comparison term 2. Document set 2 includes alignment clause 3 and alignment clause 4.
Correspondingly, the file groups corresponding to the at least two files to be compared may further include other file groups, such as a third file group, a fourth file group, and the like, according to requirements of different service scenarios, and files included in different file groups may be different or partially overlapped, which is not limited in this embodiment of the application.
In an embodiment, the determining, by the electronic device, the target comparison points corresponding to the at least two files to be compared from the target comparison template may include: the electronic equipment determines a file group corresponding to the at least two files to be compared; the electronic equipment determines comparison points corresponding to the file groups corresponding to the at least two files to be compared from the target comparison template; the electronic equipment determines the comparison points corresponding to the file groups corresponding to the at least two files to be compared as the target comparison points corresponding to the at least two files to be compared.
because each file list comprises the information of each file group in at least one file group in the corresponding service scene, the electronic device can determine the file groups corresponding to the at least two files to be compared according to the file list corresponding to the target comparison template.
s104, identifying content items corresponding to the target comparison points from the at least two files to be compared according to a preset identification rule.
in this embodiment of the application, the electronic device may identify, according to a preset identification rule, a content item corresponding to the target comparison point from the at least two files to be compared, so as to execute step S105. Wherein the identification rules include, but are not limited to, at least one of: setting a rule according to the position of the comparison point in the file to be compared, setting a rule according to the position range information of the content item corresponding to the comparison point in the file with the same identification, setting a rule according to the corresponding relation between the comparison point and the content item, and setting a rule according to the semantic analysis result corresponding to the file to be compared.
in an embodiment, the file groups corresponding to the at least two files to be compared include a first file group, the target comparison point includes a comparison point corresponding to the first file group, the identification rule includes a rule set according to a position of the comparison point in the files to be compared, and the identifying, by the electronic device, a content item corresponding to the target comparison point from the at least two files to be compared according to a preset identification rule may include: when the electronic device inquires that each file to be compared in the at least two files to be compared comprises the comparison point corresponding to the first file group, determining the content in a first length range after the position of the comparison point corresponding to the first file group in each file to be compared in the at least two files to be compared is located as the content item corresponding to the comparison point corresponding to the first file group. In one embodiment, the first length range may be determined according to the comparison point corresponding to the first file group, such as according to the length of the content item corresponding to the comparison point corresponding to the first file group in each file in the first file group. The length can be understood as the number of bytes occupied.
In an embodiment, the file groups corresponding to the at least two files to be compared include a first file group, the target comparison point includes a comparison point corresponding to the first file group, the identification rule includes a rule set according to position range information of content items corresponding to the comparison point in files with the same identifier, and the electronic device identifies the content item corresponding to the target comparison point from the at least two files to be compared according to a preset identification rule, which may include: the electronic equipment acquires a file with the same identification as any one or more files to be compared in the at least two files to be compared; the electronic equipment determines the position range information of the corresponding content items of the comparison points corresponding to the first file group in the files with the same identification; and the electronic equipment searches the content items corresponding to the comparison points corresponding to the first file group from the at least two files to be compared according to the position range information.
In an embodiment, the file groups corresponding to the at least two files to be compared include a first file group, the target matching point includes a matching point corresponding to the first file group, the identification rule includes a rule set according to a corresponding relationship between a matching point and a content item, and the electronic device identifies, according to a preset identification rule, the content item corresponding to the target matching point from the at least two files to be compared, which may include: the electronic equipment queries the content items corresponding to the comparison point corresponding to the first file group in the content items included in each file to be compared in the at least two files to be compared from the corresponding relation between the comparison point and the content items. In one embodiment, the correspondence of the comparison point to the content item may include a one-to-many correspondence.
In an embodiment, the file groups corresponding to the at least two files to be compared include a first file group, the target comparison point includes a comparison point corresponding to the first file group, the identification rule includes a rule set according to a semantic analysis result corresponding to the file to be compared, and the identifying, by the electronic device, a content item corresponding to the target comparison point from the at least two files to be compared according to a preset identification rule may include: the electronic equipment performs semantic analysis on each content item included by each file to be compared in the at least two files to be compared to obtain a semantic analysis result corresponding to each content item included by each file to be compared in the at least two files to be compared, determines a semantic analysis result matched with the comparison point corresponding to the first file group from the semantic analysis result corresponding to each content item included by each file to be compared in the at least two files to be compared, and determines the content item corresponding to the matched semantic analysis result in each content item included by each file to be compared in the at least two files to be compared as the content item corresponding to the comparison point corresponding to the first file group.
In an embodiment, the performing, by the electronic device, semantic analysis on each content item included in each file to be compared in the at least two files to be compared to obtain a semantic analysis result corresponding to each content item included in each file to be compared in the at least two files to be compared may include: the electronic equipment segments each content item included by each file to be compared in the at least two files to be compared to obtain a segmentation result of each content item included by each file to be compared in the at least two files to be compared; and the electronic equipment matches semantic analysis results corresponding to each content item in the content items included in each file to be compared in the at least two files to be compared from a preset semantic information base according to the segmentation result of each content item in the content items included in each file to be compared in the at least two files to be compared. In the embodiment of the present application, semantic analysis may also be performed in other manners to obtain a corresponding semantic analysis result, which is not limited in the embodiment of the present application.
In one embodiment, the determining, by the electronic device, a semantic analysis result matching the comparison point corresponding to the first file group may include: the electronic equipment determines a semantic analysis result of the comparison point corresponding to the first file group; or the electronic equipment determines semantic analysis results with the same semantics as the comparison points corresponding to the first file group; or the electronic equipment determines that the type of the point is the semantic analysis result of the comparison point corresponding to the first file group.
In one embodiment, the file groups corresponding to the at least two files to be compared include a second file group and a third file group, the target comparison point includes a comparison point corresponding to the second file group and a comparison point corresponding to the third file group, the identification rule includes a rule set according to a position of the comparison point in the files to be compared, and the electronic device identifies, from the at least two files to be compared, a content item corresponding to the target comparison point, including: when the electronic equipment inquires that each file to be compared in the first comparison group comprises a comparison point corresponding to the second file group, determining the content of a second length range after the position of the comparison point corresponding to the second file group in each file to be compared in the first comparison group is located as a content item corresponding to the comparison point corresponding to the second file group; when the electronic device inquires that each file to be compared in the second comparison pair group comprises the comparison point corresponding to the third file group, determining the range content of the third length after the position of the comparison point corresponding to the third file group in each file to be compared in the second comparison pair group is located as the content item corresponding to the comparison point corresponding to the third file group. In one embodiment, the second length range may be determined according to the comparison point corresponding to the second file group, such as according to the length of the content item corresponding to the comparison point corresponding to the second file group in each file in the second file group. In one embodiment, the third length range may be determined according to the comparison points corresponding to the third file group, such as the length of the content item corresponding to each file in the third file group according to the comparison points corresponding to the third file group. The length can be understood as the number of bytes occupied.
In an embodiment, the file groups corresponding to the at least two files to be compared include a second file group and a third file group, the target comparison point includes a comparison point corresponding to the second file group and a comparison point corresponding to the third file group, the identification rule includes a rule set according to position range information of content items corresponding to the comparison points in files with the same identifier, and the electronic device identifies the content item corresponding to the target comparison point from the at least two files to be compared according to a preset identification rule, which may include: the electronic equipment acquires a first file with the same identification as any one or more files to be compared in the first comparison group, and acquires a second file with the same identification as any one or more files to be compared in the second comparison group; the electronic equipment determines first position range information of content items corresponding to the comparison points corresponding to the second file group in the first file, and determines second position range information of content items corresponding to the comparison points corresponding to the third file group in the second file; the electronic equipment searches the content items corresponding to the comparison points corresponding to the second file group from the first comparison group according to the first position range information, and searches the content items corresponding to the comparison points corresponding to the third file group from the second comparison group according to the second position range information. Wherein, the first file is one or more files. The first position range information refers to the position range information of the content item corresponding to the comparison point corresponding to the second file group in the first file. The second file may be one or more files. The second location range information is location range information of content items corresponding to the peer to peer in the second file corresponding to the third file group. The first and second do not represent an order.
in an embodiment, the file groups corresponding to the at least two files to be compared include a second file group and a third file group, the target comparison point includes a comparison point corresponding to the second file group and a comparison point corresponding to the third file group, the identification rule includes a rule set according to a correspondence between the comparison point and a content item, and the electronic device identifies the content item corresponding to the target comparison point from the at least two files to be compared according to a preset identification rule, which may include: the electronic device queries the content item corresponding to the comparison point corresponding to the second file group in the content items included in the files to be compared in the first comparison group from the corresponding relationship between the comparison point and the content item, and queries the content item corresponding to the comparison point corresponding to the third file group in the content items included in the files to be compared in the second comparison group.
In an embodiment, the file groups corresponding to the at least two files to be compared include a second file group and a third file group, the target comparison point includes a comparison point corresponding to the second file group and a comparison point corresponding to the third file group, the identification rule includes a rule set according to a semantic analysis result corresponding to the file to be compared, and identifying, according to a preset identification rule, a content item corresponding to the target comparison point from the at least two files to be compared may include: the electronic equipment performs semantic analysis on each content item included by each file to be compared in the first comparison group to obtain a semantic analysis result corresponding to each content item included by each file to be compared in the first comparison group, determines a first semantic analysis result matched with the comparison point corresponding to the second file group from the semantic analysis result corresponding to each content item included by each file to be compared in the first comparison group, and determines the content item corresponding to the first semantic analysis result in each content item included by each file to be compared in the first comparison group as the content item corresponding to the comparison point corresponding to the second file group; the electronic equipment performs semantic analysis on each content item included by each file to be compared in the second comparison group to obtain a semantic analysis result corresponding to each content item included by each file to be compared in the second comparison group, determines a second semantic analysis result matched with the comparison point corresponding to the third file group from the semantic analysis result corresponding to each content item included by each file to be compared in the second comparison group, and determines the content item corresponding to the second semantic analysis result in each content item included by each file to be compared in the second comparison group as the content item corresponding to the comparison point corresponding to the third file group.
In an embodiment, the performing, by the electronic device, semantic analysis on each content item included in each file to be compared in the first comparison group to obtain a semantic analysis result corresponding to each content item in each content item included in each file to be compared in the first comparison group may include: the electronic equipment segments each content item included in each file to be compared in the first comparison group to obtain a segmentation result of each content item in each content item included in each file to be compared in at least one first comparison group; and the electronic equipment matches semantic analysis results corresponding to each content item in each content item included in each file to be compared in the at least two files to be compared from a preset semantic information base according to the segmentation result of each content item in each content item included in each file to be compared in the first comparison group. The manner of performing semantic analysis on the second comparison group may refer to the manner of performing semantic analysis on the first comparison group, which is not described herein again in this embodiment of the present application.
In one embodiment, the determining, by the electronic device, a first semantic analysis result matching the comparison point corresponding to the second file group may include: the electronic equipment determines a first semantic analysis result of the comparison point corresponding to the first file group; or the electronic equipment determines a first semantic analysis result with the same semantic as the comparison point corresponding to the first file group; or the electronic device determines that the type of the first semantic analysis result is the comparison point corresponding to the first file group, where the manner of determining the second semantic analysis result for the second comparison group may refer to the manner of determining the first semantic analysis result for the first comparison group, which is not described herein again in this embodiment of the present application.
S105, comparing the content items corresponding to the target comparison point according to a preset comparison rule to obtain comparison results of the at least two files to be compared.
In this embodiment of the application, the electronic device may compare the content items corresponding to the target comparison point according to a preset comparison rule, so as to obtain a comparison result of the at least two files to be compared. For example, the comparison result includes, but is not limited to, a conclusion of whether the two are consistent, or a result of a specific similarity, etc.
In an embodiment, the electronic device compares, according to a preset comparison rule, the content items corresponding to the target comparison point to obtain comparison results of the at least two files to be compared, which may include: the electronic equipment compares the content items corresponding to the comparison points corresponding to the first file group to obtain comparison results corresponding to the at least two files to be compared. For example, the at least two files to be compared include a file 1 and a file 2, the comparison point corresponding to the first file group includes a comparison term 1 and a comparison term 2, the electronic device may compare the content item corresponding to the comparison term 1 in the file 1 with the content item corresponding to the comparison term 1 in the file 2, and compare the content item corresponding to the comparison term 2 in the file 1 with the content item corresponding to the comparison term 2 in the file 2, so as to obtain the comparison result of the at least two files.
In an embodiment, the electronic device compares, according to a preset comparison rule, the content items corresponding to the target comparison point to obtain comparison results of the at least two files to be compared, which may include: the electronic equipment compares the content items corresponding to the comparison points corresponding to the second file group to obtain a first comparison result corresponding to the first comparison group; and the electronic equipment compares the content items corresponding to the comparison points corresponding to the third file group to obtain a second comparison result corresponding to the second comparison group. For example, the at least two files to be compared include a first comparison group: file 1 and file 2, and a second ratio-pair group: file 3 and file 4. The comparison points corresponding to the second document group include comparison clause 1 and comparison clause 2. The third set of documents includes alignment clause 3 and alignment clause 4. The electronic device may compare the content item corresponding to the comparison term 1 in the file 1 with the content item corresponding to the comparison term 1 in the file 2, and compare the content item corresponding to the comparison term 2 in the file 1 with the content item corresponding to the comparison term 2 in the file 2 to obtain a first comparison result corresponding to the first comparison group. The electronic device may further compare the content item corresponding to the comparison term 3 in the file 3 with the content item corresponding to the comparison term 3 in the file 4, and compare the content item corresponding to the comparison term 4 in the file 3 with the content item corresponding to the comparison term 4 in the file 4 to obtain a second comparison result corresponding to the second comparison group.
In an embodiment, the comparison point corresponding to the file group mentioned in the embodiment of the present application may also be replaced by a comparison point corresponding to the information of the file group, which is not described herein again.
In one embodiment, the electronic device may compare the content items corresponding to the target comparison point according to the comparison priority of each comparison term included in the target comparison point. For example, the content items corresponding to each comparison clause in the target comparison point can be compared according to the order of the priority from high to low. The comparison priority can be set according to the importance degree of each comparison clause, or can also be set according to the estimated length of each comparison clause. By adopting the above method for comparison, the key information can be preferentially compared, and the comparison flexibility can be improved.
In an embodiment, the comparing, by the electronic device, the content items corresponding to the comparison point corresponding to the first file group may include: the electronic equipment compares the content items corresponding to the comparison terms in the comparison points corresponding to the first file group in sequence according to the priority of the comparison terms included in the comparison points corresponding to the first file group. The comparing, by the electronic device, the content items corresponding to the comparison point corresponding to the second file group may include: the electronic equipment compares the content items corresponding to the comparison terms in the comparison points corresponding to the second file group in sequence according to the priority of the comparison terms included in the comparison points corresponding to the second file group. The comparing, by the electronic device, the content items corresponding to the comparison point corresponding to the third file group may include: and the electronic equipment compares the content items corresponding to the comparison terms in the comparison points corresponding to the third file group in sequence according to the priority of the comparison terms included in the comparison points corresponding to the third file group.
In one embodiment, the target comparison point may further include a comparison manner indicating a first reference comparison file of the at least two files to be compared. For example, the comparison method may include a reference file identifier, and the electronic device may determine, as the first reference file, a to-be-compared file identified as the reference file identifier in the at least two to-be-compared files. The electronic device compares the content items corresponding to the comparison point corresponding to the first file group according to a preset comparison rule to obtain comparison results of the at least two files to be compared, which may include: the electronic equipment compares the content items corresponding to the comparison points corresponding to the first file group in the first reference comparison files included in the at least two files to be compared with the content items corresponding to the comparison points corresponding to the first file group in the other files to be compared included in the at least two files to be compared respectively to obtain the comparison results of the first reference comparison file and the other files included in the at least two files to be compared.
In an embodiment, the electronic device compares, according to content items corresponding to comparison points corresponding to a first file group in a first reference comparison file included in the at least two files to be compared, content items corresponding to comparison points corresponding to a first file group in other files to be compared included in the at least two files to be compared, respectively, and may include: the electronic equipment compares the content items corresponding to each comparison term in the comparison points corresponding to the first document group in the first reference comparison documents included in the at least two documents to be compared with the content items corresponding to each comparison term in the comparison points corresponding to the first document group in the other documents to be compared included in the at least two documents to be compared respectively according to the priority of each comparison term included in the comparison points corresponding to the first document group.
in one embodiment, the comparison mode indicates a second reference comparison file in the first comparison group and a third reference comparison file in the second comparison group. The electronic device compares the content items corresponding to the comparison point corresponding to the second file group to obtain a first comparison result corresponding to the first comparison group, and the method may include: the electronic equipment compares the content items corresponding to the comparison points in the second file group in the second reference comparison file included in the first comparison group with the content items corresponding to the comparison points in the second file group in the other files to be compared included in the first comparison group respectively to obtain the first comparison results of the second reference comparison file and the other files to be compared included in the first comparison group. The electronic device compares the content items corresponding to the comparison point corresponding to the third file group to obtain a second comparison result corresponding to the second comparison group, which may include: the electronic device compares the content items corresponding to the comparison points in the third file group in the third reference comparison file included in the second comparison group with the content items corresponding to the comparison points in the third file group in the other files to be compared included in the second comparison group, respectively, to obtain a second comparison result between the third reference comparison file and the other files to be compared included in the second comparison group. Correspondingly, the priority of each comparison term in the comparison points corresponding to the second file group may also be introduced, and the priority of each comparison term in the comparison points corresponding to the third file group is compared, which is not described herein in this embodiment of the present application.
In an embodiment, the electronic device may mark, such as highlight or annotate, the content item corresponding to the target comparison point, so as to quickly locate and extract the content item corresponding to the target comparison point, thereby comparing the content item corresponding to the target comparison point according to a preset comparison rule.
It can be seen that, in the embodiment shown in fig. 1, the electronic device may determine, according to the identifier of each to-be-compared file in the at least two to-be-compared files and the corresponding relationship between the comparison template of each service scene and the file list of the service scene, a target comparison template corresponding to the at least two to-be-compared files, and determine, from the target comparison template, a target comparison point corresponding to the at least two to-be-compared files; the electronic equipment can identify the corresponding content items of the target comparison according to the preset identification rules from the at least two files to be compared, and compares the corresponding content items of the target comparison according to the preset comparison rules to obtain the comparison results of the at least two files to be compared, so that the automatic and intelligent file comparison process can be realized, and the comparison efficiency is improved.
please refer to fig. 2, which is a flowchart illustrating another file comparison method according to an embodiment of the present application. The method can be applied to electronic devices. The electronic device may be a terminal or a server. The terminal can be an intelligent terminal such as a smart phone, a tablet computer, a notebook computer and a desktop computer. The server may be a server or a cluster of servers. Specifically, the method may comprise the steps of:
S201, obtaining a file list of each service scene in a plurality of service scenes.
For one embodiment, the electronic device may collect (e.g., from a database or from another server) at least one file group for each of the plurality of business scenarios, each file group including at least two files of the file group to be compared. The electronic device may obtain information of each file group in at least one file group in each service scenario, where the information of each file group may include an identifier of each file in at least two files to be compared in the file group; and the electronic equipment generates a file list comprising the information of each file group in at least one file group under the corresponding service scene aiming at each service scene.
the electronic device obtains information of each file group in at least one file group in each service scenario, and may specifically adopt any one or more of the following manners.
In one embodiment, when the identifier includes a title name, the electronic device may identify a file title in the file content of each included file from each of at least one file group in each service scenario.
In one embodiment, when the identifier includes a file name, the electronic device may identify the file name of each included file from each file group in the at least one file group in each service scenario.
In one embodiment, when the identifier includes a file attribute, such as a file category, the electronic device may identify, in a deep learning manner, a file attribute of each included file from each file group in at least one file group in each business scenario.
For example, the file attribute includes a file category, the electronic device adopts a deep learning mode or a deep learning mode, and the file attribute of each included file is identified from each file group in at least one file group in each service scenario, which may include: the electronic equipment takes each file included in each file group in at least one file group under each service scene as input data of a preset classification model, and the classification model identifies the file category of each file included in each file group in at least one file group under the corresponding service scene.
or, when the electronic device is a terminal, the electronic device may further perform a received setting operation to set a file list of each service scenario in the plurality of service scenarios, which is not described herein again in this embodiment of the application.
s202, determining corresponding comparison points for each file group in at least one file group under the service scene corresponding to the file list of each service scene.
In this embodiment of the application, the electronic device may determine, for each file group in at least one file group in a corresponding service scenario corresponding to the file list of each service scenario, a corresponding comparison point.
in one embodiment, when the electronic device is a terminal, the determining, by the electronic device, a corresponding comparison point for each file group in at least one file group in the service scenario corresponding to the file list of each service scenario may include: the electronic equipment receives the comparison point configuration operation, and configures corresponding comparison points for each file group in at least one file group under the corresponding service scene corresponding to the file list of each service scene according to the comparison point configuration operation.
In an embodiment, when the electronic device is a server, the electronic device may obtain each file group in at least one file group in the service scenario corresponding to the file list of each service scenario sent by the terminal, and determine a corresponding peer to peer, which may include: the electronic equipment receives comparison point configuration data sent by a corresponding terminal, and configures each file group in at least one file group under the service scene corresponding to the file list of each service scene according to the comparison point configuration data, and the corresponding comparison point.
s203, generating a comparison template of each service scene by using a comparison point corresponding to each file group in at least one file group in each service scene;
S204, establishing a corresponding relation between the comparison template of each service scene and the file list of the service scene.
In this embodiment of the application, the electronic device may generate a comparison template for each service scene by using the comparison point corresponding to each file group in at least one file group in each service scene, and may establish a correspondence between the comparison template for each service scene and the file list of the service scene.
For example, the electronic device may generate a comparison template of the service scene 1 by using the comparison point corresponding to the file group 1 in the service scene 1, and establish a corresponding relationship between the comparison template of the service scene 1 and the file list of the service scene 1. Or, the electronic device may generate a comparison template of the service scene 1 by using the comparison point corresponding to the file group 1 and the comparison point corresponding to the file group 2 in the service scene 1, and establish a correspondence between the comparison template of the service scene 1 and the file list of the service scene 1.
in an embodiment, the generating, by the electronic device, a comparison template for each service scenario by using a comparison point corresponding to each file group in the at least one file group in each service scenario may include: the electronic equipment generates a comparison template comprising comparison points corresponding to each file group in at least one file group under the corresponding service scene aiming at each service scene. For example, the electronic device generates a comparison template including comparison points corresponding to the file group 1 in the service scenario 1, or the electronic device generates a comparison template including comparison points corresponding to the file group 1 and comparison points corresponding to the file group 2 in the service scenario 1.
S205, acquiring an identifier of each file to be compared in at least two files to be compared;
S206, determining target comparison templates corresponding to the at least two files to be compared according to the identification of each file to be compared and the corresponding relation between the comparison template of each service scene and the file list of the service scene;
S207, determining target comparison points corresponding to the at least two files to be compared from the target comparison template;
S208, identifying content items corresponding to the target comparison points from the at least two files to be compared according to a preset identification rule;
s209, comparing the content items corresponding to the target comparison point according to a preset comparison rule to obtain comparison results of the at least two files to be compared.
steps S205 to S209 can refer to steps S101 to S105 in the embodiment of fig. 1, and are not described herein again in this embodiment of the present application.
As can be seen, in the embodiment shown in fig. 2, the electronic device may obtain a file list of each service scene in the plurality of service scenes, and construct a corresponding relationship between the comparison template of each service scene and the file list of the service scene based on the file list of each service scene, so as to implement an automatic and intelligent file comparison process according to the corresponding relationship, thereby improving the comparison efficiency.
please refer to fig. 3, which is a schematic structural diagram of a file analysis apparatus according to an embodiment of the present disclosure. The apparatus may be applied to an electronic device. Specifically, the apparatus may include:
an obtaining module 301, configured to obtain an identifier of each of at least two files to be compared;
a first determining template 302, configured to determine, according to the identifier of each to-be-compared file and a correspondence between the comparing template of each service scenario and the file list of the service scenario, a target comparing template corresponding to the at least two to-be-compared files; each file list comprises information of each file group in at least one file group under a corresponding service scene, and the information of each file group comprises an identifier of each file in at least two files to be compared in the file group; each comparison template is generated according to a comparison point corresponding to each file group in a corresponding service scene; the comparison point corresponding to each file group comprises a comparison point between at least two files to be compared in the file group;
A second determining module 303, configured to determine, from the target comparison template, target comparison points corresponding to the at least two files to be compared;
An identifying module 304, configured to identify, according to a preset identification rule, a content item corresponding to the target comparison point from the at least two files to be compared; the identification rule includes at least one of: setting a rule according to the position of the comparison point in the file to be compared, setting a rule according to the position range information of the content item corresponding to the comparison point in the file with the same identifier, setting a rule according to the corresponding relation between the comparison point and the content item, and setting a rule according to the semantic analysis result corresponding to the file to be compared;
A comparison module 305, configured to compare content items corresponding to the target comparison point according to a preset comparison rule, so as to obtain comparison results of the at least two files to be compared.
in an optional implementation manner, the second determining module 303 is specifically configured to determine a file group corresponding to the at least two files to be compared; determining comparison points corresponding to the file groups corresponding to the at least two files to be compared from the target comparison template; and determining the comparison points corresponding to the file groups corresponding to the at least two files to be compared as target comparison points corresponding to the at least two files to be compared.
In an optional implementation manner, the file groups corresponding to the at least two files to be compared include a first file group, the information of the first file group includes an identifier of each file to be compared in the at least two files to be compared, and the target comparison point includes a comparison point corresponding to the first file group; or the file groups corresponding to the at least two files to be compared comprise a second file group and a third file group, the information of the second file group comprises the identification of each file to be compared in the first comparison group of the at least two files to be compared, the information of the third file group comprises the identification of each file to be compared in the second comparison group of the at least two files to be compared, and the target comparison point comprises the comparison point corresponding to the second file group and the comparison point corresponding to the third file group.
In an optional implementation manner, the file groups corresponding to the at least two files to be compared include a second file group and a third file group, the target comparison point includes a comparison point corresponding to the second file group and a comparison point corresponding to the third file group, the identification rule includes a rule set according to position range information of content items corresponding to the comparison points in files with the same identifier, and the identification module 304 is specifically configured to acquire a first file with the same identifier as any one or more files to be compared in the first comparison group, and acquire a second file with the same identifier as any one or more files to be compared in the second comparison group; determining first position range information of content items corresponding to the comparison points corresponding to the second file group in the first file, and determining second position range information of content items corresponding to the comparison points corresponding to the third file group in the second file; and searching the content items corresponding to the comparison points corresponding to the second file group from the first comparison group according to the first position range information, and searching the content items corresponding to the comparison points corresponding to the third file group from the second comparison group according to the second position range information.
in an optional implementation manner, the file groups corresponding to the at least two files to be compared include a second file group and a third file group, the target comparison point includes a comparison point corresponding to the second file group and a comparison point corresponding to the third file group, the identification rule includes a rule set according to a semantic analysis result corresponding to the file to be compared, the identification module 304 is further configured to perform semantic analysis on each content item included in each file to be compared in the first comparison group to obtain a semantic analysis result corresponding to each content item in each content item included in each file to be compared in the first comparison group, determine a first semantic analysis result matching the comparison point corresponding to the second file group from the semantic analysis results corresponding to each content item in each content item included in each file to be compared in the first comparison group, and correspond the first semantic analysis result to each content item included in each file to be compared in the first comparison group The content item is determined as the content item corresponding to the comparison point corresponding to the second file group; performing semantic analysis on each content item included in each file to be compared in the second comparison group to obtain a semantic analysis result corresponding to each content item included in each file to be compared in the second comparison group, determining a second semantic analysis result matched with the comparison point corresponding to the third file group from the semantic analysis result corresponding to each content item included in each file to be compared in the second comparison group, and determining the content item corresponding to the second semantic analysis result in each content item included in each file to be compared in the second comparison group as the content item corresponding to the comparison point corresponding to the third file group.
In an optional implementation manner, the comparing module 305 is specifically configured to compare content items corresponding to the comparing points corresponding to the second file group to obtain a first comparing result corresponding to the first comparing point group; and comparing the content items corresponding to the comparison points corresponding to the third file group to obtain a second comparison result corresponding to the second comparison group.
In an optional implementation manner, the processing module 306 is configured to obtain a file list of each service scenario in a plurality of service scenarios; determining a corresponding comparison point for each file group in at least one file group under the service scene corresponding to the file list of each service scene; generating a comparison template of each service scene by using a comparison point corresponding to each file group in at least one file group in each service scene; and establishing a corresponding relation between the comparison template of each service scene and the file list of the service scene.
It can be seen that, in the embodiment shown in fig. 3, the electronic device may determine, according to the identifier of each to-be-compared file in the at least two to-be-compared files and the corresponding relationship between the comparison template of each service scene and the file list of the service scene, a target comparison template corresponding to the at least two to-be-compared files, and determine, from the target comparison template, a target comparison point corresponding to the at least two to-be-compared files; the electronic equipment can identify the corresponding content items of the target comparison points from the at least two files to be compared according to a preset identification rule, compares the corresponding content items of the target comparison points according to the preset comparison rule, obtains comparison results of the at least two files to be compared, can realize an automatic and intelligent file comparison process, and further improves comparison efficiency.
Please refer to fig. 4, which is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure. The electronic device described in this embodiment may include: a processor 1000 and a memory 2000. The processor 1000 and the memory 2000 may be connected by a bus or other means as shown in fig. 4. In one embodiment, the electronic device may also include one or more input devices 3000, one or more output devices 4000. The processor 1000, memory 2000, one or more input devices 3000, and one or more output devices 4000 may be connected by a bus or other means. In one embodiment, input device 3000 includes, but is not limited to, a touch screen, a sound recorder, a sensor, and the like. Output device 4000 includes but is not limited to a display screen, speakers, etc. the touch screen and display screen may also be replaced with a touch screen display. In one embodiment, input device 3000 and output device 4000 may include standard wired or wireless communication interfaces.
the Processor 1000 may be a Central Processing Unit (CPU), and may be other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
the memory 2000 may be a high-speed RAM memory or a non-volatile memory (e.g., a disk memory). The memory 2000 is used to store a set of program codes, and the processor 1000, the input device 3000, and the output device 4000 may call the program codes stored in the memory 2000. Specifically, the method comprises the following steps:
the processor 1000 is configured to obtain an identifier of each of at least two files to be compared; determining target comparison templates corresponding to the at least two files to be compared according to the identification of each file to be compared and the corresponding relation between the comparison template of each service scene and the file list of the service scene; each file list comprises information of each file group in at least one file group under a corresponding service scene, and the information of each file group comprises an identifier of each file in at least two files to be compared in the file group; each comparison template is generated according to a comparison point corresponding to each file group in a corresponding service scene; the comparison point corresponding to each file group comprises a comparison point between at least two files to be compared in the file group; determining target comparison points corresponding to the at least two files to be compared from the target comparison template; identifying a content item corresponding to the target comparison point from the at least two files to be compared according to a preset identification rule; the identification rule includes at least one of: setting a rule according to the position of the comparison point in the file to be compared, setting a rule according to the position range information of the content item corresponding to the comparison point in the file with the same identifier, setting a rule according to the corresponding relation between the comparison point and the content item, and setting a rule according to the semantic analysis result corresponding to the file to be compared; and comparing the content items corresponding to the target comparison point according to a preset comparison rule to obtain comparison results of the at least two files to be compared.
Optionally, the processor 1000 determines, from the target comparison template, target comparison points corresponding to the at least two files to be compared, specifically, determines a file group corresponding to the at least two files to be compared; determining comparison points corresponding to the file groups corresponding to the at least two files to be compared from the target comparison template; and determining the comparison points corresponding to the file groups corresponding to the at least two files to be compared as target comparison points corresponding to the at least two files to be compared.
optionally, the file groups corresponding to the at least two files to be compared include a first file group, the information of the first file group includes an identifier of each file to be compared in the at least two files to be compared, and the target comparison point includes a comparison point corresponding to the first file group; or the file groups corresponding to the at least two files to be compared comprise a second file group and a third file group, the information of the second file group comprises the identification of each file to be compared in the first comparison group of the at least two files to be compared, the information of the third file group comprises the identification of each file to be compared in the second comparison group of the at least two files to be compared, and the target comparison point comprises the comparison point corresponding to the second file group and the comparison point corresponding to the third file group.
Optionally, the file groups corresponding to the at least two files to be compared include a second file group and a third file group, the target comparison point includes a comparison point corresponding to the second file group and a comparison point corresponding to the third file group, the identification rule includes a rule set according to position range information of content items corresponding to the comparison points in files with the same identifier, and the processor 1000 identifies, according to a preset identification rule, a content item corresponding to the target comparison point from the at least two files to be compared, specifically, obtains a first file with the same identifier as any one or more files to be compared in the first comparison group, and obtains a second file with the same identifier as any one or more files to be compared in the second comparison group; determining first position range information of content items corresponding to the comparison points corresponding to the second file group in the first file, and determining second position range information of content items corresponding to the comparison points corresponding to the third file group in the second file; and searching the content items corresponding to the comparison points corresponding to the second file group from the first comparison group according to the first position range information, and searching the content items corresponding to the comparison points corresponding to the third file group from the second comparison group according to the second position range information.
Optionally, the file groups corresponding to the at least two files to be compared include a second file group and a third file group, the target comparison point includes a comparison point corresponding to the second file group and a comparison point corresponding to the third file group, the identification rule includes a rule set according to a semantic analysis result corresponding to the file to be compared, the processor 1000 identifies a content item corresponding to the target comparison point from the at least two files to be compared according to a preset identification rule, specifically performs semantic analysis on each content item included in each file to be compared in the first comparison group to obtain a semantic analysis result corresponding to each content item included in each file to be compared in the first comparison group, and determines a first semantic analysis result matched with the comparison point corresponding to the second file group from the semantic analysis result corresponding to each content item included in each file to be compared in the first comparison group, determining content items corresponding to the first semantic analysis result in the content items included in the files to be compared in the first comparison group as content items corresponding to the comparison point corresponding to the second file group; performing semantic analysis on each content item included in each file to be compared in the second comparison group to obtain a semantic analysis result corresponding to each content item included in each file to be compared in the second comparison group, determining a second semantic analysis result matched with the comparison point corresponding to the third file group from the semantic analysis result corresponding to each content item included in each file to be compared in the second comparison group, and determining the content item corresponding to the second semantic analysis result in each content item included in each file to be compared in the second comparison group as the content item corresponding to the comparison point corresponding to the third file group.
Optionally, the processor 1000 compares content items corresponding to the target comparison point according to a preset comparison rule to obtain comparison results of the at least two files to be compared, specifically, compares content items corresponding to the comparison point corresponding to the second file group to obtain a first comparison result corresponding to the first comparison group; and comparing the content items corresponding to the comparison points corresponding to the third file group to obtain a second comparison result corresponding to the second comparison group.
Optionally, the processor 1000 is further configured to obtain a file list of each service scenario in the plurality of service scenarios; determining a corresponding comparison point for each file group in at least one file group under the service scene corresponding to the file list of each service scene; generating a comparison template of each service scene by using a comparison point corresponding to each file group in at least one file group in each service scene; and establishing a corresponding relation between the comparison template of each service scene and the file list of the service scene.
In a specific implementation, the processor 1000, the input device 3000, and the output device 4000 described in this embodiment of the present application may perform the implementation described in the embodiment of fig. 1 and fig. 2, or may perform the implementation described in this embodiment of the present application, and are not described herein again.
The functional modules in the embodiments of the present application may be integrated into one processing module, or each module may exist alone physically, or two or more modules are integrated into one module. The integrated module can be realized in a form of sampling hardware, and can also be realized in a form of sampling software functional modules.
it will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by a computer program, which can be stored in a computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. The medium is a computer-readable storage medium, which may be a magnetic disk, an optical disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), or the like.
While the invention has been described with reference to a preferred embodiment, it will be understood by those skilled in the art that various changes in form and detail may be made therein without departing from the spirit and scope of the invention as defined by the appended claims.

Claims (10)

1. A file comparison method is characterized by comprising the following steps:
Acquiring an identifier of each file to be compared in at least two files to be compared;
Determining target comparison templates corresponding to the at least two files to be compared according to the identification of each file to be compared and the corresponding relation between the comparison template of each service scene and the file list of the service scene; each file list comprises information of each file group in at least one file group under a corresponding service scene, and the information of each file group comprises an identifier of each file in at least two files to be compared in the file group; each comparison template is generated according to a comparison point corresponding to each file group in a corresponding service scene; the comparison point corresponding to each file group comprises a comparison point between at least two files to be compared in the file group;
determining target comparison points corresponding to the at least two files to be compared from the target comparison template;
Identifying a content item corresponding to the target comparison point from the at least two files to be compared according to a preset identification rule; the identification rule includes at least one of: setting a rule according to the position of the comparison point in the file to be compared, setting a rule according to the position range information of the content item corresponding to the comparison point in the file with the same identifier, setting a rule according to the corresponding relation between the comparison point and the content item, and setting a rule according to the semantic analysis result corresponding to the file to be compared;
and comparing the content items corresponding to the target comparison point according to a preset comparison rule to obtain comparison results of the at least two files to be compared.
2. The method of claim 1, wherein the determining the target comparison points corresponding to the at least two files to be compared from the target comparison template comprises:
Determining a file group corresponding to the at least two files to be compared;
Determining comparison points corresponding to the file groups corresponding to the at least two files to be compared from the target comparison template;
And determining the comparison points corresponding to the file groups corresponding to the at least two files to be compared as target comparison points corresponding to the at least two files to be compared.
3. The method of claim 2,
The file groups corresponding to the at least two files to be compared comprise a first file group, the information of the first file group comprises the identification of each file to be compared in the at least two files to be compared, and the target comparison point comprises a comparison point corresponding to the first file group; or the like, or, alternatively,
the file groups corresponding to the at least two files to be compared comprise a second file group and a third file group, the information of the second file group comprises the identification of each file to be compared in the first comparison group of the at least two files to be compared, the information of the third file group comprises the identification of each file to be compared in the second comparison group of the at least two files to be compared, and the target comparison point comprises a comparison point corresponding to the second file group and a comparison point corresponding to the third file group.
4. The method according to claim 3, wherein the file groups corresponding to the at least two files to be compared include a second file group and a third file group, the target comparison point includes a comparison point corresponding to the second file group and a comparison point corresponding to the third file group, the identification rule includes a rule set according to position range information of content items corresponding to the comparison points in files with the same identifier, and identifying the content item corresponding to the target comparison point from the at least two files to be compared according to a preset identification rule includes:
acquiring a first file with the same identification as any one or more files to be compared in the first comparison group, and acquiring a second file with the same identification as any one or more files to be compared in the second comparison group;
Determining first position range information of content items corresponding to the comparison points corresponding to the second file group in the first file, and determining second position range information of content items corresponding to the comparison points corresponding to the third file group in the second file;
And searching the content items corresponding to the comparison points corresponding to the second file group from the first comparison group according to the first position range information, and searching the content items corresponding to the comparison points corresponding to the third file group from the second comparison group according to the second position range information.
5. the method according to claim 3, wherein the file groups corresponding to the at least two files to be compared include a second file group and a third file group, the target comparison point includes a comparison point corresponding to the second file group and a comparison point corresponding to the third file group, the identification rule includes a rule set according to semantic analysis results corresponding to the files to be compared, and identifying a content item corresponding to the target comparison point from the at least two files to be compared according to a preset identification rule includes:
Performing semantic analysis on each content item included in each file to be compared in the first comparison group to obtain a semantic analysis result corresponding to each content item included in each file to be compared in the first comparison group, determining a first semantic analysis result matched with a comparison point corresponding to the second file group from the semantic analysis result corresponding to each content item included in each file to be compared in the first comparison group, and determining the content item corresponding to the first semantic analysis result in each content item included in each file to be compared in the first comparison group as the content item corresponding to the comparison point corresponding to the second file group;
Performing semantic analysis on each content item included in each file to be compared in the second comparison group to obtain a semantic analysis result corresponding to each content item included in each file to be compared in the second comparison group, determining a second semantic analysis result matched with the comparison point corresponding to the third file group from the semantic analysis result corresponding to each content item included in each file to be compared in the second comparison group, and determining the content item corresponding to the second semantic analysis result in each content item included in each file to be compared in the second comparison group as the content item corresponding to the comparison point corresponding to the third file group.
6. The method according to claim 4 or 5, wherein the comparing the content items corresponding to the target comparison point according to a preset comparison rule to obtain the comparison results of the at least two files to be compared comprises:
Comparing the content items corresponding to the comparison points corresponding to the second file group to obtain a first comparison result corresponding to the first comparison group;
And comparing the content items corresponding to the comparison points corresponding to the third file group to obtain a second comparison result corresponding to the second comparison group.
7. The method of claim 1, further comprising:
Acquiring a file list of each service scene in a plurality of service scenes;
determining a corresponding comparison point for each file group in at least one file group under the service scene corresponding to the file list of each service scene;
generating a comparison template of each service scene by using a comparison point corresponding to each file group in at least one file group in each service scene;
and establishing a corresponding relation between the comparison template of each service scene and the file list of the service scene.
8. a file comparison device, comprising:
the acquisition module is used for acquiring the identifier of each file to be compared in at least two files to be compared;
The first determining template is used for determining target comparison templates corresponding to the at least two files to be compared according to the identification of each file to be compared and the corresponding relation between the comparison template of each service scene and the file list of the service scene; each file list comprises information of each file group in at least one file group under a corresponding service scene, and the information of each file group comprises an identifier of each file in at least two files to be compared in the file group; each comparison template is generated according to a comparison point corresponding to each file group in a corresponding service scene; the comparison point corresponding to each file group comprises a comparison point between at least two files to be compared in the file group;
The second determining module is used for determining target comparison points corresponding to the at least two files to be compared from the target comparison template;
The identification module is used for identifying a content item corresponding to the target comparison point from the at least two files to be compared according to a preset identification rule; the identification rule includes at least one of: setting a rule according to the position of the comparison point in the file to be compared, setting a rule according to the position range information of the content item corresponding to the comparison point in the file with the same identifier, setting a rule according to the corresponding relation between the comparison point and the content item, and setting a rule according to the semantic analysis result corresponding to the file to be compared;
and the comparison module is used for comparing the content items corresponding to the target comparison points according to a preset comparison rule to obtain comparison results of the at least two files to be compared.
9. An electronic device, comprising a processor and a memory, the processor and the memory being interconnected, wherein the memory is configured to store a computer program comprising program instructions, the processor being configured to invoke the program instructions to perform the method of any one of claims 1-7.
10. a computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program which is executed by a processor to implement the method according to any one of claims 1-7.
CN201910813971.0A 2019-08-30 2019-08-30 file comparison method and device, electronic equipment and storage medium Pending CN110580243A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910813971.0A CN110580243A (en) 2019-08-30 2019-08-30 file comparison method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910813971.0A CN110580243A (en) 2019-08-30 2019-08-30 file comparison method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN110580243A true CN110580243A (en) 2019-12-17

Family

ID=68811529

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910813971.0A Pending CN110580243A (en) 2019-08-30 2019-08-30 file comparison method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110580243A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113723071A (en) * 2021-08-31 2021-11-30 重庆富民银行股份有限公司 Electronic file checking method, system, storage medium and equipment

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105095229A (en) * 2014-04-29 2015-11-25 国际商业机器公司 Method for training topic model, method for comparing document content and corresponding device
CN106294110A (en) * 2015-06-02 2017-01-04 阿里巴巴集团控股有限公司 A kind of file comparison method and device
WO2018054199A1 (en) * 2016-09-26 2018-03-29 上海泓智信息科技有限公司 Method and device for evaluating file
CN108920436A (en) * 2018-06-29 2018-11-30 郑州云海信息技术有限公司 A kind of file data comparison method, tool and equipment
CN109492197A (en) * 2018-09-18 2019-03-19 深圳壹账通智能科技有限公司 The file information comparison method, device, computer equipment and storage medium
CN109933754A (en) * 2019-01-31 2019-06-25 平安科技(深圳)有限公司 Search method, apparatus, computer equipment and the storage medium of change to the contract part
CN110162509A (en) * 2019-04-26 2019-08-23 平安普惠企业管理有限公司 File comparison method, device, computer equipment and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105095229A (en) * 2014-04-29 2015-11-25 国际商业机器公司 Method for training topic model, method for comparing document content and corresponding device
CN106294110A (en) * 2015-06-02 2017-01-04 阿里巴巴集团控股有限公司 A kind of file comparison method and device
WO2018054199A1 (en) * 2016-09-26 2018-03-29 上海泓智信息科技有限公司 Method and device for evaluating file
CN108920436A (en) * 2018-06-29 2018-11-30 郑州云海信息技术有限公司 A kind of file data comparison method, tool and equipment
CN109492197A (en) * 2018-09-18 2019-03-19 深圳壹账通智能科技有限公司 The file information comparison method, device, computer equipment and storage medium
CN109933754A (en) * 2019-01-31 2019-06-25 平安科技(深圳)有限公司 Search method, apparatus, computer equipment and the storage medium of change to the contract part
CN110162509A (en) * 2019-04-26 2019-08-23 平安普惠企业管理有限公司 File comparison method, device, computer equipment and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113723071A (en) * 2021-08-31 2021-11-30 重庆富民银行股份有限公司 Electronic file checking method, system, storage medium and equipment
CN113723071B (en) * 2021-08-31 2023-05-09 重庆富民银行股份有限公司 Electronic archive verification method, system, storage medium and equipment

Similar Documents

Publication Publication Date Title
CN106446816B (en) Face recognition method and device
CN110162695B (en) Information pushing method and equipment
CN107798047B (en) Repeated work order detection method, device, server and medium
CN107291949B (en) Information searching method and device
US10936819B2 (en) Query-directed discovery and alignment of collections of document passages for improving named entity disambiguation precision
CN110674360B (en) Tracing method and system for data
CN110929125A (en) Search recall method, apparatus, device and storage medium thereof
CN109408507B (en) Multi-attribute data processing method, device, equipment and readable storage medium
CN104462307A (en) Searching method and device for object in terminal
CN111475694A (en) Data processing method, device, terminal and storage medium
CN107704520B (en) Multi-file retrieval method and device based on face recognition
CN112559526A (en) Data table export method and device, computer equipment and storage medium
CN113157731A (en) Symbol analysis method, device, equipment and storage medium
CN115329556A (en) Transformer substation CAD drawing auditing method and device
CN112307318A (en) Content publishing method, system and device
CN110580243A (en) file comparison method and device, electronic equipment and storage medium
CN111221742A (en) Test case updating method and device, storage medium and server
US20220058214A1 (en) Document information extraction method, storage medium and terminal
CN113626558B (en) Intelligent recommendation-based field standardization method and system
CN115904978A (en) Redfish interface testing method, computing device and storage medium
CN112612866B (en) Knowledge base text synchronization method and device, electronic equipment and storage medium
CN106294433B (en) Equipment information processing method and device
CN113051919B (en) Method and device for identifying named entity
CN114416847A (en) Data conversion method, device, server and storage medium
CN112612817A (en) Data processing method and device, terminal equipment and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
AD01 Patent right deemed abandoned

Effective date of abandoning: 20240119

AD01 Patent right deemed abandoned