CN114661671A - File processing method and device, computer readable storage medium and electronic equipment - Google Patents

File processing method and device, computer readable storage medium and electronic equipment Download PDF

Info

Publication number
CN114661671A
CN114661671A CN202210390336.8A CN202210390336A CN114661671A CN 114661671 A CN114661671 A CN 114661671A CN 202210390336 A CN202210390336 A CN 202210390336A CN 114661671 A CN114661671 A CN 114661671A
Authority
CN
China
Prior art keywords
file
imported
target
field
import
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210390336.8A
Other languages
Chinese (zh)
Inventor
陆杨芳
魏亚东
高丽
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202210390336.8A priority Critical patent/CN114661671A/en
Publication of CN114661671A publication Critical patent/CN114661671A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/16File or folder operations, e.g. details of user interfaces specifically adapted to file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Human Computer Interaction (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a file processing method, a file processing device, a computer readable storage medium and electronic equipment. Relating to the technical field of big data, the method comprises the following steps: acquiring a file identifier corresponding to each file to be imported; determining a file import rule corresponding to each file to be imported from the first configuration file based on the file identification, wherein different file import rules correspond to files to be imported with different structures; and calling a file import rule corresponding to each file to be imported based on a preset program, and importing the corresponding file to be imported into the target platform based on the file import rule. The invention solves the technical problem of low file import efficiency caused by importing files with different structures by adopting different codes in the prior art.

Description

File processing method and device, computer readable storage medium and electronic equipment
Technical Field
The invention relates to the technical field of big data, in particular to a file processing method and device, a computer readable storage medium and electronic equipment.
Background
With the continuous development of computer technology, various single applications are more and more, the connection between the applications is tighter and tighter, and the data interaction between the applications is more frequent.
At present, when a single application needs to receive data files transmitted by other applications, a large amount of data interaction between the applications is realized by adopting a mode of batch import of files with different structures by different codes. Under the condition that the requirement of a large amount of applications on data file interaction is more and more vigorous, the currently adopted mode cannot well meet the interaction requirement, and the problems of low research and development efficiency, high maintenance cost, poor expandability and the like exist.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The embodiment of the invention provides a file processing method and device, a computer readable storage medium and electronic equipment, which are used for at least solving the technical problem of low file import efficiency caused by importing files with different structures by adopting different codes in the prior art.
According to an aspect of an embodiment of the present invention, there is provided a file processing method including: acquiring a file identifier corresponding to each file to be imported; determining a file import rule corresponding to each file to be imported from the first configuration file based on the file identification, wherein different file import rules correspond to files to be imported with different structures; and calling a file import rule corresponding to each file to be imported based on a preset program, and importing the corresponding file to be imported into the target platform based on the file import rule.
Further, the file processing method further comprises: and determining a first file verification rule corresponding to each file to be imported from the second configuration file based on the file identification, wherein the first file verification rule is used for verifying the field length and the field type of the file to be imported.
Further, the file processing method further comprises: determining at least one first target field in a file to be imported based on a first file verification rule; detecting whether the length of at least one first target field is a target length and detecting whether the field type of at least one first target field is a target type; and marking the file to be imported under the condition that the length of the at least one first target field is detected to be the non-target length or the field type of the at least one first target field is detected to be the non-target type.
Further, the file processing method further comprises: determining a second file check rule corresponding to each file to be imported from a third configuration file based on the file identification under the condition that the length of at least one first target field is a target length and the field type of the at least one first target field is a target type, wherein the second file check rule is used for checking the file content corresponding to the file to be imported; determining at least one second target field in the file to be imported based on a second file checking rule; detecting whether the field content of at least one second target field is target content; and marking the file to be imported under the condition that the field content of at least one second target field is detected to be non-target content.
Further, the file processing method further comprises: and under the condition that the field content of at least one second target field is target content, determining a file import rule corresponding to each file to be imported from the first configuration file based on the file identification, wherein the file import rule is used for representing the corresponding relation between each file to be imported and the file in the target platform.
Further, the file processing method further comprises: determining a target file corresponding to each file to be imported from files in a target platform based on a file import rule; determining the target position of each field in the file to be imported in the corresponding target file based on the file import rule; and importing each file to be imported into a corresponding target file, and importing the fields in each file to be imported into a corresponding target position.
Further, the file processing method further comprises: determining at least one third target field in the file to be imported based on the file import rule; and converting the field content of at least one third target field to obtain a target field to be imported.
Further, the file processing method further comprises: acquiring a file to be imported; constructing a temporary file, wherein the temporary file comprises time information and a file identifier corresponding to each file to be imported; and importing each file to be imported into the temporary file in sequence based on the file identification sequence corresponding to the file identification in the temporary file.
Further, the file processing method further comprises: responding to an input instruction of a target object, and acquiring a target configuration file; and processing the file to be imported based on the target configuration file to obtain the target file to be imported.
According to another aspect of the embodiments of the present invention, there is also provided a file processing apparatus including: the acquisition module is used for acquiring a file identifier corresponding to each file to be imported; the determining module is used for determining a file import rule corresponding to each file to be imported from the first configuration file based on the file identification, wherein different file import rules correspond to files to be imported with different structures; and the import module is used for calling a file import rule corresponding to each file to be imported based on a preset program and importing the corresponding file to be imported into the target platform based on the file import rule.
According to another aspect of the embodiments of the present invention, there is also provided a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the above-mentioned file processing method when running.
According to another aspect of the embodiments of the present invention, there is also provided an electronic device, including one or more processors; a memory for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement a method for running the programs, wherein the programs are arranged to perform the file processing method described above when run.
According to another aspect of the embodiments of the present invention, there is also provided a computer program product including a computer program/instructions, which when executed by a processor, implement the file processing method described above.
In the embodiment of the invention, a mode of determining the corresponding file import rule based on the file identifier is adopted, the file identifier corresponding to each file to be imported is obtained, and then the file import rule corresponding to each file to be imported is determined from the first configuration file based on the file identifier, so that the file import rule corresponding to each file to be imported is called based on a preset program, and the corresponding file to be imported is imported into the target platform based on the file import rule. Different file import rules correspond to files to be imported with different structures.
In the process, the first configuration file comprises file import rules, and different file import rules correspond to files to be imported with different structures, so that the file import rules can be accurately determined by acquiring the file identifier corresponding to each file to be imported and determining the file import rules corresponding to the files to be imported from the first configuration file according to the identifier, so that accurate calling of the file import rules by a preset program is ensured, the corresponding files to be imported can be imported into a target platform based on the file import rules, and accurate import of the files is realized. Compared with the mode that a set of import codes is developed for each file import adopted in the prior art, the file import method and the file import device lead the corresponding file to be imported into the target platform based on the file import rule, and avoid the situation of high maintenance cost caused by a large number of identical codes in each set of import codes in the prior art.
Therefore, the scheme provided by the application achieves the purpose of reducing the research and development workload and the subsequent maintenance cost, the technical effect of improving the research and development efficiency is achieved, and the technical problem of low file import efficiency caused by importing files with different structures by adopting different codes in the prior art is solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
FIG. 1 is a flow diagram of an alternative document processing method according to an embodiment of the invention;
FIG. 2 is a step diagram of an alternative document processing method according to an embodiment of the invention;
FIG. 3 is a schematic view of an alternative document processing device according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of an alternative electronic device according to an embodiment of the invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Moreover, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be noted that the related information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for presentation, analyzed data, etc.) related to the present invention are information and data authorized by the user or sufficiently authorized by each party. For example, an interface is provided between the system and the relevant user or organization, before obtaining the relevant information, an obtaining request needs to be sent to the user or organization through the interface, and after receiving the consent information fed back by the user or organization, the relevant information is obtained.
Example 1
In accordance with an embodiment of the present invention, there is provided an embodiment of a file processing method, it should be noted that the steps illustrated in the flowchart of the drawings may be performed in a computer system such as a set of computer executable instructions, and that while a logical order is illustrated in the flowchart, in some cases the steps illustrated or described may be performed in an order different than here.
Fig. 1 is a flowchart of an alternative document processing method according to an embodiment of the present invention, as shown in fig. 1, the method includes the following steps:
step S101, acquiring a file identifier corresponding to each file to be imported.
In the above steps, the file importing operation may be generated when the system needs to receive data files of other systems, for example, when the backend system needs to acquire a data file sent by the upstream service system, the data file of the upstream service system may be imported into the backend system. Optionally, the file identifier corresponding to each file to be imported may be an attribute type of the file, and specifically, the file identifier may be information that can uniquely identify the file, such as an identity card and an organization structure code.
It should be noted that, in this embodiment, files can be distinguished by obtaining the file identifier, so that the accuracy of file importing is improved.
Step S102, determining a file import rule corresponding to each file to be imported from the first configuration file based on the file identification, wherein different file import rules correspond to files to be imported with different structures.
In the above step, the first configuration file is created by the system before receiving the file, and includes the file import rule corresponding to each file to be imported. Optionally, the file import rule may be a rule formulated for the file itself, for example, a rule may be formulated for the type of the file, and when the file is a file expressed by characters, the file may be imported; when the file is a file represented by a number, the file cannot be imported. Optionally, the import rule may also be a rule formulated for data in a file, for example, when the data type in the file is a character and the data length is 10 bits, an import operation may be performed on the file.
Further, the corresponding import rule may be determined by the previously obtained file identifier, for example, when the obtained file identifier is a digital identifier, the corresponding file import rule may be "the file is a file represented by a number, and the file cannot be imported". In addition, different file import rules correspond to files to be imported with different structures, and specifically, the file structure may be a nested structure, a parallel structure, or the like. For example, a file having a nested structure is imported by using the principle a, and a file having a parallel structure is imported by using the principle B.
It should be noted that, by the correspondence between the file identifier and the import rule, the rule configuration and identification can be performed on the file import, which is convenient for determining the import file, thereby improving the file import efficiency.
Step S103, calling a file import rule corresponding to each file to be imported based on a preset program, and importing the corresponding file to be imported into the target platform based on the file import rule.
In the above step, the preset program may be a program code for implementing a calling function, and the target platform may be the backend system for receiving the file, for example, the file import rule corresponding to the file to be imported is "the file can be imported if the file is represented by a character", and the file can be imported into the backend system by calling the rule script.
It should be noted that, by calling the import rule, accurate docking of the file can be realized, the docked file can be stored in the receiving system, and the receiving system can perform related processing subsequently.
Based on the schemes defined in steps S101 to S103, it can be known that, in the embodiment of the present invention, a manner of determining a corresponding file import rule based on a file identifier is adopted, and a file identifier corresponding to each file to be imported is obtained, and then a file import rule corresponding to each file to be imported is determined from the first configuration file based on the file identifier, so that the file import rule corresponding to each file to be imported is called based on a preset program, and the corresponding file to be imported is imported to the target platform based on the file import rule. Different file import rules correspond to files to be imported with different structures.
In the process, the first configuration file comprises file import rules, and different file import rules correspond to files to be imported with different structures, so that the file import rules can be accurately determined by acquiring the file identifier corresponding to each file to be imported and determining the file import rules corresponding to the files to be imported from the first configuration file according to the identifier, so that the file import rules can be accurately called by a preset program, the corresponding files to be imported can be imported to a target platform based on the file import rules, and the files can be accurately imported. Compared with the mode that a set of import codes is developed for each file import adopted in the prior art, the file import method and the file import device lead the corresponding file to be imported into the target platform based on the file import rule, and avoid the situation of high maintenance cost caused by a large number of identical codes in each set of import codes in the prior art.
Therefore, the scheme provided by the application achieves the purpose of reducing the research and development workload and the subsequent maintenance cost, the technical effect of improving the research and development efficiency is achieved, and the technical problem of low file import efficiency caused by importing files with different structures by adopting different codes in the prior art is solved.
In an optional embodiment, before determining a file import rule corresponding to each file to be imported from the first configuration file based on the file identifier, determining a first file check rule corresponding to each file to be imported from the second configuration file based on the file identifier, where the first file check rule is used to check a field length and a field type in the file to be imported.
Optionally, the corresponding configuration file is preconfigured in the database, where the first configuration file may be a preconfigured main loading table field meaning comparison table, a file import rule is configured in the table, the second configuration file may be a preconfigured main loading table field type length configuration table, and the first file verification rule may be a verification of the field length and the field type.
It should be noted that, by identifying the verification rule for the file import, accurate verification of the field can be realized, so that accurate docking of the file import data is realized.
In an optional embodiment, after determining a first check rule corresponding to each file to be imported from a second configuration file based on a file identifier, determining at least one first target field in the file to be imported based on the first file check rule, detecting the first target field, detecting whether the length of the first target field is a target length, detecting whether the field type of the first target field is a target type, and marking the file to be imported under the condition that the length of the first target field is detected to be a non-target length or the field type of the first target field is detected to be a non-target type.
Optionally, fig. 2 is a step diagram of an optional file processing method according to an embodiment of the present invention, and as shown in fig. 2, after determining the corresponding first check rule, a field technology check step is performed. Optionally, the at least one first target field may be a field to be checked, the target length of the field may be a number of bits, for example, when the first target field is a date, the target length is configured to be 8-bit number, the first target field is detected, and when the 8-bit number "20220330" is detected, the length of the first target field is concluded to be the target length; when the 7-digit number "2022330" is detected, it is concluded that the length of the first target field is a non-target length. In addition, the field type may be a number or a character, for example, when the field type of the first target field is detected, the field type is detected to be a number, and a conclusion that the field type of the first target field is the target type is obtained; and when the field type is detected to be the Chinese character, the conclusion that the field type of the first target field is the non-target type is obtained.
Further, when it is detected that the length of the first target field is a non-target length or the field type of the first target field is a non-target type, a conclusion that the verification fails is obtained, and the file to be imported is marked. Optionally, the reason for the failed verification is indicated in the file to be imported, which fails to be verified, for example, the detected field length is 7 bits, and does not satisfy the length configured by the target field.
It should be noted that, in the field technology verification process, the file to be imported that fails to pass the verification is marked in the general temporary table and the failure reason is noted, so that the operation and maintenance personnel can obtain import technology abnormal data after the verification is finished, the operation and maintenance personnel can conveniently perform the technology verification, and the operation and maintenance cost is reduced.
In an optional embodiment, after detecting whether the length of the at least one first target field is a target length and whether the field type of the at least one first target field is a target type, if the length of the at least one first target field is the target length and the field type of the at least one first target field is the target type, determining a second file verification rule corresponding to each file to be imported from the third configuration file based on the file identification, determining at least one second target field from the file to be imported based on the rule, then detecting whether the field content of the field is target content, and if the field content of the field is detected to be non-target content, marking the file to be imported. And the second file checking rule is used for checking the file content corresponding to the file to be imported.
Optionally, when it is detected that the length of the first target field is the target length and the field type of the first target field is the target type, the result that the first target field meets the requirement of the first check rule, that is, the check is passed is obtained, and the field service check step shown in fig. 2 is continued. Optionally, the third configuration file is a preconfigured main loading table field service meaning value check table, and the second file check rule may check the service content directly according to the rule, or may check the service content indirectly by calling a content verification function.
Optionally, the second target field may be a field for which checking is continued, and whether the field content is correct is checked, for example, the field content may be filled in by gender, the target content may be "male" or "female", and in a case that it is detected that the field content of the field is "none", that is, non-target content, a conclusion that checking is incorrect, that is, checking is not passed is obtained, and the file to be imported is marked. Optionally, the reason for the verification failure is noted in the file to be imported, for which the verification fails, for example, the detected sex content is not "male" or "female".
It should be noted that, in the field service verification process, the file to be imported which is not verified is marked in the general temporary table and the failure reason is noted, so that the operation and maintenance personnel can obtain abnormal data of the imported service after the verification is finished, the operation and maintenance personnel can conveniently check the service, and the operation and maintenance cost is further reduced.
In an optional embodiment, in the process of determining the file import rule corresponding to each file to be imported from the first configuration file based on the file identifier, in the case that the field content of the at least one second target field is the target content, the file import rule corresponding to each file to be imported is determined from the first configuration file based on the file identifier, where the file import rule is used to characterize the correspondence between each file to be imported and the file in the target platform.
Optionally, when it is detected that the field content of the second target field is the target content, a conclusion that the second target field meets the second check rule, that is, the check is passed, is obtained, and the step of importing the formal table shown in fig. 2 is continued. Specifically, the fields passing the technical and service verification are imported into the formal table according to the import rule, i.e. the corresponding relation, in the field meaning comparison table of the main loading table, wherein the comparison relation can be file position comparison or field position comparison.
It should be noted that, unlike the prior art in which files with different structures need to be imported from the temporary table to the formal table based on different codes, in this embodiment, by determining a file import rule, accurate correspondence between files with different structures and fields of the formal table is achieved, thereby avoiding a situation that a large number of identical import codes exist in the file import process in the prior art, further reducing maintenance cost, and facilitating development of subsequent test work.
In an optional embodiment, in the process of importing the corresponding file to be imported into the target platform based on the file import rule, a target file corresponding to each file to be imported is determined from files in the target platform based on the file import rule, then a target position of a field in each file to be imported in the corresponding target file is determined based on the file import rule, and further each file to be imported is imported into the corresponding target file, and the field in each file to be imported is imported into the corresponding target position.
Optionally, the target file may be a formal table pre-configured in the receiving system, and the formal table corresponding to the file to be imported may be determined according to a file import principle, that is, a correspondence relationship. Specifically, the file position in the formal table, i.e. the file position comparison, is determined from the formal table pre-configured in the receiving system based on the file import rule, and the position of the field in the formal table, i.e. the field position comparison, may also be determined according to the correspondence, thereby completing the step of importing the formal table as shown in fig. 2.
It should be noted that, by determining the file position and the field position of the file to be imported, the accurate correspondence of the import position is realized, and the accurate import of the file is ensured.
In an optional embodiment, before each file to be imported is imported into a corresponding target file and a field in each file to be imported is imported into a corresponding target position, at least one third target field in the file to be imported is determined based on a file import rule, and the field content of the at least one third target field is converted to obtain a target field to be imported.
Optionally, the fields that pass the technical and service checks may be imported into the formal table according to the import rule, i.e., the corresponding relationship, in the field meaning comparison table of the main loading table, and at the same time, the field contents may be converted. In the above process, the third target field may be a field subjected to conversion processing, and the conversion processing may be dictionary entry conversion. Specifically, the dictionary term conversion may be a representation conversion process performed due to the fact that the representation of the field is different in different systems, for example, the gender is represented by the characters "male" or "female" in the system a, and is represented by the number "0" or "1" in the system B, and the field in the system B, in which the gender is represented by the number "0" or "1", that is, the target field to be imported is obtained through the conversion process.
It should be noted that, by performing conversion processing on the field content, it is ensured that the imported file data is normally read after the file import is completed, and processing operation is performed by subsequent related personnel conveniently.
In an optional embodiment, before determining a file import rule corresponding to each file to be imported from the first configuration file based on the file identifier, obtaining the files to be imported, and constructing a temporary file, where the temporary file includes time information and a file identifier corresponding to each file to be imported, and importing each file to be imported into the temporary file in sequence based on the file identifier sequence corresponding to the file identifier in the temporary file.
Optionally, in this embodiment, the temporary file may be a general temporary table, and include time information and a file identifier corresponding to each file to be imported, that is, each file to be imported may be distinguished by the time information and the file identifier. And performing the step of importing the acquired file to be imported into the general temporary table as shown in fig. 2, wherein the file to be imported may be files with different structures.
Optionally, in addition to the time information and the file identifier, other fields characterizing file characteristics, such as format and size of the file, may be defined as fixed fields according to requirements, or may be defined as general fields, for example, the size of the file may be fixed to 500M, or may not be fixed to the size of the file. Other fields are imported into the general temporary table according to a certain sequence, for example, the fields can be imported according to the data type, the data length and the storage format of the data.
It should be noted that, compared with the prior art in which each file is uniquely developed and developed, each file corresponds to a different set of import program, in this embodiment, files of all structures are imported into the general temporary table by creating the general temporary table, so that a situation in which a unique database table is prepared for files of different structures in the prior art, that is, files of different structures are imported into different temporary tables, and the number of temporary tables increases as the number of imported files increases, is avoided, and further, development workload and subsequent maintenance cost are reduced.
In an optional embodiment, the file processing method may further respond to an input instruction of the target object, acquire the target configuration file, and process the file to be imported based on the target configuration file to obtain the target file to be imported.
Optionally, the target object may be a system that needs to perform a file import operation, and during the process of performing the file import by the system, a step that needs to be performed personally in the file to be imported may also be configured by creating a personalized customization table, specifically, the step of performing personalized customization on the file to be imported as shown in fig. 2 may be performed by configuring a call function. For example, the account balance copy module of the financial market risk system imports the position data of the financial market transaction system into the database, and simultaneously performs financial tool tree registration on the account balance data, and completes product registration in the process of importing the position data into the formal form by creating a newly added product registration configuration table, configuring a calling function and an input field.
It should be noted that, compared with the prior art that each file is uniquely developed and developed, each file corresponds to a different set of import program, in this embodiment, by creating a personalized customization table, an expansion operation for importing expansion requirements of the file can be realized in the file import process, which avoids the problem that in the prior art, when there is an expansion requirement in the file import process, the expansion requirements cannot be rapidly developed and developed, and an import code is embedded in the developed program, which leads to a high later maintenance cost, thereby realizing flexible configuration of file import, improving the expandability of file import, and reducing the maintenance cost.
Therefore, the scheme provided by the application achieves the purpose of reducing the research and development workload and the subsequent maintenance cost, the technical effect of improving the research and development efficiency is achieved, and the technical problem that in the prior art, files with different structures are imported by adopting different codes, so that the file import efficiency is low is solved.
Example 2
According to an embodiment of the present invention, an embodiment of a document processing apparatus is provided, where fig. 3 is a schematic diagram of an alternative document processing apparatus according to an embodiment of the present invention, as shown in fig. 3, the apparatus includes:
an obtaining module 301, configured to obtain a file identifier corresponding to each file to be imported;
a determining module 302, configured to determine, based on the file identifier, a file import rule corresponding to each file to be imported from the first configuration file, where different file import rules correspond to files to be imported with different structures;
the importing module 303 is configured to call a file importing rule corresponding to each file to be imported based on a preset program, and import the corresponding file to be imported to the target platform based on the file importing rule.
It should be noted that the obtaining module 301, the determining module 302, and the importing module 303 correspond to steps S101 to S103 in the above embodiment, and the three modules are the same as the examples and application scenarios realized by the corresponding steps, but are not limited to the disclosure in embodiment 1.
Optionally, the file processing apparatus further includes: and the first determining module is used for determining a first file verification rule corresponding to each file to be imported from the second configuration file based on the file identifier, wherein the first file verification rule is used for verifying the field length and the field type of the file to be imported.
Optionally, the file processing apparatus further includes: the second determining module is used for determining at least one first target field in the file to be imported based on the first file checking rule; the first detection module is used for detecting whether the length of at least one first target field is a target length and detecting whether the field type of at least one first target field is a target type; the first marking module is used for marking the file to be imported under the condition that the length of the at least one first target field is detected to be the non-target length or the field type of the at least one first target field is detected to be the non-target type.
Optionally, the file processing apparatus further includes: a third determining module, configured to determine, based on the file identifier, a second file verification rule corresponding to each file to be imported from a third configuration file when the length of the at least one first target field is a target length and the field type of the at least one first target field is a target type, where the second file verification rule is used to verify file content corresponding to the file to be imported; the fourth determining module is used for determining at least one second target field in the file to be imported based on the second file verification rule; the second detection module is used for detecting whether the field content of at least one second target field is the target content; and the second marking module is used for marking the file to be imported under the condition that the field content of at least one second target field is detected to be non-target content.
Optionally, the file processing apparatus further includes: and the fifth determining module is used for determining a file import rule corresponding to each file to be imported from the first configuration file based on the file identification under the condition that the field content of the at least one second target field is the target content, wherein the file import rule is used for representing the corresponding relation between each file to be imported and the file in the target platform.
Optionally, the document processing apparatus further includes: the sixth determining module is used for determining a target file corresponding to each file to be imported from the files in the target platform based on the file import rule; a seventh determining module, configured to determine, based on a file import rule, a target position of a field in each file to be imported in the corresponding target file; and the first import module is used for importing each file to be imported into the corresponding target file and importing the fields in each file to be imported into the corresponding target positions.
Optionally, the file processing apparatus further includes: the eighth determining module is used for determining at least one third target field in the file to be imported based on the file import rule; and the conversion module is used for converting the field content of at least one third target field to obtain a target field to be imported.
Optionally, the file processing apparatus further includes: the first acquisition module is used for acquiring a file to be imported; the system comprises a building module, a storage module and a processing module, wherein the building module is used for building temporary files, and the temporary files comprise time information and file identifications corresponding to each file to be imported; and the second import module is used for importing each file to be imported into the temporary file in sequence based on the file identification sequence corresponding to the file identification in the temporary file.
Optionally, the document processing apparatus further includes: the second acquisition module is used for responding to an input instruction of the target object and acquiring a target configuration file; and the processing module is used for processing the file to be imported based on the target configuration file to obtain the target file to be imported.
Example 3
According to another aspect of the embodiments of the present invention, there is also provided a computer-readable storage medium having a computer program stored therein, wherein the computer program is configured to execute the above-mentioned file processing method when running.
Example 4
According to another aspect of the embodiments of the present invention, there is also provided an electronic device, where fig. 4 is a schematic diagram of an alternative electronic device according to the embodiments of the present invention, as shown in fig. 4, the electronic device includes one or more processors; a memory for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement a method for running the programs, wherein the programs are arranged to perform the file processing method described above when run.
Example 5
According to another aspect of the embodiments of the present invention, there is also provided a computer program product including a computer program/instructions, which when executed by a processor, implement the above-mentioned file processing method.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the embodiments provided in the present application, it should be understood that the disclosed technology can be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, a division of a unit may be a division of a logic function, and an actual implementation may have another division, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or may not be executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk, and various media capable of storing program codes.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that it is obvious to those skilled in the art that various modifications and improvements can be made without departing from the principle of the present invention, and these modifications and improvements should also be considered as the protection scope of the present invention.

Claims (13)

1. A file processing method, comprising:
acquiring a file identifier corresponding to each file to be imported;
determining a file import rule corresponding to each file to be imported from a first configuration file based on the file identification, wherein different file import rules correspond to files to be imported with different structures;
and calling a file import rule corresponding to each file to be imported based on a preset program, and importing the corresponding file to be imported into the target platform based on the file import rule.
2. The method according to claim 1, wherein before determining the file import rule corresponding to each file to be imported from the first configuration file based on the file identifier, the method comprises:
and determining a first file verification rule corresponding to each file to be imported from a second configuration file based on the file identifier, wherein the first file verification rule is used for verifying the field length and the field type of the file to be imported.
3. The method according to claim 2, wherein after determining the first check rule corresponding to each file to be imported from the second configuration file based on the file identifier, the method further comprises:
determining at least one first target field in the file to be imported based on the first file verification rule;
detecting whether the length of the at least one first target field is a target length and detecting whether the field type of the at least one first target field is a target type;
and marking the file to be imported under the condition that the length of the at least one first target field is detected to be the non-target length or the field type of the at least one first target field is detected to be the non-target type.
4. The method of claim 3, wherein after detecting whether the length of the at least one first target field is a target length and the field type of the at least one first target field is a target type, the method further comprises:
determining a second file checking rule corresponding to each file to be imported from a third configuration file based on the file identification under the condition that the length of the at least one first target field is the target length and the field type of the at least one first target field is the target type, wherein the second file checking rule is used for checking the file content corresponding to the file to be imported;
determining at least one second target field in the file to be imported based on the second file verification rule;
detecting whether the field content of the at least one second target field is target content;
and marking the file to be imported under the condition that the field content of the at least one second target field is detected to be non-target content.
5. The method according to claim 4, wherein determining a file import rule corresponding to each file to be imported from a first configuration file based on the file identifier comprises:
and under the condition that the field content of the at least one second target field is target content, determining a file import rule corresponding to each file to be imported from a first configuration file based on the file identification, wherein the file import rule is used for representing the corresponding relation between each file to be imported and the file in the target platform.
6. The method according to claim 5, wherein importing the corresponding file to be imported into the target platform based on the file import rule comprises:
determining a target file corresponding to each file to be imported from the files in the target platform based on the file import rules;
determining the target position of the field in each file to be imported in the corresponding target file based on the file import rule;
and importing each file to be imported into a corresponding target file, and importing the fields in each file to be imported into a corresponding target position.
7. The method according to claim 6, wherein before importing each file to be imported into the corresponding target file and importing the fields in each file to be imported into the corresponding target location, the method further comprises:
determining at least one third target field in the file to be imported based on the file import rule;
and converting the field content of the at least one third target field to obtain a target field to be imported.
8. The method according to claim 1, wherein before determining the file import rule corresponding to each file to be imported from the first configuration file based on the file identifier, the method further comprises:
acquiring the file to be imported;
constructing a temporary file, wherein the temporary file comprises time information corresponding to each file to be imported and the file identification;
and importing each file to be imported into the temporary file in sequence based on the file identification sequence corresponding to the file identification in the temporary file.
9. The method of claim 1, further comprising:
responding to an input instruction of a target object, and acquiring a target configuration file;
and processing the file to be imported based on the target configuration file to obtain a target file to be imported.
10. A document processing apparatus, characterized by comprising:
the acquisition module is used for acquiring a file identifier corresponding to each file to be imported;
the determining module is used for determining a file import rule corresponding to each file to be imported from a first configuration file based on the file identification, wherein different file import rules correspond to files to be imported with different structures;
and the import module is used for calling a file import rule corresponding to each file to be imported based on a preset program and importing the corresponding file to be imported into the target platform based on the file import rule.
11. A computer-readable storage medium, in which a computer program is stored, wherein the computer program is arranged to execute the file processing method of any one of claims 1 to 9 when executed.
12. An electronic device, wherein the electronic device comprises one or more processors; memory for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement for running a program, wherein the program is arranged to, when running, perform the file processing method of any of claims 1 to 9.
13. A computer program product comprising computer programs/instructions, characterized in that the computer programs/instructions, when executed by a processor, implement the file processing method of any of claims 1 to 9.
CN202210390336.8A 2022-04-14 2022-04-14 File processing method and device, computer readable storage medium and electronic equipment Pending CN114661671A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210390336.8A CN114661671A (en) 2022-04-14 2022-04-14 File processing method and device, computer readable storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210390336.8A CN114661671A (en) 2022-04-14 2022-04-14 File processing method and device, computer readable storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN114661671A true CN114661671A (en) 2022-06-24

Family

ID=82035400

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210390336.8A Pending CN114661671A (en) 2022-04-14 2022-04-14 File processing method and device, computer readable storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN114661671A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115174555A (en) * 2022-06-28 2022-10-11 平安科技(深圳)有限公司 File transmission method and device, electronic equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115174555A (en) * 2022-06-28 2022-10-11 平安科技(深圳)有限公司 File transmission method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN110597511B (en) Page automatic generation method, system, terminal equipment and storage medium
JP2019500680A (en) Data processing method and apparatus
CN109784738B (en) Approval method and approval device
US20150186195A1 (en) Method of analysis application object which computer-executable, server performing the same and storage media storing the same
CN110928534B (en) Workflow node authentication method and device based on block chain
CN115563002A (en) Data importing method and device, storage medium and computer equipment
CN114661671A (en) File processing method and device, computer readable storage medium and electronic equipment
CN109189372B (en) Development script generation method of insurance product and terminal equipment
CN109324963B (en) Method for automatically testing profit result and terminal equipment
CN113703753B (en) Method and device for product development and product development system
CN113704123B (en) Interface testing method, device, equipment and storage medium
CN116302502A (en) Electronic signature method, device, equipment and storage medium
CN110570207A (en) commodity tracing method and device
CN114255134A (en) Account number disassembling method and device and storage medium
CN112241328A (en) Data processing method, device and system
CN103489051A (en) Method for checking and normalizing customer information in multiple information systems of fund company
CN112907395A (en) Client type identification method, device and equipment
CN113821441B (en) Execution method, device, equipment and storage medium based on document test case
CN113822046B (en) Analysis method, device, equipment and storage medium based on document test case
CN110716930A (en) Numerical value transfer method, device, computer equipment and storage medium
CN111400245A (en) Art resource migration method and device
CN110609790A (en) Analytic program test method, device, medium and computer equipment
CN109584087B (en) Information processing method, device and storage medium
CN115525805A (en) Method and device for identifying amount character string
CN109783131B (en) Method, device and equipment for acquiring version function difference and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination