File generation method and device, computer equipment and storage medium

By obtaining and parsing the configuration parameters in the file generation request, processing file data and generating target files, the problems of insufficient flexibility and low efficiency of file processing in the prior art are solved, and flexible and efficient file processing are achieved.

CN120106012APending Publication Date: 2025-06-06SHENZHEN LEXIN SOFTWARE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510071604.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-16
Publication Date
2025-06-06

AI Technical Summary

Technical Problem

The existing file processing methods are insufficient flexibility and low processing efficiency, making it difficult to meet the complex, changing diverse and personalized needs.

Method used

By obtaining a file generation request containing file configuration parameters, the initial data file is obtained and parsed according to the file parsing parameters, the data processing is then processed according to the file processing parameters, and finally formatted according to the file generation parameters to generate the target file.

Benefits of technology

It realizes flexible and efficient file dynamic parsing and processing, improves file processing flexibility and efficiency, improves user experience, and ensures data accuracy and completeness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120106012A_ABST
    Figure CN120106012A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of data processing, and discloses a file generation method and device, computer equipment and a storage medium. The file generation method comprises the steps of obtaining a file generation request containing file configuration parameters; the file configuration parameters comprise file receiving parameters, file analysis parameters, file processing parameters and file generation parameters; when it is confirmed that the file generation request is a valid request, obtaining an initial data file corresponding to the file receiving parameter, and performing analysis processing on the initial data file according to the file analysis parameter to obtain file analysis data; processing the file analysis data according to the file processing parameters to obtain file processing data; and formatting the file processing data according to the file generation parameters to obtain a target file. According to the method and the device, customized dynamic file analysis processing is realized, and the file generation flexibility and processing efficiency are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data processing technology, and in particular to a file generation method, device, computer equipment and storage medium. Background Art

[0002] Against the backdrop of rapid development of informatization, file processing has become an indispensable part of business operations and decision-making, such as generating a new file from data in a database as needed, or generating a new file using part of the content of a file. However, with the increasing complexity of business needs and the continuous enrichment of file formats, traditional file processing methods are limited by fixed processing procedures and simple rules, and are difficult to meet complex and changing diversified and personalized needs. On the one hand, existing file processing methods often only have the ability to process files in basic formats, and have the defect of insufficient flexibility. When users have diverse business file format processing needs, a lot of time and manpower are required for customized development, which affects the user experience. On the other hand, existing file processing methods still have many repetitive processes and low processing efficiency. Summary of the invention

[0003] Based on this, it is necessary to provide a file generation method, device, computer equipment and storage medium to address the above technical problems, so as to solve the problems of insufficient flexibility and low processing efficiency in the existing file processing process.

[0004] A file generation method, comprising: Obtaining a file generation request including file configuration parameters; the file configuration parameters include file receiving parameters, file parsing parameters, file processing parameters and file generation parameters; When confirming that the file generation request is a valid request, obtaining an initial data file corresponding to the file receiving parameter, and parsing the initial data file according to the file parsing parameter to obtain file parsing data; Processing the file parsing data according to the file processing parameters to obtain file processing data; The file processing data is formatted according to the file generation parameters to obtain a target file corresponding to the file generation request.

[0005] A file generating device, comprising: A request acquisition module, used to acquire a file generation request including file configuration parameters; the file configuration parameters include file receiving parameters, file parsing parameters, file processing parameters and file generation parameters; A file parsing module, configured to obtain an initial data file corresponding to the file receiving parameter when confirming that the file generation request is a valid request, and parse the initial data file according to the file parsing parameter to obtain file parsing data; A file processing module, used for processing the file parsing data according to the file processing parameters to obtain file processing data; The target file generation module is used to format the file processing data according to the file generation parameters to obtain a target file corresponding to the file generation request.

[0006] A computer device comprises a memory, a processor and computer-readable instructions stored in the memory and executable on the processor, wherein the processor implements the above-mentioned file generation method when executing the computer-readable instructions.

[0007] A computer-readable storage medium stores computer-readable instructions. When the computer-readable instructions are executed by one or more processors, the one or more processors execute the file generation method as described above.

[0008] In the above-mentioned file generation method, device, computer equipment and storage medium, the file generation method obtains a file generation request including file configuration parameters; the file configuration parameters include file receiving parameters, file parsing parameters, file processing parameters and file generation parameters; when confirming that the file generation request is a valid request, obtain the initial data file corresponding to the file receiving parameters, and parse the initial data file according to the file parsing parameters to obtain file parsing data; process the file parsing data according to the file processing parameters to obtain file processing data; format the file processing data according to the file generation parameters to obtain the target file corresponding to the file generation request. The present invention proposes a flexible and efficient file dynamic parsing and processing scheme. On the one hand, the file generation request is generated based on the file configuration parameters entered on the visual configuration page, and customized data processing can be performed according to the actual needs of the user, thereby generating a new file that meets the standard or personalized requirements, greatly improving the flexibility of file processing and improving the user experience. On the other hand, the present invention can automatically extract, verify, convert and integrate the data in the file based on the file receiving parameters, file parsing parameters, file processing parameters and file generation parameters, ensure the accuracy and integrity of the data, improve the efficiency of file processing, and help to achieve more efficient and accurate data management and business operations. BRIEF DESCRIPTION OF THE DRAWINGS

[0009] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative labor.

[0010] Figure 1 is a flowchart of a file generation method in one embodiment of the present invention; Figure 2 is a flow chart of step S10 in the file generation method in one embodiment of the present invention; Figure 3 is a flow chart of step S20 in the file generation method in one embodiment of the present invention; Figure 4 is another flow chart of step S20 in the file generation method in one embodiment of the present invention; Figure 5 is another flow chart of step S20 in the file generation method in one embodiment of the present invention; Figure 6 is a flow chart of step S30 in the file generation method in one embodiment of the present invention; Figure 7 is a flow chart of step S40 in the file generation method in one embodiment of the present invention; Figure 8 is a structural schematic diagram of a file generating device in one embodiment of the present invention; Fig. 9 is a schematic diagram of a computer device in one embodiment of the present invention. DETAILED DESCRIPTION

[0011] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0012] The file generation method provided in this embodiment can be applied to application scenarios in which new files are generated on demand based on a file processing system. The file processing system is used to perform flexible data processing and output the processed files according to the actual needs of the user, and is mainly composed of two parts: a hardware platform and a software application. The hardware platform serves as a support, including high-performance servers, storage devices, and network communication devices to ensure the stable operation of the file system and efficient data transmission. The software application is installed on the server, and the user can interact with the server through a graphical user interface (GUI). The server can be divided into a file parsing engine, a rule configurator, a processing core, and a file generator according to its function. The various components of the file processing system are closely connected and work together to complete the dynamic parsing and on-demand generation tasks of the file, ensuring that even when processing large-scale file data, an efficient processing speed can be maintained. Among them, the file parsing engine is used to receive or retrieve external input files and parse the file content into a processable data structure; the rule configurator allows users to define data processing rules according to their needs, such as data screening, conversion logic, etc.; the processing core, as the core brain of the system, performs corresponding processing on the parsed data according to the instructions of the rule configurator; finally, the file generator generates a new file with the processing results in the format specified by the user, and outputs it to the specified location for the user to download or further edit. This embodiment can not only intelligently identify and dynamically parse multiple file formats, but also perform deep customized configuration according to the actual needs of users, ensuring that the final generated file meets both standards and personalized requirements.

[0013] In actual application scenarios, the hardware part follows the compact and efficient standard server rack design, while the software part is presented in an intuitive and easy-to-use GUI with a clear interface layout and clear functional module partitions for easy user operation. On the visual interface of the software, each functional component is displayed in the form of an icon or panel, such as the file parsing engine represented by a folder icon, and the rule configurator is displayed as a gear or table icon, which intuitively reflects its functional characteristics. The visual interface provides non-technical users with an intuitive and easy-to-use configuration interface to define and configure file processing requirements. Users can clearly see the configured rules, thereby achieving transparency in file processing and improving user experience. This design not only lowers the technical threshold, but also promotes cross-departmental collaboration, making file processing a smoother and more efficient part of enterprise data management and business operations. The various links of the file processing system communicate through internal API interfaces or message queues to ensure the smooth flow of data in the system. In addition, the file processing system also has built-in error handling and logging mechanisms to monitor and record abnormal situations that may occur in each link to ensure the stability and reliability of the file processing system.

[0014] In one embodiment, if Figure 1 As shown, a file generation method is provided, comprising the following steps S10-S40: S10. Obtain a file generation request including file configuration parameters; the file configuration parameters include file receiving parameters, file parsing parameters, file processing parameters and file generation parameters.

[0015] Understandably, the file generation request is information received by the server for requesting to trigger the task of dynamic parsing and on-demand generation of files. The file configuration parameters are configuration parameters contained in the file generation request for characterizing the file generation requirements. When executing the task of dynamic parsing and on-demand generation of files, the entire processing flow can be divided into four stages: "receiving, parsing, processing, and generating", and the corresponding file configuration parameters include file receiving parameters, file parsing parameters, file processing parameters, and file generation parameters. Among them, the file receiving parameters are specific parameters for defining how to receive files, which may include file sources (such as local file systems, network addresses, and databases), file types, receiving time, etc. The file parsing parameters are specific parameters for defining how to parse received files, which may include parsing formats (such as CSV, XML, and JSON), parsing rules (such as column delimiters and row delimiters), etc. The file processing parameters are specific parameters for defining how to process the parsed data, which may include data conversion (such as data type conversion and data cleaning), data aggregation (such as grouping and sorting), etc. The file generation parameters are specific parameters for defining how to generate the final file, which may include output formats (such as Excel, PDF, and HTML), output paths, file names, etc.

[0016] In one embodiment, if Figure 2 As shown, in step S10, that is, obtaining a file generation request, includes: S101, after detecting that a parameter input operation is triggered in a visualization configuration page, obtaining file receiving parameters associated with a receiving configuration area, file parsing parameters associated with a parsing configuration area, file processing parameters associated with a processing configuration area, and file generation parameters associated with a generation configuration area entered in the visualization configuration page during the parameter input operation; S102: Generate the file generation request according to the file receiving parameter, the file parsing parameter, the file processing parameter and the file generation parameter.

[0017] Understandably, in the process of obtaining a file generation request, it is necessary to first receive the file configuration parameters entered based on the visualization configuration page. The file configuration parameters are the basis for constructing a file generation request, and cover the entire process of dynamic parsing and on-demand generation of files, that is, from receiving, parsing, processing to generation. The visualization configuration page is a configuration page that allows users to enter parameters in a graphical manner. The visualization configuration page contains multiple configuration areas, each of which corresponds to a different file processing stage. That is, the receiving configuration area is a page area for users to input requirements for the file receiving stage, the parsing configuration area is a page area for users to input requirements for the file parsing stage, the processing configuration area is a page area for users to input requirements for the file processing stage, and the generation configuration area is a page area for users to input requirements for the file generation stage.

[0018] When the user inputs parameters through the fill-in bar of the visual configuration page, the server can detect these parameter input operations and obtain the parameter values ​​input by the user. After obtaining the file receiving parameters associated with the receiving configuration area, the file parsing parameters associated with the parsing configuration area, the file processing parameters associated with the processing configuration area, and the file generation parameters associated with the generation configuration area, the file receiving parameters, the file parsing parameters, the file processing parameters, and the file generation parameters are assembled and processed to obtain a file generation request.

[0019] In this embodiment, users can adjust the parameters and rules of different stages according to actual needs and enjoy customized data processing and file generation services. The server promptly receives file reception parameters, file parsing parameters, file processing parameters and file generation parameters and assembles them into a file generation request, ensuring the integrity of the parameters.

[0020] S20. When confirming that the file generation request is a valid request, obtaining an initial data file corresponding to the file receiving parameter, and parsing the initial data file according to the file parsing parameter to obtain file parsing data.

[0021] Understandably, after obtaining the file generation request, and before starting the file generation method process of the four stages of "receiving, parsing, processing, and generating" in response to the file generation request, it is necessary to first determine whether the file generation request is a valid request. A valid request means that the parameters contained in the file generation request are complete and executable. When it is confirmed that the file generation request is a valid request, the initial data file corresponding to the file reception parameters is obtained, and the initial data file is parsed according to the file parsing parameters to obtain file parsing data. The initial data file refers to unprocessed raw data and files, which may come from various sources, such as sensor data, user input, network links, etc. The initial data file is the starting point of the file generation method process, and the file parsing data refers to the data obtained after the initial data file is parsed.

[0022] In one embodiment, if Figure 3 As shown, in step S20, that is, confirming that the file generation request is a valid request, includes: S201, performing content verification on the file receiving parameters, file parsing parameters, file processing parameters and file generating parameters to determine whether any parameters are missing; and performing format verification on the file receiving parameters, file parsing parameters, file processing parameters and file generating parameters to determine whether any parameter format errors exist; S202: If there is no missing parameter or parameter format error, confirm that the file generation request is a valid request.

[0023] Understandably, when judging whether a file generation request is a valid request, two aspects of judgment are mainly performed. On the one hand, various parameters are judged through content verification to determine whether there are any missing parameters (the integrity of file reception parameters, file parsing parameters, file processing parameters, and file generation parameters). On the other hand, format verification is performed to determine whether various parameters have parameter format errors (the executable nature of file reception parameters, file parsing parameters, file processing parameters, and file generation parameters). When there is neither missing parameters nor parameter format errors, the file generation request is confirmed to be a valid request. In actual applications, dynamic rule support and enhanced error handling mechanisms can be introduced so that verification rules can be adjusted according to specific needs and scenarios. For example, customize which parameters are optional and which parameters are required; for another example, the format rules of certain parameters may need to be customized according to the characteristics of the input data.

[0024] The purpose of content verification is to check whether all necessary parameters have been provided, that is, to determine whether there are any missing parameters. First, it is necessary to clarify which parameters are required in the file generation process. The required parameters are usually pre-defined based on the file generation process. Then, traverse the file receiving parameters, file parsing parameters, file processing parameters, and file generation parameters in the file generation request to check whether each required parameter has been provided. When any required parameter is missing, the content verification fails, and the file generation request is confirmed to be an invalid request. An invalid request is a request that is the opposite of a valid request, indicating that the parameters contained in the file generation request are incomplete or unexecutable.

[0025] The purpose of format verification is to ensure that each parameter meets the expected format requirements, that is, to determine whether there are any parameter format errors. Different types of parameters have different formats. For each parameter, its corresponding format requirements need to be defined in advance. These rules can be based on data types (such as date format, email format, etc.), integer ranges, string length limits, etc. Traverse the file receiving parameters, file parsing parameters, file processing parameters, and file generation parameters in the file generation request to check whether each parameter meets the corresponding format requirements. When any parameter does not meet the corresponding format requirements, the format verification fails, and the file generation request is confirmed to be an invalid request.

[0026] This embodiment introduces dynamic rule support and an enhanced error handling mechanism to perform verification from both content verification and format verification, which can accurately confirm the validity of the file generation request, significantly improve the reliability of file processing, and ensure the smooth progress of subsequent processing procedures.

[0027] In one embodiment, if Figure 4 As shown, in step S20, that is, obtaining the initial data file corresponding to the file receiving parameter, includes: S203, performing parameter parsing processing on the file receiving parameters to obtain data source configuration information and receiving condition information; S204: Determine a target data source according to the data source configuration information, and perform data call processing on the target data source according to the receiving condition information to obtain the initial data file.

[0028] Understandably, the file receiving parameters are subjected to parameter parsing processing, and the data source configuration information and receiving condition information can be extracted from the file receiving parameters. During the extraction process, it is necessary to identify which of the file receiving parameters are related to the data source configuration and which are related to the receiving conditions, for example, by distinguishing by parameter name, parameter value or parameter structure. The server can determine the target data source based on the data source configuration information and establish a connection with the target data source, such as opening a database connection, accessing a file system or a network service, etc. Then, the target data source is subjected to data call processing according to the triggering method of the receiving condition information to obtain the initial data file.

[0029] Data source configuration information is information used to characterize the source of the original file, such as data source type, server address, account, file pull path, etc. For example, when a user enters "sftp server" in the data source type column, "www.fql.com" in the server address column, "19022" in the sftp port column, "fenqile" in the sftp account column, "123456" in the sftp password column, and " / upload / order / " in the sftp pull path column, the set of these inputs constitutes the data source configuration information.

[0030] The receiving condition information is information used to characterize the file call trigger mode, such as timed trigger or real-time trigger. When the timed trigger mode is adopted, the Cron expression is used to define the execution time of the scheduled task. Specifically, the Cron expression consists of six fields separated by spaces, each of which represents a different time unit "[seconds] [minutes] [hours] [days] [months] [years]". For example, "0 0 / 5 xxx ?" means execution every 5 minutes, "0 0 10 ? xx" means execution at 10 am every day, "0 0 0 1 x ?" means execution at noon on the first day of each month, and "0 0 / 10 9-10 ? xx" means execution every 10 minutes between 9:00 and 10:00 am every day. In addition, the receiving condition information also includes the data range of the received file, for example, "0 days before ~ ​​0 days after" means the data file generated by the server today.

[0031] This embodiment can accurately obtain the initial data file corresponding to the file receiving parameters, provide necessary data support for the subsequent processing flow, and at the same time, data security can be guaranteed based on parameter parsing processing.

[0032] In one embodiment, if Figure 5 As shown, in step S20, the initial data file is parsed according to the file parsing parameters to obtain file parsing data, including: S205, performing parameter parsing processing on the file parsing parameters to obtain file content extraction rules; S206: Perform content extraction processing on the initial data file according to the file content extraction rule to obtain the file parsing data.

[0033] Understandably, after obtaining the initial data file, it is necessary to further parse the file parsing parameters, and generate a series of file content extraction rules based on the parameter information obtained by parsing. File content extraction rules refer to a series of requirements for extracting specific information from the initial data file according to specific requirements or standards, which can be defined based on data structure, data format, keywords, field names, positions or other features. Specifically, the fill bar in the parsing configuration area defines the relevant configuration of the file extraction process, and the user can select "whether to index the file", "whether to compress and encrypt", etc. as needed. When extracting the file content, the specific content is extracted according to the user's selection of "whether to skip the file header", "whether to skip the file tail", and "whether to separate". When "whether to skip the file header" is "yes", it means that the first line is used as the table header and is not extracted. When "whether to skip the file tail" is "yes", it means that the last line is used as the table tail and is not extracted. "Whether to need a separator" indicates the matters of content extraction of the file, which is further divided into "separator", "index value", "separation key description", "separation key" and "whether to merge keys". Among them, "delimiter" is used to define which characters are used as delimiters for each row. For example, in the screenshot, "@!@" is used as the delimiter. For example, when parsing a row of data, "column A@!@column B@!@column C" means that the three field values ​​of column A, column B, and column C can be obtained. "Index value" is used to define the specific column number to be extracted. For example, index value = 5 means to extract the 5th column of the data table. "Separator key" is used to redefine the name of the parsed data column. If the subsequent processing needs to reference this column of data value, the separator key value can be used. Through content extraction processing, the file parsing data is finally obtained to meet the needs of subsequent processing steps.

[0034] This embodiment obtains file content extraction rules based on file parsing parameters. The file content extraction rules can ensure that the required data is accurately extracted from the initial data file, thereby obtaining file parsing data with a clear structure that is easy to analyze and use, which is helpful for subsequent data processing and file generation.

[0035] S30: Process the file parsing data according to the file processing parameters to obtain file processing data.

[0036] In one embodiment, if Figure 6As shown, in step S30, that is, processing the file parsing data according to the file processing parameters to obtain file processing data, includes: S301, performing parameter parsing processing on the file processing parameters to generate at least one processing task and task sorting information corresponding to each processing task; S302: Perform data processing operations corresponding to the processing tasks on the file parsing data according to the task sorting information, so that the file processing data is obtained after all the processing tasks are completed.

[0037] Understandably, after obtaining the file parsing data, it is necessary to further parse the file processing parameters, which contain specific task instructions on how to process the file parsing data, as well as the dependencies and execution order between these tasks. Based on the parameter information obtained by parsing, one or more processing tasks and task sorting information corresponding to each processing task are generated. A processing task refers to the descriptive information of performing data processing operations on file parsing data. Each task corresponds to a specific data processing operation, such as string replacement, numerical calculation, data deduplication, etc. Task sorting information is serial number information used to characterize the execution order of different processing tasks.

[0038] Specifically, the fill bar in the processing configuration area defines the relevant configuration of the file processing process, and the user can enter specific "processing type", "sort", etc. as needed. After the file processing parameters are parsed, the processing task is generated according to the parameters in the "processing type" column, and the task sorting information corresponding to the processing task is generated according to the parameters in the "sorting" column. Specifically, when the user enters "field query" in the "processing type" column, "1" in the "sorting" column, "order number" in the "field" column, and "bank Order: ${1}" in the "field input parameter" column, the processing task after the file processing parameters are parsed is "call the field system to query the field value of the order number, and use the queried order number as the first column of the file processing data", and the task sorting information is the first task. Further, continue to perform data processing operations corresponding to the processing tasks with a lower sorting on the file parsing data according to the task sorting information, and splice the data of the subsequent processing tasks into the file processing data until all processing tasks are completed to obtain the final file processing data.

[0039] This embodiment parses the specified task dependencies and execution order based on the file processing parameters, generates processing tasks and task sorting information corresponding to the processing tasks, which helps to ensure that when processing file parsing data, each task is executed in the correct order, and can complete complex processing flows quickly and orderly, and obtain file processing data that meets the requirements.

[0040] S40: Format the file processing data according to the file generation parameters to obtain a target file corresponding to the file generation request.

[0041] In one embodiment, if Figure 7 As shown, in step S40, the file processing data is formatted according to the file generation parameters to obtain a target file corresponding to the file generation request, including: S401, performing parameter parsing processing on the file generation parameters to obtain target format information and target address information; S402: Format the file processing data according to the target format information to obtain the target file, and save the target file according to the target address information.

[0042] Understandably, after acquiring the file processing data, it is necessary to further parse and process the file generation parameters, which contain specific instructions on how to format the file processing data and where to save the formatted target file, that is, the parsed file generation parameters include target format information and target address information. Among them, formatting is the process of converting the data format; the target file is a new file that meets the user's needs after the initial data file is processed through the entire process; the target format information is the format requirement information used to characterize the target file; the target address information is the storage location requirement information used to characterize the target file, which may be a local file path, a network storage address, or a URL of a cloud storage service, etc.

[0043] Specifically, the fill-in bars in the generation configuration area define the relevant configurations of the file generation process. Users can enter specific "routing rules", "output path and file name", "final record format" and "upload server address" as needed. Among them, the "routing rules" and "output path and file name" are used in combination, indicating that if the judgment conditions of the "routing rules" are met, the data of the "output path and file name" is determined. After the file generation parameters are parsed, the target format information is generated according to the parameters in the "routing rules", "output path and file name" and "final record format" columns, and the target address information is generated according to the parameters in the "upload server address" column. For example, when the user enters "key3==00&&key4==105600" in the "routing rules" column, enters " / download / nj30 / ${yesterday_date_yyyyMMdd}" in the "output path and file name" column, and enters " / download / nj30 / ${yesterday_date_yyyyMMdd}" in the "final record format" column. If you enter “#{key1},#{key2},#{key0},#{key4}” in the “Upload server address” column and “example.fql.com” in the “Upload server address” column, you need to convert the file processing data in “ / download / nj30 / ${yesterday_date_yyyyMMdd}” into the “#{key1},#{key2},#{key0},#{key4}” format to generate a target file, and upload the target file to the server of “example.fql.com”.

[0044] This embodiment parses the target format information and target address information based on the file generation parameters, can accurately generate a new file in the format specified by the user, and save the newly generated target file to a specified location, making it convenient for the user to download or further edit and use it, thereby improving the user experience.

[0045] This embodiment obtains a file generation request including file configuration parameters; the file configuration parameters include file receiving parameters, file parsing parameters, file processing parameters and file generation parameters; when confirming that the file generation request is a valid request, obtains the initial data file corresponding to the file receiving parameters, and parses and processes the initial data file according to the file parsing parameters to obtain file parsing data; processes the file parsing data according to the file processing parameters to obtain file processing data; formats the file processing data according to the file generation parameters to obtain the target file corresponding to the file generation request. This embodiment proposes a flexible and efficient file dynamic parsing and processing solution. On the one hand, the file generation request is generated based on the file configuration parameters entered in the visual configuration page, and customized data processing can be performed according to the actual needs of the user, which improves the flexibility of data processing and also improves the user experience. On the other hand, this embodiment can automatically extract, verify, convert and integrate the data in the file based on the file receiving parameters, file parsing parameters, file processing parameters and file generation parameters to ensure the accuracy and integrity of the data and improve the efficiency of file processing. In addition, the file processing system also supports dynamic expansion of new file format parsers and processing functions to adapt to the ever-changing file generation needs and maintain a high degree of flexibility and scalability.

[0046] It should be understood that the order of execution of the steps in the above embodiment does not necessarily mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiment of the present invention.

[0047] In one embodiment, a file generation device is provided, which corresponds one-to-one to the file generation method in the above embodiment. Figure 8 As shown, the file generation device includes a request acquisition module 10, a file parsing module 20, a file processing module 30 and a target file generation module 40. The functional modules are described in detail as follows: A request acquisition module 10, used to acquire a file generation request including file configuration parameters; the file configuration parameters include file receiving parameters, file parsing parameters, file processing parameters and file generation parameters; The file parsing module 20 is used to obtain an initial data file corresponding to the file receiving parameter when confirming that the file generation request is a valid request, and parse the initial data file according to the file parsing parameter to obtain file parsing data; A file processing module 30, used to process the file parsing data according to the file processing parameters to obtain file processing data; The target file generation module 40 is used to format the file processing data according to the file generation parameters to obtain a target file corresponding to the file generation request.

[0048] In one embodiment, the request acquisition module 10 includes: A parameter acquisition unit, configured to, after detecting that a parameter input operation is triggered in a visualization configuration page, acquire file receiving parameters associated with a receiving configuration area, file parsing parameters associated with a parsing configuration area, file processing parameters associated with a processing configuration area, and file generation parameters associated with a generation configuration area, which are entered in the visualization configuration page during the parameter input operation; The request generating unit is used to generate the file generating request according to the file receiving parameter, the file parsing parameter, the file processing parameter and the file generating parameter.

[0049] In one embodiment, the file parsing module 20 includes: A parameter checking unit is used to perform content checking on the file receiving parameters, file parsing parameters, file processing parameters and file generating parameters to determine whether any parameters are missing; and perform format checking on the file receiving parameters, file parsing parameters, file processing parameters and file generating parameters to determine whether any parameter format errors exist; The request validity confirmation unit is used to confirm that the file generation request is a valid request if there is no missing parameter and no parameter format error.

[0050] In one embodiment, the file parsing module 20 further includes: A receiving parameter parsing unit, used to perform parameter parsing processing on the file receiving parameters to obtain data source configuration information and receiving condition information; The initial data file acquisition unit is used to determine the target data source according to the data source configuration information, and perform data call processing on the target data source according to the receiving condition information to obtain the initial data file.

[0051] In one embodiment, the file parsing module 20 further includes: A parsing parameter parsing unit, used to perform parameter parsing processing on the file parsing parameters to obtain file content extraction rules; The file parsing data acquisition unit is used to perform content extraction processing on the initial data file according to the file content extraction rule to obtain the file parsing data.

[0052] In one embodiment, the file processing module 30 includes: A processing parameter parsing unit, used for performing parameter parsing on the file processing parameters, generating at least one processing task and task sorting information corresponding to each processing task; The file processing data acquisition unit is used to perform data processing operations corresponding to the processing tasks on the file parsing data according to the task sorting information, so that the file processing data is obtained after all the processing tasks are completed.

[0053] In one embodiment, the target file generation module 40 includes: A generation parameter parsing unit is used to perform parameter parsing processing on the file generation parameters to obtain target format information and target address information; The target file generating unit is used to format the file processing data according to the target format information to obtain the target file, and save the target file according to the target address information.

[0054] For the specific definition of the file generation device, please refer to the definition of the file generation method above, which will not be repeated here. Each module in the above-mentioned file generation device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.

[0055] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig. 9 As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a readable storage medium and an internal memory. The readable storage medium stores an operating system, computer-readable instructions and a database. The internal memory provides an environment for the operation of the operating system and computer-readable instructions in the readable storage medium. The database of the computer device is used to store data involved in the file generation method. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer-readable instructions are executed by the processor, a file generation method is implemented. The readable storage medium provided in this embodiment includes a non-volatile readable storage medium and a volatile readable storage medium.

[0056] In one embodiment, a computer device is provided, including a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, wherein the processor executes the computer-readable instructions to implement the following steps: Obtaining a file generation request including file configuration parameters; the file configuration parameters include file receiving parameters, file parsing parameters, file processing parameters and file generation parameters; When confirming that the file generation request is a valid request, obtaining an initial data file corresponding to the file receiving parameter, and parsing the initial data file according to the file parsing parameter to obtain file parsing data; Processing the file parsing data according to the file processing parameters to obtain file processing data; The file processing data is formatted according to the file generation parameters to obtain a target file corresponding to the file generation request.

[0057] In one embodiment, one or more computer-readable storage media storing computer-readable instructions are provided. The readable storage media provided in this embodiment include non-volatile readable storage media and volatile readable storage media. The readable storage media store computer-readable instructions, and when the computer-readable instructions are executed by one or more processors, the following steps are implemented: Obtaining a file generation request including file configuration parameters; the file configuration parameters include file receiving parameters, file parsing parameters, file processing parameters and file generation parameters; When confirming that the file generation request is a valid request, obtaining an initial data file corresponding to the file receiving parameter, and parsing the initial data file according to the file parsing parameter to obtain file parsing data; Processing the file parsing data according to the file processing parameters to obtain file processing data; The file processing data is formatted according to the file generation parameters to obtain a target file corresponding to the file generation request.

[0058] A person of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiments can be implemented by instructing the relevant hardware through computer-readable instructions. The computer-readable instructions can be stored in a non-volatile readable storage medium or a volatile readable storage medium. When the computer-readable instructions are executed, they can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided by the present invention may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0059] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.

[0060] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.

Claims

1. A file generation method, characterized in that: include: Obtaining a file generation request including file configuration parameters; the file configuration parameters include file receiving parameters, file parsing parameters, file processing parameters and file generation parameters; When confirming that the file generation request is a valid request, obtaining an initial data file corresponding to the file receiving parameter, and parsing the initial data file according to the file parsing parameter to obtain file parsing data; Processing the file parsing data according to the file processing parameters to obtain file processing data; The file processing data is formatted according to the file generation parameters to obtain a target file corresponding to the file generation request.

2. The file generation method according to claim 1, characterized in that: Before obtaining the file generation request including the file configuration parameters, the method includes: After detecting that a parameter input operation is triggered in the visualization configuration page, obtaining the file receiving parameters associated with the receiving configuration area, the file parsing parameters associated with the parsing configuration area, the file processing parameters associated with the processing configuration area, and the file generation parameters associated with the generation configuration area entered in the visualization configuration page during the parameter input operation; The file generation request is generated according to the file receiving parameters, the file parsing parameters, the file processing parameters and the file generation parameters.

3. The file generation method according to claim 1, characterized in that: The confirming that the file generation request is a valid request includes: Performing content verification on the file receiving parameters, file parsing parameters, file processing parameters and file generation parameters to determine whether any parameters are missing; and performing format verification on the file receiving parameters, file parsing parameters, file processing parameters and file generation parameters to determine whether any parameter format errors exist; If there is no missing parameter or parameter format error, the file generation request is confirmed to be a valid request.

4. The file generation method according to claim 1, characterized in that: The obtaining of the initial data file corresponding to the file receiving parameter comprises: Performing parameter parsing processing on the file receiving parameters to obtain data source configuration information and receiving condition information; The target data source is determined according to the data source configuration information, and data call processing is performed on the target data source according to the receiving condition information to obtain the initial data file.

5. The file generation method according to claim 1, characterized in that: The parsing of the initial data file according to the file parsing parameters to obtain file parsing data includes: Performing parameter parsing processing on the file parsing parameters to obtain file content extraction rules; The initial data file is subjected to content extraction processing according to the file content extraction rule to obtain the file parsing data.

6. The file generation method according to claim 1, characterized in that: The step of processing the file parsing data according to the file processing parameters to obtain the file processing data includes: Performing parameter parsing processing on the file processing parameters to generate at least one processing task and task sorting information corresponding to each processing task; According to the task sorting information, a data processing operation corresponding to the processing task is performed on the file parsing data, so that the file processing data is obtained after all the processing tasks are completed.

7. The file generation method according to claim 1, characterized in that: The step of formatting the file processing data according to the file generation parameters to obtain a target file corresponding to the file generation request includes: Performing parameter parsing processing on the file generation parameters to obtain target format information and target address information; The file processing data is formatted according to the target format information to obtain the target file, and the target file is saved according to the target address information.

8. A file generating device, characterized in that: include: A request acquisition module, used to acquire a file generation request including file configuration parameters; the file configuration parameters include file receiving parameters, file parsing parameters, file processing parameters and file generation parameters; A file parsing module, configured to obtain an initial data file corresponding to the file receiving parameter when confirming that the file generation request is a valid request, and parse the initial data file according to the file parsing parameter to obtain file parsing data; A file processing module, used for processing the file parsing data according to the file processing parameters to obtain file processing data; The target file generation module is used to format the file processing data according to the file generation parameters to obtain a target file corresponding to the file generation request.

9. A computer device comprising a memory, a processor, and computer-readable instructions stored in the memory and executable on the processor, characterized in that: When the processor executes the computer-readable instructions, the file generation method according to any one of claims 1 to 7 is implemented.

10. A computer-readable storage medium storing computer-readable instructions, characterized in that: When the computer-readable instructions are executed by one or more processors, the one or more processors are caused to perform the file generation method according to any one of claims 1 to 7.