File comparison method and device, electronic device and storage medium

By obtaining the configuration attribute information of the target file for grouping and parsing, building a parameter table, screening and comparing files, the problem of low accuracy of manual file comparison is solved and efficient and accurate file comparison is achieved.

CN119476253BActive Publication Date: 2025-09-30PING AN BANK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

Existing file comparison methods mainly rely on manual methods, which are prone to errors and result in low file comparison accuracy.

Method used

By obtaining the configuration attribute information of the target file, grouping the files, building the file basic parameter table and structure definition table, screening out the reference files and updated files, and using the file basic parameter table and structure definition table to perform file parsing and comparison, manual participation is reduced and accuracy is improved.

Benefits of technology

It improves the accuracy and efficiency of file comparison, reduces the degree of manual participation, and ensures the pertinence and accuracy of file comparison.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119476253B_ABST
    Figure CN119476253B_ABST
Patent Text Reader

Abstract

The embodiments of the present application provide a file comparison method and device, an electronic device, and a storage medium, which belong to the field of text processing technology and are applicable to the field of financial technology. The method includes: obtaining 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; filtering 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; performing file parsing on the reference file based on the file basic parameter table and the file structure definition table to obtain a reference file field; performing file parsing on the update file based on the file basic parameter table and the file structure definition table to obtain an update file field; performing file comparison between the update file and the reference file based on the reference file field, the update file field, and the file structure definition table. The embodiments of the present application can improve the accuracy of file comparison.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the fields 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] Currently, the common file comparison method is usually to compare the file contents of multiple files manually. However, this method is prone to errors, resulting in file comparison errors and reduced file comparison accuracy. 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 facial 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 objectives, a first aspect of an embodiment of the present application provides a file comparison method, the method comprising:

[0006] Get the configuration property information of the target file;

[0007] Grouping the target files to obtain a comparison file group;

[0008] Based on the comparison file group and the configuration attribute information, constructing 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;

[0009] Based on 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 updated file;

[0010] Based on the file basic parameter table and the file structure definition table, performing file parsing on the reference file to obtain reference file fields; based on the file basic parameter table and the file structure definition table, performing file parsing on the update file to obtain update file fields;

[0011] 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.

[0012] In some embodiments, 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, includes:

[0013] Based on the file basic parameter table, querying the reference file for a file type to obtain a reference file type; based on the file basic parameter table, querying the update file for a file type to obtain an update file type;

[0014] Based on the reference file type, the file basic parameter table and the file structure definition table, performing a field structure query on the reference file to obtain reference field structure information;

[0015] Based on the update file type, the file basic parameter table and the file structure definition table, performing a field structure query on the update file to obtain update field structure information;

[0016] Extracting information from the reference file based on the reference field structure information to obtain the reference file field;

[0017] Based on the update field structure information, information is extracted from the update file to obtain the update file field.

[0018] In some embodiments, the file type includes a fixed-length file type and a variable-length file type, and 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 includes:

[0019] If the reference file type is the fixed-length file type, performing a field structure query on the file structure definition table based on the reference file to obtain the reference field structure information;

[0020] If the reference file type is the variable-length file type, performing a delimiter type query on the file basic parameters based on the reference file to obtain a field delimiter;

[0021] Based on the field delimiter, the reference file is structurally parsed to obtain the reference field structure information.

[0022] In some embodiments, extracting information from the reference file based on the reference field structure information to obtain the reference file field includes:

[0023] Based on the reference field structure information, performing a field query on the reference file to obtain reference field position information;

[0024] Based on the reference field position information, field extraction is performed on the reference file to obtain the reference file field.

[0025] In some embodiments, the configuration attribute information includes file configuration information and file attribute information, and constructing a file basic parameter table and a file structure definition table based on the comparison file group and the configuration attribute information includes:

[0026] Performing group identification on the comparison file group to obtain a file group identification;

[0027] Based on the file group identifier, construct a group identifier field;

[0028] Constructing a file attribute field based on the file attribute information;

[0029] Constructing a file configuration field based on the file configuration information;

[0030] Performing field concatenation on the group identification field and the file attribute field to obtain the file basic parameter table;

[0031] The group identification field and the file configuration field are concatenated to obtain the file structure definition table.

[0032] In some embodiments, the step of selecting a target file group from the comparison file group based on preset file identification parameters and the file basic parameter table includes:

[0033] Based on the file identification parameter, selecting a target group identifier from the file group identifiers of the comparison file group;

[0034] Based on the target group identifier, a path query is performed on the file basic parameter table to obtain a file path;

[0035] Based on the file path, read the file to obtain the reference file and the update file;

[0036] The reference file and the update file are combined to obtain the target file group.

[0037] In some embodiments, comparing the updated file with the reference file based on the reference file field, the updated file field, and the file structure definition table includes:

[0038] Based on the update file and the reference file, performing a field whitelist query on the file structure definition table to obtain non-comparison field information;

[0039] 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.

[0040] To achieve the above-mentioned purpose, a second aspect of an embodiment of the present application provides a file comparison device, comprising:

[0041] A file information acquisition module is used to obtain the configuration attribute information of the target file;

[0042] A target file grouping module, configured to group the target files based on the configuration attribute information to obtain a comparison file group;

[0043] a parameter table construction module, configured 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;

[0044] 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;

[0045] A file field parsing module, configured to parse the reference file based on the file basic parameter table and the file structure definition table to obtain reference file fields, and parse the update file based on the file basic parameter table and the file structure definition table to obtain update file fields;

[0046] 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.

[0047] 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 the processor implements the method described in the first aspect when executing the computer program.

[0048] To achieve the above-mentioned purpose, the fourth aspect of the embodiments of the present application proposes a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, it implements the method described in the first aspect.

[0049] The file comparison method and device, electronic device, and storage medium proposed in the present application obtain configuration attribute information of a target file and then use the configuration attribute information to group the target file to obtain a comparison file group, thereby preventing completely unrelated files from appearing in the same comparison file group, thereby improving the pertinence and accuracy of the file comparison. Furthermore, a file basic parameter table and a file structure definition table are constructed based on the comparison file group and the configuration attribute information, which can provide detailed reference information for subsequent file comparisons. Secondly, based on preset file identification parameters and the file basic parameter table, the target file group is screened from the comparison file group, and based on the file basic parameter table and the file structure definition table, the reference file is parsed to obtain the reference file field. Based on 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 intervention in obtaining the file field, thereby improving the efficiency and accuracy of the file comparison. Finally, based on 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 intervention in the file comparison process and improving the efficiency and accuracy of the file comparison. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0051] Figure 2 yes Figure 1 Flowchart of step S103 in FIG.

[0052] Figure 3 yes Figure 2 Flowchart of step S204 in FIG.

[0053] Figure 4 yes Figure 1 Flowchart of step S105 in FIG.

[0054] Figure 5 yes Figure 1 Flowchart of step S402 in FIG.

[0055] Figure 6 yes Figure 5 Flowchart of step S404 in FIG.

[0056] Figure 7 yes Figure 1 Flowchart of step S106 in FIG.

[0057] Figure 8 Schematic diagram of the structure of the file comparison device provided in an embodiment of the present application;

[0058] Figure 9This is a schematic diagram of the hardware structure of the electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0059] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.

[0060] It should be noted that although the device schematics illustrate functional module divisions and the flowcharts illustrate logical sequences, in certain circumstances, the steps shown or described may be performed in a sequence that differs from the module divisions in the device or the sequence in the flowcharts. The terms "first," "second," and so on, in the specification, claims, and drawings, are used to distinguish similar items and are not necessarily used to describe a specific sequence or precedence.

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

[0062] First, let’s analyze some of the terms used in this application:

[0063] Data Table: A data table is a structured collection of data consisting of rows and columns, typically 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, often called a record, represents an instance of that subject, while each column, called a field, defines specific attributes or characteristics of the record, ensuring consistency and descriptiveness of the data.

[0064] Fields: Fields are the basic building blocks of a data table, representing specific data attributes or characteristics, such as name, age, and address. Each field has a specific data type and constraints, ensuring that data entry and processing adhere to pre-defined formats and standards. Fields define the specific content of a record through their name and type, making data storage, retrieval, and analysis clearer and more efficient.

[0065] 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.

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

[0067] Based on this, 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.

[0068] 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.

[0069] The embodiments of the present application can acquire and process relevant data based on artificial intelligence technology. Artificial intelligence (AI) refers to the theories, methods, techniques, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results.

[0070] Fundamental AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interaction systems, and mechatronics. AI software technologies primarily encompass computer vision, robotics, biometrics, speech processing, natural language processing, and machine learning / deep learning.

[0071] 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 as a server cluster or distributed system composed of multiple physical servers, or as 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.

[0072] 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, and the like. 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, and the like 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 via a communication network. In a distributed computing environment, program modules can be located in local and remote computer storage media, including storage devices.

[0073] Figure 1 This is an optional flowchart 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.

[0074] Step S101, obtaining configuration attribute information of the target file;

[0075] Step S102: grouping the target files based on the configuration attribute information to obtain a comparison file group;

[0076] Step S103: constructing a file basic parameter table and a file structure definition table based on the comparison file group and 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;

[0077] Step S104: Filtering a target file group from the comparison file group based on the preset file identification parameters and the file basic parameter table, wherein the target file group includes the reference file and the updated file;

[0078] Step S105: 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;

[0079] 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.

[0080] 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, the 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 files 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, based on 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. According to the file basic parameter table and the file structure definition table, the updated file is parsed to obtain the updated file field, 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.

[0081] 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 the primary key, and whether the field is on the 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.

[0082] The present application can obtain the configuration attribute information of the target file by querying the configuration file of the target file, and can also obtain the file configuration information and file attribute information of the target file respectively by querying the structure and attributes of the target file. Finally, the file configuration information and file attribute information of the target file are combined to obtain the configuration attribute information.

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

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

[0085] 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.

[0086] For details, see Figure 2 In some embodiments, step S103 may include but is not limited to steps S201 to S206:

[0087] Step S201, performing group identification on the comparison file group to obtain a file group identification;

[0088] Step S202: constructing a group identification field based on the file group identification;

[0089] Step S203: constructing a file attribute field based on the file attribute information;

[0090] Step S204, constructing a file configuration field based on the file configuration information;

[0091] Step S205: concatenate the group identification field and the file attribute field to obtain a file basic parameter table;

[0092] Step S206: perform field concatenation on the group identification field and the file configuration field to obtain a file structure definition table.

[0093] 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 identification of the comparison file group, that is, a file group identification. For example, in a financial scenario, 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 identification of the medical insurance file group No. 1 can be generated.

[0094] 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 contains the file attribute information of each file in the comparison file group, and the file configuration field contains the file configuration information of each file in the comparison file group.

[0095] In steps S205 and S206 of some embodiments, the group identification field of the comparison file group is field-joined 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 field-joined 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.

[0096] In steps S201 to S206 shown in this 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 field-joined to obtain a file basic parameter table, and the group identification field and the file configuration field are field-joined 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.

[0097] In step S104 of some embodiments, the file identification parameter may be a file group identifier of a comparison file group that requires file comparison processing.

[0098] 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.

[0099] For details, see Figure 3 In some embodiments, step S104 may include but is not limited to steps S301 to S304:

[0100] Step S301, selecting a target group identifier from the file group identifiers of the comparison file group based on the file identifier parameter;

[0101] Step S302: Based on the target group identifier, a path query is performed on the file basic parameter table to obtain the file path;

[0102] Step S303: Read the file based on the file path to obtain the reference file and the update file;

[0103] Step S304: combine the reference file and the updated file to obtain a target file group.

[0104] 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.

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

[0106] In step S303 of some embodiments, the file is read according to the above file path to obtain the reference file and the 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.

[0107] 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.

[0108] In steps S301 to S304 shown in this embodiment, a target group identifier is selected from the file group identifiers of the comparison file group based on the file identifier parameter, and then a path query is performed on the file basic parameter table based on the target group identifier to obtain the file path. Secondly, based on 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. This can accurately obtain the comparison file group that needs to be compared, thereby improving the accuracy of the file comparison.

[0109] 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, based on 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, based on 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.

[0110] For details, see Figure 4 In some embodiments, step S105 may include but is not limited to steps S401 to S405:

[0111] Step S401: Based on the file basic parameter table, query the file type of the reference file to obtain the reference file type; based on the file basic parameter table, query the file type of the update file to obtain the update file type;

[0112] Step S402: 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;

[0113] 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;

[0114] Step S404: extract information from the reference file based on the reference field structure information to obtain the reference file field;

[0115] Step S405: extract information from the update file based on the update field structure information to obtain the update file fields.

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

[0117] It is important to note that the file types in the file basic parameter table include variable-length file types and fixed-length file types. Variable-length file types indicate that the file's field length and file format may change, while fixed-length file types indicate that the file's field length and file format will not change.

[0118] In step S402 of some embodiments, the field structure in the reference file can be clarified based on the reference file type of the reference file. When the reference file type is a fixed-length file type, the field structure query of the reference file in the file structure definition table can be directly performed 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.

[0119] For details, see Figure 5 In some embodiments, step S402 may include but is not limited to steps S501 to S503:

[0120] Step S501: If the reference file type is a fixed-length file type, a field structure query is performed on the file structure definition table based on the reference file to obtain reference field structure information;

[0121] 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;

[0122] Step S503: performing structural analysis on the reference file based on the field delimiter to obtain reference field structure information.

[0123] 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.

[0124] 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 delimiters. Therefore, before parsing the reference file, it is also necessary to clarify the delimiter type of the reference file. Specifically, the field delimiter of the reference file can be obtained by querying the delimiter type of the reference file in the file basic parameter table.

[0125] In step S503 of some embodiments, after the field delimiter of the reference file is determined, the field delimiter position in the reference file can be identified based on the field delimiter, thereby implementing structural analysis of the reference file and obtaining reference field structure information.

[0126] In steps S501 to S503 shown in this embodiment, when the reference file type is a fixed-length file type, a field structure query is performed on the file structure definition table based on 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 based on 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. This can improve the recognition accuracy of the field structure information, thereby improving the extraction accuracy of the reference file fields.

[0127] 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 the 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 the reference field structure information, and therefore is not repeated here.

[0128] 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.

[0129] For details, see Figure 6 In some embodiments, step S404 may include but is not limited to steps S601 to S602:

[0130] Step S601: Based on the reference field structure information, perform a field query on the reference file to obtain the reference field location information;

[0131] Step S602: Based on the reference field position information, field extraction is performed on the reference file to obtain the reference file field.

[0132] 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.

[0133] 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.

[0134] 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.

[0135] 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.

[0136] In steps S401 to S405 shown in this 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. Secondly, 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. According to 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. Finally, according to the reference field structure information, information extraction is performed on the reference file to obtain the reference file field. According to the update field structure information, information extraction is performed on the update file to obtain the update file field. This can reduce the manual participation in the process of extracting file fields, reduce the probability of file field extraction errors, and thus improve the accuracy of file comparison.

[0137] 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 realizing file comparison between the reference file and the update file.

[0138] For details, see Figure 7 In some embodiments, step S106 may include but is not limited to steps S701 to S702:

[0139] Step S701: Based on the updated file and the reference file, perform a field whitelist query on the file structure definition table to obtain non-comparison field information;

[0140] 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.

[0141] 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, non-comparison field information, by querying the relevant field whitelist information in the file structure definition table.

[0142] In step S702 of some embodiments, the reference file fields and the update file fields 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 fields and the update file fields, 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.

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

[0144] The present application obtains the configuration attribute information of the target file, and then uses the configuration attribute information to group the target files 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, based on 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. According to the file basic parameter table and the file structure definition table, the updated file is parsed to obtain the updated file field, 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.

[0145] See also Figure 8 The present application also provides a file comparison device that can implement the above-mentioned file comparison method. The device includes:

[0146] The file information acquisition module 801 is used to obtain the configuration attribute information of the target file;

[0147] 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;

[0148] A 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 configuration attribute information. 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.

[0149] A target file location module 804 is configured to filter out 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 updated file;

[0150] The file field parsing module 805 is used to parse the reference file based on the file basic parameter table and the file structure definition table to obtain the reference file fields, and parse the update file based on the file basic parameter table and the file structure definition table to obtain the update file fields;

[0151] The file field comparison module 806 is used to compare the updated file with the reference file based on the reference file field, the updated file field and the file structure definition table.

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

[0153] The present application also provides an electronic device comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the above-mentioned file comparison method when executing the computer program. The electronic device can be any smart terminal including a tablet computer, an in-vehicle computer, or the like.

[0154] See also Figure 9 , Figure 9 The hardware structure of an electronic device according to another embodiment is shown. The electronic device includes:

[0155] The processor 901 can be implemented as a general-purpose CPU (Central Processing Unit), a microprocessor, an 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;

[0156] 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 solutions provided in the embodiments of this specification are implemented through software or firmware, the relevant program code is stored in the memory 902 and is called by the processor 901 to execute the file comparison method of the embodiments of this application.

[0157] Input / output interface 903, used to implement information input and output;

[0158] Communication interface 904, used to implement communication interaction between this device and other devices, which can be achieved through wired means (such as USB, network cable, etc.) or wireless means (such as mobile network, WiFi, Bluetooth, etc.);

[0159] Bus 905 , which transmits information between various components of the device (e.g., processor 901 , memory 902 , input / output interface 903 , and communication interface 904 );

[0160] 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 .

[0161] An embodiment of the present application further 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.

[0162] 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 arranged 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.

[0163] The file comparison method, file comparison device, electronic device and storage medium provided in the embodiments of the present application group the target files by obtaining 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 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, the reference file and the update file 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.

[0164] The embodiments described in the embodiments of this application are intended to more clearly illustrate the technical solutions of the embodiments of this application and do not constitute a limitation on the technical solutions provided by the embodiments of this 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 this application are also applicable to similar technical problems.

[0165] Those skilled in the art will understand 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.

[0166] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, i.e., they may be located in one place or distributed across multiple network units. Some or all of the modules may be selected based on actual needs to achieve the objectives of this embodiment.

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

[0168] 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 sequential order. 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 variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes 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.

[0169] It should be understood that in this 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 previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single items 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.

[0170] In the several embodiments provided in this 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 merely schematic. For example, the division of the above-mentioned units is only a logical function division. In actual implementation, there may be other division methods, 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.

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

[0172] In addition, the functional units in the various embodiments of the present application may be integrated into a single processing unit, or each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.

[0173] 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 enabling a computer device (which can be a personal computer, server, or 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: various media that can store programs, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0174] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but are not intended to limit the scope of the present invention. Any modifications, equivalent substitutions, and improvements made by those skilled in the art without departing from the scope and essence of the present invention should be within the scope of the present invention.

Claims

1. A file comparison method, characterized in that: The method comprises: Acquire configuration attribute information of a target file, wherein the configuration attribute information includes file configuration information and file attribute information; Grouping the target files based on the configuration attribute information to obtain a comparison file group; 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; Constructing a file attribute field based on the file attribute information; Constructing a file configuration field based on the file configuration information; Performing field concatenation on the group identification field and the file attribute field to obtain a file basic parameter table, wherein the file basic parameter table is used to describe the file attributes of the comparison file group; Performing field concatenation on the group identification field and the file configuration field to obtain a file structure definition table, wherein the file structure definition table is used to describe the file configuration of the comparison file group; Based on 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 updated file; Based on the file basic parameter table and the file structure definition table, performing file parsing on the reference file to obtain reference file fields; based on the file basic parameter table and the file structure definition table, performing file parsing on the update file 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, includes: Based on the file basic parameter table, performing a file type query on the reference file to obtain a reference file type; based on the file basic parameter table, performing a file type query on the update file to obtain an update file type; Based on the reference file type, the file basic parameter table and the file structure definition table, performing a field structure query 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, performing a field structure query 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; and the field structure query of the reference file is performed based on the reference file type, the file basic parameter table, and the file structure definition table to obtain reference field structure information, including: If the reference file type is the fixed-length file type, performing a field structure query on the file structure definition table based on the reference file to obtain the reference field structure information; If the reference file type is the variable-length file type, performing a delimiter type query on the file basic parameters based on the reference file to obtain a field delimiter; Based on the field delimiter, 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, performing a field query 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, wherein The step of screening out 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 identifier from the file group identifiers 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.

6. The method according to any one of claims 1 to 4, characterized in that The comparing the updated file with the reference file based on the reference file field, the updated file field, and the file structure definition table includes: Based on the update file and the reference file, performing a field whitelist query 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.

7. A document comparison device, characterized in that: The device comprises: A file information acquisition module, configured to acquire configuration attribute information of a target file, wherein the configuration attribute information includes file configuration information and file attribute information; A target file grouping module, configured to group the target files based on the configuration attribute information to obtain a comparison file group; a parameter table construction module, configured to perform group identification on the comparison file group to obtain a file group identification, construct a group identification field based on the file group identification, construct a file attribute field based on the file attribute information, construct a file configuration field based on the file configuration information, perform field concatenation on the group identification field and the file attribute field to obtain a file basic parameter table, wherein the file basic parameter table is used to describe the file attributes of the comparison file group, and perform field concatenation on the group identification field and the file configuration field to obtain a file structure definition table, wherein 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 based on the file basic parameter table and the file structure definition table to obtain reference file fields, and parse the update file based on the file basic parameter table and the file structure definition table to obtain update file fields; 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.

8. 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 6 when executing the computer program.

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