File comparison method and device, electronic equipment and storage medium

By obtaining the configuration attribute information of the target file, grouping and parsing files, building the basic file parameter table and file structure definition table, filtering out the reference files and update files, and performing file comparisons, solving the problem of low file comparison accuracy in the existing technology Problem, achieving more efficient and accurate file comparison.

CN119476253AActive Publication Date: 2025-02-18PING AN BANK CO LTD
View PDF 10 Cites 0 Cited by

Patent Information

Application Number
CN202411585956.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-07
Publication Date
2025-02-18
Estimated Expiration
2044-11-07

AI Technical Summary

Technical Problem

In the prior art, file comparison methods rely on manual operations, which are prone to errors, resulting in a decrease in the accuracy of file comparison.

Method used

A file comparison method is proposed, by obtaining the configuration attribute information of the target file, grouping files, building a file basic parameter table and file structure definition table, filtering out reference files and update files, and performing file analysis and comparison.

Benefits of technology

It improves the accuracy and efficiency of file comparison, reduces manual participation, and enhances the targetedness of comparison.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119476253A_ABST
    Figure CN119476253A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a file comparison method and device, electronic equipment and a storage medium, belongs to the technical field of text processing, and is suitable for the field of financial science and technology. The method comprises the following steps: acquiring configuration attribute information of a comparison file group; constructing a file basic parameter table and a file structure definition table based on the configuration attribute information; based on a preset file identification parameter and a file basic parameter table, a target file group is screened out from the comparison file group, and the target file group comprises a reference file and an update file; based on the file basic parameter table and the file structure definition table, performing file analysis on the reference file to obtain a reference file field, and based on the file basic parameter table and the file structure definition table, performing file analysis on the update file to obtain an update file field; and comparing the updated file with the reference file based on the reference file field, the updated file field and the file structure definition table. According to the embodiment of the invention, the file comparison accuracy can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of text processing and artificial intelligence technology, and in particular to a file comparison method and device, an electronic device and a storage medium. Background Art

[0002] File comparison refers to comparing the contents of multiple files to obtain the data differences between the files. For example, in the financial field, by comparing the latest version of the insurance regulations file with the specified version of the insurance regulations file, the differences in regulations between the latest version of the insurance regulations file and the specified version of the insurance regulations file can be obtained, thereby clarifying the updated content of the latest version of the insurance regulations file.

[0003] At present, the common file comparison method is usually to compare the file contents of multiple files manually, but this method is prone to errors, resulting in file comparison errors and reduced accuracy of file comparison. Therefore, how to improve the accuracy of file comparison has become a technical problem that needs to be solved urgently. Summary of the invention

[0004] The main purpose of the embodiments of the present application is to provide a face mask detection method and device, an electronic device and a storage medium, aiming to improve the accuracy of file comparison.

[0005] To achieve the above object, a first aspect of an embodiment of the present application provides a file comparison method, the method comprising: Get the configuration property information of the target file; Grouping the target files to obtain a comparison file group; Based on the comparison file group and the configuration attribute information, construct a file basic parameter table and a file structure definition table, wherein the file basic parameter table is used to describe the file attributes of the comparison file group, and the file structure definition table is used to describe the file configuration of the comparison file group; Based on the preset file identification parameters and the file basic parameter table, a target file group is selected from the comparison file group, wherein the target file group includes a reference file and an update file; Based on the file basic parameter table and the file structure definition table, the reference file is parsed to obtain reference file fields; based on the file basic parameter table and the file structure definition table, the update file is parsed to obtain update file fields; Based on the reference file field, the update file field and the file structure definition table, the update file is compared with the reference file.

[0006] In some embodiments, the performing file parsing on the reference file based on the file basic parameter table and the file structure definition table to obtain the reference file field, and performing file parsing on the update file based on the file basic parameter table and the file structure definition table to obtain the update file field, includes: Based on the file basic parameter table, query the reference file for the file type to obtain the reference file type; based on the file basic parameter table, query the update file for the file type to obtain the update file type; Based on the reference file type, the file basic parameter table and the file structure definition table, a field structure query is performed on the reference file to obtain reference field structure information; Based on the update file type, the file basic parameter table and the file structure definition table, a field structure query is performed on the update file to obtain update field structure information; Extracting information from the reference file based on the reference field structure information to obtain the reference file field; Based on the update field structure information, information is extracted from the update file to obtain the update file field.

[0007] In some embodiments, the file type includes a fixed-length file type and a variable-length file type, and the field structure query of the reference file based on the reference file type, the file basic parameter table, and the file structure definition table to obtain the reference field structure information includes: If the reference file type is the fixed-length file type, then based on the reference file, a field structure query is performed on the file structure definition table to obtain the reference field structure information; If the reference file type is the variable-length file type, then based on the reference file, a delimiter type query is performed on the file basic parameters to obtain a field delimiter; Based on the field separator, the reference file is structurally parsed to obtain the reference field structure information.

[0008] In some embodiments, extracting information from the reference file based on the reference field structure information to obtain the reference file field includes: Based on the reference field structure information, a field query is performed on the reference file to obtain reference field position information; Based on the reference field position information, field extraction is performed on the reference file to obtain the reference file field.

[0009] In some embodiments, the configuration attribute information includes file configuration information and file attribute information, and the step of constructing a file basic parameter table and a file structure definition table based on the comparison file group and the configuration attribute information includes: Performing group identification on the comparison file group to obtain a file group identification; Based on the file group identifier, construct a group identifier field; Based on the file attribute information, construct a file attribute field; Based on the file configuration information, construct a file configuration field; Perform field concatenation on the group identification field and the file attribute field to obtain the file basic parameter table; The group identification field and the file configuration field are concatenated to obtain the file structure definition table.

[0010] In some embodiments, the step of selecting a target file group from the comparison file group based on the preset file identification parameters and the file basic parameter table includes: Based on the file identification parameter, selecting a target group identification from the file group identifications of the comparison file group; Based on the target group identifier, a path query is performed on the file basic parameter table to obtain a file path; Based on the file path, read the file to obtain the reference file and the update file; The reference file and the update file are combined to obtain the target file group.

[0011] In some embodiments, the comparing the update file with the reference file based on the reference file field, the update file field and the file structure definition table includes: Based on the update file and the reference file, a field whitelist query is performed on the file structure definition table to obtain non-comparison field information; Based on the non-comparison field information, the reference file field and the update file field are compared to obtain file comparison information, wherein the file comparison information is used to indicate the difference between the reference file and the update file.

[0012] To achieve the above-mentioned purpose, a second aspect of an embodiment of the present application provides a file comparison device, the device comprising: A file information acquisition module, used to obtain configuration attribute information of a target file; A target file grouping module, used for grouping the target files based on the configuration attribute information to obtain a comparison file group; A parameter table construction module, used to construct a file basic parameter table and a file structure definition table based on the comparison file group and the configuration attribute information, wherein the file basic parameter table is used to describe the file attributes of the comparison file group, and the file structure definition table is used to describe the file configuration of the comparison file group; a target file locating module, configured to filter out a target file group from the comparison file group based on preset file identification parameters and the file basic parameter table, wherein the target file group includes a reference file and an update file; A file field parsing module, configured to parse the reference file to obtain reference file fields based on the file basic parameter table and the file structure definition table, and parse the update file to obtain update file fields based on the file basic parameter table and the file structure definition table; The file field comparison module is used to compare the update file with the reference file based on the reference file field, the update file field and the file structure definition table.

[0013] To achieve the above-mentioned purpose, the third aspect of an embodiment of the present application proposes an electronic device, which includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the method described in the first aspect is implemented.

[0014] To achieve the above-mentioned purpose, the fourth aspect of an embodiment of the present application proposes a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method described in the first aspect is implemented.

[0015] The file comparison method and device, electronic device and storage medium proposed in the present application obtain configuration attribute information of the target file, and then use the configuration attribute information to group the target file to obtain a comparison file group, thereby avoiding completely unrelated files from appearing in the same comparison file group, thereby improving the pertinence and accuracy of the file comparison. Furthermore, according to the comparison file group and the configuration attribute information, a file basic parameter table and a file structure definition table are constructed, which can provide detailed reference information for subsequent file comparisons. Secondly, according to the preset file identification parameters and the file basic parameter table, the target file group is screened out from the comparison file group, and according to the file basic parameter table and the file structure definition table, the reference file is parsed to obtain the reference file field, and according to the file basic parameter table and the file structure definition table, the updated file is parsed to obtain the updated file field, thereby reducing the degree of manual participation in file field acquisition, thereby improving the efficiency and accuracy of file comparison. Finally, according to the reference file field, the updated file field and the file structure definition table, the updated file is compared with the reference file, thereby further reducing the degree of manual participation in the file comparison process and improving the efficiency and accuracy of file comparison. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] Figure 1 is a flow chart of a file comparison method provided in an embodiment of the present application; Figure 2 yes Figure 1 Flow chart of step S103 in FIG. Figure 3 yes Figure 2 Flow chart of step S204 in FIG. Figure 4 yes Figure 1 Flow chart of step S105 in FIG. Figure 5 yes Figure 1 Flow chart of step S402 in FIG. Figure 6 yes Figure 5 Flow chart of step S404 in FIG. Figure 7 yes Figure 1 Flow chart of step S106 in FIG. Figure 8 is a structural schematic diagram of a file comparison device provided in an embodiment of the present application; Fig. 9 It is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. DETAILED DESCRIPTION

[0017] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0018] It should be noted that, although the functional modules are divided in the device schematic diagram and the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the module division in the device or the order in the flowchart. The terms "first", "second", etc. in the specification, claims and the above drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence.

[0019] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0020] First, some nouns involved in this application are analyzed: Data table: A data table is a structured data collection consisting of rows and columns, usually used to store information for easy management and retrieval. Each data table represents a specific subject or entity, such as a user, product, or order. Each row is usually called a record, representing an instance of the subject, and each column is called a field, which defines the specific attributes or characteristics of the record to ensure the consistency and descriptiveness of the data.

[0021] Field: A field is the basic unit of a data table, representing a specific data attribute or feature, such as name, age, address, etc. Each field has a clear data type and constraints to ensure that the data is entered and processed in accordance with the preset format and standards. The field defines the specific content of the record through its name and type, making data storage, retrieval and analysis clearer and more efficient.

[0022] File comparison refers to comparing the contents of multiple files to obtain the data differences between the files. For example, in the financial field, by comparing the latest version of the insurance regulations file with the specified version of the insurance regulations file, the differences in regulations between the latest version of the insurance regulations file and the specified version of the insurance regulations file can be obtained, thereby clarifying the updated content of the latest version of the insurance regulations file.

[0023] At present, the common file comparison method is usually to compare the file contents of multiple files manually, but this method is prone to errors, resulting in file comparison errors and reduced accuracy of file comparison. Therefore, how to improve the accuracy of file comparison has become a technical problem that needs to be solved urgently.

[0024] Based on this, the embodiments of the present application provide a file comparison method and device, an electronic device and a storage medium, aiming to improve the accuracy of file comparison.

[0025] The file comparison method and device, electronic device and storage medium provided in the embodiments of the present application are specifically described through the following embodiments. First, the file comparison method in the embodiments of the present application is described.

[0026] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results.

[0027] AI basic technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics, etc. AI software technologies mainly include computer vision technology, robotics technology, biometrics technology, speech processing technology, natural language processing technology, and machine learning / deep learning.

[0028] The file comparison method provided in the embodiment of the present application relates to the field of text processing and artificial intelligence technology. The file comparison method provided in the embodiment of the present application can be applied to a terminal, can be applied to a server side, or can be software running in a terminal or a server side. In some embodiments, the terminal can be a smart phone, a tablet computer, a laptop computer, a desktop computer, etc.; the server side can be configured as an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms; the software can be an application that implements the file comparison method, etc., but is not limited to the above forms.

[0029] The present application can be used in many general or special computer system environments or configurations. For example: personal computers, server computers, handheld or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set-top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments including any of the above systems or devices, etc. The present application can be described in the general context of computer-executable instructions executed by a computer, such as program modules. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform specific tasks or implement specific abstract data types. The present application can also be practiced in distributed computing environments, in which tasks are performed by remote processing devices connected through a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media including storage devices.

[0030] Figure 1 is an optional flow chart of the file comparison method provided in the embodiment of the present application. Figure 1 The method may include but is not limited to steps S101 to S106.

[0031] Step S101, obtaining configuration attribute information of the target file; Step S102, grouping the target files based on the configuration attribute information to obtain a comparison file group; Step S103, constructing a file basic parameter table and a file structure definition table based on the comparison file group and the configuration attribute information, wherein the file basic parameter table is used to describe the file attributes of the comparison file group, and the file structure definition table is used to describe the file configuration of the comparison file group; Step S104, based on the preset file identification parameters and the file basic parameter table, a target file group is screened out from the comparison file group, wherein the target file group includes a reference file and an update file; Step S105, based on the file basic parameter table and the file structure definition table, the reference file is parsed to obtain the reference file field, and based on the file basic parameter table and the file structure definition table, the update file is parsed to obtain the update file field; Step S106: Based on the reference file field, the update file field and the file structure definition table, the update file is compared with the reference file.

[0032] In steps S101 to S106 shown in the embodiment of the present application, the target files are grouped by obtaining the configuration attribute information of the target files to obtain a comparison file group, and then a file basic parameter table for describing the file attributes of the comparison file group and a file structure definition table for describing the file configuration of the comparison file group are constructed based on the comparison file group and the configuration attribute information. Furthermore, based on the preset file identification parameters and the file basic parameter table, reference files and update files that need to be compared are screened out from the comparison file group. Secondly, based on the file basic parameter table and the file structure definition table, the reference file is parsed to obtain the reference file field, and based on the file basic parameter table and the file structure definition table, the update file is parsed to obtain the update file field. Finally, based on the reference file field, the update file field and the file structure definition table, the update file is compared with the reference file. Therefore, the present application obtains the configuration attribute information of the target file, and then uses the configuration attribute information to group the target file to obtain a comparison file group, thereby avoiding completely unrelated files from appearing in the same comparison file group, thereby improving the pertinence and accuracy of the file comparison. Furthermore, according to the comparison file group and the configuration attribute information, a file basic parameter table and a file structure definition table are constructed, which can provide detailed reference information for subsequent file comparisons. Secondly, according to the preset file identification parameters and the file basic parameter table, the target file group is screened out from the comparison file group, and according to the file basic parameter table and the file structure definition table, the reference file is parsed to obtain the reference file field, and according to the file basic parameter table and the file structure definition table, the updated file is parsed to obtain the updated file field, thereby reducing the degree of manual participation in file field acquisition, thereby improving the efficiency and accuracy of file comparison. Finally, according to the reference file field, the updated file field and the file structure definition table, the updated file is compared with the reference file, further reducing the degree of manual participation in the file comparison process and improving the efficiency and accuracy of file comparison.

[0033] In step S101 of some embodiments, the configuration attribute information may be a collection of file configuration information and file attribute information of the target file, wherein the file configuration information includes information such as the field name, field position, maximum length of the field, whether the field is a primary key, and whether the field is a whitelist, and the file attribute information includes information such as the index path, file date, file name, file content type, file separator type, and file owner of the target file.

[0034] The present application can obtain configuration attribute information of the target file by querying the configuration file of the target file, and can also obtain file configuration information and file attribute information of the target file by querying the structure and attributes of the target file, and finally, combine the file configuration information and file attribute information of the target file to obtain configuration attribute information.

[0035] In step S102 of some embodiments, by querying the file contents of the target files, target files with similar contents are grouped into the same group, thereby forming a comparison file group.

[0036] It is important to know that by grouping the target files so that target files with similar contents are grouped into the same group to form a comparison file group, the increase in file comparison time caused by comparison between irrelevant files during the file comparison process can be reduced, thereby improving the efficiency of file comparison.

[0037] In step S103 of some embodiments, the comparison file groups obtained by the above classification are numbered to obtain a file group identifier for representing the identity of the comparison file group. Furthermore, the file group identifier is combined with the configuration attribute information of each file in the comparison file group to obtain a file basic parameter table for describing the file attributes of the comparison file group and a file structure definition table for describing the file configuration of the comparison file group.

[0038] For details, see Figure 2 In some embodiments, step S103 may include but is not limited to steps S201 to S206: Step S201, performing group identification on the comparison file group to obtain a file group identification; Step S202, constructing a group identification field based on the file group identification; Step S203, constructing a file attribute field based on the file attribute information; Step S204, constructing a file configuration field based on the file configuration information; Step S205, concatenating the group identification field and the file attribute field to obtain a file basic parameter table; Step S206, concatenating the group identification field and the file configuration field to obtain a file structure definition table.

[0039] In step S201 of some embodiments, the comparison file group can be numbered according to the file content of the comparison file group to obtain a group identifier of the comparison file group, that is, a file group identifier. For example, in a scenario in the financial field, if all the files in the comparison file group A are medical insurance files, then by group identifying the comparison file group, a file group identifier of the medical insurance file group No. 1 can be generated.

[0040] In steps S202 to S204 of some embodiments, a group identification field of the comparison file group can be constructed based on the file group identification of the comparison file group, and then a file attribute field and a file configuration field can be constructed respectively based on the configuration attribute information of each file in the comparison file group, wherein the file attribute field includes the file attribute information of each file in the comparison file group, and the file configuration field includes the file configuration information of each file in the comparison file group.

[0041] In step S205 and step S206 of some embodiments, the group identification field of the comparison file group is concatenated with the file attribute field of the comparison file group to form a data table, and a file basic parameter table for describing the file attributes of the comparison file group can be obtained. The group identification field of the comparison file group is concatenated with the file configuration field of the comparison file group to form a data table, and a file structure definition table for describing the file configuration of the comparison file group can be obtained.

[0042] In steps S201 to S206 shown in the present embodiment, a file group identification is obtained by group identification of the comparison file group, so that the comparison file group that needs to be compared can be quickly screened out later. Furthermore, a group identification field is constructed based on the file group identification, a file attribute field is constructed based on the file attribute information, and a file configuration field is constructed based on the file configuration information. The group identification field and the file attribute field are concatenated to obtain a file basic parameter table, and the group identification field and the file configuration field are concatenated to obtain a file structure definition table, which can provide detailed reference information for subsequent file comparison and file parsing steps, thereby reducing the time for file information query and improving the efficiency of file comparison.

[0043] In step S104 of some embodiments, the file identification parameter may be a file group identification of a comparison file group that needs to be compared.

[0044] This method can perform an identification query on the file basic parameter table based on the pre-set file identification parameters to obtain the target group identification, and then query the index path of the comparison file group corresponding to the target group identification in the file basic parameter table to obtain the file path. Further, according to the file path, the specified file is read to obtain the target file group.

[0045] For details, see Figure 3 In some embodiments, step S104 may include but is not limited to steps S301 to S304: Step S301, selecting a target group identifier from the file group identifiers of the comparison file group based on the file identifier parameter; Step S302, based on the target group identifier, perform a path query on the file basic parameter table to obtain the file path; Step S303, based on the file path, read the file to obtain the reference file and the update file; Step S304: combine the reference file and the update file to obtain a target file group.

[0046] In step S301 of some embodiments, the target group identifier can be obtained by searching the file basic parameter table for a file group identifier that is identical to the file identifier parameter. It should be noted that the target group identifier refers to the identity information of the comparison file group that needs to be compared.

[0047] In step S302 of some embodiments, the file basic parameter table includes the index path of the file, so the file paths of the multiple files can be obtained by querying the index path corresponding to the target group identifier in the file basic parameter table.

[0048] In step S303 of some embodiments, the file is read according to the above file path to obtain a reference file and an update file. It should be noted that the timestamp data of the reference file is generally earlier than the timestamp data of the update file.

[0049] In step S304 of some embodiments, the reference file and the update file read out are combined into a folder, so as to obtain a target file group corresponding to the preset file identification parameters.

[0050] In steps S301 to S304 shown in the present embodiment, a target group identifier is selected from the file group identifiers of the comparison file group according to the file identifier parameters, and then a path query is performed on the file basic parameter table according to the target group identifier to obtain the file path. Next, according to the file path, the file is read to obtain the reference file and the update file. Finally, the reference file and the update file are combined to obtain the target file group, so that the comparison file group that needs to be compared can be accurately obtained, thereby improving the accuracy of the file comparison.

[0051] In step S105 of some embodiments, the reference file type and the update file type can be obtained by querying the file basic parameter table for the file types of the reference file and the update file. Secondly, according to the file types of the reference file and the update file and the pre-set file field query method, the file basic parameter table and the file structure definition table are queried to obtain the reference field structure information and the update field structure information. Finally, according to the reference field structure information and the update field structure information, the reference file and the update file are read for fields to obtain the reference file fields and the update file fields.

[0052] For details, see Figure 4 In some embodiments, step S105 may include but is not limited to steps S401 to S405: Step S401, based on the file basic parameter table, query the file type of the reference file to obtain the reference file type, and based on the file basic parameter table, query the file type of the update file to obtain the update file type; Step S402, based on the reference file type, the file basic parameter table and the file structure definition table, perform a field structure query on the reference file to obtain reference field structure information; Step S403, based on the update file type, the file basic parameter table and the file structure definition table, perform a field structure query on the update file to obtain update field structure information; Step S404, extracting information from the reference file based on the reference field structure information to obtain the reference file field; Step S405: extract information from the update file based on the update field structure information to obtain the update file fields.

[0053] In step S401 of some embodiments, by querying the file type of the target file group in the file basic parameter table, the file type of each file in the target file group, ie, the reference file type and the update file type, can be obtained.

[0054] It is important to know that the file types in the file basic parameter table include variable-length file types and fixed-length file types. The variable-length file type indicates that the field length and file format of the file may change, while the fixed-length file type indicates that the field length and file format of the file will not change.

[0055] In step S402 of some embodiments, the field structure in the reference file can be clarified based on the reference file type. When the reference file type is a fixed-length file type, the field structure of the reference file in the file structure definition table can be directly queried to obtain the reference field structure information. When the reference file type is a variable-length file type, it is necessary to determine the delimiter type of the reference file through the file basic parameter table, and then perform file structure parsing to obtain the reference field structure information.

[0056] For details, see Figure 5 In some embodiments, step S402 may include but is not limited to steps S501 to S503: Step S501, if the reference file type is a fixed-length file type, then based on the reference file, a field structure query is performed on the file structure definition table to obtain reference field structure information; Step S502: If the reference file type is a variable-length file type, a delimiter type query is performed on the file basic parameters based on the reference file to obtain a field delimiter; Step S503: perform structural analysis on the reference file based on the field separator to obtain reference field structure information.

[0057] In step S501 of some embodiments, when the reference file type of the reference file is a fixed-length file type, it indicates that the fields of the reference file do not need to be separated by separators. Therefore, the field structure of the reference file in the file structure definition table can be directly queried to obtain the reference field structure information of the reference file.

[0058] In step S502 of some embodiments, when the reference file type of the reference file is a variable-length file type, it indicates that the fields of the reference file need to be separated by separators. Therefore, before parsing the reference file, it is also necessary to clarify the separator type of the reference file. Specifically, the field separator of the reference file can be obtained by querying the separator type of the reference file in the file basic parameter table.

[0059] In step S503 of some embodiments, after the field separator of the reference file is clarified, the field separation position in the reference file can be identified according to the field separator, thereby implementing structural analysis of the reference file and obtaining reference field structure information.

[0060] In steps S501 to S503 shown in the present embodiment, when the reference file type is a fixed-length file type, a field structure query is performed on the file structure definition table according to the reference file to obtain reference field structure information; when the reference file type is a variable-length file type, a delimiter type query is performed on the file basic parameters according to the reference file to obtain the field delimiter; then, based on the field delimiter, the reference file is structurally parsed to obtain reference field structure information, which can improve the recognition accuracy of the field structure information, thereby improving the extraction accuracy of the reference file fields.

[0061] In step S403 of some embodiments, a method for performing a field structure query on the update file based on the update file type, the file basic parameter table and the file structure definition table to obtain update field structure information is similar to a method for performing a field structure query on the reference file based on the reference file type, the file basic parameter table and the file structure definition table to obtain reference field structure information, and therefore is not described in detail.

[0062] In step S404 of some embodiments, the specific location of each field in the reference file can be queried based on the reference field structure information, and then the field information of the reference file, namely the reference file field, can be extracted based on the queried location information.

[0063] For details, see Figure 6 In some embodiments, step S404 may include but is not limited to steps S601 to S602: Step S601, based on the reference field structure information, perform field query on the reference file to obtain reference field location information; Step S602: Based on the reference field position information, field extraction is performed on the reference file to obtain the reference file field.

[0064] In step S601 of some embodiments, the reference field structure information includes the position information of each field in the reference file. Therefore, the reference field position information of the reference file can be queried based on the reference field structure information.

[0065] In step S602 of some embodiments, field information of the reference file, ie, the reference file field, can be obtained by performing field extraction on the area indicated by the reference field position information.

[0066] In steps S601 to S602 shown in this embodiment, a field query is performed on the reference file based on the reference field structure information to obtain the reference field position information, and then a field extraction is performed on the reference file based on the reference field position information to obtain the reference file field. The field information of the reference file can be accurately extracted, thereby improving the accuracy of file comparison.

[0067] In step S405 of some embodiments, the method of extracting information from the update file based on the update field structure information to obtain the update file field is similar to the method of extracting information from the reference file based on the reference field structure information to obtain the reference file field, so it is not repeated here.

[0068] In steps S401 to S405 shown in the present embodiment, a file type query is performed on the reference file according to the file basic parameter table to obtain the reference file type, and a file type query is performed on the update file according to the file basic parameter table to obtain the update file type. Next, a field structure query is performed on the reference file according to the reference file type, the file basic parameter table and the file structure definition table to obtain reference field structure information. A field structure query is performed on the update file according to the update file type, the file basic parameter table and the file structure definition table to obtain update field structure information. Finally, information is extracted from the reference file according to the reference field structure information to obtain the reference file field. Information is extracted from the update file according to the update field structure information to obtain the update file field. This can reduce the degree of manual involvement in the process of extracting file fields, reduce the probability of file field extraction errors, and thus improve the accuracy of file comparison.

[0069] In step S106 of some embodiments, after extracting the reference file fields of the reference file and the update file fields of the update file, targeted field comparison can be performed on the reference file fields and the update file fields by querying the relevant field whitelist information in the file structure definition table, thereby achieving file comparison between the reference file and the update file.

[0070] For details, see Figure 7 In some embodiments, step S106 may include but is not limited to steps S701 to S702: Step S701, based on the update file and the reference file, perform a field whitelist query on the file structure definition table to obtain non-comparison field information; Step S701 : Based on the non-comparison field information, the reference file field and the update file field are compared to obtain file comparison information, wherein the file comparison information is used to indicate the difference between the reference file and the update file.

[0071] In step S701 of some embodiments, the file structure definition table contains field whitelist information for each comparison file group, wherein the field whitelist information is used to describe field information in the comparison file group that does not need to be compared. Therefore, the present application can clearly refer to the field information that does not need to be compared in the file and update file, that is, the non-comparison field information, by querying the relevant field whitelist information in the file structure definition table.

[0072] In step S702 of some embodiments, the reference file field and the update file field are masked based on the non-comparison field information, so that only the comparison fields that need to be compared remain in the reference file field and the update file field, and file comparison information representing the differences between the reference file and the update file is generated based on the comparison results of the comparison fields.

[0073] In steps S701 to S702 shown in this embodiment, a field whitelist query is performed on the file structure definition table based on the update file and the reference file to obtain non-comparison field information, and then based on the non-comparison field information, a field comparison is performed between the reference file field and the update file field to obtain file comparison information, which can reduce the time for file comparison and thus improve the efficiency of file comparison.

[0074] The present application obtains configuration attribute information of the target file, and then uses the configuration attribute information to group the target file to obtain a comparison file group, thereby avoiding completely unrelated files from appearing in the same comparison file group, thereby improving the pertinence and accuracy of file comparison. Furthermore, according to the comparison file group and the configuration attribute information, a file basic parameter table and a file structure definition table are constructed, which can provide detailed reference information for subsequent file comparisons. Secondly, according to the preset file identification parameters and the file basic parameter table, the target file group is screened out from the comparison file group, and according to the file basic parameter table and the file structure definition table, the reference file is parsed to obtain the reference file field, and according to the file basic parameter table and the file structure definition table, the updated file is parsed to obtain the updated file field, thereby reducing the degree of manual participation in file field acquisition, thereby improving the efficiency and accuracy of file comparison. Finally, according to the reference file field, the updated file field and the file structure definition table, the updated file is compared with the reference file, thereby further reducing the degree of manual participation in the file comparison process and improving the efficiency and accuracy of file comparison.

[0075] See also Figure 8 The present application also provides a file comparison device, which can implement the above-mentioned file comparison method, and the device includes: The file information acquisition module 801 is used to acquire the configuration attribute information of the target file; The target file grouping module 802 is used to group the target files based on the configuration attribute information to obtain a comparison file group; The parameter table construction module 803 is used to construct a file basic parameter table and a file structure definition table based on the comparison file group and the configuration attribute information, wherein the file basic parameter table is used to describe the file attributes of the comparison file group, and the file structure definition table is used to describe the file configuration of the comparison file group; The target file positioning module 804 is used to select a target file group from the comparison file group based on a preset file identification parameter and a file basic parameter table, wherein the target file group includes a reference file and an update file; The file field parsing module 805 is used to parse the reference file to obtain the reference file field based on the file basic parameter table and the file structure definition table, and parse the update file to obtain the update file field based on the file basic parameter table and the file structure definition table; The file field comparison module 806 is used to compare the update file with the reference file based on the reference file field, the update file field and the file structure definition table.

[0076] The specific implementation of the document comparison device is basically the same as the specific implementation of the above-mentioned document comparison method, and will not be repeated here.

[0077] The embodiment of the present application also provides an electronic device, the electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the above file comparison method when executing the computer program. The electronic device can be any intelligent terminal including a tablet computer, a car computer, etc.

[0078] See also Fig. 9 , Fig. 9 The hardware structure of an electronic device of another embodiment is illustrated, and the electronic device includes: The processor 901 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), or one or more integrated circuits, and is used to execute relevant programs to implement the technical solutions provided in the embodiments of the present application; The memory 902 can be implemented in the form of a read-only memory (ROM), a static storage device, a dynamic storage device, or a random access memory (RAM). The memory 902 can store an operating system and other application programs. When the technical solution provided in the embodiment of this specification is implemented by software or firmware, the relevant program code is stored in the memory 902, and the processor 901 calls and executes the file comparison method of the embodiment of this application; Input / output interface 903, used to implement information input and output; Communication interface 904, used to realize communication interaction between the device and other devices, which can be realized through wired mode (such as USB, network cable, etc.) or wireless mode (such as mobile network, WIFI, Bluetooth, etc.); A bus 905 that transmits information between various components of the device (e.g., the processor 901, the memory 902, the input / output interface 903, and the communication interface 904); The processor 901 , the memory 902 , the input / output interface 903 and the communication interface 904 are connected to each other in communication within the device via a bus 905 .

[0079] An embodiment of the present application also provides a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, the above-mentioned file comparison method is implemented.

[0080] The memory, as a non-transient computer-readable storage medium, can be used to store non-transient software programs and non-transient computer executable programs. In addition, the memory may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some embodiments, the memory may optionally include a memory remotely disposed relative to the processor, and these remote memories may be connected to the processor via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0081] The file comparison method, file comparison device, electronic device and storage medium provided by the embodiments of the present application group the target files by acquiring the configuration attribute information of the target files to obtain a comparison file group, and then construct a file basic parameter table for describing the file attributes of the comparison file group and a file structure definition table for describing the file configuration of the comparison file group according to the comparison file group and the configuration attribute information. Furthermore, according to the preset file identification parameters and the file basic parameter table, the reference file and the update file that need to be compared are screened out from the comparison file group. Secondly, according to the file basic parameter table and the file structure definition table, the reference file is parsed to obtain the reference file field, and according to the file basic parameter table and the file structure definition table, the update file is parsed to obtain the update file field. Finally, according to the reference file field, the update file field and the file structure definition table, the update file is compared with the reference file.

[0082] The embodiments described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. Those skilled in the art will appreciate that with the evolution of technology and the emergence of new application scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.

[0083] Those skilled in the art will appreciate that the technical solutions shown in the figures do not constitute a limitation on the embodiments of the present application, and may include more or fewer steps than shown in the figures, or a combination of certain steps, or different steps.

[0084] The device embodiments described above are merely illustrative, and the units described as separate components may or may not be physically separated, that is, they may be located in one place or distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0085] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.

[0086] The terms "first", "second", "third", "fourth", etc. (if any) in the specification of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0087] It should be understood that in the present application, "at least one (item)" means one or more, and "plurality" means two or more. "And / or" is used to describe the association relationship of associated objects, indicating that three relationships may exist. For example, "A and / or B" can mean: only A exists, only B exists, and A and B exist at the same time, where A and B can be singular or plural. The character " / " generally indicates that the objects associated before and after are in an "or" relationship. "At least one of the following" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b or c can mean: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", where a, b, c can be single or multiple.

[0088] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the above units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. The mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0089] The units described above as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0090] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0091] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes multiple instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods of various embodiments of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), disk or optical disk, and other media that can store programs.

[0092] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the rights of the present invention is not limited thereto. Any modification, equivalent substitution and improvement made by a person skilled in the art without departing from the scope and essence of the present invention should be within the scope of the rights of the present invention.

Claims

1. A file comparison method, characterized in that: The method comprises: Get the configuration property information of the target file; Grouping the target files to obtain a comparison file group; Based on the comparison file group and the configuration attribute information, construct a file basic parameter table and a file structure definition table, wherein the file basic parameter table is used to describe the file attributes of the comparison file group, and the file structure definition table is used to describe the file configuration of the comparison file group; Based on the preset file identification parameters and the file basic parameter table, a target file group is selected from the comparison file group, wherein the target file group includes a reference file and an update file; Based on the file basic parameter table and the file structure definition table, the reference file is parsed to obtain reference file fields; based on the file basic parameter table and the file structure definition table, the update file is parsed to obtain update file fields; Based on the reference file field, the update file field and the file structure definition table, the update file is compared with the reference file.

2. The method according to claim 1, characterized in that The step of performing file parsing on the reference file based on the file basic parameter table and the file structure definition table to obtain reference file fields, and performing file parsing on the update file based on the file basic parameter table and the file structure definition table to obtain update file fields comprises: Based on the file basic parameter table, query the reference file for the file type to obtain the reference file type; based on the file basic parameter table, query the update file for the file type to obtain the update file type; Based on the reference file type, the file basic parameter table and the file structure definition table, a field structure query is performed on the reference file to obtain reference field structure information; Based on the update file type, the file basic parameter table and the file structure definition table, a field structure query is performed on the update file to obtain update field structure information; Extracting information from the reference file based on the reference field structure information to obtain the reference file field; Based on the update field structure information, information is extracted from the update file to obtain the update file field.

3. The method according to claim 2, characterized in that: The file type includes a fixed-length file type and a variable-length file type. Based on the reference file type, the file basic parameter table and the file structure definition table, a field structure query is performed on the reference file to obtain reference field structure information, including: If the reference file type is the fixed-length file type, then based on the reference file, a field structure query is performed on the file structure definition table to obtain the reference field structure information; If the reference file type is the variable-length file type, then based on the reference file, a delimiter type query is performed on the file basic parameters to obtain a field delimiter; Based on the field separator, the reference file is structurally parsed to obtain the reference field structure information.

4. The method according to claim 2, characterized in that: The extracting information from the reference file based on the reference field structure information to obtain the reference file field includes: Based on the reference field structure information, a field query is performed on the reference file to obtain reference field position information; Based on the reference field position information, field extraction is performed on the reference file to obtain the reference file field.

5. The method according to claim 1, characterized in that The configuration attribute information includes file configuration information and file attribute information. The constructing of a file basic parameter table and a file structure definition table based on the comparison file group and the configuration attribute information includes: Performing group identification on the comparison file group to obtain a file group identification; Based on the file group identifier, construct a group identifier field; Based on the file attribute information, construct a file attribute field; Based on the file configuration information, construct a file configuration field; Perform field concatenation on the group identification field and the file attribute field to obtain the file basic parameter table; The group identification field and the file configuration field are concatenated to obtain the file structure definition table.

6. The method according to claim 5, characterized in that The step of selecting a target file group from the comparison file group based on the preset file identification parameters and the file basic parameter table includes: Based on the file identification parameter, selecting a target group identification from the file group identifications of the comparison file group; Based on the target group identifier, a path query is performed on the file basic parameter table to obtain a file path; Based on the file path, read the file to obtain the reference file and the update file; The reference file and the update file are combined to obtain the target file group.

7. The method according to any one of claims 1 to 5, characterized in that: The comparing the update file with the reference file based on the reference file field, the update file field and the file structure definition table includes: Based on the update file and the reference file, a field whitelist query is performed on the file structure definition table to obtain non-comparison field information; Based on the non-comparison field information, the reference file field and the update file field are compared to obtain file comparison information, wherein the file comparison information is used to indicate the difference between the reference file and the update file.

8. A document comparison device, characterized in that: The device comprises: A file information acquisition module, used to obtain configuration attribute information of a target file; A target file grouping module, used for grouping the target files based on the configuration attribute information to obtain a comparison file group; A parameter table construction module, used to construct a file basic parameter table and a file structure definition table based on the comparison file group and the configuration attribute information, wherein the file basic parameter table is used to describe the file attributes of the comparison file group, and the file structure definition table is used to describe the file configuration of the comparison file group; a target file locating module, configured to filter out a target file group from the comparison file group based on preset file identification parameters and the file basic parameter table, wherein the target file group includes a reference file and an update file; A file field parsing module, configured to parse the reference file to obtain reference file fields based on the file basic parameter table and the file structure definition table, and parse the update file to obtain update file fields based on the file basic parameter table and the file structure definition table; The file field comparison module is used to compare the update file with the reference file based on the reference file field, the update file field and the file structure definition table.

9. An electronic device, characterized in that: The electronic device includes a memory and a processor, the memory stores a computer program, and the processor implements the file comparison method according to any one of claims 1 to 7 when executing the computer program.

10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the file comparison method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • File comparison device and file comparison method

    CN103500169A

  • Index-based file comparison method and device

    CN103970792A

  • File information comparison method, apparatus, computer device, and storage medium

    CN109492197A

  • File comparison method and device, electronic equipment and storage medium

    CN114416662A

  • File processing method and device, electronic equipment and storage medium

    CN115269832A