A file processing method and device, electronic equipment and storage medium
By defining file processing records and events through configuration, the problem of low development efficiency in accounting file processing in multimodal online financial scenarios is solved, and efficient file processing logic development and quality management are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHANGHAI PUDONG DEVELOPMENT BANK
- Filing Date
- 2022-09-21
- Publication Date
- 2026-04-17
AI Technical Summary
In multimodal online financial scenarios, the accounting document processing process is cumbersome and highly varied, requiring developers to develop unique document processing logic for each product, which seriously affects development efficiency.
By using a configuration-based approach, target records and events can be determined from pre-configured file processing configuration records based on task identifiers and file types, enabling differentiated and diversified file processing processes and reducing development workload.
It improves development efficiency, ensures product quality management, and adapts to the accounting document requirements in multimodal online financial scenarios.
Smart Images

Figure CN115481090B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of document processing technology, and in particular to a document processing method, apparatus, electronic device and storage medium. Background Technology
[0002] With the rapid development and popularization of mobile internet and smart devices, online lending products (hereinafter referred to as "products") have developed rapidly.
[0003] Faced with the pressure of competition from peers, the demand for products is increasing rapidly, and product managers are demanding higher and higher delivery speeds. This has led to developers needing to respond quickly to the development needs of various products.
[0004] However, the processing procedures for accounting documents involved in various products are quite complicated and may differ. This means that for each new product, developers need to develop a unique set of document processing logic for that product, and the large amount of development work seriously affects development efficiency. Summary of the Invention
[0005] This invention provides a file processing method, apparatus, electronic device, and storage medium to reduce the development workload of file processing logic and thereby improve development efficiency.
[0006] According to one aspect of the present invention, a file processing method is provided, which may include:
[0007] In response to a task execution command, the target task to be executed is initiated, and the following steps are performed by executing the target task:
[0008] Retrieve at least one pre-configured file processing configuration record and at least one file processing event;
[0009] Based on the task identifier of the target task, determine the target record from at least one file processing configuration record, and obtain the file type of the target file to be processed from the target record;
[0010] Based on the task identifier of the target task and the file type of the target file, a target event for processing the target file is determined from at least one file processing event, and the target file is processed by executing the target event.
[0011] According to another aspect of the present invention, a document processing apparatus is provided, which may include:
[0012] The target task execution module is used to respond to the task execution command, launch the target task to be executed, and perform the following steps by executing the target task;
[0013] The event acquisition module is used to acquire at least one pre-configured file processing configuration record and at least one file processing event.
[0014] The file type acquisition module is used to determine the target record from at least one file processing configuration record based on the task identifier of the target task, and obtain the file type of the target file to be processed from the target record;
[0015] The target file processing module is used to determine the target event for processing the target file from at least one file processing event based on the task identifier of the target task and the file type of the target file, and to process the target file by executing the target event.
[0016] According to another aspect of the present invention, an electronic device is provided, which may include:
[0017] At least one processor; and
[0018] A memory that is communicatively connected to at least one processor; wherein,
[0019] The memory stores a computer program that can be executed by at least one processor, such that when the at least one processor executes the program, it implements the file processing method provided in any embodiment of the present invention.
[0020] According to another aspect of the present invention, a computer-readable storage medium is provided having computer instructions stored thereon for causing a processor to execute and implement the file processing method provided in any embodiment of the present invention.
[0021] The technical solution of this invention, in response to a task execution instruction, initiates a target task to be executed and implements the following file processing logic by executing the target task: Based on the task identifier of the target task, a target record representing the target file to be processed is determined from at least one pre-configured file processing configuration record, and the file type of the target file is obtained from the target record; furthermore, based on the task identifier and the file type, a target event for processing the target file is determined from at least one pre-configured file processing event, and the target file is processed by executing the target event. This technical solution, when developing new file processing logic, can be implemented through a configurable approach. That is, based on the processing architecture of tasks and file processing events, and under the role of standardized file processing configuration records, a differentiated, diversified, and personalized file processing process is achieved through a configurable approach. This reduces development workload, improves development efficiency, and facilitates product quality management, effectively solving the accounting file requirements problem in multimodal online financial scenarios.
[0022] It should be understood that the description in this section is not intended to identify key or important features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description
[0023] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0024] Figure 1 This is a flowchart of a file processing method provided according to an embodiment of the present invention;
[0025] Figure 2 This is a schematic diagram illustrating the relationship between tasks and file processing events in a file processing method provided by an embodiment of the present invention;
[0026] Figure 3 This is a flowchart of another file processing method provided according to an embodiment of the present invention;
[0027] Figure 4 This is a schematic diagram illustrating the function of the file processing configuration table in another file processing method provided according to an embodiment of the present invention;
[0028] Figure 5 This is a flowchart of another file processing method provided according to an embodiment of the present invention;
[0029] Figure 6 This is a schematic diagram illustrating the concurrent execution of multiple tasks in another file processing method provided by an embodiment of the present invention;
[0030] Figure 7 This is a structural block diagram of a document processing apparatus provided according to an embodiment of the present invention;
[0031] Figure 8 This is a schematic diagram of the structure of an electronic device that implements the file processing method of the present invention. Detailed Implementation
[0032] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.
[0033] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. The same applies to "target," "original," etc., and will not be repeated here. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0034] Figure 1 This is a flowchart of a file processing method provided in an embodiment of the present invention. This embodiment is applicable to situations where files are processed using file processing logic obtained in a configurable manner, and is particularly applicable to situations where files are generated in batches using file generation logic obtained in a configurable manner. This method can be executed by the file processing apparatus provided in this embodiment of the present invention, which can be implemented in software and / or hardware, and can be integrated into an electronic device, which can be various user terminals or servers.
[0035] See Figure 1 The method of this invention specifically includes the following steps:
[0036] S110. In response to the task execution instruction, start the target task to be executed, and perform the following steps by executing the target task.
[0037] The task execution instruction can be understood as an instruction to begin executing a task. In this embodiment of the invention, the task execution instruction can optionally be generated in various ways. For example, it can be generated when the current time is a preset time, i.e., the task execution instruction can be automatically generated at a fixed time. Alternatively, it can be generated when a trigger operation is received on a pre-set physical button or virtual control used to generate the task execution instruction. This trigger operation can be a pressing operation or a clicking operation, etc. The method of generating the task execution instruction is related to the actual application scenario and is not specifically limited here.
[0038] In response to the task execution command, the target task to be executed is initiated. If at least one task is pre-configured, the target task can be understood as a task among the at least one tasks that has an execution requirement; it can be a part or all of the at least one task. In this embodiment of the invention, optionally, each of the at least one task corresponds to its own file processing scope. Therefore, the task can be used to process part or all of the files within its corresponding file processing scope. The specific file processing logic can be set when configuring the task. Considering the application scenarios that may be involved in this embodiment of the invention, optionally, taking any task as an example, the task can correspond to one or more products. Any product may involve one or more files. The files involved in each product may be completely identical, partially identical, or completely different. Therefore, the file processing scope corresponding to this task can be understood as the union of the files involved in each product.
[0039] Execute the target task so that the corresponding file can be processed based on the file processing logic corresponding to the target task. The specific file processing logic is as described in the following steps.
[0040] S120: Obtain at least one pre-configured file processing configuration record and at least one file processing event.
[0041] The file processing configuration record can be understood as a pre-configured record representing the content of a specific file. In practical applications, this file processing configuration record may optionally include at least one of the following fields: product code, cooperation platform, task identifier, file type, file target path, and activation identifier. Specifically, if the file is a file under a specific product, the product code can be understood as the identifier of the product; the cooperation platform can be understood as the platform that needs to be cooperated with to sell the product; the task identifier can be understood as the identifier of the task used to process the file; the file type can be understood as the type of the file, such as a loan disbursement detail file or a repayment detail file. Typically, a file type corresponds to a file processing event; in other words, to some extent, the file type determines the file content; the file target path can be understood as the path used to store the file; and the activation identifier can be used to indicate whether the file needs to be processed. Based on this, optionally, the file processing scope of the product can be determined based on the cooperation platform and the file type, or the file processing scope of the corresponding task, or the scope of events included, can be determined based on the task identifier.
[0042] Retrieve at least one pre-configured file processing configuration record. Any two file processing configuration records in this record may represent files belonging to the same or different products; no specific limitation is made here. For example, if the at least one file processing configuration record is stored in the same file processing configuration table, it can be assumed that the file processing configuration table stores file processing configuration records for all files involved in all products. That is, the personalized and differentiated content for each product can be configured through this file processing configuration table.
[0043] File processing events can be understood as pre-configured events used to process the file corresponding to that file. Specific processing methods can include creating or deleting the file, or adding, deleting, modifying, or querying the file's content, etc., without specific limitations. At least one file processing event is obtained so that, in conjunction with subsequent steps, one or more file processing events can be selected from these at least one file processing event to process the corresponding file.
[0044] Building upon this, to better understand the configuration process for tasks and file processing events, and the relationship between them, the following examples illustrate this process. For example, see [link to example]. Figure 2 A task can consist of one or more file processing events, and a file processing event can belong to only one task. A file processing event can correspond to a file processing logic; taking file generation logic as an example, this includes the corresponding filename, field content, field separator, and whether compression is enabled. Tasks can be configured through a task parameter configuration table, which can include task identifier, task execution class, earliest start time, latest start time, number of task processing events, and enable flag. File processing events can be configured through an event parameter configuration table, which can include event identifier, belonging task identifier (i.e., the task identifier of the task it belongs to), event execution class, execution sequence number, filename, file separator, whether file compression is enabled, and enable flag. The event parameters of any file processing event can be understood as the input parameters of the file processing logic corresponding to that file processing event, allowing the file processing logic to determine how to process the file based on the input parameters. Tasks and the one or more file processing events constituting a task can be associated through task identifiers; this architecture facilitates the rapid processing of batch files.
[0045] S130. Based on the task identifier of the target task, determine the target record from at least one file processing configuration record, and obtain the file type of the target file to be processed from the target record.
[0046] Specifically, based on the task identifier of the target task, a target record is determined from at least one file processing configuration record. The file represented by this target record (i.e., the target file corresponding to this target record among all files corresponding to the at least one file processing configuration record) can be understood as a file that can be processed by executing the target task. As shown in the example above, the file type can be a field in the target record; therefore, the file type of the target file can be obtained from this target record.
[0047] S140. Based on the task identifier of the target task and the file type of the target file, determine the target event for processing the target file from at least one file processing event, and process the target file by executing the target event.
[0048] As illustrated in the examples above, the target task is associated with one or more file processing events (referred to as task events for clarity). Since each file processing event can correspond to one or more tasks, these task events can be understood as part or all of the at least one file processing event. Based on this, to correctly process the target file, a target event for processing the target file can be determined from the at least one file processing event based on the task identifier and the file type. This determination process can be performed by directly identifying the target event from the at least one file processing event based on these two factors; alternatively, the at least one or more task events can be identified first based on the task identifier, and then the target event can be identified based on the file type; and so on. No specific limitations are specified here. The target event is then executed to process the target file.
[0049] It should be noted that, as explained above, all factors involved in file processing, such as tasks, file processing configuration records, and file processing events, can be configured. This means that developers only need to develop one set of code to process files based on these factors, and this code can be applied to processing various files. Furthermore, when there is a need to add a new product or add a file to an existing product, the processing of the corresponding file (i.e., developing the file processing logic for that file) can be achieved by configuring one or more of these factors for the new content. Because this does not involve changes at the code level, it reduces development workload, thereby improving development efficiency and facilitating product quality management (the code for each product is basically the same, with no redundancy).
[0050] The technical solution of this invention, in response to a task execution instruction, initiates a target task to be executed and implements the following file processing logic by executing the target task: Based on the task identifier of the target task, a target record representing the target file to be processed is determined from at least one pre-configured file processing configuration record, and the file type of the target file is obtained from the target record; furthermore, based on the task identifier and the file type, a target event for processing the target file is determined from at least one pre-configured file processing event, and the target file is processed by executing the target event. This technical solution, when developing new file processing logic, can be implemented through a configurable approach. That is, based on the processing architecture of tasks and file processing events, and under the role of standardized file processing configuration records, a differentiated, diversified, and personalized file processing process is achieved through a configurable approach. This reduces development workload, improves development efficiency, and facilitates product quality management, effectively solving the accounting file requirements problem in multimodal online financial scenarios.
[0051] In one optional technical solution, at least one file processing event includes various task events associated with a target task attached to the target task. After launching the target task to be executed, the file processing method may further include: setting the enable flag of the target task to enable, so that the target task can be executed; after performing the following steps by executing the target task, the file processing method may further include: setting the enable flags of all task events attached to the target task to enable, so that each task event can be executed. The enable flag of the target task can be used to indicate whether the target task can be executed, and the enable flag of each task event can be used to indicate whether the task event can be executed. Therefore, after launching the target task, the task flag of the target task can be set to enable, or the task flag of the target task can be changed to enable by launching the target task, so that the target task can be executed. Furthermore, since the target event is one or more of the various task events attached to the target task, when executing the target task, the enable flags of each task event can be set to enable respectively, so that all these task events can be executed, thereby ensuring the effective execution of subsequent target events.
[0052] Another optional technical solution involves processing the target file by executing a target event, including: obtaining a pre-configured event parameter configuration table; retrieving the event parameters of the target event from the event parameter configuration table; and executing the target event based on the event parameters to process the target file through the executed target event. The relevant features of this solution have been described in the above examples and will not be repeated here. The above technical solution ensures the correct execution of the target event, thereby ensuring the correct processing of the target file.
[0053] Figure 3 This is a flowchart of another file processing method provided in this embodiment of the invention. This embodiment is an optimization based on the above-described technical solutions. In this embodiment, optionally, obtaining at least one pre-configured file processing configuration record includes: obtaining a pre-configured file processing configuration table, and obtaining at least one file processing configuration record from the file processing configuration table. The explanations of terms that are the same as or corresponding to those in the above embodiments are not repeated here.
[0054] See Figure 3 The method in this embodiment may specifically include the following steps:
[0055] S210. In response to the task execution instruction, start the target task to be executed, and perform the following steps by executing the target task.
[0056] S220. Obtain the pre-configured file processing configuration table and retrieve at least one file processing configuration record from the file processing configuration table.
[0057] In this method, at least one file processing configuration record is stored in the file processing configuration table in advance. This allows the file processing configuration table to be obtained first, and then the at least one file processing configuration record to be obtained from the file processing configuration table, thereby achieving efficient acquisition of the file processing configuration record.
[0058] S230. Based on the task identifier of the target task, determine the target record from at least one file processing configuration record, and obtain the file type of the target file to be processed from the target record.
[0059] S240. Obtain at least one file processing event, determine the target event for processing the target file from the at least one file processing event based on the task identifier of the target task and the file type of the target file, and process the target file by executing the target event.
[0060] Building upon this, to more vividly illustrate the role of the configuration table in this file processing, a specific example is provided below. For an example, see [link to example]. Figure 4 The middle section displays a file processing configuration record from the file processing configuration table. This can be understood as the target record determined from at least one obtained file processing configuration record based on the task identifier of the target task. This target record may include fields such as task identifier, file type, product code, cooperation platform, and activation identifier. The file type is obtained from this target record, and then the target event is determined from at least one file processing event stored in the event database based on the task identifier and the file type. In other words, the file processing configuration table enables accurate determination of the target record and the target event.
[0061] The technical solution of this invention obtains a pre-configured file processing configuration table and retrieves at least one file processing configuration record from the file processing configuration table. This record is then combined with subsequent steps to achieve accurate determination of the target record and the target event.
[0062] An optional technical solution, the above file processing method, may further include: responding to a product addition instruction, obtaining the task identifier and file type corresponding to the product file of the new product; generating a product addition record based on the task identifier and file type corresponding to the product file; and configuring the product addition record as a newly configured file processing configuration record in the file processing configuration table. Here, a new product can be understood as a newly added product that has not yet been configured. For each product file in the new product, the task identifier and file type corresponding to that product file can be obtained. That is, if at least one file processing event exists that can process the product file, the task identifier and file type corresponding to that file processing event can be obtained; or, if a file matching the product file exists in the file library, the task identifier and file type corresponding to that file can be obtained. Then, a product addition record is generated based on the task identifier and file type, and this product addition record is configured as a newly configured file processing configuration record in the file processing configuration table. In this way, the new product can be deployed to production without code development, thereby improving development efficiency.
[0063] Optionally, at least one file processing event is stored in a file processing event library. The file processing method may further include: responding to an event addition instruction, obtaining a new event corresponding to the task identifier and file type associated with the product file, and storing the new event as a newly configured file processing event in the file processing event library. Where at least one file processing event does not exist that can process the product file, the developer can configure a file processing event that can process the product file. Specifically, this can be done by developing an event execution class, adding a corresponding file type, and then adding that file type to the event parameter library, or in other words, adding that file processing event to the file processing event library. Alternatively, from the perspective of the file processing device's response, a new event is obtained, and the task identifier and file type associated with this new event are the same as those associated with the product file. Then, the new event is stored as a newly configured file processing event in the file processing event library. Optionally, where a file processing event is associated with a task, the new event can also be configured under the corresponding task.
[0064] Based on any of the above technical solutions, optionally, determining a target record from at least one file processing configuration record based on the task identifier of the target task includes: obtaining the enable identifier from each file processing configuration record in the at least one file processing configuration record, and determining the target record from the at least one file processing configuration record based on the task identifier of the target task and the enable identifier in each file processing configuration record. The enable identifier can be used to indicate whether the file represented by the file processing configuration record with the enable identifier needs to be processed. Therefore, the target record can be determined from at least one file processing configuration record based on the task identifier of the target task and the enable identifier in each file processing configuration record. This target record can be understood as a file processing configuration record that can be processed by the target task and currently has a processing requirement. By configuring the enable identifier field in the file processing configuration record, only files with current processing requirements can be processed, thereby improving the flexibility and accuracy of file processing.
[0065] Optionally, the above file processing method may further include: receiving an enable flag setting instruction input through a pre-set manual management service interface; and, in response to the enable flag setting instruction, setting the enable flag in at least one file processing configuration record to be set, such as changing it from enabled to disabled or from disabled to enabled. This technical solution, by providing a manual management service interface, can meet users' individual needs in real time. For example, when a product no longer needs a certain file, the enable flag of that file can be turned off in real time through this manual management service interface.
[0066] Figure 5 This is a flowchart of another file processing method provided in this embodiment of the invention. This embodiment is based on the above-described technical solutions and optimized. In this embodiment, optionally, launching the target task to be executed includes: launching at least two target tasks to be executed; performing the following steps by executing the target tasks includes: concurrently executing at least two target tasks, so that each of the at least two target tasks being executed performs the following steps; determining a target record from at least one file processing configuration record based on the task identifier of the target task, and obtaining the file type of the target file to be processed from the target record, including: determining at least two target records from at least one file processing configuration record based on the task identifier of the target task, wherein the at least two target records are applied serially; for the currently applied target record among the at least two target records, obtaining the file type of the target file to be processed corresponding to the target record from the target record. The explanations of terms that are the same as or corresponding to those in the above embodiments are not repeated here.
[0067] See Figure 5 The method in this embodiment may specifically include the following steps:
[0068] S310. In response to a task execution instruction, start at least two target tasks to be executed and execute at least two target tasks concurrently, such that each of the at least two target tasks being executed performs the following steps.
[0069] In this context, considering that a task may be associated with one or more file processing events, when associated with at least two file processing events, these events are executed sequentially. Furthermore, given that there are at least two target tasks, if these two target tasks are executed sequentially (for example, target task 1 and target task 2), then all file processing events under target task 1 must be completed before the execution of file processing events under target task 2 can begin. Clearly, any file processing event under target task 1 that takes a long time to execute will affect the execution of target task 2. Therefore, to execute each target task quickly, the at least two target tasks can be executed concurrently. The execution process of each target task is described below.
[0070] S320: Obtain at least one pre-configured file processing configuration record and at least one file processing event.
[0071] S330. Based on the task identifier of the target task, determine at least two target records from at least one file processing configuration record, wherein the at least two target records are applied serially.
[0072] In this system, at least two target records are applied serially, meaning that the target events corresponding to each of the at least two target records are executed serially. In practical applications, optionally, the target files represented by the at least two target records belong to at least two existing products. In other words, a task can process the related files of at least two existing products. Compared to a task that processes the related files of only one existing product, this reduces the number of tasks, thereby improving system performance and operating efficiency.
[0073] S340. For the target record of the current application in at least two target records, obtain the file type of the target file to be processed corresponding to the target record from the target record.
[0074] S350. Based on the task identifier of the target task and the file type of the target file, determine the target event for processing the target file from at least one file processing event, and process the target file by executing the target event.
[0075] Based on this, to more vividly understand the above technical solution, a specific example is provided below for illustration. For example, such as... Figure 6As shown, task identifiers for three target tasks are obtained. Since these three task identifiers correspond to the same task execution class A, the concurrent execution of these three target tasks can be achieved through three different instantiated objects of task execution class A. Specifically, through task execution class A, the file processing range corresponding to each task identifier is found in the file processing configuration table. Then, the files are processed by executing the file processing events corresponding to the files within these file processing ranges. This concurrent task execution strategy reduces the system's operating pressure, thereby improving the overall high availability of the system.
[0076] The technical solution of this invention, since the file processing events associated with any task are executed serially, can execute at least two target tasks concurrently when there are at least two target tasks, thereby effectively ensuring the rapid execution of each target task.
[0077] An optional technical solution for launching at least two target tasks to be executed may include: obtaining at least two task identifiers from a pre-configured task parameter table, and launching at least two target tasks for each target task represented by the at least two task identifiers, wherein the at least two task identifiers and the at least two target tasks have a one-to-one correspondence; the above file processing method may further include: in response to a task addition instruction, obtaining the task identifier of the new task and the task addition record corresponding to the task identifier of the new task; configuring the task identifier of the new task in the task parameter table, and storing the task addition record as a newly configured file processing configuration record. The specific meaning of the task parameter table has been explained in the above example and will not be repeated here. For a new task, the task identifier of the new task can be configured in the task parameter table. In addition, for each file within the file processing scope of the new task, a task addition record configured for that file can be obtained, and this task addition record can be stored as a newly configured file processing configuration record, for example, stored in a file configuration record table. In this way, tasks can be added in a configurable manner through parameters (such as task identifiers and task addition records) without adding any code, thereby improving development efficiency.
[0078] Figure 7 This is a structural block diagram of a file processing apparatus provided in an embodiment of the present invention. This apparatus is used to execute the file processing method provided in any of the above embodiments. This apparatus and the file processing methods of the above embodiments belong to the same inventive concept. Details not described in detail in the embodiments of the file processing apparatus can be found in the embodiments of the above file processing methods. See also... Figure 7 The device may specifically include: a target task execution module 410, a record event acquisition module 420, a file type acquisition module 430, and a target file processing module 440.
[0079] The target task execution module 410 is used to respond to the task execution instruction, start the target task to be executed, and perform the following steps by executing the target task;
[0080] The event acquisition module 420 is used to acquire at least one pre-configured file processing configuration record and at least one file processing event;
[0081] The file type acquisition module 430 is used to determine the target record from at least one file processing configuration record based on the task identifier of the target task, and to obtain the file type of the target file to be processed from the target record;
[0082] The target file processing module 440 is used to determine the target event for processing the target file from at least one file processing event based on the task identifier of the target task and the file type of the target file, and to process the target file by executing the target event.
[0083] Optionally, the event acquisition module 420 may include:
[0084] The file processing configuration record acquisition unit is used to acquire a pre-configured file processing configuration table and obtain at least one file processing configuration record from the file processing configuration table.
[0085] Optionally, the aforementioned document processing apparatus may further include:
[0086] The product addition record generation module is used to respond to the product addition command, obtain the task identifier and file type corresponding to the product file of the new product, and generate a product addition record based on the task identifier and file type corresponding to the product file.
[0087] The first configuration module for file processing configuration records is used to configure newly added product records as new configuration file processing configuration records into the file processing configuration table.
[0088] Optionally, at least one file processing event is stored in a file processing event library, and the aforementioned file processing device may further include:
[0089] The file processing event storage module is used to respond to the event addition command, obtain the task identifier corresponding to the product file and the new event corresponding to the file type, and store the new event as a newly configured file processing event in the file processing event library.
[0090] Optionally, the file type acquisition module 430 may include:
[0091] The first target record determination unit is used to obtain the enable identifier in each file processing configuration record in at least one file processing configuration record, and determine the target record from at least one file processing configuration record based on the task identifier of the target task and the enable identifier in each file processing configuration record.
[0092] Optionally, the aforementioned document processing apparatus may further include:
[0093] The enable identifier setting instruction receiving module is used to receive enable identifier setting instructions input through a pre-set manual management service interface;
[0094] The first setting module for enabling identifiers is used to set the enable identifier in at least one file processing configuration record to be set in response to the enable identifier setting command.
[0095] Optionally, at least one file processing event is attached to each task event associated with the target task, and the aforementioned file processing apparatus may further include:
[0096] The second setting module for enabling the flag is used to set the enable flag of the target task to enabled after the target task to be executed is launched, so that the target task can be executed;
[0097] The third setting module enables the flags of each task event attached to the target task to be enabled after the following steps are performed by executing the target task, so that each task event can be executed.
[0098] Optionally, the target file processing module 440 may include
[0099] The event parameter configuration table acquisition unit is used to acquire the pre-configured event parameter configuration table.
[0100] The target file processing unit is used to obtain the event parameters of the target event from the event parameter configuration table, and execute the target event based on the event parameters, so as to process the target file through the executed target event.
[0101] Optionally, the target task execution module 410 may include:
[0102] The target task initiation unit is used to initiate at least two target tasks to be executed.
[0103] The target task concurrent execution unit is used to concurrently execute at least two target tasks, such that each of the at least two target tasks being executed performs the following steps;
[0104] The file type obtained from module 430 can include:
[0105] The second target record determining unit is used to determine at least two target records from at least one file processing configuration record based on the task identifier of the target task, wherein the at least two target records are applied serially;
[0106] The file type acquisition unit is used to obtain the file type of the target file to be processed from the target record corresponding to the target record of the current application among at least two target records.
[0107] Based on this, the optional target task initiation unit is specifically used for:
[0108] Obtain at least two task identifiers from the pre-configured task parameter table, and launch at least two target tasks for the at least two target tasks represented by the at least two task identifiers, wherein the at least two task identifiers and the at least two target tasks have a one-to-one correspondence.
[0109] The above-mentioned processing apparatus may further include:
[0110] The task new record acquisition module is used to respond to the task new command, acquire the task identifier of the new task, and the task new record corresponding to the task identifier of the new task;
[0111] The file processing configuration record storage module is used to configure the task identifier of newly added tasks into the task parameter table, and to store the newly added task records as file processing configuration records of the new configuration.
[0112] Alternatively, the target files corresponding to the at least two target records may belong to at least two existing products.
[0113] The file processing apparatus provided in this invention, in response to a task execution instruction, initiates a target task to be executed via a target task execution module. The file processing logic is implemented by executing the target task: An event acquisition module and a file type acquisition module cooperate to determine a target record representing the target file to be processed from at least one pre-configured file processing configuration record based on the task identifier of the target task, and obtains the file type of the target file from the target record. Furthermore, the event acquisition module and the target file processing module cooperate to determine a target event for processing the target file from at least one pre-configured file processing event based on the task identifier and the file type, and executes the target event to process the target file. When developing new file processing logic, this apparatus can be implemented in a configurable manner. Based on a task and file processing event-driven processing architecture and standardized file processing configuration records, it enables differentiated, diverse, and personalized file processing processes through configurability. This reduces development workload, improves development efficiency, and facilitates product quality management, effectively solving the accounting document requirements in multimodal online financial scenarios.
[0114] The file processing apparatus provided in the embodiments of the present invention can execute the file processing method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of executing the method.
[0115] It is worth noting that in the embodiments of the above-mentioned document processing device, the various units and modules included are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be achieved; in addition, the specific names of each functional unit are only for easy differentiation and are not used to limit the scope of protection of the present invention.
[0116] Figure 8 A schematic diagram of an electronic device 10 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0117] like Figure 8As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded into the RAM 13 from storage unit 18. The RAM 13 can also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.
[0118] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0119] Processor 11 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as file processing methods.
[0120] In some embodiments, the file processing method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the file processing method described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the file processing method by any other suitable means (e.g., by means of firmware).
[0121] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0122] Computer programs used to implement the methods of the present invention can be written in any combination of one or more programming languages. These computer programs can be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The computer programs can be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0123] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0124] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).
[0125] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0126] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.
[0127] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.
[0128] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A file processing method characterized by, include: In response to a task execution command, the target task to be executed is initiated, and the following steps are performed by executing the target task: Obtain at least one pre-configured file processing configuration record and at least one file processing event; the file processing event is a pre-configured event used to process the file corresponding to that file processing event; Based on the task identifier of the target task, a target record is determined from the at least one file processing configuration record, and the file type of the target file to be processed is obtained from the target record; Based on the task identifier of the target task and the file type of the target file, a target event for processing the target file is determined from the at least one file processing event, and the target file is processed by executing the target event; The step of determining the target record from the at least one file processing configuration record based on the task identifier of the target task includes: The activation identifier in each of the at least one file processing configuration records is obtained, and the target record is determined from the at least one file processing configuration record based on the task identifier of the target task and the activation identifier in each file processing configuration record. Receive the enable flag setting command input through the pre-configured manual management service interface; In response to the enable flag setting instruction, the enable flag in the file processing configuration record to be set in the at least one file processing configuration record is set; wherein, the enable flag is used to indicate whether the file represented by the file processing configuration record with the enable flag needs to be processed.
2. The method of claim 1, wherein, The process of obtaining at least one pre-configured file processing configuration record includes: Obtain the pre-configured file processing configuration table, and retrieve at least one file processing configuration record from the file processing configuration table.
3. The method of claim 2, wherein, Also includes: In response to a product addition instruction, the task identifier and file type corresponding to the product file of the new product are obtained, and a product addition record is generated based on the task identifier and file type corresponding to the product file. The newly added product record is configured as a new file processing configuration record and added to the file processing configuration table.
4. The method of claim 3, wherein, The at least one file processing event is stored in a file processing event library, and the method further includes: In response to the event addition command, the system retrieves the new event corresponding to the task identifier and file type of the product file, and stores the new event as a newly configured file processing event in the file processing event library.
5. The method according to claim 1, characterized in that, Each task event associated with the target task in the at least one file processing event is attached to the target task; After initiating the target task to be executed, the method further includes: Set the enable flag of the target task to enable so that the target task can be executed; After performing the following steps by executing the target task, the method further includes: Set the enable flag of each task event attached to the target task to enable so that each task event can be executed.
6. The method according to claim 1, characterized in that, The process of processing the target file by executing the target event includes: Retrieve the pre-configured event parameter configuration table; The event parameters of the target event are obtained from the event parameter configuration table, and the target event is executed based on the event parameters to process the target file through the executed target event.
7. The method according to claim 1, characterized in that, The process of launching the target task to be executed includes: Initiate at least two target tasks that are yet to be executed; The steps performed by executing the target task include: The at least two target tasks are executed concurrently, such that each of the at least two target tasks performs the following steps; The process of determining a target record from at least one file processing configuration record based on the task identifier of the target task, and obtaining the file type of the target file to be processed from the target record, includes: Based on the task identifier of the target task, at least two target records are determined from the at least one file processing configuration record, wherein the at least two target records are applied serially; For the target record of the current application among the at least two target records, obtain the file type of the target file to be processed corresponding to the target record from the target record.
8. The method according to claim 7, characterized in that, The initiation of at least two target tasks to be executed includes: Obtain at least two task identifiers from a pre-configured task parameter table, and launch the at least two target tasks to be executed, as represented by the at least two task identifiers, wherein the at least two task identifiers and the at least two target tasks have a one-to-one correspondence. The method further includes: In response to a task addition instruction, obtain the task identifier of the new task and the task addition record corresponding to the task identifier of the new task; Configure the task identifier of the newly added task in the task parameter table, and store the newly added task record as a newly configured file processing configuration record.
9. The method according to claim 7, characterized in that, The target files corresponding to the at least two target records belong to at least two existing products.
10. A document processing device, characterized in that, include: The target task execution module is used to respond to a task execution command, launch a target task to be executed, and perform the following steps by executing the target task; The event acquisition module is used to acquire at least one pre-configured file processing configuration record and at least one file processing event; the file processing event is a pre-configured event used to process the file corresponding to the file processing event; The file type acquisition module is used to determine the target record from the at least one file processing configuration record based on the task identifier of the target task, and to obtain the file type of the target file to be processed from the target record; The target file processing module is configured to determine a target event for processing the target file from the at least one file processing event based on the task identifier of the target task and the file type of the target file, and to process the target file by executing the target event; The file type acquisition module includes: The first target record determination unit is used to obtain the enable identifier in each file processing configuration record in at least one file processing configuration record, and determine the target record from at least one file processing configuration record based on the task identifier of the target task and the enable identifier in each file processing configuration record; The enable identifier setting instruction receiving module is used to receive enable identifier setting instructions input through a pre-set manual management service interface; The first setting module for enabling identifiers is used to set the enable identifier in at least one file processing configuration record to be set in response to an enable identifier setting instruction; wherein the enable identifier is used to indicate whether the file represented by the file processing configuration record with the enable identifier needs to be processed.
11. An electronic device, characterized in that, include: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to cause the at least one processor to perform the file processing method as described in any one of claims 1-9.
12. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the file processing method as described in any one of claims 1-9.
Citation Information
Patent Citations
Task processing method and device
CN109597678A
Service process configuration method and device, equipment and storage medium
CN114064112A