File processing method and device, processor and electronic device
By splitting, decoding, and merging files, the compatibility issues between the host system and the platform system during file interaction are resolved, achieving bidirectional compatibility and resource optimization in file processing.
Patent Information
- Application Number
- CN202210682644.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-16
- Publication Date
- 2026-08-25
- Estimated Expiration
- 2042-06-16
AI Technical Summary
In existing technologies, when the host system and the platform system interact with each other, the file content is incompatible due to differences in encoding mechanisms and structures. Furthermore, the lack of bidirectional decoding and file splitting/merging functions leads to resource contention and processing incompatibility issues.
By acquiring multiple files to be processed and matching target splitting, decoding, and merging rules from multiple rule sets, the files are split, decoded, and merged, supporting bidirectional compatibility between host systems and platform systems.
It enables file compatibility between the host system and the platform system, avoids resource contention, and improves the efficiency and compatibility of file interaction processing.
Smart Images

Figure CN115221127B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of financial technology, and more specifically, to a document processing method, apparatus, processor, and electronic device. Background Technology
[0002] Mainframe systems and platform systems exchange and transmit data files. Due to differences in encoding mechanisms and structures between the files of the mainframe and platform systems, the content of the files generated by the two systems also differs. Therefore, during file exchange, both the mainframe and platform systems need to perform encoding translation and conversion (decoding) of the file content before further data identification and processing can proceed. Furthermore, because some files involve differences in regional business scope, they need to be split or merged according to specific business rules such as region to generate business file content for different regional scopes, adapting to different business processing scenarios.
[0003] In related technologies, files generated on the host system are decoded and split on the host, while the core business system also runs on the host. The decoding and splitting process and the operation of the business system will compete for resources such as host CPU and memory. In addition, most decoding systems have limited functionality, mainly decoding host files into platform file formats, lacking the function of decoding platform files into host files, and also lacking splitting and merging processing steps.
[0004] There is currently no effective solution to the problem that files processed by one system are incompatible with files on other platform systems. Summary of the Invention
[0005] The main objective of this application is to provide a file processing method, apparatus, processor, and electronic device to solve the problem in the related art that files processed by one system are incompatible with files on other platform systems.
[0006] To achieve the above objectives, according to one aspect of this application, a file processing method is provided. The method includes: acquiring multiple files to be processed, and acquiring target rules matching each file to be processed from multiple rule sets, wherein the multiple rule sets include a splitting rule set, a decoding rule set, and a merging rule set, and the target rules include target splitting rules, target decoding rules, and target merging rules; splitting the multiple files to be processed according to the matching target splitting rules to obtain multiple sets of first files; decoding the multiple sets of first files according to the matching target decoding rules to obtain multiple sets of second files; and merging the multiple sets of second files according to the matching target merging rules to obtain a target file from which each file to be processed has been processed.
[0007] Optionally, splitting multiple files to be processed according to the matching target splitting rules to obtain multiple sets of first files includes: determining the acquisition order of multiple files to be processed, and reading the matching target splitting rules in sequence according to the acquisition order; splitting multiple files to be processed in sequence according to the matching target splitting rules in the acquisition order, and determining whether all files to be processed have been split; if all files to be processed have been split, multiple sets of first files are obtained.
[0008] Optionally, decoding multiple sets of first files according to the matching target decoding rules to obtain multiple sets of second files includes: determining the acquisition order of multiple files to be processed, reading the matching target decoding rules sequentially according to the acquisition order; performing decoding processing on multiple sets of first files sequentially according to the matching target decoding rules according to the acquisition order, and determining whether all first files have been decoded. If all first files have been decoded, multiple sets of second files are obtained.
[0009] Optionally, merging multiple sets of second files according to the matching target merging rules to obtain the target file matching each file to be processed includes: determining the acquisition order of multiple files to be processed, reading the matching target merging rules sequentially according to the acquisition order; merging multiple sets of second files sequentially according to the matching target merging rules according to the acquisition order, and determining whether all second files have been merged. If all second files have been merged, the target file matching each file to be processed is obtained.
[0010] Optionally, before acquiring multiple files to be processed and obtaining target rules matching each file from multiple rule sets, the method further includes: the target file processing device reading multiple first rules from a local system and multiple second rules from at least one external system, wherein the multiple first rules and multiple second rules constitute multiple rule sets; acquiring multiple files to be processed and obtaining target rules matching each file from multiple rule sets includes: the target file processing device reading multiple first files to be processed from a local system and multiple second files to be processed from at least one external system, wherein the multiple first files to be processed and multiple second files to be processed constitute multiple files to be processed; determining the system type corresponding to each file to be processed, and obtaining matching target rules from multiple rule sets according to the system type, wherein each rule in each rule set is associated with a preset system type.
[0011] Optionally, after obtaining multiple files to be processed and obtaining target rules matching each file from multiple rule sets, the method further includes: if at least one file to be processed cannot obtain matching target rules from multiple rule sets, monitoring whether the first rule of the local system and the second rule of the external system have changed; and updating the multiple rule sets if the first rule of the local system and / or the second rule of the external system have changed.
[0012] Optionally, after merging multiple sets of second files according to the matching target merging rules to obtain the target files for each file to be processed, the method further includes: obtaining split logs, decoding logs, merging logs, and rule logs, wherein the split log records the running status and splitting result information when splitting the files to be processed, the decoding log records the running status and decoding result information when decoding the first file, the merging log records the running status and merging result information when merging the second file, and the rule log records the update information of the rule set; generating a file splitting report based on the split log, a file decoding report based on the decoding log, a file merging report based on the merging log, and a rule report based on the rule log.
[0013] To achieve the above objectives, according to another aspect of this application, a file processing apparatus is provided. The apparatus includes: an acquisition unit, configured to acquire multiple files to be processed and acquire target rules matching each file to be processed from multiple rule sets, wherein the multiple rule sets include a splitting rule set, a decoding rule set, and a merging rule set, and the target rules include target splitting rules, target decoding rules, and target merging rules; a splitting unit, configured to split the multiple files to be processed according to the matching target splitting rules to obtain multiple sets of first files; a decoding unit, configured to decode the multiple sets of first files according to the matching target decoding rules to obtain multiple sets of second files; and a merging unit, configured to merge the multiple sets of second files according to the matching target merging rules to obtain a target file from which each file to be processed has been processed.
[0014] This application employs the following steps: obtaining multiple files to be processed, and acquiring target rules matching each file from multiple rule sets, including splitting rule sets, decoding rule sets, and merging rule sets; the target rules include target splitting rules, target decoding rules, and target merging rules; splitting the multiple files to be processed according to the matching target splitting rules to obtain multiple sets of first files; decoding the multiple sets of first files according to the matching target decoding rules to obtain multiple sets of second files; and merging the multiple sets of second files according to the matching target merging rules to obtain the target file from which each file to be processed has been processed. This solves the problem in related technologies where processing files using one system is incompatible with files on other platform systems. By supporting bidirectional splitting, decoding, and merging of files between the host system and other platform systems, the effect of processing files compatible with files on multiple platform systems is achieved. Attached Figure Description
[0015] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:
[0016] Figure 1 This is a flowchart of a document processing method provided according to an embodiment of this application;
[0017] Figure 2 This is a schematic diagram of the structure of a decoding processing server provided according to an embodiment of this application;
[0018] Figure 3 This is a schematic diagram of a document processing apparatus provided according to an embodiment of this application;
[0019] Figure 4 This is a schematic diagram of an electronic device provided according to an embodiment of this application. Detailed Implementation
[0020] It should be noted that, unless otherwise specified, the embodiments and features described in this application can be combined with each other. This application will now be described in detail with reference to the accompanying drawings and embodiments.
[0021] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0022] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application 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 for the embodiments of this application described herein. 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.
[0023] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data used for analysis, etc.) involved in this disclosure are all information and data authorized by the user or fully authorized by all parties.
[0024] The present invention will now be described in conjunction with preferred implementation steps. Figure 1 This is a flowchart of a file processing method provided according to an embodiment of this application, such as... Figure 1 As shown, the method includes the following steps:
[0025] Step S101: Obtain multiple files to be processed, and obtain target rules that match each file to be processed from multiple rule sets. The multiple rule sets include splitting rule sets, decoding rule sets, and merging rule sets, and the target rules include target splitting rules, target decoding rules, and target merging rules.
[0026] Specifically, the files to be processed can be files generated by the host system and various platform systems that need to be interacted with. The host system can be the system currently used by the company to process various businesses, and the platform system can be a non-company system that has business communication with the company. The rule set can be various rules that the host system and platform system themselves use to process files. The files to be processed are obtained from the host and various platform systems, each file to be processed is matched with multiple rule sets, and corresponding target splitting rules, target decoding rules, and target merging rules are assigned to each file to be processed.
[0027] Step S102: Split the multiple files to be processed according to the matching target splitting rules to obtain multiple sets of first files.
[0028] Specifically, the first file can be the result file after splitting the file to be processed. For files to be processed that need to be split, there can be multiple first files in each group. For files to be processed that do not need to be split, there can be only one first file in each group. The file splitting device of the file processing system splits the files to be processed sequentially according to the target splitting rules corresponding to each file to be processed, and obtains multiple groups of first files after splitting.
[0029] Step S103: Decode the multiple sets of first files according to the matching target decoding rules to obtain multiple sets of second files.
[0030] Specifically, the second file can be the result file after decoding the first file. The file decoding device of the file processing system decodes the first file sequentially according to the target decoding rules corresponding to each file to be processed, thereby obtaining multiple sets of decoded second files.
[0031] Step S104: Merge the multiple sets of second files according to the matching target merging rules to obtain the target file for each file to be processed.
[0032] Specifically, the target file can be the result file after merging the second file, that is, the file after interactive processing between the host system and each platform system. The file merging device of the file processing system merges the second file sequentially according to the target merging rules to obtain the target file.
[0033] The file processing method provided in this application obtains multiple files to be processed and acquires target rules matching each file from multiple rule sets. These rule sets include splitting rule sets, decoding rule sets, and merging rule sets. The target rules include target splitting rules, target decoding rules, and target merging rules. The multiple files to be processed are split according to the matching target splitting rules to obtain multiple sets of first files. The multiple sets of first files are decoded according to the matching target decoding rules to obtain multiple sets of second files. The multiple sets of second files are merged according to the matching target merging rules to obtain the target file from which all files to be processed are processed. This solves the problem in related technologies where file processing using one system is incompatible with files on other platform systems. By supporting bidirectional splitting, decoding, and merging of files between the host system and other platform systems, the method achieves compatibility with files from multiple platform systems during file processing.
[0034] When the host system and the platform system perform file interaction processing, the files to be processed are first split. Optionally, in the file processing method provided in this application embodiment, splitting multiple files to be processed according to the matching target splitting rules to obtain multiple sets of first files includes: determining the acquisition order of multiple files to be processed, and reading the matching target splitting rules in sequence according to the acquisition order; splitting multiple files to be processed in sequence according to the matching target splitting rules in the acquisition order, and determining whether all files to be processed have been split. If all files to be processed have been split, multiple sets of first files are obtained.
[0035] Specifically, the acquisition order can be the order in which the file reading device reads the files to be processed from the host system or other platform system, obtaining the files to be processed and the target splitting rules that match them. Based on the target splitting rules, the files to be processed are split to obtain the first split file. The completeness of the file splitting process is determined by checking if the first split file exists for all files. If not, the file splitting process continues; if complete, it ends. This separate processing of the file splitting process avoids preempting the host's business system's operating resources.
[0036] After obtaining the split first file, in order for the host system and platform system to recognize their respective files, the first file needs to be decoded. Optionally, in the file processing method provided in this application embodiment, decoding multiple sets of first files according to the matching target decoding rules to obtain multiple sets of second files includes: determining the acquisition order of multiple files to be processed, reading the matching target decoding rules in sequence according to the acquisition order; decoding multiple sets of first files in sequence according to the matching target decoding rules in the acquisition order, and determining whether all first files have been decoded. If all first files have been decoded, multiple sets of second files are obtained.
[0037] Specifically, the process involves obtaining the first file and its corresponding target decoding rules. The first file includes two types: one is a set of larger files that have been split, and the other is a single, smaller file that doesn't require splitting. According to the target decoding rules, the first file is decoded to obtain the decoded second file. The completeness of the first file decoding is determined by checking if all decoded second files exist. If not, the decoding process continues; if complete, it ends. This added decoding process ensures that files exchanged between the host system and the platform system do not suffer from missing content.
[0038] It should be noted that the first file is decoded using multiple decoding servers. Figure 2 This is a schematic diagram of the structure of a decoding processing server provided according to an embodiment of this application, as shown below. Figure 2 As shown, the number of decoding servers can be flexibly reduced or increased based on the number and size of the files being processed, supporting distributed parallel processing. Multiple decoding servers perform parallel decoding processing on different first files. For a single decoding server, the decoding program on it supports multi-threaded processing. For the list of decoding files allocated to this server, multiple decoding threads can be enabled simultaneously for parallel processing based on the number of CPUs on the server, thereby accelerating the processing speed.
[0039] The first file is decoded to obtain the second file. The second file needs to be merged to obtain the target file. Optionally, in the file processing method provided in this application embodiment, merging multiple sets of second files according to the matching target merging rules to obtain the target file matching each file to be processed includes: determining the acquisition order of multiple files to be processed, reading the matching target merging rules in sequence according to the acquisition order; merging multiple sets of second files in sequence according to the matching target merging rules in the acquisition order, and determining whether all second files have been merged. If all second files have been merged, the target file matching each file to be processed is obtained.
[0040] Specifically, the process involves obtaining a second file and its corresponding target merging rule. The second file is then merged according to the target merging rule. The completion of the merging process is determined by checking if the target file exists after merging all the second files. If not, the merging process continues; if complete, it ends. By merging the second files using the file merging device, a target file that can be recognized and processed by the host system or platform system can be obtained.
[0041] Before processing the files to be processed, the file processing system needs to obtain the rule sets of the host system and other platform systems. Optionally, in the file processing method provided in this application embodiment, before obtaining multiple files to be processed and obtaining the target rule matching each file to be processed from multiple rule sets, the method further includes: the target file processing device reads multiple first rules from the local system and multiple second rules from at least one external system, and the multiple first rules and multiple second rules constitute multiple rule sets; obtaining multiple files to be processed and obtaining the target rule matching each file to be processed from multiple rule sets includes: the target file processing device reads multiple first files to be processed from the local system and multiple second files to be processed from at least one external system, and the multiple first files to be processed and multiple second files to be processed constitute multiple files to be processed; determining the system type corresponding to each file to be processed, and obtaining the matching target rule from multiple rule sets according to the system type, wherein each rule in each rule set is associated with a preset system type.
[0042] Specifically, the target file processing device is also known as the target file processing system. The local system is also known as the host system, and the external system can be various platform systems. The first rule can be various rules used by the host system when processing files, such as the splitting rules, decoding rules, and merging rules used by the host system when processing files. The second rule can be the splitting rules, decoding rules, and merging rules used by the platform system when processing files. The first file to be processed can be the file to be processed generated by the host system, and the second file to be processed can be the file to be processed generated by the platform system. The target rule matching the file to be processed is obtained through the rule management device.
[0043] For example, if the target splitting rule is to split the file by using the first 1-5 digits of each line of data as the region code, then when the file processing system performs splitting, it will first read the first 1-5 digits of the region code from each line of data in the file to be processed that matches the target splitting rule, and then split the file into multiple first files according to different region codes, facilitating subsequent decoding processing. The information in the target splitting rule includes the file type, i.e., the first or second file to be processed, the file name, and the file splitting rule. Default initial splitting rules are assigned to various types of files to be processed. Users can add, modify, and delete rules in the initial splitting rules to ensure that the files to be processed match the target splitting rule.
[0044] The target decoding rule is EBCDIC encoding (source code) and ASCII encoding (target code). Direct decoding is used. During decoding, the file processing system will convert the file content of the first file matching the target decoding rule from EBCDIC to ASCII. The target decoding rule includes information such as file type, file name, source code, target code, and file decoding rule. Default initial decoding rules are assigned to various types of first files. Users can add, modify, and delete rules to ensure the first file matches the target decoding rule.
[0045] The target merging rule uses the first 1-5 digits of each line of data in a file as the region code. When merging, the file processing system first reads the first 1-5 digits of the region code from each line of data in the second file that matches the target merging rule, then merges the file content according to different region codes, combining all files under all region codes into one file. The maintained merging rule information includes file type (host or platform), file name, and file merging rule. Default initial merging rules are assigned to various types of second files. Users can add, modify, and delete rules to ensure that the second files match the target merging rule.
[0046] For example, Table 1 shows the target splitting rules for different file types, Table 2 shows the target decoding rules for different file types, and Table 3 shows the target merging rules for different file types.
[0047] Table 1
[0048]
[0049] Table 2
[0050] File type File Name Source code Target code system Decoding rules host cardlist.bin EBCDIC code ASCII code direct decoding platform ebanklist.txt UTF-8 EBCDIC code First split, then decode
[0051] Table 3
[0052] File type File Name Merge rules host cardlist.bin Merge the files using the first 1-5 characters of each line as the area code. platform ebanklist.txt Merge files based on the 4th-6th characters of each line as the business type.
[0053] Since the rules of the host system and platform system are subject to updates, it is necessary to update various rule sets in the rule management device before matching target rules for the files to be processed. Optionally, in the file processing method provided in this application embodiment, after obtaining multiple files to be processed and obtaining target rules matching each file from multiple rule sets, the method further includes: if at least one file to be processed cannot obtain matching target rules from multiple rule sets, monitoring whether the first rule of the local system and the second rule of the external system have changed; and updating the multiple rule sets if the first rule of the local system and / or the second rule of the external system have changed.
[0054] Specifically, in the event of an update to the host system or platform system, the matching rules for some files may not be stored in the rule management device, or existing rules may change, requiring modification of the changed rules in the rule set. In such cases, the target rules may be redefined, or existing rules may be added or deleted.
[0055] Optionally, in the file processing method provided in this application embodiment, after merging multiple groups of second files according to the matching target merging rules to obtain the target files for each file to be processed, the method further includes: obtaining split logs, decoding logs, merging logs, and rule logs, wherein the split log records the running status and splitting result information when splitting the files to be processed, the decoding log records the running status and decoding result information when decoding the first file, the merging log records the running status and merging result information when merging the second file, and the rule log records the update information of the rule set; generating a file splitting report based on the split log, generating a file decoding report based on the decoding log, generating a file merging report based on the merging log, and generating a rule report based on the rule log.
[0056] Specifically, the splitting log can be a log recording the file splitting process in the file splitting device, the decoding log can be a log recording the file decoding process in the file decoding device, the merging log can be a log recording the file merging process in the file merging device, and the rule log can be a log recording rule changes in the rule management device. The reporting device generates file splitting reports from the splitting log, file decoding reports from the decoding log, file merging reports from the merging log, and rule reports from the rule log. The reporting device can output detailed processing information and statistical information for each of the aforementioned devices, allowing users to query and statistically analyze detailed logs and reports for each stage of decoding, splitting, and merging. The rule reports mainly statistically analyze and display the rule configuration information for splitting, decoding, and merging. The file splitting reports mainly statistically analyze and display the real-time operating status and historical operating results of the file splitting processing stage. The file decoding reports mainly statistically analyze and display the real-time operating status and historical operating results of the file decoding processing stage. The file merging reports mainly statistically analyze and display the real-time operating status and historical operating results of the file merging processing stage.
[0057] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.
[0058] This application also provides a file processing apparatus. It should be noted that the file processing apparatus of this application can be used to execute the file processing method provided in this application. The file processing apparatus provided in this application is described below.
[0059] Figure 3 This is a schematic diagram of a document processing apparatus provided according to an embodiment of this application. For example... Figure 3 As shown, the device includes:
[0060] The acquisition unit 10 is used to acquire multiple files to be processed and to acquire target rules that match each file to be processed from multiple rule sets. The multiple rule sets include splitting rule sets, decoding rule sets, and merging rule sets, and the target rules include target splitting rules, target decoding rules, and target merging rules.
[0061] Splitting unit 20 is used to split multiple files to be processed according to the matching target splitting rules to obtain multiple sets of first files.
[0062] The decoding unit 30 is used to decode multiple sets of first files according to the matching target decoding rules to obtain multiple sets of second files.
[0063] Merging unit 40 is used to merge multiple groups of second files according to the matching target merging rules to obtain the target file for each file to be processed.
[0064] The file processing apparatus provided in this application embodiment acquires multiple files to be processed through an acquisition unit 10, and obtains target rules matching each file from multiple rule sets. These rule sets include a splitting rule set, a decoding rule set, and a merging rule set. The target rules include target splitting rules, target decoding rules, and target merging rules. A splitting unit 20 splits the multiple files to be processed according to the matching target splitting rules, resulting in multiple sets of first files. A decoding unit 30 decodes the multiple sets of first files according to the matching target decoding rules, resulting in multiple sets of second files. A merging unit 40 merges the multiple sets of second files according to the matching target merging rules, resulting in the target file from which each file to be processed is processed. This solves the problem in related technologies where processing files using one system is incompatible with files on other platform systems. By supporting bidirectional splitting, decoding, and merging of files between the host system and other platform systems, it achieves the effect of being compatible with files on multiple platform systems when processing files.
[0065] Optionally, in the file processing apparatus provided in this application embodiment, the splitting unit 20 includes: a first determining module, used to determine the acquisition order of multiple files to be processed, and read the matching target splitting rules sequentially according to the acquisition order; and a splitting module, used to split the multiple files to be processed sequentially according to the matching target splitting rules according to the acquisition order, and determine whether all files to be processed have been split completely, and obtain multiple sets of first files when all files to be processed have been split completely.
[0066] Optionally, in the file processing apparatus provided in this application embodiment, the decoding unit 30 includes: a second determining module, used to determine the acquisition order of multiple files to be processed, and sequentially read the matching target decoding rules according to the acquisition order; and a decoding module, used to sequentially decode multiple sets of first files according to the acquisition order and the matching target decoding rules, and determine whether all first files have been decoded, and obtain multiple sets of second files if all first files have been decoded.
[0067] Optionally, in the file processing apparatus provided in this application embodiment, the merging unit 40 includes: a third determining module, used to determine the acquisition order of multiple files to be processed, and read the matching target merging rules sequentially according to the acquisition order; and a merging module, used to merge multiple groups of second files sequentially according to the matching target merging rules according to the acquisition order, and determine whether all second files have been merged, and if all second files have been merged, obtain the target file matched by each file to be processed.
[0068] Optionally, in the file processing apparatus provided in this application embodiment, the apparatus further includes: a reading unit, configured to read multiple first rules from a local system and multiple second rules from at least one external system via a target file processing device, wherein the multiple first rules and multiple second rules constitute multiple rule sets; the acquisition unit 10 includes: a reading module, configured to read multiple first files to be processed from a local system via a target file processing device and multiple second files to be processed from at least one external system, wherein the multiple first files to be processed and multiple second files to be processed constitute multiple files to be processed; and a fourth determining module, configured to determine the system type corresponding to each file to be processed, and acquire matching target rules from multiple rule sets according to the system type, wherein each rule in each rule set is associated with a preset system type.
[0069] Optionally, in the file processing apparatus provided in the embodiments of this application, the apparatus further includes: a monitoring unit, configured to monitor whether the first rule of the local system and the second rule of the external system have changed when at least one file to be processed cannot obtain a matching target rule from multiple rule sets; and an updating unit, configured to update multiple rule sets when the first rule of the local system and / or the second rule of the external system have changed.
[0070] Optionally, in the file processing apparatus provided in this application embodiment, the apparatus further includes: a log acquisition unit, used to acquire split logs, decoding logs, merging logs, and rule logs, wherein the split logs record the running status and splitting result information when splitting the file to be processed, the decoding logs record the running status and decoding result information when decoding the first file, the merging logs record the running status and merging result information when merging the second file, and the rule logs record the update information of the rule set; and a generation unit, used to generate a file splitting report based on the split logs, a file decoding report based on the decoding logs, a file merging report based on the merging logs, and a rule report based on the rule logs.
[0071] The file processing device includes a processor and a memory. The aforementioned acquisition unit 10, splitting unit 20, decoding unit 30, and merging unit 40 are all stored in the memory as program units. The processor executes the aforementioned program units stored in the memory to realize the corresponding functions.
[0072] The processor contains a kernel, which retrieves the corresponding program unit from memory. One or more kernels can be configured, and by adjusting kernel parameters, file processing can be made compatible with multiple platform systems.
[0073] The memory may include non-permanent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0074] This invention provides a computer-readable storage medium storing a program thereon, which, when executed by a processor, implements a file processing method.
[0075] This invention provides a processor for running a program, wherein the program executes a file processing method during runtime.
[0076] like Figure 4 As shown, this embodiment of the invention provides an electronic device. Device 401 includes a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, it constructs a pressure sensor. The device described herein can be a server, PC, PAD, mobile phone, etc.
[0077] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0078] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0079] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0080] These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable apparatus for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0081] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0082] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0083] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0084] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0085] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0086] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A file processing method, characterized in that, include: Multiple files to be processed are obtained, and target rules matching each file to be processed are obtained from multiple rule sets. The multiple rule sets include splitting rule sets, decoding rule sets, and merging rule sets. The target rules include target splitting rules, target decoding rules, and target merging rules. The files to be processed are files that need to interact with other systems. The multiple files to be processed are split according to the matching target splitting rules to obtain multiple sets of first files; The first files are decoded according to the target decoding rules to obtain the second files. The second files are merged according to the matching target merging rules to obtain the target files for each of the files to be processed. Decode each of the multiple sets of the first files according to the matching target decoding rule to obtain multiple sets of the second files, including: Determine the acquisition order of the multiple files to be processed, and read the matching target decoding rules sequentially according to the acquisition order; According to the acquisition order, the first files are sequentially decoded according to the matching target decoding rules, and it is determined whether all the first files have been decoded. If all the first files have been decoded, the second files are obtained.
2. The method according to claim 1, characterized in that, The multiple files to be processed are split according to the matching target splitting rule to obtain multiple sets of first files, including: Determine the acquisition order of the multiple files to be processed, and read the matching target splitting rules sequentially according to the acquisition order; According to the acquisition order, the multiple files to be processed are split sequentially according to the matching target splitting rules, and it is determined whether all the files to be processed have been split. If all the files to be processed have been split, multiple sets of the first files are obtained.
3. The method according to claim 1, characterized in that, The second files are merged according to the matching target merging rules to obtain the target files that match each of the files to be processed, including: Determine the acquisition order of the multiple files to be processed, and read the matching target merging rules sequentially according to the acquisition order; According to the acquisition order, the multiple groups of second files are merged sequentially according to the matching target merging rules, and it is determined whether all second files have been merged. If all second files have been merged, the target file matching each of the files to be processed is obtained.
4. The method according to claim 1, characterized in that, Before acquiring multiple files to be processed and obtaining target rules matching each file from multiple rule sets, the method further includes: The target file processing device reads multiple first rules from the local system and multiple second rules from at least one external system, and the multiple first rules and multiple second rules constitute multiple rule sets; Obtaining multiple files to be processed, and retrieving target rules matching each file from multiple rule sets, includes: The target file processing device reads a plurality of first files to be processed from the local system and a plurality of second files to be processed from at least one external system, wherein the plurality of first files to be processed and the plurality of second files to be processed constitute the plurality of files to be processed. The system type corresponding to each file to be processed is determined, and the matching target rule is obtained from multiple rule sets according to the system type, wherein each rule in each rule set is associated with a preset system type.
5. The method according to claim 4, characterized in that, After acquiring multiple files to be processed and obtaining target rules matching each file from multiple rule sets, the method further includes: If at least one of the files to be processed cannot obtain a matching target rule from multiple rule sets, monitor whether the first rule of the local system and the second rule of the external system have changed; If the first rule in the local system and / or the second rule in the external system change, the various rule sets are updated.
6. The method according to claim 1, characterized in that, After merging multiple groups of the second files according to the matching target merging rules to obtain the target files for each of the files to be processed, the method further includes: Obtain split logs, decoding logs, merging logs, and rule logs, wherein the split logs record the running status and splitting result information when splitting the file to be processed, the decoding logs record the running status and decoding result information when decoding the first file, the merging logs record the running status and merging result information when merging the second file, and the rule logs record the update information of the rule set; A file splitting report is generated based on the splitting log, a file decoding report is generated based on the decoding log, a file merging report is generated based on the merging log, and a rule report is generated based on the rule log.
7. A document processing device, characterized in that, include: The acquisition unit is used to acquire multiple files to be processed and to acquire target rules that match each file to be processed from multiple rule sets. The multiple rule sets include splitting rule sets, decoding rule sets, and merging rule sets. The target rules include target splitting rules, target decoding rules, and target merging rules. The files to be processed are files that need to interact with other systems. The splitting unit is used to split the multiple files to be processed according to the matching target splitting rule to obtain multiple sets of first files; The decoding unit is used to decode the multiple sets of the first files according to the matched target decoding rule to obtain multiple sets of the second files; The merging unit is used to merge multiple groups of the second files according to the matching target merging rules to obtain the target file for each of the files to be processed. The decoding unit includes: a second determining module, used to determine the acquisition order of multiple files to be processed, and read the matching target decoding rules in sequence according to the acquisition order; and a decoding module, used to decode multiple sets of first files in sequence according to the acquisition order and the matching target decoding rules, and to determine whether all first files have been decoded. If all first files have been decoded, multiple sets of second files are obtained.
8. A processor, characterized in that, The processor is used to run a program, wherein the program executes the file processing method according to any one of claims 1 to 6 when it runs.
9. An electronic device, characterized in that, It includes one or more processors and a memory, the memory being used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors cause the one or more processors to implement the file processing method according to any one of claims 1 to 6.
Citation Information
Patent Citations
File processing method and device, equipment and computer readable storage medium
CN110457260A