Disclosure of Invention
The embodiment of the invention provides a file processing method, a device and computer equipment, which are used for providing a new processing mode for a fund file so as to improve the accuracy of processing the fund file and the efficiency of processing the file.
In a first aspect, a method for processing a file is provided, the method comprising:
Determining a fund file to be converted;
Reading transaction record data in the fund file, wherein the transaction record data comprises M pieces of sub transaction data formed by splicing according to a preset sequence, each piece of sub transaction data in the M pieces of sub transaction data comprises field data of N fields, the field names of each field in the N fields are different, and M and N are integers which are greater than or equal to 1;
Dividing N fields of each piece of sub transaction data into N columns according to the typesetting format of the EXCEL file, and setting column identification of each column according to the field name of the field corresponding to each column to perform EXCEL typesetting so as to obtain a first typesetting result aiming at the transaction record data;
and generating an EXCEL file corresponding to the foundation file according to the first typesetting result.
According to the technical scheme, the transaction record data formed by splicing the N fields of M rows in the foundation file is divided into N columns according to the N fields of each piece of sub transaction data, and the column identification of the column is set according to the field name of the field corresponding to each column to perform EXCEL typesetting, so that different fields in each piece of sub transaction record data are divided, a user can know the field content in each piece of sub transaction record data clearly, and the accuracy of processing the foundation file is improved.
In an alternative embodiment, the method further comprises:
translating field names of the N fields in a second language different from the first language to obtain N field identifiers expressed in the second language, wherein the field names of the N fields in the first typesetting result are expressed in the first language;
Setting N field identifiers expressed in the second language and N column identifiers in the first typesetting result as one column respectively according to a mode that the field identifiers used for expressing the same field name are correspondingly arranged with the column identifiers, so as to obtain a second typesetting result for the N fields;
And generating an EXCEL file corresponding to the fund file according to the first typesetting result, wherein the EXCEL file comprises:
and generating an EXCEL file corresponding to the foundation file according to the first typesetting result and the second typesetting result.
According to the technical scheme, the field names of the N fields are translated in the second language different from the first language, N field identifiers expressed in the second language are respectively and correspondingly set into one row with N row identifiers in the first typesetting result for typesetting, so that users who are used to reading in different languages can directly acquire the meaning expressed by the field names, the operation of the users is reduced, and the user experience is improved.
In an alternative embodiment, obtaining the second typesetting result for the N subsections includes:
Determining a bit number identifier corresponding to each field according to the bit number occupied by each field in the N fields;
typesetting the digit identification of each field and the field identification or column identification corresponding to the field to obtain a field digit typesetting result;
And updating the second typesetting result according to the field digit typesetting result.
According to the technical scheme, the digit identification corresponding to each field is determined, and then the digit identification of each field is typeset corresponding to the field identification or the column identification corresponding to the field, so that a field digit typesetting result is obtained, that is, a user can see the EXCEL file displayed with the digit identifications of N fields, and therefore when the user needs to check whether the digit of the field accords with the protocol specification, the digit identification of the N fields can be determined directly according to the displayed digit identifications of the N fields, and the processing efficiency of processing the foundation file is improved.
In an alternative embodiment, the method further comprises:
Determining fixed file description data in the fund files, wherein the fixed file description data comprises data with the same type included in all the fund files represented by a financial data protocol adopted by the fund files;
According to the typesetting format of the fixed file description data in the foundation file, performing EXCEL typesetting on the fixed file description data to obtain a third typesetting result aiming at the fixed file description data;
And generating an EXCEL file corresponding to the fund file according to the first typesetting result, wherein the EXCEL file comprises:
and generating an EXCEL file corresponding to the foundation file according to the first typesetting result and the third typesetting result.
According to the technical scheme, the fixed file description data in the fund files are typeset, and then the fixed file description data and the first typesetting result are combined to generate the EXCEL files corresponding to the fund files, so that the generated EXCEL files correspond to the fund files, and a user can accurately use all data contents of the fund files through the EXCEL files, so that the user experience is improved.
In an alternative embodiment, after generating the EXCEL file corresponding to the fund file, the method further comprises:
Receiving an editing operation for the EXCEL file;
determining a response result of the edited data in the EXCEL file to the editing operation according to the editing operation;
carrying out validity check on the response result according to the data attribute of the edited data, wherein the data attribute comprises the number of bits occupied by the data and/or the data retention level;
and if the test is not passed, the response to the editing operation is canceled.
In the above technical solution, an editing operation (e.g., a modification operation) for the EXCEL file may be received, and then, according to the editing operation, a response result of the edited data in the EXCEL file to the editing operation is determined, so that validity verification is performed on the response result according to a data attribute of the edited data, that is, when the user edits the EXCEL file, verification may be performed on the user edited data, so as to improve accuracy of processing the file. When the verification fails, the response to the editing operation, that is, the illegal editing of the user is prevented during the editing operation, may be canceled to determine the validity of the edited data.
In an alternative embodiment, the method further comprises:
Determining an EXCEL file to be converted, wherein the EXCEL file to be converted is the EXCEL file obtained by conversion according to the foundation file;
performing typesetting conversion on the EXCEL file to be converted according to the typesetting format of the foundation file to obtain a fourth typesetting result;
and generating a fund file corresponding to the EXCEL file to be converted according to the fourth typesetting result.
According to the technical scheme, the EXCEL file obtained through conversion according to the foundation file can be processed, namely, the EXCEL file to be converted is subjected to typesetting conversion according to the typesetting format of the foundation file, and then the foundation file corresponding to the EXCEL file to be converted is generated. That is, the converted EXCEL file can be converted into the fund file again, so that a user can process transaction record data of the fund file in the EXCEL file, and then the processed EXCEL file is converted into the fund file, so that user experience is improved.
In an alternative embodiment, the method further comprises:
in the process of converting the EXCEL file to be converted into a corresponding fund file, carrying out validity check on key data, wherein the key data comprises at least one of field length, parameter number and data line number;
And when the key data passes the validity check, continuing to convert the EXCEL file to be converted into the corresponding fund file.
In the technical scheme, the validity of the key data can be checked in the process of converting the EXCEL file to be converted into the corresponding fund file, so that the validity of the fund file converted from the EXCEL file can be further ensured, and the accuracy of file processing is improved.
In a second aspect, the present application provides a document processing apparatus, the apparatus comprising:
the first determining module is used for determining the fund file to be converted;
The reading module is used for reading transaction record data in the fund file, wherein the transaction record data comprises M pieces of sub transaction data formed by splicing according to a preset sequence, each piece of sub transaction data in the M pieces of sub transaction data comprises field data of N fields, the field names of each field in the N fields are different, and M and N are integers which are larger than or equal to 1;
The first typesetting module is used for dividing N fields of each piece of sub transaction data into N columns according to the typesetting format of the EXCEL file and setting column identifications of the columns according to field names of the fields corresponding to each column so as to obtain a first typesetting result for the transaction record data;
and the first processing module is used for generating an EXCEL file corresponding to the foundation file according to the first typesetting result.
In an alternative embodiment, the apparatus further comprises a second determining module configured to:
translating field names of the N fields in a second language different from the first language to obtain N field identifiers expressed in the second language, wherein the field names of the N fields in the first typesetting result are expressed in the first language;
The device also comprises a second typesetting module, a first typesetting module and a second typesetting module, wherein the second typesetting module is used for setting N field identifiers expressed in the second language and N column identifiers in the first typesetting result into a column respectively according to a mode that the field identifiers used for expressing the same field name are correspondingly arranged with the column identifiers so as to obtain a second typesetting result aiming at the N fields;
The device also comprises a second processing module, which is used for generating an EXCEL file corresponding to the fund file according to the first typesetting result and the second typesetting result.
In an alternative embodiment, the second determining module is further configured to:
Determining a bit number identifier corresponding to each field according to the bit number occupied by each field in the N fields;
The second typesetting module is used for typesetting the digit identification of each field and the field identification or the column identification corresponding to the field so as to obtain a field digit typesetting result;
And updating the second typesetting result according to the field digit typesetting result.
In an alternative embodiment, the apparatus further comprises a third determining module configured to:
Determining fixed file description data in the fund files, wherein the fixed file description data comprises data with the same type included in all the fund files represented by a financial data protocol adopted by the fund files;
the device further comprises a third typesetting module, which is used for performing EXCEL typesetting on the fixed file description data according to the typesetting format of the fixed file description data in the foundation file so as to obtain a third typesetting result aiming at the fixed file description data;
the device also comprises a third processing module which is used for generating an EXCEL file corresponding to the fund file according to the first typesetting result and the third typesetting result.
In an alternative embodiment, the apparatus further includes a verification module, after generating the EXCEL file corresponding to the fund file, for:
Receiving an editing operation for the EXCEL file;
determining a response result of the edited data in the EXCEL file to the editing operation according to the editing operation;
carrying out validity check on the response result according to the data attribute of the edited data, wherein the data attribute comprises the number of bits occupied by the data and/or the data retention level;
and if the test is not passed, the response to the editing operation is canceled.
In an alternative embodiment, the apparatus further comprises a conversion module for:
Determining an EXCEL file to be converted, wherein the EXCEL file to be converted is the EXCEL file obtained by conversion according to the foundation file;
performing typesetting conversion on the EXCEL file to be converted according to the typesetting format of the foundation file to obtain a fourth typesetting result;
and generating a fund file corresponding to the EXCEL file to be converted according to the fourth typesetting result.
In an alternative embodiment, the verification module is further configured to:
in the process of converting the EXCEL file to be converted into a corresponding fund file, carrying out validity check on key data, wherein the key data comprises at least one of field length, parameter number and data line number;
The conversion module is further configured to:
And when the key data passes the validity check, continuing to convert the EXCEL file to be converted into the corresponding fund file.
The advantages of the second aspect and the embodiments of the second aspect may be referred to the advantages of the first aspect and the embodiments of the first aspect, and will not be described here again.
In a third aspect, there is provided a computer device comprising:
A memory for storing program instructions;
And a processor for calling program instructions stored in the memory, and executing steps comprised in any one of the methods of the first aspect according to the obtained program instructions.
In a fourth aspect, there is provided a storage medium storing computer-executable instructions for causing a computer to perform the steps comprised in any one of the methods of the first aspect.
These and other aspects of the application will be more readily apparent from the following description of the embodiments.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application, and it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments of the present application. All other embodiments, which can be made by those skilled in the art based on the embodiments of the application without making any inventive effort, are intended to be within the scope of the application. Embodiments of the application and features of the embodiments may be combined with one another arbitrarily without conflict. Also, while a logical order is depicted in the flowchart, in some cases, the steps depicted or described may be performed in a different order than presented herein.
In order to facilitate understanding of the technical solution provided by the embodiments of the present application, a part of terms used in the embodiments of the present application are explained here:
1. the data exchange protocol of the open-type foundation business of the central data exchange platform prescribes data formats, data definitions and data contents used for data exchange between institutions in related business of asset management products (including but not limited to public offering foundation, non public offering foundation, aggregate asset management plan, etc., abbreviated herein as "foundation").
2. And the fund file is a file which complies with the data exchange protocol specification of the open fund business of the central data exchange platform, is called fund file for short and comprises a data index file and a data file. The naming rule of the data index file is 'OFI/OFJ/OFS/OFK/OFC "+ the code of the file creator +" _ "+ the code of the file receiver + the code of the file + the date (YYYYMMDD) +the TXT', and the naming rule of the data file is 'OFD" + "_" + the code of the file creator + the code of the file receiver + the date (YYYYMMDD) +the "_" + the two-bit file type code + ". TXT' content is the data content exchanged between the institutions.
3. A graphical user interface (GRAPHICAL USER INTERFACE, GUI) refers to a computer-operated user interface that is displayed graphically. A graphical user interface is an interface display format in which a person communicates with a computer, allowing a user to manipulate icons or menu options on a screen using an input device such as a mouse to select commands, invoke files, launch programs, or perform some other daily task.
4. Tkinter interface interfaces to standard Tk GUI toolkit for Python.
In addition, in the embodiment of the present application, the "plurality" may mean at least two, for example, two, three or more, and the embodiment of the present application is not limited. The term "and/or" is merely an association relationship describing the associated object, and means that three relationships may exist, for example, a and/or B may mean that a exists alone, while a and B exist together, and B exists alone. The character "/" herein generally indicates that the associated object is an "or" relationship unless otherwise specified.
In order to better understand the technical scheme provided by the embodiment of the present application, the technical background of the embodiment of the present application is described below.
In the prior art, referring to fig. 1, fig. 1 is a schematic diagram of a data file in an existing transaction fund file, the data file in the fund file is identified by 1 line of file start identifier, that is, OFDCFDAT,8 lines of fixed fields, each of the fixed fields includes a version number of open-type fund service data exchange protocol of the central data exchange platform, an information creator code, an information receiver code, a data date, a file transmission order flag, a file type, a sender, a receiver, that is, the number n of fields of lines 21, 03, 918, 20170106, 999, 04, 03, 918,1 in fig. 1, that is, the number of field of lines 116, n of field names in fig. 1, that is, the name of field App Sheet Serial No、Transaction Cfm Date、Currency Type、Confirmed Vol、Confirmed Amount、Fund Code、Large Rede mption Flag( in fig. 1, that is, only 8 field names in fig. 1, and the number of lines (m) of lines of 1 of line data content of 8, that is, only part of data content in line 8 in fig. 1, and the end identifier of file of line 1, that is, OFDCFEND.
Referring to fig. 2, fig. 2 is a diagram illustrating data contents of a data file in the transaction fund file shown in fig. 1, and it can be seen from the diagram that the first data content and the second data content each include a plurality of characters, and if the data file is only manually checked or processed, errors are easily generated.
In view of this, the inventors of the present application developed a modifier having a function of converting a fund file into an EXCEL file, which can be applied to a computer device. The modifier uses python development language and Tkinter interface, uses PYINSTALLER to package into exe executable file, thus, the user does not need to install python and other development integrated environments, and the use of the user is greatly facilitated.
Referring to fig. 3, a GUI interface of a modifier in the present application includes a tool log output area, where the tool log output area includes a time when a user uses the modifier and a specific content of an operation performed by the user, so that the user can quickly view a processing time and a specific processing procedure of a fund file, so that the user can clearly know the processing procedure of a working content of the fund file. Further, the tool log output area also includes a select file area and a function area, such as the functions of generating a file, opening xls files, opening zip files, and switching process files shown in fig. 3.
In the embodiment of the application, when the user uses the two functions, the corresponding file can be directly obtained by the function of opening xls file and the function of opening zip file displayed in the modifier GUI interface, namely, the two functions can enable the user to open the generated EXCLE file or the fund file without double clicking the file manager, but can open the corresponding file by clicking the functional button provided by the modifier, thereby reducing the operation steps of the user and improving the processing efficiency of the fund file.
In a specific implementation process, when the user selects to open the ZIP file function, please refer to fig. 4, a plurality of data files and data index files in the opened fund file may be displayed in the GUI interface of the modifier, and then the user may select to open one of the data files, for example, open the ofd_03_918_20170106_04.Txt data file as shown in fig. 4, the content of the data file may be seen, and the data content may be seen to be displayed partially because of the manner of splicing between fields, which makes it difficult for the user to read and modify. After the user performs the file generating operation on the aforementioned ofd_03_918_20170106_04.txt data file of the selected open fund file, please refer to fig. 5, fig. 5 is a GUI interface diagram for converting the data file fd_03_918_20170106_04.txt in the fund file into an EXCLE file.
In the embodiment of the application, the file switching function displayed in the modifier GUI interface can be easily and quickly switched between the functions of converting the fund file into the excel file and converting the excel file into the fund file when the user uses the function, so that the operation steps of the user are reduced, the time is saved, and the processing efficiency of the fund file is improved.
Further, referring to fig. 6, in a specific implementation process, the process of processing the fund file by using the modifier includes the following specific steps:
step 601, obtaining a selection operation for a foundation file to be processed.
Step 602, converting EXLCE the to-be-processed fund file into a file according to the selection operation.
Step 603, obtaining a processing operation of opening the xls file, and displaying the generated EX LCE file according to the processing operation.
Step 604, obtaining a modification or viewing operation for the displayed EXLCE file, and processing the EXLCE file according to the modification or viewing operation to obtain the target EXLCE file.
Step 605, obtaining a conversion operation for the target EXLCE file, and converting the target EXLCE file into a target fund file.
Step 606, obtaining an inspection operation for the target fund file to inspect the generated fund file.
As previously described, a user may use the modifier to convert a fund file into EXLCE files, then use the provided searching, hiding, etc. functions of EXLCE to quickly locate a certain field of a data file in the fund file, then perform checking or modifying on the field, etc. and also hide unnecessary fields. Further, after the value of a certain field in the EXLCE file is further modified, the EXLCE file can be converted into a fund file by using the switching processing file function of the modifier again.
The following describes the implementation principle of converting EXLCE a to-be-processed fund file in this embodiment in detail, please refer to fig. 7, fig. 7 is a flowchart of a file processing method in an embodiment of the present application.
Step 701, determining a fund file to be converted.
Step 702, reading transaction record data in a fund file, wherein the transaction record data comprises M pieces of sub-transaction data spliced according to a preset sequence, each piece of sub-transaction data in the M pieces of sub-transaction data comprises field data of N fields, the field names of each field in the N fields are different, and M and N are integers which are larger than or equal to 1.
In the embodiment of the present application, the method provided by the present application may be executed by the modifier, and specifically, the user clicks the foregoing fund file to determine the fund file to be converted.
When the modifier obtains the operation performed on the data file in the fund file, the modifier may obtain the data content in the data file, and in the embodiment of the present application, for convenience of description, the data content in the data file is referred to as transaction record data, where the transaction record data includes M pieces of sub-transaction data that are spliced in a predetermined order, each piece of sub-transaction data in the M pieces of sub-transaction data includes field data of N fields, and a field name of each field in the N fields is different.
For example, as shown in fig. 8, the transaction record data includes 3 pieces of sub-transaction record data, which are respectively the first sub-transaction record data, the second sub-transaction record data, and the third sub-transaction record data, and the first sub-transaction record data, the second sub-transaction record data, and the third sub-transaction record data include field 1, field 2, field 3, field 4, field 5, field 6, field 7, and field 8, respectively. With continued reference to fig. 8, the first sub-transaction record data is formed by concatenating data corresponding to field 1, field 2, field 3, field 4, field 5, field 6, field 7, and field 8, respectively. Further, the transaction record data may be formed by splicing the first sub-transaction record data, the second sub-transaction record data and the third sub-transaction record data. In addition, the first sub-transaction record data, the second sub-transaction record data, and the third sub-transaction in fig. 8 may be understood as the data contents in fig. 1.
In practical application, each piece of sub transaction record data includes a predetermined identifier, where the predetermined identifier is used to separate data between the sub transaction record data, and specifically, the predetermined identifier may be a space, or may be a x, or may be a #, which is not limited in the embodiment of the present application.
For example, as shown in fig. 9, the predetermined mark is a space, the transaction record data includes 3 pieces of sub transaction record data in total, which are respectively first sub transaction record data, second sub transaction record data and third sub transaction record data, and the first sub transaction record data, the second sub transaction record data and the third sub transaction record data include field 1, field 2, field 3, field 4 and field 5, respectively. With continued reference to fig. 9, the first sub-transaction record data may also be formed by concatenating the data corresponding to field 1, field 2, field 3, field 4, and field 5, and the second sub-transaction record data and the third sub-transaction record data may also be formed by concatenating the data corresponding to field 1, field 2, field 3, field 4, and field 5. A space is included between the first sub-transaction record data and the second sub-transaction record data, and a space is included between the second sub-transaction record data and the third sub-transaction record data. In this way, the first sub-transaction record data, the second sub-transaction record data, and the third sub-transaction record data can be clearly separated.
Step 703, dividing N fields of each piece of sub transaction data into N columns according to a typesetting format of the EXCEL file, and setting column identifications of the columns according to field names of the fields corresponding to each column to perform EXCEL typesetting so as to obtain a first typesetting result for the transaction record data;
In the embodiment of the application, after the transaction record data in the fund file is read, according to the typesetting format of the EXCEL file, N fields of each piece of sub transaction data are divided into N columns, and the EXCEL typesetting is performed by setting the column identification of the column according to the field name of the field corresponding to each column. That is, each piece of sub transaction data is composed of N fields which are spliced and arranged originally, each field occupies one column, and the transaction record data is typeset in a mode that each piece of sub transaction data occupies one row.
In a specific implementation process, taking the transaction record data as shown in fig. 4 as an example, according to the typesetting format of the EXCEL file, the transaction record data is divided into rows and columns to typeset the transaction record data, specifically, the division of each sub-transaction record data into rows may be performed according to the character length limitation of each field in the N fields, so that the typesetting result may be obtained. That is, the transaction record data is clearly displayed by the division manner of the rows and the columns, so that the user can accurately know the content of each field, and the accuracy of processing the fund file is enhanced.
And step 704, generating an EXCEL file corresponding to the foundation file according to the first typesetting result.
In the embodiment of the application, the EXCEL file corresponding to the fund file can be generated according to the first typesetting result obtained by dividing N fields of each piece of sub transaction data into N columns and setting the column identification of each column according to the field name of the field corresponding to each column.
That is, the field names included in the sub-transaction record data and the N columns of the typeset sub-transaction record data are arranged correspondingly, and then the transaction record data are processed in the manner described above, so that the EXCEL file corresponding to the fund file can be generated.
Referring to fig. 5 specifically, line 13 in the excel file shows the field name, and lines 14-18 show the transaction record data of the fund file, so that the user can clearly determine the content of the field, and thus can accurately view and/or modify the content of the field, and the processing efficiency of the fund file is improved.
Specifically, in one possible implementation manner, a target configuration file corresponding to the target fund file may be further determined, the field name of each field is determined from the target configuration file according to the field names of the N fields, and then the field names of the N fields are translated in a second language different from the first language to obtain N field identifiers represented in the second language, where the field names of the N fields in the first typesetting result are represented in the first language, for example, the first language of the field names is english, the second language may be chinese, german, french, portuguese, and other languages, that is, the N field identifiers represented in the second language may be a field identifier of chinese or a field identifier of french.
And setting N field identifiers expressed in a second language and N column identifiers in the first typesetting result as one column respectively according to the mode that the field identifiers used for expressing the same field name are correspondingly arranged with the column identifiers, so as to obtain a second typesetting result for the N fields. Further, an EXCEL file corresponding to the fund file may be generated according to the first typesetting result and the second typesetting result.
For example, referring to FIG. 5, the field identifier in the second language is converted to Chinese. In this way, users who are used to use different languages can know the field names clearly, and the user experience is improved.
Specifically, in one possible implementation manner, the bit number identifier corresponding to each field may be determined according to the bit number occupied by each field in the N fields, and then the bit number identifier of each field is typeset corresponding to the field identifier or the column identifier corresponding to the field, so as to obtain a field bit number typesetting result, and the second typesetting result is updated according to the field bit number typesetting result.
With continued reference to fig. 5, the field identifier of each field and the number of data bits of each field are in a column, so that the user can modify the data in a targeted manner when modifying the data, and the problem that the number of bits of modification is inconsistent with the protocol requirements is reduced as much as possible.
Specifically, in one possible implementation manner, fixed file description data in the fund file is determined, where the fixed file description data includes data with the same type included in all the fund files represented by the financial data protocol adopted by the fund file, and specifically, the fixed file description data may include a file identifier, a fixed record, a field name, and an end-of-file identifier. And then, according to the typesetting format of the fixed file description data in the fund file, performing EXCEL typesetting on the fixed file description data to obtain a third typesetting result aiming at the fixed file description data, so that the EXCEL file corresponding to the fund file can be generated according to the first typesetting result and the third typesetting result. Of course, in a specific implementation process, the EXCEL file corresponding to the fund file may also be generated according to the first typesetting result, the second typesetting result, and the third typesetting result.
In such a way, the generated EXCEL file corresponds to the foundation file, and the user can accurately use all data contents of the foundation file through the EXCEL file, so that the use experience of the user is improved.
Specifically, in one possible implementation, when the user wishes to modify or view the fund file, the user may perform a data modification operation in the EXCEL file after generating the EXCEL file corresponding to the fund file, and the computer device may receive an editing operation (e.g., modification) for the EXCEL file, and then determine a response result of the edited data in the EXCEL file to the editing operation according to the editing operation.
Further, after determining the response result of the edited data in the EXCEL file to the editing operation, the validity of the response result can be checked according to the data attribute of the edited data, wherein the data attribute comprises the number of bits occupied by the data and/or the data retention level, and when the check fails, the response to the editing operation is canceled.
In a specific implementation process, when a user modifies a certain field data in transaction record data in an EXCEL file, after determining a response result of edited data in the EXCEL file to the editing operation, the computer device may verify the field data according to the number of bits occupied by the data, and when the number of bits of the edited field data is different from the number of bits occupied by the field data (for example, the number of bits of the edited field data is greater than the number of bits occupied by the field or the number of bits of the edited field data is less than the number of bits occupied by the field), it may confirm that the verification is not passed, so that the response to the editing operation is cancelled, that is, the user finds that the modified field data is not displayed in the GUI interface.
In a specific implementation process, the data retention level may represent that the data may be deleted or not deleted when the file is converted, specifically, considering that the fixed file description data in the fund file is fixed and unchanged, the fixed file description data in the fund file may be determined to be low in retention level (data that may be deleted), and the transaction record data is determined to be high in retention level (data that may not be deleted).
When the data attribute of the edited data is transaction record data, if the number of the fields of the edited data is different from the number of the fields occupied by the data, for example, the number of the fields of the edited data is larger than the number of the fields occupied by the data, namely, the validity check is not passed, the response to the editing operation can be cancelled. In this way, the validity of the transaction record data can be accurately ensured.
In the embodiment of the application, when the user edits the EXCEL file, the user edited data can be checked to improve the accuracy of processing the file. When the verification fails, the response to the editing operation, that is, the illegal editing of the user is prevented during the editing operation, may be canceled to determine the validity of the edited data.
Specifically, in one possible implementation, the EXCEL file converted from the fund file may also be converted into the fund file. Specifically, an EXCEL file to be converted may be determined, where the EXCEL file to be converted is an EXCEL file converted from a foundation file. And then typesetting and converting the EXCEL file to be converted according to the typesetting format of the foundation file, so that a fourth typesetting result can be obtained, and the foundation file corresponding to the EXCEL file to be converted is generated according to the fourth typesetting result.
In such a way, the converted EXCEL file can be converted into the fund file again, so that a user can conveniently process transaction record data of the fund file in the EXCEL file, and then the processed EXCEL file is converted into the fund file, thereby improving user experience.
Specifically, in one possible implementation manner, the validity check may be further performed on the key data in the process of converting the EXCEL file to be converted into the corresponding fund file, where the key data includes at least one of a field length, a parameter number and a data line number, and when the validity check is performed on the key data, the conversion from the EXCEL file to be converted into the corresponding fund file may be continued.
In the embodiment of the application, the validity of the key data can be checked in the process of converting the EXCEL file to be converted into the corresponding fund file, so that the validity of the fund file converted from the EXCEL file can be further ensured, and the accuracy of file processing is improved.
Based on the same inventive concept, an embodiment of the present application provides a file processing device. The file processing means may be a hardware structure, a software module, or a hardware structure plus a software module. The document processing device may be implemented by a chip system, which may be formed by a chip, or may include a chip and other discrete devices. Referring to fig. 10, a file processing apparatus in an embodiment of the present application includes:
A first determining module 1001, configured to determine a fund file to be converted;
A reading module 1002, configured to read transaction record data in the fund file, where the transaction record data includes M pieces of sub-transaction data formed by splicing according to a predetermined order, each piece of sub-transaction data in the M pieces of sub-transaction data includes field data of N fields, field names of each field in the N fields are different, and M and N are integers greater than or equal to 1;
A first typesetting module 1003, configured to divide N fields of each piece of sub transaction data into N columns according to a typesetting format of an EXCEL file, and set a column identifier of each column according to a field name of a field corresponding to the column, so as to obtain a first typesetting result for the transaction record data;
and the first processing module 1004 is configured to generate an EXCEL file corresponding to the fund file according to the first typesetting result.
In an alternative embodiment, the file processing apparatus further includes a second determining module, configured to:
translating field names of the N fields in a second language different from the first language to obtain N field identifiers expressed in the second language, wherein the field names of the N fields in the first typesetting result are expressed in the first language;
The file processing device also comprises a second typesetting module, which is used for typesetting N field identifiers expressed in a second language and N column identifiers in the first typesetting result respectively into a column according to the mode that the field identifiers used for expressing the same field name are correspondingly arranged with the column identifiers so as to obtain a second typesetting result for the N fields;
The file processing device further comprises a second processing module, and the second processing module is used for generating an EXCEL file corresponding to the fund file according to the first typesetting result and the second typesetting result.
In an alternative embodiment, the second determining module is further configured to:
determining a bit number identifier corresponding to each field according to the bit number occupied by each field in the N fields;
The second typesetting module is used for typesetting the digit identification of each field and the field identification or the column identification corresponding to the field so as to obtain a field digit typesetting result;
and updating the second typesetting result according to the field bit typesetting result.
In an alternative embodiment, the file processing apparatus further includes a third determining module, configured to:
determining fixed file description data in the fund files, wherein the fixed file description data comprises data with the same type included in all the fund files represented by a financial data protocol adopted by the fund files;
The file processing device further comprises a third typesetting module, which is used for typesetting the fixed file description data according to the typesetting format of the fixed file description data in the foundation file so as to obtain a third typesetting result aiming at the fixed file description data;
The file processing device further comprises a third processing module, and the third processing module is used for generating an EXCEL file corresponding to the foundation file according to the first typesetting result and the third typesetting result.
In an alternative embodiment, the file processing device further includes a verification module, after generating the EXCEL file corresponding to the fund file, for:
receiving an editing operation for an EXCEL file;
Determining a response result of the edited data in the EXCEL file to the editing operation according to the editing operation;
carrying out validity check on the response result according to the data attribute of the edited data, wherein the data attribute comprises the bit number occupied by the data and/or the data retention level;
if the test fails, the response to the editing operation is revoked.
In an alternative embodiment, the file processing apparatus further includes a conversion module configured to:
Determining an EXCEL file to be converted, wherein the EXCEL file to be converted is the EXCEL file obtained by conversion according to the foundation file;
performing typesetting conversion on the EXCEL file to be converted according to the typesetting format of the foundation file to obtain a fourth typesetting result;
And generating a fund file corresponding to the EXCEL file to be converted according to the fourth typesetting result.
In an alternative embodiment, the verification module is further configured to:
in the process of converting an EXCEL file to be converted into a corresponding fund file, carrying out validity check on key data, wherein the key data comprises at least one of field length, parameter number and data line number;
the conversion module is also used for:
and when the key data passes the validity check, continuing to convert the EXCEL file to be converted into the corresponding fund file.
The division of the modules in the embodiments of the present application is schematically only one logic function division, and there may be another division manner in actual implementation, and in addition, each functional module in each embodiment of the present application may be integrated in one processor, or may exist separately and physically, or two or more modules may be integrated in one module. The integrated modules may be implemented in hardware or in software functional modules.
Based on the same inventive concept, the embodiment of the application also provides a computer device. As shown in fig. 11, the computer device in the embodiment of the present application includes at least one processor 1101, and a memory 1102 and a communication interface 1103 connected to the at least one processor 1101, and in the embodiment of the present application, a specific connection medium between the processor 1101 and the memory 1102 is not limited to the embodiment of the present application, and in fig. 11, the connection between the processor 1101 and the memory 1102 is taken as an example, and in fig. 11, the connection between the bus 1100 and other components is shown by a thick line, which is merely illustrative and not limiting. The bus 1100 may be divided into an address bus, a data bus, a control bus, etc., and is represented by only one thick line in fig. 11 for convenience of representation, but does not represent only one bus or one type of bus.
In an embodiment of the present application, the memory 1102 stores instructions executable by the at least one processor 1101, and the at least one processor 1101 can perform the steps included in the foregoing fault detection method by executing the instructions stored in the memory 1102.
The processor 1101 is a control center of a computer device, and may use various interfaces and lines to connect various parts of the entire fault detection device, and by executing or executing instructions stored in the memory 1102 and invoking data stored in the memory 1102, various functions of the computing device and processing the data, thereby overall monitoring the computing device. Alternatively, the processor 1101 may include one or more processing units, and the processor 1101 may integrate an application processor and a modem processor, wherein the processor 1101 primarily processes an operating system, a user interface, an application program, and the like, and the modem processor primarily processes wireless communications. It will be appreciated that the modem processor described above may not be integrated into the processor 1101. In some embodiments, the processor 1101 and the memory 1102 may be implemented on the same chip, and in some embodiments they may be implemented separately on separate chips.
The processor 1101 may be a general purpose processor such as a Central Processing Unit (CPU), digital signal processor, application specific integrated circuit, field programmable gate array or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, which may implement or perform the methods, steps and logic blocks disclosed in embodiments of the application. The general purpose processor may be a microprocessor or any conventional processor or the like. The steps of a method disclosed in connection with the embodiments of the present application may be embodied directly in a hardware processor for execution, or in a combination of hardware and software modules in the processor for execution.
Memory 1102 is a non-volatile computer-readable storage medium that can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules. The Memory 1102 may include at least one type of storage medium, and may include, for example, flash Memory, hard disk, multimedia card, card Memory, random access Memory (Random Access Memory, RAM), static random access Memory (Static Random Access Memory, SRAM), programmable Read-Only Memory (Programmable Read Only Memory, PROM), read-Only Memory (ROM), charged erasable programmable Read-Only Memory (ELECTRICALLY ERASABLE PROGRAMMABLE READ-Only Memory, EEPROM), magnetic Memory, magnetic disk, optical disk, and the like. Memory 1102 is any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer, but is not limited to such. The memory 1102 in embodiments of the present application may also be circuitry or any other device capable of performing memory functions for storing program instructions and/or data.
The communication interface 1103 is a transmission interface that can be used for communication, and data can be received or transmitted through the communication interface 1103.
With reference to the further structural schematic diagram of the computer device shown in fig. 12, the computer device further includes a basic input/output system (I/O system) 1201 to facilitate the transfer of information between various devices within the computer device, a mass storage device 1205 to store an operating system 1202, application programs 1203, and other program modules 1204.
The basic input/output system 1201 includes a display 1206 for displaying information, and an input device 1207, such as a mouse, keyboard, or the like, for user input of information. Wherein a display 1206 and an input device 1207 are coupled to the processor 1101 via a basic input/output system 1201 coupled to the system bus 1100. The basic input/output system 1201 may also include an input/output controller for receiving and processing input from a number of other devices, such as a keyboard, mouse, or electronic stylus. Similarly, the input-output controller also provides output to a display screen, a printer, or other type of output device.
The mass storage device 1205 is connected to the processor 1101 through a mass storage controller (not shown) that is connected to the system bus 1100. The mass storage device 1205 and its associated computer-readable media provide non-volatile storage for the server package. That is, the mass storage device 1205 may include a computer readable medium (not shown) such as a hard disk or CD-ROM drive.
According to various embodiments of the application, the computing device package may also be operated by a remote computer connected to the network through a network, such as the Internet. I.e., the computing device may connect to the network 1208 through a communication interface 1103 connected to the system bus 1100, or may connect to other types of networks or remote computer systems (not shown) using the communication interface 1103.
Based on the same inventive concept, embodiments of the present application also provide a computer-readable storage medium storing computer instructions that, when run on a computer, cause the computer to perform the steps of the order labeling method as described above.
Based on the same inventive concept, the embodiment of the application also provides a chip system, which comprises a processor and can also comprise a memory for realizing the steps of the file processing method. The chip system may be formed of a chip or may include a chip and other discrete devices.
In some possible implementations, aspects of the file processing method provided by the embodiments of the present application may also be implemented in the form of a program product including program code for causing a computer to perform the steps of the file processing method according to the various exemplary embodiments of the present application as described above when the program product is run on the computer.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, magnetic disk storage, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may 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, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
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 such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various modifications and variations can be made to the present application without departing from the spirit or scope of the application. Thus, it is intended that the present application also include such modifications and alterations insofar as they come within the scope of the appended claims or the equivalents thereof.