File processing method and device, and electronic device

By acquiring and updating the initial query statements in the post-loan management system and generating target files, the problem of large workload and error-proneness in file processing during the reconstruction of the post-loan management system was solved, and efficient and accurate file processing was achieved.

CN116841962BActive Publication Date: 2026-06-09CHINA CONSTRUCTION BANK +1

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
CHINA CONSTRUCTION BANK
Filing Date
2023-06-26
Publication Date
2026-06-09

Smart Images

  • Figure CN116841962B_ABST
    Figure CN116841962B_ABST
Patent Text Reader

Abstract

The present disclosure provides a file processing method, device and electronic equipment. The file processing method comprises: obtaining an initial query statement from an initial file, wherein the initial query statement has corresponding position information, the position information representing the position of the initial query statement in the initial file, the initial query statement comprising: initial information; determining target information corresponding to the initial information; updating the initial information in the initial query statement to the target information to obtain a target query statement; and generating a target file according to the position information and the target query statement. Through the present disclosure, the workload of file processing can be effectively reduced, and the accuracy and processing effect of file processing can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of computer technology, and in particular to a document processing method, apparatus, and electronic device. Background Technology

[0002] Post-loan management system restructuring typically adopts a new generation of data standards. All tables involved in the documents within the post-loan management system need to be re-evaluated for new-generation data items to replace the old fields. Furthermore, the documents involve a large number of database queries, as well as some stored procedures.

[0003] In related technologies, developers typically replace fields by referring to the mapping relationship between the old and new fields, and then configure the new file after the replacement.

[0004] This approach involves a cumbersome workload for file processing, is prone to errors, and results in poor file processing efficiency. Summary of the Invention

[0005] This disclosure aims to at least partially address one of the technical problems in the related art.

[0006] Therefore, this disclosure provides a document processing method, apparatus, electronic device, non-transitory computer-readable storage medium storing computer instructions, and computer program product, which can effectively reduce the workload of document processing and improve the accuracy and effect of document processing.

[0007] The file processing method proposed in the first aspect of this disclosure includes: obtaining an initial query statement from an initial file, wherein the initial query statement has corresponding position information, the position information indicating the position of the initial query statement in the initial file, and the initial query statement includes: initial information; determining target information corresponding to the initial information; updating the initial information in the initial query statement to the target information to obtain a target query statement; and generating a target file based on the position information and the target query statement.

[0008] The file processing apparatus proposed in the second aspect of this disclosure includes: an acquisition module for acquiring an initial query statement from an initial file, wherein the initial query statement has corresponding position information, the position information indicating the position of the initial query statement in the initial file, and the initial query statement includes: initial information; a determination module for determining target information corresponding to the initial information; an update module for updating the initial information in the initial query statement to the target information to obtain a target query statement; and a generation module for generating a target file based on the position information and the target query statement.

[0009] The electronic device proposed in the third aspect of this disclosure includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the file processing method proposed in the first aspect of this disclosure.

[0010] The fourth aspect of this disclosure provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the file processing method as proposed in the first aspect of this disclosure.

[0011] A fifth aspect of this disclosure provides a computer program product in which, when instructions in the computer program product are executed by a processor, a file processing method as described in a first aspect of this disclosure is performed.

[0012] The document processing method, apparatus, electronic device, non-transitory computer-readable storage medium storing computer instructions, and computer program product provided in this disclosure obtain an initial query statement from an initial file, wherein the initial query statement has corresponding location information indicating the position of the initial query statement in the initial file, the initial query statement includes: initial information, and determines target information corresponding to the initial information, and updates the initial information in the initial query statement to the target information to obtain a target query statement, and generates a target file based on the location information and the target query statement, which can effectively reduce the workload of document processing and improve the accuracy and effect of document processing.

[0013] Additional aspects and advantages of this disclosure will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this disclosure. Attached Figure Description

[0014] The above and / or additional aspects and advantages of this disclosure will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, in which:

[0015] Figure 1 This is a schematic flowchart of a document processing method proposed in an embodiment of this disclosure;

[0016] Figure 2 This is a flowchart illustrating the overall design of an embodiment of this disclosure;

[0017] Figure 3 This is a flowchart of the parser module according to an embodiment of the present disclosure;

[0018] Figure 4 This is a schematic flowchart of a document processing method proposed in another embodiment of this disclosure;

[0019] Figure 5 This is a schematic diagram of the automated conversion process according to an embodiment of the present disclosure;

[0020] Figure 6 This is a flowchart of the converter module according to an embodiment of the present disclosure;

[0021] Figure 7 This is a schematic flowchart of a document processing method proposed in another embodiment of this disclosure;

[0022] Figure 8 This is a flowchart of the verifier module in an embodiment of this disclosure;

[0023] Figure 9 This is a schematic diagram of the structure of a document processing apparatus according to an embodiment of the present disclosure;

[0024] Figure 10 A block diagram of an exemplary electronic device suitable for implementing embodiments of the present disclosure is shown. Detailed Implementation

[0025] Embodiments of this disclosure are described in detail below, examples of which are illustrated in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are used only to explain this disclosure, and should not be construed as limiting this disclosure. Rather, embodiments of this disclosure include all variations, modifications, and equivalents falling within the spirit and scope of the appended claims.

[0026] Figure 1 This is a schematic flowchart of a file processing method proposed in an embodiment of this disclosure.

[0027] This embodiment illustrates the example of a file processing method configured within a file processing device. In this embodiment, the file processing method can be configured within a file processing device, which can be located in a server or an electronic device; there are no limitations on this. This embodiment uses the example of a file processing method configured in an electronic device. The electronic device can be, for example, a smartphone, tablet computer, personal digital assistant, e-reader, or other hardware device with various operating systems.

[0028] It should be noted that the execution entity of the embodiments disclosed herein may be, in hardware, a central processing unit (CPU) in a server or electronic device, and in software, a related background service in a server or electronic device, without limitation.

[0029] like Figure 1 As shown, the file processing method includes:

[0030] S101: Obtain the initial query statement from the initial file. The initial query statement has corresponding position information, which indicates the position of the initial query statement in the initial file. The initial query statement includes: initial information.

[0031] In some embodiments, the initial file may be, for example, the original file to be processed in the post-loan management system. The initial file may be, for example, an Extensible Markup Language file, a computer programming language file, a stored procedure, a query statement script, etc. Of course, the initial file may also be any other possible form of file related to the post-loan management system, without limitation.

[0032] In some embodiments, the initial query statement refers to the statement containing the initial file that queries the database. The initial query statement may be, for example, a Structured Query Language (SQL) server database statement, and there is no limitation on this.

[0033] In some embodiments, the information to be processed contained in the initial query statement can be referred to as initial information, such as the initial table name, initial fields, initial judgment conditions, etc., and there are no restrictions on this.

[0034] In some embodiments, the location information represents the position of the initial query statement in the initial file, such as the paragraph position, start position, end position, etc. in the initial file. The location information can be used to recover a new target file, and there are no restrictions on this.

[0035] In some embodiments, the number of initial files may be one or more, each initial file may contain one or more initial query statements, each initial query statement has a corresponding position information, and each initial query statement may contain one or more initial information, without limitation.

[0036] S102: Determine the target information corresponding to the initial information.

[0037] In some embodiments, the information to be replaced by the initial information can be referred to as the target information. The initial information is, for example, the initial table name, the initial field, the initial judgment condition, etc. Correspondingly, the target information is, for example, the target table name, the target field, the target judgment condition, etc. The initial information and the target information can be of the same type or different types, and there is no restriction on this.

[0038] In some embodiments, the target information corresponding to the initial information can be determined based on the mapping relationship between the pre-configured initial information and the target information. Alternatively, the corresponding information can be obtained by querying based on the content of the initial information as the target information. Or, any other possible method can be used to determine the target information corresponding to the initial information, without any limitation.

[0039] S103: Update the initial information in the initial query statement to the target information to obtain the target query statement.

[0040] After determining the target information corresponding to the initial information, the initial information in the initial query statement can be automatically replaced with the target information to obtain the target query statement. For example, the initial information in the initial query statement can be replaced with the target information in real time, or the initial information in the initial query statement can be replaced with the target information asynchronously, without any restrictions.

[0041] S104: Generate the target file based on the location information and the target query statement.

[0042] After updating the initial information in the initial query statement to the target information and obtaining the target query statement, the target query statement can be synthesized into the position indicated by the position information in the initial file by referring to the position information of the initial query statement to form the target file. There are no restrictions on this.

[0043] Therefore, this embodiment can effectively reduce the workload of file processing and improve the accuracy and effectiveness of file processing.

[0044] In some embodiments, when implementing the step of obtaining the initial query statement from the initial file, it may be to determine the file type corresponding to the initial file, and extract the initial query statement from the initial file according to the file type, so that the process of extracting the initial query statement can be effectively applied to personalized file types, and the initial query statement can be effectively extracted from initial files of different file types.

[0045] In some embodiments, the file type includes one or more of Extensible Markup Language (XML) files, computer programming language (CPL) files, stored procedures, and query scripts, thereby effectively applicable to file processing of one or more of these file types.

[0046] For example, in the restructuring of the post-loan management system, a new generation of data standards can be adopted. This allows the tables and fields (optional examples of initial information) of the SQL statements (an optional example of the initial query statement) in the post-loan management system to be converted into tables and fields of the new generation of data standards (an optional example of target information). The restructuring of the post-loan management system mainly includes application system and batch processing restructuring. The sources of SQL statements mainly include various file types such as Extensible Markup Language (XML) configuration files, JAVA (JAVA is an object-oriented programming language) files, stored procedures, and SQL scripts.

[0047] like Figure 2 As shown, Figure 2 This is a flowchart illustrating the overall design of an embodiment of this disclosure. It parses and extracts source data (an optional example of an initial file) to obtain standard data (an optional example of an initial query statement), which is then transformed and verified to obtain target data (an optional example of a target file). It can parse initial files of various file types (XML files, JAVA files, stored procedures, SQL scripts, various data input streams, etc.), extract the SQL statements contained therein, and based on the extracted SQL statements, form a standard SQL statement set, which serves as the input stream for subsequent transformation modules. The SQL statements are then transformed to obtain the target data, which is output according to the source file type.

[0048] In this embodiment of the disclosure, the various initial files containing SQL statements can be parsed, converted, verified, and assembled to quickly obtain the conversion results, greatly improving the efficiency of the conversion between old and new files, saving a lot of manual operations, and ensuring the accuracy of the replacement.

[0049] In some embodiments, different extraction methods can be used to extract the initial query statement from the initial file for different file types, and there is no limitation on this.

[0050] In some embodiments, if the file type is an Extensible Markup Language (XML) file, multiple candidate objects and the relationships between different candidate objects can be identified from the XML file. Based on the configuration rules and query syntax rules of the XML, the target object can be identified from the multiple candidate objects. Based on the target object and the relationships between target objects related to the target object, an initial query statement can be generated, thereby effectively extracting the initial query statement from the XML file.

[0051] In some embodiments, one or more document objects with attributes and methods contained in an Extensible Markup Language file may be referred to as candidate objects. There may be some relationships between candidate objects. The relationship between a candidate object and other candidate objects may be referred to as a candidate object relationship, and there is no limitation on this.

[0052] In some embodiments, after identifying multiple candidate objects from an Extensible Markup Language (EXPLAIN) file, a tree-like relationship between the candidate objects can be formed, without limitation.

[0053] In some embodiments, the configuration rules of Extensible Markup Language (XML) are used to describe the basic syntax and usage rules of XML, and the query syntax rules are used to describe the syntax and usage rules of query statements, without any restrictions.

[0054] In some embodiments, a target object refers to a candidate object that can be used to form an initial query statement. The relationship between a target object and other candidate objects can be called a target object relationship. Target object relationships can also be used to form an initial query statement, and there is no limitation on this.

[0055] In some embodiments, the basic syntax and usage rules of Extensible Markup Language, as well as the syntax and usage rules of query statements, can be referenced to identify candidate objects that can form an initial query statement from multiple candidate objects, and use the candidate object as the target object. The initial query statement is generated based on the target object and the target object relationship related to the target object, without any restrictions.

[0056] In some embodiments, if the file type is a computer programming language file, the query keywords can be determined according to the query syntax rules, and candidate query statements containing the query keywords can be retrieved from the initial file. If the candidate query statements conform to the query syntax rules, the candidate query statements are used as the initial query statements, thereby effectively extracting the initial query statements from the computer programming language file.

[0057] In some embodiments, query syntax rules are used to describe the syntax and usage rules of query statements, and there are no restrictions on them.

[0058] In some embodiments, the query keyword refers to the keyword used to support the query function. Query keywords are, for example, SELECT, UPDATE, INSERT, DELETE, MERGE INTO, etc., and there is no limitation on this.

[0059] In some embodiments, each statement in the initial file can be searched to determine whether each statement contains a query keyword. If a statement contains a query keyword, it is taken as a candidate query statement. After retrieving all the candidate query statements in the initial file, it can be determined whether each candidate query statement conforms to the query syntax rules. If it does, it is taken as the initial query statement. If it does not, it is further determined whether the next candidate query statement conforms to the query syntax rules. There are no restrictions on this.

[0060] In some embodiments, if the file type is a stored procedure or query statement script, candidate query statements containing query keywords and ending with delimiters can be retrieved from the initial file, and the candidate query statements can be used as the initial query statements, thereby effectively extracting the initial query statements from the stored procedure or query statement script.

[0061] In some embodiments, the query keyword refers to the keyword used to support the query function. Query keywords are, for example, SELECT, UPDATE, INSERT, DELETE, MERGE INTO, etc., and there is no limitation on this.

[0062] In some embodiments, the separator may be, for example, the semicolon ";", and there is no limitation thereto.

[0063] In some embodiments, each statement in the stored procedure or query statement script can be searched to determine whether each statement contains a query keyword and whether it ends with a delimiter. If a statement contains a query keyword and ends with a delimiter, then that statement is used as the initial query statement, and there are no restrictions on this.

[0064] The implementation method for extracting the initial query statement from the initial file as described above can be illustrated by the following example: Figure 3 As shown, Figure 3This is a flowchart of the parser module according to an embodiment of this disclosure. The parser module can be used to extract initial query statements from initial files. For XML files, the XML file can be parsed with reference to XML syntax to form a tree-structured object relationship. Based on the XML configuration (an optional example of Extensible Markup Language configuration rules) and syntax rules (query syntax rules), the SQL statement (an optional example of the initial query statement) to be converted is located and extracted. For JAVA files, the search is performed based on SQL syntax (an optional example of query syntax rules) keywords (an optional example of query keywords), such as SELECT, UPDATE, INSERT, DELETE, MERGEINTO, etc. For stored procedures or SQL scripts, the search is performed based on SQL syntax keywords and delimiters within the stored procedure or SQL script. The located SQL statements are then parsed and extracted to obtain the SQL statement to be converted. After obtaining the SQL statement to be converted, the position information of the SQL statement to be converted in the extracted file can be recorded to facilitate subsequent result recovery and replacement. The extracted SQL statements are formed into a SQL statement result set, which is then used by the converter for unified conversion processing. The converter can be used to update the tables and fields that need to be converted (an optional example of the initial information) to tables and fields of the next generation standard (an optional example of the target information).

[0065] Figure 4 This is a schematic flowchart of a file processing method proposed in another embodiment of this disclosure.

[0066] like Figure 4 As shown, the file processing method includes:

[0067] S401: Obtain the initial query statement from the initial file. The initial query statement has corresponding position information, which indicates the position of the initial query statement in the initial file. The initial query statement includes: the initial table name and / or the initial fields.

[0068] In some embodiments, the database table name included in the initial query statement may be referred to as the initial table name, and the initial field may be represented by the field name or field alias in the initial query statement, without any restriction.

[0069] S402: Obtain the target data table and the initial data table corresponding to the initial table name, wherein the target data table has a corresponding target table name.

[0070] In some embodiments, the target data table refers to the database table to which it is to be replaced, the name of the target data table can be called the target table name, and the database table described by the initial table name can be called the initial data table; there is no restriction on this.

[0071] S403: Obtain the field mapping information corresponding to the initial table name, wherein the field mapping information includes: candidate fields, and target fields corresponding to the candidate fields.

[0072] The field mapping information can be pre-configured and can include several candidate fields and a target field corresponding to each candidate field. The candidate fields can be query statement fields in the old data standard, and the target field can be a field in the new generation data standard corresponding to the candidate fields. There are no restrictions on this.

[0073] In some embodiments, field mapping information can be preset and stored in association with the initial table name. The associated initial table name can be the table name of the database table to which several candidate fields in the field mapping information belong. Then, the preset field mapping information corresponding to the initial table name can be obtained, and there is no restriction on this.

[0074] In other embodiments, the candidate fields in the database table indicated by the initial table name can be dynamically configured with corresponding target fields, and field mapping information can be formed based on several candidate fields and the target fields corresponding to each candidate field. There are no restrictions on this.

[0075] S404: Determine candidate fields that match the initial fields from the field mapping information.

[0076] After obtaining the field mapping information corresponding to the initial table name, candidate fields that match (e.g., the same or similar) the initial fields can be determined from a number of candidate fields, and the target field can be retrieved based on the matching candidate fields, without any restrictions.

[0077] S405: Use the target table name and / or the target field corresponding to the matching candidate field as the target information.

[0078] After retrieving candidate fields that match the initial fields from the field mapping information, the target table name and / or the target field corresponding to the candidate field can be used as the target information without restriction.

[0079] Therefore, by obtaining the target data table and the initial data table corresponding to the initial table name, where the target data table has a corresponding target table name, and obtaining the field mapping information corresponding to the initial table name, where the field mapping information includes: candidate fields, and target fields corresponding to the candidate fields, the candidate fields matching the initial fields are determined from the field mapping information, and the target table name and / or the target fields corresponding to the matching candidate fields are used as target information, the target fields corresponding to the initial fields and the target table names corresponding to the initial table names can be accurately determined, which can support highly efficient automated transformation processing of query statements.

[0080] S406: Update the initial table name in the initial query statement to the target table name, where the initial table name and the target table name are different.

[0081] S407: Update the initial fields in the initial query statement to the target fields to obtain the target query statement.

[0082] After obtaining the target table name and / or target field, the initial table name in the initial query statement can be updated to the target table name, and / or the initial field in the initial query statement can be updated to the target field, so as to achieve automatic conversion between the old and new table names and / or the old and new fields, without any restrictions.

[0083] In some embodiments, only the initial table name in the initial query statement may be updated to the target table name; or only the initial field in the initial query statement may be updated to the target field; or the initial table name in the initial query statement may be updated to the target table name, and the initial field in the initial query statement may be updated to the target field, without limitation.

[0084] Examples are given below, such as Figure 5 As shown, Figure 5 This is a schematic diagram of the automated conversion process according to an embodiment of this disclosure. It supports the analysis of various source files containing SQL statements (an optional example of the initial file) by the parser module, parsing out all complete SQL statements (an optional example of the initial query statement) to form an SQL statement result set. For a single SQL statement in the SQL statement result set, the new and old field converter module updates the tables and fields to be converted (an optional example of the initial information) to the new generation standard tables and fields (an optional example of the target information), and obtains the target result SQL statement (an optional example of the target query statement). After being verified by the SQL validator, the result statements are finally assembled into a target file, completing the final conversion.

[0085] For example, the parser module parses files containing SQL statements from various sources, such as XML files, Java files, stored procedures, SQL scripts, etc. Then, it parses all the SQL statements to form an SQL statement result set. For each SQL statement in the result set, the converter module converts the old and new field and table names to obtain the target SQL statement. The validator module can then perform placeholder replacements and other processing on the target SQL statements to create executable SQL statements. These executable SQL statements are then executed in a test environment to verify their correctness. Finally, the converted SQL statements can be restored to their original format based on the file location and other information recorded by the parser module, forming the final target file, thus completing the conversion.

[0086] Examples are given below, such as Figure 6 As shown, Figure 6 This is a flowchart of the converter module in an embodiment of this disclosure. In this process, SQL statements are segmented and parsed using database reserved symbols and whitespace characters (space, tab, carriage return, etc.). After the SQL statement segmentation and parsing are completed, the hierarchical structure of the SQL statement is formed based on query keywords, such as SELECT, UPDATE, INSERT, DELETE, MERGEINTO, JOIN, etc. Then, based on query keywords, such as FROM, LEFT JOIN, MERGE INTO, etc., all initial table names and their corresponding aliases are parsed out. New and old mapping information (an optional example of field mapping information) can be pre-maintained and loaded into the cache. The target data table, the old table of the initial data table, and the field mapping information are found based on the initial table name. The original fields can also be replaced by field name or "alias.field name" based on the field mapping information and the SQL hierarchy information. If the initial table name and the target table name are inconsistent, the initial table name is replaced with the target table name. After the conversion is completed, the converted elements are reassembled into the target SQL (an optional example of the target query statement).

[0087] Therefore, by updating the initial table name in the initial query statement to the target table name (where the initial table name and the target table name are different), and updating the initial fields in the initial query statement to the target fields, the target query statement is obtained, thus achieving automatic conversion of the query statement and effectively improving the conversion efficiency and effect of the query statement.

[0088] S408: Generate the target file based on the location information and the target query statement.

[0089] For a detailed description of S408, please refer to the above embodiments, which will not be repeated here.

[0090] This embodiment effectively reduces the workload of file processing and improves the accuracy and effectiveness of file processing. It accurately determines the target field corresponding to the initial field and the target table name corresponding to the initial table name, supporting highly efficient automated conversion of query statements. This automated conversion of query statements effectively improves the efficiency and effectiveness of query statement conversion.

[0091] Figure 7 This is a schematic flowchart of a file processing method proposed in another embodiment of this disclosure.

[0092] like Figure 7 As shown, the file processing method includes:

[0093] S701: Obtain the initial query statement from the initial file. The initial query statement has corresponding position information, which indicates the position of the initial query statement in the initial file. The initial query statement includes: initial information.

[0094] S702: Determine the target information corresponding to the initial information.

[0095] For a detailed description of S701-S702, please refer to the above embodiments, which will not be repeated here.

[0096] S703: Update the initial information in the initial query statement to the target information to obtain the query statement to be verified.

[0097] The query statement to be verified can refer to a query statement that needs to be verified for correctness; there are no restrictions on this.

[0098] In some embodiments, the initial information in the initial query statement can be updated to the target information, and the updated query statement can be processed to generate an executable query statement. The executable query statement can then be used as the query statement to be verified. There are no restrictions on this.

[0099] S704: If the correctness verification of the query statement to be verified passes, then the query statement to be verified shall be used as the target query statement.

[0100] S705: If the validity of the query statement to be validated fails, the query statement to be validated shall be corrected and the resulting query statement shall be used as the target query statement.

[0101] In some embodiments, predefined verification rules can be used to verify the correctness of the query statement to be verified. For example, the verification can be performed to check whether the query statement to be verified can be executed correctly, whether it contains garbled characters, whether it carries ambiguous content, etc. If the correctness verification of the query statement to be verified passes, the query statement to be verified is used as the target query statement. If the correctness verification of the query statement to be verified fails, the query statement to be verified is corrected, and the query statement obtained after correction is used as the target query statement. This can further improve the correctness of the automatic conversion of query statements and improve the accuracy of file processing.

[0102] For example, such as Figure 8 As shown, Figure 8 This is a flowchart of the validator module in this embodiment. The validator module can be used to verify the correctness of the query statement to be verified. For example, for an SQL statement that has completed the conversion between old and new fields, depending on the file source, if it is an XML file, a general field set replacement process can be performed, followed by condition judgment, input variable replacement, etc., to form an executable query statement (the executable query statement can be an optional example of the query statement to be verified); if it is a JAVA file or a stored procedure, placeholders or input variables are inserted, and default values ​​are assigned according to the field type to form an executable query statement. Then, the database environment can be connected to execute the executable query statement and record the execution status of the executable query statement. If the execution is successful, it means that the correctness verification has passed; if the execution fails, it means that the correctness verification has failed, and manual intervention for troubleshooting is supported.

[0103] S706: Generate the target file based on the location information and the target query statement.

[0104] For a detailed description of S706, please refer to the above embodiments, which will not be repeated here.

[0105] This embodiment effectively reduces the workload of file processing and improves the accuracy and effectiveness of file processing. It further enhances the correctness of automated conversion of query statements, thereby improving the accuracy of file processing.

[0106] Figure 9 This is a schematic diagram of the structure of a document processing apparatus according to an embodiment of the present disclosure.

[0107] like Figure 9 As shown, the file processing device 90 includes:

[0108] The acquisition module 901 is used to acquire the initial query statement from the initial file. The initial query statement has corresponding position information, which indicates the position of the initial query statement in the initial file. The initial query statement includes: initial information.

[0109] The determination module 902 is used to determine the target information corresponding to the initial information.

[0110] The update module 903 is used to update the initial information in the initial query statement to the target information, thereby obtaining the target query statement.

[0111] Module 904 is used to generate target files based on location information and target query statements.

[0112] It should be noted that the foregoing explanation of the file processing method also applies to the file processing device of this embodiment, and will not be repeated here.

[0113] In this embodiment, by obtaining an initial query statement from an initial file, wherein the initial query statement has corresponding location information indicating the position of the initial query statement in the initial file, the initial query statement includes: initial information, and determining the target information corresponding to the initial information, and updating the initial information in the initial query statement to the target information to obtain the target query statement; and generating a target file based on the location information and the target query statement, the workload of file processing can be effectively reduced, and the accuracy and effect of file processing can be improved.

[0114] Figure 10 A block diagram of an exemplary electronic device suitable for implementing embodiments of the present disclosure is shown. Figure 10 The electronic device 12 shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments disclosed herein.

[0115] like Figure 10 As shown, the electronic device 12 is represented in the form of a general-purpose computing device. The components of the electronic device 12 may include, but are not limited to: one or more processors or processing units 16, memory 28, and bus 18 connecting different system components (including memory 28 and processing unit 16).

[0116] Bus 18 represents one or more of several bus architectures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the various bus architectures. Examples of these architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MAC) bus, the Enhanced ISA bus, the Video Electronics Standards Association (VESA) local bus, and the Peripheral Component Interconnect (PCI) bus.

[0117] Electronic device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by electronic device 12, including volatile and non-volatile media, removable and non-removable media.

[0118] Memory 28 may include computer system readable media in the form of volatile memory, such as Random Access Memory (RAM) 30 and / or cache 32. Electronic device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 34 may be used to read and write non-removable, non-volatile magnetic media (… Figure 10 Not shown; usually referred to as a "hard drive".

[0119] although Figure 10 Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk") and an optical disc drive for reading and writing to a removable non-volatile optical disc (e.g., a compact disc read-only memory (CD-ROM), a digital video disc read-only memory (DVD-ROM), or other optical media) may be provided. In these cases, each drive may be connected to bus 18 via one or more data media interfaces. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the embodiments of this disclosure.

[0120] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in memory 28. Such program modules 42 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. Program modules 42 typically perform the functions and / or methods described in the embodiments of this disclosure.

[0121] Electronic device 12 can also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), and with one or more devices that enable human interaction with electronic device 12, and / or with any device that enables electronic device 12 to communicate with one or more other computing devices (e.g., network card, modem, etc.). This communication can be performed via input / output (I / O) interface 22. Furthermore, electronic device 12 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 20. As shown, network adapter 20 communicates with other modules of electronic device 12 via bus 18. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 12, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.

[0122] The processing unit 16 executes various functional applications and data processing by running programs stored in the memory 28, such as implementing the file processing method mentioned in the foregoing embodiments.

[0123] To implement the above embodiments, this disclosure also proposes a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the file processing method proposed in the foregoing embodiments of this disclosure.

[0124] To implement the above embodiments, this disclosure also proposes a computer program product that, when instructions in the computer program product are executed by a processor, performs the file processing method as proposed in the foregoing embodiments of this disclosure.

[0125] It should be noted that in the description of this disclosure, the terms "first," "second," etc., are used for descriptive purposes only and should not be construed as indicating or implying relative importance. Furthermore, in the description of this disclosure, unless otherwise stated, "a plurality of" means two or more.

[0126] Any process or method description in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing a particular logical function or process, and the scope of preferred embodiments of this disclosure includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the function involved, as will be understood by those skilled in the art to which embodiments of this disclosure pertain.

[0127] It should be understood that various parts of this disclosure can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.

[0128] Those skilled in the art will understand that all or part of the steps of the methods described in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it includes one or a combination of the steps of the method embodiments.

[0129] Furthermore, the functional units in the various embodiments of this disclosure can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.

[0130] The storage media mentioned above can be read-only memory, disk, or optical disk, etc.

[0131] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this disclosure. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.

[0132] Although embodiments of the present disclosure have been shown and described above, it is to be understood that the above embodiments are exemplary and should not be construed as limiting the present disclosure. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of the present disclosure.

Claims

1. A file processing method, characterized in that, The method includes: Determine the file type corresponding to the initial file; Based on the file type, an initial query statement is extracted from the initial file, wherein the initial query statement has corresponding position information, the position information indicating the position of the initial query statement in the initial file, and the initial query statement includes: initial information; The new and old field converter module determines the target information corresponding to the initial information. The initial information includes the initial table name and / or initial fields, and the target information includes the target table name and / or target fields. The initial information in the initial query statement is automatically updated to the target information to obtain the query statement to be verified. If the correctness verification of the query statement to be verified passes, then the query statement to be verified is used as the target query statement; If the correctness verification of the query statement to be verified fails, the query statement to be verified is corrected, and the corrected query statement is used as the target query statement; and A target file is generated based on the location information and the target query statement.

2. The method as described in claim 1, characterized in that, in, The file type includes at least one of the following: Extensible Markup Language (XML) files; Computer programming language files; Stored procedures; Query statement script.

3. The method as described in claim 1, characterized in that, The file type is an Extensible Markup Language (EXPLAIN) file; wherein, extracting the initial query statement from the initial file according to the file type includes: Multiple candidate objects are identified from the Extensible Markup Language file, as well as the relationships between different candidate objects; Based on the configuration rules and query syntax rules of Extensible Markup Language, the target object is identified from the multiple candidate objects; The initial query statement is generated based on the target object and the target object relationships related to the target object.

4. The method as described in claim 1, characterized in that, The file type is a computer programming language file; wherein, extracting the initial query statement from the initial file according to the file type includes: Determine the query keywords based on the query syntax rules; Candidate query statements containing the query keywords are retrieved from the initial file; If the candidate query statement conforms to the query syntax rules, then the candidate query statement is used as the initial query statement.

5. The method as described in claim 1, characterized in that, The file type is a stored procedure or a query statement script; wherein, extracting the initial query statement from the initial file according to the file type includes: Candidate query statements containing query keywords and ending with delimiters are retrieved from the initial file; The candidate query statement is used as the initial query statement.

6. The method according to any one of claims 1-5, characterized in that, The initial information includes: an initial table name and / or initial fields; wherein, determining the target information corresponding to the initial information includes: Obtain the target data table and the initial data table corresponding to the initial table name, wherein the target data table has a corresponding target table name; Obtain the field mapping information corresponding to the initial table name, wherein the field mapping information includes: candidate fields, and target fields corresponding to the candidate fields; Determine candidate fields that match the initial fields from the field mapping information; The target table name and / or the target field corresponding to the matching candidate field are used as the target information.

7. The method according to any one of claims 1-5, characterized in that, The initial information includes: an initial table name and / or initial fields; the target information includes: a target table name and / or target fields; wherein, updating the initial information in the initial query statement to the target information includes: Update the initial table name in the initial query statement to the target table name, wherein the initial table name and the target table name are not the same; and / or, Update the initial field in the initial query statement to the target field.

8. A document processing device, characterized in that, The apparatus is used to implement the file processing method as described in claim 1, the apparatus comprising: The acquisition module is used to acquire an initial query statement from an initial file, wherein the initial query statement has corresponding position information, the position information indicating the position of the initial query statement in the initial file, and the initial query statement includes: initial information; The determination module is used to determine the target information corresponding to the initial information; An update module is used to update the initial information in the initial query statement to the target information, thereby obtaining the target query statement; and The generation module is used to generate a target file based on the location information and the target query statement.

9. An electronic device, characterized in that, include: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-7.

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

11. A computer program product, characterized in that, Includes a computer program that, when executed by a processor, implements the steps of the method according to any one of claims 1-7.