File analysis method and device, equipment, storage medium and program product

By using preset file configuration tables and field configuration tables to process file data sent by external applications, the server performance degradation and memory overflow problems caused by the need for different interaction processors in the prior art is solved, and efficient file data interaction and improved user experience is achieved.

CN119652994APending Publication Date: 2025-03-18INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411812761.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-10
Publication Date
2025-03-18

AI Technical Summary

Technical Problem

Existing file data interaction solutions require different interaction processors to process large data volumes, resulting in a decrease in performance capacity of the backend server or memory overflow, reducing user experience.

Method used

Through the preset file configuration table and field configuration table, the file data sent by external applications are processed, and the processed files are written into the target business table, avoiding the development of different file interaction processing logic codes, improving code maintainability, and reducing over-frequency interaction and memory usage between the application end and the backend database.

Benefits of technology

It realizes the interaction between application and external applications or systems in the financial field, avoids application downtime, and improves user experience and system processing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119652994A_ABST
    Figure CN119652994A_ABST
Patent Text Reader

Abstract

The invention provides a file analysis method and device, equipment, a storage medium and a program product, and relates to the field of financial science and technology or other related fields. According to the method, after file data sent by an external application program is processed through a preset file configuration table and a field configuration table, the processed file is written into a target service table, so that the application program realizes file data interaction with the external application program or a system by executing file data in an internal target service table, and the file data interaction efficiency is improved. Therefore, development of different file interaction processing logic codes is avoided, and the maintainability of the codes is improved. And moreover, downtime of the application program or the system caused by over-frequency interaction between the application program end and the rear-end database or overlarge memory occupation is avoided, and the use experience of a user is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of financial technology or other related fields, and in particular to a file parsing method, device, equipment, storage medium and program product. Background Art

[0002] In the working process of financial applications, there are often work scenarios that require file data interaction with other applications or systems. As the number of applications increases, the number of file data interactions is also increasing.

[0003] Existing file data interaction solutions require writing different corresponding interaction parsing programs for different types of file data and different interaction requirements, and different interaction processing programs need to be implemented based on the back-end database corresponding to the application or the memory of the terminal device.

[0004] However, existing file data interaction solutions require more different interaction processing programs to process large amounts of file data, which puts pressure on the memory operation of the back-end database or terminal device, thereby reducing the performance capacity of the back-end server that handles the business or causing memory overflow, resulting in application crashes and reducing the user experience. Summary of the invention

[0005] The present application provides a file parsing method, apparatus, device, storage medium and program product to solve the technical problem that the existing file data interaction solution requires different interaction processing programs to process, which reduces the performance capacity of the back-end server processing the business or causes memory overflow, thereby reducing the user's experience.

[0006] In a first aspect, the present application provides a file parsing method, comprising:

[0007] Reading file configuration information of at least one file from a preset file configuration table according to current information, and reading target field information to be parsed in at least one file from a preset field configuration table, wherein the current information includes: current date, current batch, current session, and the file configuration information includes: file identifier, target temporary table identifier;

[0008] Determine the target file to be parsed according to the file identifier and the current information;

[0009] If the target file exists in the target directory corresponding to the target file, move the target file from the target directory to the target directory to be processed, so as to parse the target field in the target file into the target temporary table corresponding to the target temporary table identifier according to the target field information;

[0010] The data in the target temporary table is written into the target business table corresponding to the target file.

[0011] In a second aspect, the present application provides a file parsing device, comprising:

[0012] An acquisition module is used to read the file configuration information of at least one file from a preset file configuration table according to current information, and to read the target field information to be parsed in at least one file from a preset field configuration table, wherein the current information includes: current date, current batch, current session, and the file configuration information includes: file identifier, target temporary table identifier;

[0013] A processing module, used for determining a target file to be parsed according to the file identifier and the current information;

[0014] A control module, configured to move the target file from the target directory to a target to-be-processed directory if the target file exists in the target directory corresponding to the target file, so as to parse the target field in the target file into a target temporary table corresponding to the target temporary table identifier according to the target field information;

[0015] The execution module is used to write the data in the target temporary table into the target business table corresponding to the target file.

[0016] In a third aspect, the present application provides an electronic device, characterized in that it includes: a processor, and a memory communicatively connected to the processor;

[0017] The memory stores computer-executable instructions;

[0018] The processor executes the computer-executable instructions stored in the memory to implement the above-mentioned file parsing method.

[0019] In a fourth aspect, the present application provides a computer-readable storage medium, characterized in that the computer-readable storage medium stores computer execution instructions, and the computer execution instructions are used to implement the above-mentioned file parsing method when executed by a processor.

[0020] In a fifth aspect, the present application provides a computer program product, characterized in that it includes a computer program, which implements the above-mentioned file parsing method when executed by a processor.

[0021] The file parsing method, device, equipment, storage medium and program product provided by the present application process the file data sent by the external application through the preset file configuration table and field configuration table, and write the processed file into the target business table, so that the application in the financial field can realize the file data interaction with the external application or system by executing the file data in the target business table, thereby avoiding the development of different file interaction processing logic codes and improving the maintainability of the code. It also avoids the application or system crash caused by excessive interaction between the application end and the back-end database or excessive memory occupation, thereby improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0023] Figure 1 Schematic diagram of the process of file parsing method provided in the embodiment of the present application Figure 1 ;

[0024] Figure 2 Schematic diagram of the process of file parsing method provided in the embodiment of the present application Figure 2 ;

[0025] Figure 3 A schematic diagram of the data structure of the file configuration table provided in the embodiment of the present application;

[0026] Figure 4 Schematic diagram of the process of file parsing method provided in the embodiment of the present application Figure 3 ;

[0027] Figure 5 A schematic diagram of the data structure of the field configuration table provided in the embodiment of the present application;

[0028] Figure 6 A schematic diagram of the structure of a file parsing device provided in an embodiment of the present application;

[0029] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application.

[0030] The above drawings have shown clear embodiments of the present application, which will be described in more detail later. These drawings and text descriptions are not intended to limit the scope of the present application in any way, but to illustrate the concept of the present application to those skilled in the art by referring to specific embodiments. DETAILED DESCRIPTION

[0031] Exemplary embodiments will be described in detail herein, examples of which are shown in the accompanying drawings. When the following description refers to the drawings, unless otherwise indicated, the same numbers in different drawings represent the same or similar elements. The implementations described in the following exemplary embodiments do not represent all implementations consistent with the present application. Instead, they are merely examples of devices and methods consistent with some aspects of the present application as detailed in the appended claims.

[0032] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with the relevant laws, regulations and standards of the relevant countries and regions, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0033] In addition, this application involves conducting big data analysis of user information (including but not limited to personal biometrics, identity data, consumption data, asset data, electronic terminal operation data, etc.), and using artificial intelligence technology to make automated decisions, and making technical solutions that have a significant impact on personal rights and interests based on the results of automated decisions. The application provides users with corresponding operation entrances for them to choose to agree or reject the results of automated decisions; if the user chooses to reject, the expert decision-making process will be entered.

[0034] It should be noted that the file parsing method, device, equipment, storage medium and program product provided in the present application can be used in the field of financial technology, and can also be used in any field other than the field of financial technology. The application field of the file parsing method, device, equipment, storage medium and program product in the present application is not limited.

[0035] When a financial application or system interacts with other applications or systems, due to the different file interfaces or file data types of each application, it is necessary to write corresponding file interaction systems for different applications or systems. Therefore, the file interaction system between different applications or systems is an important basic framework.

[0036] As the number of applications or systems increases, the amount of interactive file data between different applications or systems also continues to grow. When facing large amounts of file data, existing file data interaction solutions need to develop separate file interaction processing logic code for each file with different formats and requirements, which will make the application or system itself bloated and complicated, and reduce the maintainability of the code. In addition, the file interaction processing logic usually needs to be implemented with the back-end database or the memory of the terminal device, which makes the application end interact with the back-end database too frequently or occupies too much memory, resulting in a decrease in the performance capacity of processing business or memory overflow, causing the application or system to crash, affecting the user experience.

[0037] In the prior art, there are file data interaction solutions for processing different types of files, such as a file interaction solution that converts and merges files according to external file IDs, wherein after obtaining the files to be transferred through the file ID list in the transfer file list of the external system or application and the configured internal system file, the files to be transferred are converted and merged according to the parameters of each personalized configuration file in the transfer file list to achieve file interaction between multiple applications or systems. However, the above-mentioned file data interaction solution does not perform batch conversion and analysis on file data in combination with specific fields, and does not meet the data granularity requirements of financial applications.

[0038] The file parsing method, device, equipment, storage medium and program product provided in this application are intended to solve the above technical problems in the prior art.

[0039] The file parsing method provided by the present application obtains the current information indicating the date status of the current batch sequence file from the file sent by the external application, reads the file configuration information of the file from the preset file configuration table, and reads the target field information to be parsed in the file from the preset field configuration table, and then determines the target file to be parsed according to the file identifier and current information in the file configuration information. Move the target file from the corresponding target directory to the target pending directory, parse the target field in the target file into the target temporary table corresponding to the target temporary table identifier according to the target field information, write the data in the target temporary table into the target business table corresponding to the target file, and execute the file data in the target business table.

[0040] Therefore, this application processes the file data sent by the external application through the preset file configuration table and field configuration table, and writes the processed file into the target business table, so that the application in the financial field can realize the file data interaction with the external application or system by executing the file data in the target business table, thereby avoiding the development of different file interaction processing logic codes and improving the maintainability of the code. It also avoids the application or system crash caused by excessive interaction between the application end and the backend database or excessive memory occupation, thereby improving the user experience.

[0041] The technical solution of the present application and how the technical solution of the present application solves the above-mentioned technical problems are described in detail below with specific embodiments. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of the present application will be described below in conjunction with the accompanying drawings.

[0042] Figure 1 Schematic diagram of the process of file parsing method provided in the embodiment of the present application Figure 1 ,like Figure 1 As shown, the method includes:

[0043] S101. Read file configuration information of at least one file from a preset file configuration table according to current information, and read target field information to be parsed in at least one file from a preset field configuration table, wherein the current information includes: current date, current batch, current session, and the file configuration information includes: file identifier, target temporary table identifier.

[0044] Specifically, after obtaining the batch file data sent by an external application or external system, the file configuration information corresponding to each file in the current batch file is obtained through the preset file configuration table, and the fields in each file in the current batch file are read through the preset field configuration table to obtain the target field information corresponding to each file.

[0045] Among them, the current date in the current information is used to indicate the date on which the file needs to be executed, the current batch is used to indicate the file batch to which the executed file belongs, and the current session is used to identify multiple batches of files sent on the current date; the file identifier in the file configuration information is used to indicate the name of the corresponding file, and the target temporary table identifier is used to indicate the name of the corresponding business temporary table.

[0046] S102: Determine a target file to be parsed according to the file identifier and the current information.

[0047] Specifically, after obtaining the current information and the file configuration information corresponding to each file, in the batch file, determine the files that meet the current date, current batch and current session indicated by the current information, as well as the unprocessed files, and use the files that meet the current information and have not been processed as the target files.

[0048] S103: If the target file exists in the target directory corresponding to the target file, move the target file from the target directory to the target directory to be processed, so as to parse the target field in the target file into the target temporary table corresponding to the target temporary table identifier according to the target field information.

[0049] Specifically, after determining the target file according to the file identifier and current information, check whether the target file exists in the corresponding target directory according to the file name of the target file, that is, check whether the target file has arrived in the corresponding target directory. If it is detected that the corresponding target file exists in the target directory, the target file is moved to the target directory to be processed; if it is detected that the corresponding target file does not exist in the target directory, wait for a preset time and then check again whether there is a target file in the target directory.

[0050] S104: Write the data in the target temporary table into the target business table corresponding to the target file.

[0051] Specifically, after the target file is moved into the target to-be-processed directory, the fields in the target file are parsed and extracted according to the target field information to obtain the corresponding target fields. After the parsed multiple target fields are batch-inserted into the target temporary table corresponding to the target temporary table identifier, according to the business processing switch in the file configuration information, that is, the flow switching flag, it is detected whether the batch target field data in the target temporary table is written into the target business table corresponding to the target file. If the business processing switch indicates to be turned on, the batch target field data in the target temporary table is written into the target business table to execute the batch target field data in the target business table to realize data interaction between this application and external applications.

[0052] The file parsing method provided in this embodiment processes the file data sent by the external application through the preset file configuration table and field configuration table, and writes the processed file into the target business table, so that the application in the financial field can realize the file data interaction with the external application or system by executing the file data in the target business table. That is, the parsing logic of the file is written into the preset file configuration table and field configuration table, so that only the general logic needs to be implemented in the code, and the parsing logic for different files is implemented through the configuration table, which reduces the amount of code, thereby avoiding the development of different file interaction processing logic codes and improving the maintainability of the code. It also avoids the application or system crash caused by excessive interaction between the application end and the backend database or excessive memory occupation, thereby improving the user experience.

[0053] Figure 2 Schematic diagram of the process of file parsing method provided in the embodiment of the present application Figure 2 , Figure 3 A schematic diagram of the data structure of the file configuration table provided in the embodiment of the present application, combined with Figure 2 and Figure 3 As shown, based on Figure 1 In an embodiment, the method comprises:

[0054] S201. Read file configuration information of at least one file from a preset file configuration table according to current information, and read target field information to be parsed in at least one file from a preset field configuration table.

[0055] Specifically, after obtaining the batch files sent by the external application or external system, the file configuration information corresponding to each file in the current batch file is obtained through the preset file configuration table, wherein the file configuration information includes the job date such as file_date in the file configuration table, the job batch such as file_prefix in the file configuration table, the job session such as file_suffix in the file configuration table, the file identifier bin_file_name, the target temporary table identifier, the repeatable processing flag, the maximum waiting time, the dependent file identifier, the application dependency flag, the batch write row number and field separation method, the business processing switch and the parsing executor. The application dependency flag is used to indicate whether the file depends on the parsing task of the target application, that is, it corresponds to the label names under the column name in the file configuration table.

[0056] Furthermore, the target field information includes file type, field sequence number, field name, field description, field parsing start position, field parsing end position, field length, whether it can be empty, whether it contains rare characters and field type, that is, it corresponds to each label name under the column name in the field configuration table.

[0057] S202. Determine whether the file has been processed according to the file processing log table. If the file has not been processed, and / or the repeatable processing flag of the file indicates that the file can be processed repeatedly, determine the target file according to the file identifier of the file and the current information.

[0058] Specifically, after obtaining the file configuration information of each file, the file processing log table is checked to see whether each file has been processed. The file processing log table stores the identifiers of files that have been processed. If an identifier identical to that of a file is detected in the file processing log table, the file is marked as a processed file, otherwise it is marked as a processable file.

[0059] Furthermore, in the file configuration information marked as processed files, the corresponding file is detected according to the repeatable processing flag whether it can still be processed, and when the repeatable processing flag indicates that the file can be repeatedly processed, the corresponding file is marked as a processable file, otherwise it is marked as a processed file. Among the files marked as processed files, the files that meet the current date, current batch and current session indicated by the current information are used as target files, and the repeatable processing flag is used to avoid repeated processing of unnecessary files.

[0060] S203: If the target file does not exist in the target directory corresponding to the target file, determine whether the waiting time of the target file is greater than the maximum waiting time of the target file.

[0061] Specifically, after obtaining the target file, the corresponding directory is queried based on the target file name to see if the file has arrived. If it is detected to exist, the collision is successful. After the collision is successful, the target file is verified.

[0062] Furthermore, if it is detected that it does not exist, the collision fails. When the collision fails, the target file in the corresponding directory is continuously waited for to arrive, and the waiting time is recorded, and it is detected whether the waiting time is greater than the maximum waiting time in the file configuration information of the target file. Among them, for the corresponding directory of the target file, the name mapping can be used, and the corresponding file directory information can also be configured in the file configuration table.

[0063] S204: If the waiting time is less than or equal to the maximum waiting time of the target file, continue waiting until the target file exists in the target directory corresponding to the target file, and / or the waiting time of the target file is greater than the maximum waiting time of the target file.

[0064] Specifically, when the collision fails, continue to wait for the target file in the corresponding directory to arrive, and record the waiting time. If the waiting time is not greater than the maximum waiting time wait_time in the file configuration information, such as sixty seconds, then continue to wait until the target file exists in the target directory, or the waiting time is greater than the maximum waiting time.

[0065] If the waiting time is longer than the maximum waiting time, the target file is determined to be parsed abnormally, and a prompt message is generated according to the target file to remind the user. Of course, the maximum waiting time can also be set to 180 seconds, as long as it can be used to detect file collisions. The target file is determined to be qualified through the collision file action, thereby ensuring the effective qualification of the target file.

[0066] S205: Obtain a verification file corresponding to the target file, and verify the target file according to the verification file.

[0067] Specifically, when it is detected that the target file has arrived in the corresponding directory, that is, when the collision is successful, it is determined whether the target file, that is, the BIN file, is compliant based on the arrived CHK check file.

[0068] Among them, the CHK verification file is a verification file of the target file, which is used to store some basic information such as the size and format of the BIN file, and is used to verify the BIN file. If the target file does not meet the CHK verification file requirements, a prompt message is generated based on the target file to remind the user.

[0069] S206: After the target file is successfully verified, the target field in the target file is parsed into a target temporary table corresponding to the target temporary table identifier according to the target field information.

[0070] Specifically, after the target file is verified according to the verification file and the verification is successful, before the successfully verified target file is moved to the target pending directory, the target file is checked again for abnormality according to the dependent file identifier and application dependent flag in the file configuration information, and after determining that the target file is normal, the target file is moved to the target pending directory. In the target pending directory, based on the field configuration table, the target field to be parsed in the target file is determined according to the file type in the file configuration information, and read into the target temporary table corresponding to the target temporary table identifier.

[0071] S207. If the business processing switch of the target file is on, call the parsing execution body to write the data in the target temporary table into the target business table corresponding to the target file, wherein the parsing execution body includes one of the following: a stored procedure or a software function interface.

[0072] Specifically, after the target fields are batch inserted into the corresponding target temporary table, the business processing switch is used to confirm whether business processing is required, that is, to detect whether the target file is switched to normal, and when the target file needs to be switched to normal, that is, when the business processing switch in the file configuration information of the target file is turned on, the target field data in the target temporary table is read through the parsing execution body such as the software function interface Java or the stored procedure execution parsing to write the data in the target temporary table to the target business table.

[0073] S208: Delete the target temporary table corresponding to the target file, and update the file processing log.

[0074] Specifically, after the target field data in the target temporary table is read into the target business table through a software function interface or a stored procedure, the data in the target temporary table is deleted or the target temporary table corresponding to the target file is directly deleted. After the application can execute the file data in the target business table, the identifier of the target file to be parsed is recorded in the file processing log to update the file processing log.

[0075] The file parsing method provided in this embodiment obtains the current information indicating the date status of the current batch of files from the file sent by the external application, reads the file configuration information of the file from the preset file configuration table, and reads the target field information to be parsed in the file from the preset field configuration table, and then determines the target file to be parsed according to the file identifier in the file configuration information and the current information. Move the target file from the corresponding target directory to the target pending directory, parse the target field in the target file into the target temporary table corresponding to the target temporary table identifier according to the target field information, write the data in the target temporary table into the target business table corresponding to the target file, and execute the file data in the target business table, so that the application in the financial field can realize the file data interaction with the external application or system by executing the file data in the target business table, thereby avoiding the development of different file interaction processing logic codes and improving the maintainability of the code. And avoid the application or system downtime caused by excessive interaction between the application end and the backend database or occupying too much memory, thereby improving the user experience.

[0076] Figure 4 Schematic diagram of the process of file parsing method provided in the embodiment of the present application Figure 3 , Figure 5 A data structure diagram of the field configuration table provided in the embodiment of the present application, combined with Figure 4 and Figure 5 As shown, based on Figure 2In an embodiment, for the step of parsing the target field in the target file into the target temporary table corresponding to the target temporary table identifier according to the target field information, the method steps include:

[0077] S301. After the target file is successfully verified, if there is a dependent file identifier in the file configuration information, after the dependent file parsing corresponding to the dependent file identifier is completed, the target field is parsed into a target temporary table.

[0078] Specifically, before the successfully verified target file is transferred to the target to-be-processed directory, a check is performed in the configuration information of the target file to determine whether a dependent file identifier exists. If a dependent file identifier exists, that is, it is detected that a preceding dependent file needs to be executed and the preceding dependent file has not yet been executed, a prompt message is generated based on the dependent file identifier and the target file to remind the background user; if the dependent file identifier does not exist, then based on the application dependency flag, it is determined whether the target field in the target file is parsed into the target temporary table corresponding to the target temporary table identifier.

[0079] S302: If the application dependency flag of the target file indicates that the target file does not depend on the parsing task of the target application, and / or the target application to which the target file depends has been parsed, parse the target field into a target temporary table.

[0080] Specifically, if there is no dependent file identifier in the configuration information of the target file, then the application dependency flag in the configuration information of the target file is detected, wherein the application dependency flag is used to indicate whether the target file depends on the parsing task of the target application, such as the completion of the end-of-day batch. If the application dependency flag indicates that the target file depends on the end-of-day batch of the target application, and the end-of-day batch has not been completed, a prompt message is generated according to the application dependency flag and the target file to remind the background user;

[0081] Further, if the application dependency flag indicates that the target file does not depend on the end-of-day batch of the target application, or although it depends on the end-of-day batch of the target application, but the end-of-day batch is completed, confirm that the target field in the target file is parsed into the target temporary table corresponding to the target temporary table identifier.

[0082] S303 . Read data from the target file in sequence according to the batch write row number and the target field information of the target file to obtain a batch data group.

[0083] Specifically, based on the number of rows written in batches in the file configuration information of the target file, the row data of the target file is read in a stream form to form a field array corresponding to the fields, that is, a data group, so as to obtain multiple data groups, that is, batch data groups.

[0084] S304, segmenting each of the batch data groups according to the field separation method of the target file to obtain field data corresponding to each field, and writing the field content into the target temporary table of the target file.

[0085] Specifically, after obtaining the batch data group, determine whether there are rare Chinese characters in the file configuration. If so, parse the fixed-length field into a separator form according to the field separation method. The default separator is (char), and transcode the rare characters into the code values ​​corresponding to the standard ASCII (American Standard Code for Information Interchange). The converted corresponding code values ​​are written into the target temporary table for storage and use, that is, the target fields are batch inserted into the corresponding target temporary table.

[0086] The file parsing method provided in this embodiment can flexibly use a custom file structure within or between applications through a preset file configuration table and field configuration table. The development user only needs to set the file type configuration rules and parsing field rules to quickly get started, realize zero-coding file parsing on the JAVA side, and simplify the code programming process. In addition, the file parsing process can be flexibly controlled to facilitate horizontal and vertical expansion. Effective control is also made for the processing of large files, and the files are read in the form of streams and inserted into the database in batches, which improves the efficiency of data insertion and reduces the number of interactions with the database, thereby avoiding application or system crashes due to excessive interactions between the application end and the backend database or excessive memory usage, thereby improving the processing efficiency of the entire system.

[0087] Figure 6 This is a schematic diagram of the structure of the file parsing device provided in the embodiment of the present application. Figure 6 As shown, the file parsing device 60 may include: an acquisition module 601, a processing module 602, a control module 603 and an execution module 604, wherein:

[0088] The acquisition module 601 is used to read the file configuration information of at least one file from the preset file configuration table according to the current information, and read the target field information to be parsed in at least one file from the preset field configuration table, wherein the current information includes: the current date, the current batch, and the current session, and the file configuration information includes: the file identifier and the target temporary table identifier.

[0089] The processing module 602 is used to determine the target file to be parsed according to the file identifier and the current information.

[0090] Control module 603 is used to move the target file from the target directory to the target directory to be processed if the target file exists in the target directory corresponding to the target file, so as to parse the target field in the target file into the target temporary table corresponding to the target temporary table identifier according to the target field information.

[0091] The execution module 604 is used to write the data in the target temporary table into the target business table corresponding to the target file.

[0092] Optionally, the file configuration information also includes: a repeatable processing flag, a processing module 602, specifically configured to determine whether the file has been processed according to a file processing log table, wherein the file processing log table includes a parsed file identifier;

[0093] For one of the files, if the file has not been processed, and / or the repeatable processing flag of the file indicates that the file can be processed repeatedly, the target file is determined according to the file identifier of the file and the current information.

[0094] Optionally, the file configuration information also includes: a maximum waiting time, and the processing module 602 is further used to determine whether the waiting time of the target file is greater than the maximum waiting time of the target file if the target file does not exist in the target directory corresponding to the target file;

[0095] If the waiting time is less than or equal to the maximum waiting time of the target file, continue waiting until the target file exists in the target directory corresponding to the target file, and / or the waiting time of the target file is greater than the maximum waiting time of the target file;

[0096] If the waiting time of the target file is greater than the maximum waiting time of the target file, it is determined that the parsing of the target file is abnormal.

[0097] Optionally, the control module 603 is specifically configured to obtain a verification file corresponding to the target file, wherein the verification file includes basic information corresponding to the target file;

[0098] Verifying the target file according to the verification file;

[0099] After the target file is successfully verified, the target field in the target file is parsed into the target temporary table corresponding to the target temporary table identifier according to the target field information.

[0100] Optionally, the file configuration information includes: a dependent file identifier, a control module 603, which is specifically used to parse the target field in the target file into the target temporary table corresponding to the target temporary table identifier according to the target field information after the dependent file corresponding to the dependent file identifier is parsed if the dependent file identifier exists;

[0101] If the dependent file identifier does not exist, the target field in the target file is parsed into the target temporary table corresponding to the target temporary table identifier according to the target field information.

[0102] Optionally, the file configuration information also includes: an application dependency flag, wherein the application dependency flag is used to indicate whether the file depends on the parsing task of the target application; a control module 603 is specifically used to parse the target field in the target file into the target temporary table corresponding to the target temporary table identifier according to the target field information if the application dependency flag of the target file indicates that the target file does not depend on the parsing task of the target application, and / or the target application that the target file depends on has been parsed.

[0103] Optionally, the file configuration information further includes: the number of rows to be written in batches and the field separation method, and the execution module 604 is specifically configured to read data from the target file in sequence according to the number of rows to be written in batches and the target field information of the target file to obtain batch data groups, each of which corresponds to the number of rows to be written in batches;

[0104] Segment each of the batch data groups according to the field separation method of the target file to obtain field data corresponding to each field, and transcode the data to be transcoded when there is content to be transcoded in the field content;

[0105] The field content is written into the target temporary table of the target file.

[0106] Optionally, the file configuration information also includes: a business processing switch, an execution module 604, which is specifically used to write the data in the target temporary table into the target business table corresponding to the target file if the business processing switch of the target file is in the on state.

[0107] Optionally, the file configuration information includes: a parsing execution body, an execution module 604, specifically used to call the parsing execution body to write the data in the target temporary table into the target business table corresponding to the target file, the parsing execution body includes one of the following: a stored procedure or a software function interface;

[0108] The target temporary table corresponding to the target file is deleted, and the file processing log is updated.

[0109] Figure 7 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. Figure 7 As shown, the electronic device may include: a transceiver 701 , a processor 702 and a memory 703 .

[0110] The processor 702 executes the computer-executable instructions stored in the memory, so that the processor 702 executes the solution in the above embodiment. The processor 702 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gates or transistor logic devices, and discrete hardware components.

[0111] The memory 703 is connected to the processor 702 via a system bus and completes communication between them. The memory 703 is used to store computer program instructions.

[0112] The transceiver 701 may be used to obtain tasks to be executed and configuration information of the tasks to be executed.

[0113] The system bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus. The system bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus. The transceiver is used to realize the communication between the database access device and other computers (such as clients, read-write libraries, and read-only libraries).

[0114] The memory may include random access memory (RAM) and may also include non-volatile memory (VNM).

[0115] An embodiment of the present application further provides a computer-readable storage medium, in which computer instructions are stored. When the computer instructions are executed on a computer, the computer executes the technical solution of the above-mentioned file parsing method.

[0116] An embodiment of the present application also provides a computer program product, which includes a computer program stored in a computer-readable storage medium. At least one processor can read the computer program from the computer-readable storage medium. When at least one processor executes the computer program, the technical solution of the file parsing method in the above embodiment can be implemented.

[0117] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present application.

[0118] It should be further noted that, although the various steps in the flowchart are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowchart may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of the sub-steps or stages of other steps.

[0119] In addition, unless otherwise specified, each functional unit / module in each embodiment of the present application may be integrated into one unit / module, each unit / module may exist physically separately, or two or more units / modules may be integrated together. The above-mentioned integrated unit / module may be implemented in the form of hardware or in the form of a software program module.

[0120] If the integrated unit / module is implemented in the form of hardware, the hardware may be a digital circuit, an analog circuit, etc. The physical implementation of the hardware structure includes but is not limited to transistors, memristors, etc. Unless otherwise specified, the processor may be any appropriate hardware processor, such as a CPU, a GPU, an FPGA, a DSP, an ASIC, etc. Unless otherwise specified, the storage unit may be any appropriate magnetic storage medium or magneto-optical storage medium, such as a resistive random access memory (RRAM), a dynamic random access memory (DRAM), a static random access memory (SRAM), an enhanced dynamic random access memory (EDRAM), a high-bandwidth memory (HBM), a hybrid memory cube (HMC), etc.

[0121] If the integrated unit / module is implemented in the form of a software program module and sold or used as an independent product, it can be stored in a computer-readable memory. 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. The computer software product is stored in a memory, including a number of instructions to enable a computer device (which can be a personal computer, server or network device, etc.) to execute all or part of the steps of the various embodiments of the present application. The aforementioned memory includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, disk or optical disk and other media that can store program codes.

[0122] In the above embodiments, the description of each embodiment has its own emphasis. For the part not described in detail in a certain embodiment, please refer to the relevant description of other embodiments. The technical features of the above embodiments can be combined arbitrarily. In order to make the description concise, all possible combinations of the technical features in the above embodiments are not described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0123] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the invention disclosed herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the following claims.

Claims

1. A file parsing method, characterized in that: include: Reading file configuration information of at least one file from a preset file configuration table according to current information, and reading target field information to be parsed in at least one file from a preset field configuration table, wherein the current information includes: current date, current batch, current session, and the file configuration information includes: file identifier, target temporary table identifier; Determine the target file to be parsed according to the file identifier and the current information; If the target file exists in the target directory corresponding to the target file, move the target file from the target directory to the target directory to be processed, so as to parse the target field in the target file into the target temporary table corresponding to the target temporary table identifier according to the target field information; The data in the target temporary table is written into the target business table corresponding to the target file.

2. The method according to claim 1, characterized in that The file configuration information also includes: a repeatable processing flag, and the step of determining the target file to be parsed according to the file identifier and the current information includes: Determine whether the file has been processed according to a file processing log table, wherein the file processing log table includes a parsed file identifier; For one of the files, if the file has not been processed, and / or the repeatable processing flag of the file indicates that the file can be processed repeatedly, the target file is determined according to the file identifier of the file and the current information.

3. The method according to claim 1, characterized in that The file configuration information also includes: a maximum waiting time, and the method further includes: If the target file does not exist in the target directory corresponding to the target file, determining whether the waiting time of the target file is greater than the maximum waiting time of the target file; If the waiting time is less than or equal to the maximum waiting time of the target file, continue waiting until the target file exists in the target directory corresponding to the target file, and / or the waiting time of the target file is greater than the maximum waiting time of the target file; If the waiting time of the target file is greater than the maximum waiting time of the target file, it is determined that the parsing of the target file is abnormal.

4. The method according to claim 1, characterized in that: The step of parsing the target field in the target file into the target temporary table corresponding to the target temporary table identifier according to the target field information includes: Obtaining a verification file corresponding to the target file, wherein the verification file includes basic information corresponding to the target file; Verifying the target file according to the verification file; After the target file is successfully verified, the target field in the target file is parsed into the target temporary table corresponding to the target temporary table identifier according to the target field information.

5. The method according to claim 1, characterized in that The file configuration information includes: a dependent file identifier, and the target field in the target file is parsed into a target temporary table corresponding to the target temporary table identifier according to the target field information, including: If the dependent file identifier exists, after the dependent file corresponding to the dependent file identifier is parsed, the target field in the target file is parsed into the target temporary table corresponding to the target temporary table identifier according to the target field information; If the dependent file identifier does not exist, the target field in the target file is parsed into the target temporary table corresponding to the target temporary table identifier according to the target field information.

6. The method according to claim 1, characterized in that The file configuration information also includes: an application dependency flag, the application dependency flag is used to indicate whether the file depends on the parsing task of the target application, and the target field in the target file is parsed into the target temporary table corresponding to the target temporary table identifier according to the target field information, including: If the application dependency flag of the target file indicates that the target file does not depend on the parsing task of the target application, and / or the target application on which the target file depends has been parsed, then according to the target field information, the target field in the target file is parsed into the target temporary table corresponding to the target temporary table identifier.

7. The method according to any one of claims 1 to 6, characterized in that The file configuration information also includes: the number of rows written in batches and the field separation method. According to the target field information, the target field in the target file is parsed into the target temporary table corresponding to the target temporary table identifier, including: According to the batch write row number and the target field information of the target file, data is read from the target file in sequence to obtain batch data groups, each of which corresponds to the batch write row number; Segment each of the batch data groups according to the field separation method of the target file to obtain field data corresponding to each field, and transcode the data to be transcoded when there is content to be transcoded in the field content; The field content is written into the target temporary table of the target file.

8. The method according to claim 2, characterized in that: The file configuration information also includes: a business processing switch, and the step of writing the data in the target temporary table into the target business table corresponding to the target file includes: If the business processing switch of the target file is in the on state, the data in the target temporary table is written into the target business table corresponding to the target file.

9. The method according to claim 8, characterized in that The file configuration information includes: parsing execution body, and writing the data in the target temporary table into the target business table corresponding to the target file includes: Calling the parsing execution body to write the data in the target temporary table into the target business table corresponding to the target file, the parsing execution body comprising one of the following: a stored procedure or a software function interface; The target temporary table corresponding to the target file is deleted, and the file processing log is updated.

10. A file parsing device, characterized in that: include: An acquisition module is used to read the file configuration information of at least one file from a preset file configuration table according to current information, and to read the target field information to be parsed in at least one file from a preset field configuration table, wherein the current information includes: current date, current batch, current session, and the file configuration information includes: file identifier, target temporary table identifier; A processing module, used for determining a target file to be parsed according to the file identifier and the current information; A control module, configured to move the target file from the target directory to a target to-be-processed directory if the target file exists in the target directory corresponding to the target file, so as to parse the target field in the target file into a target temporary table corresponding to the target temporary table identifier according to the target field information; The execution module is used to write the data in the target temporary table into the target business table corresponding to the target file.

11. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 9.

12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 9 when executed by a processor.

13. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 9 when being executed by a processor.

Citation Information

Patent Citations

  • File processing method, engine and system

    CN110245115A

  • File analysis and storage method and device and file generation method and device

    CN111339041A

  • File analysis method and device based on dynamic configuration

    CN116341514A

  • Data acquisition device and data acquisition method

    US20230239379A1