A file conversion method, device and equipment

By generating the basic parameter table and filling it into the xml tree structure, the efficiency and accuracy of converting excel reports into xml files in financial institutions is solved, and efficient and accurate data conversion and batch processing are achieved, reducing costs and time.

CN113095044BActive Publication Date: 2025-02-28INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110392762.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-04-13
Publication Date
2025-02-28
Estimated Expiration
2041-04-13

AI Technical Summary

Technical Problem

When financial institutions submit data, they need to convert excel reports into XML files that meet local regulatory requirements, but existing tools are difficult to achieve efficient and accurate conversion, and require manual operations, which is time-consuming and labor-intensive and error-prone.

Method used

By obtaining the basic parameter table corresponding to the business data table, determining the node parameters based on the labeled cell position information and labeled information in the sample table, reading the node parameters and extracting the corresponding data values ​​from the business data table, filling it into the xml tree structure, and generating an xml file that meets regulatory requirements.

Benefits of technology

It improves the efficiency and accuracy of file conversion, reduces the time and error rate of manual operations, supports batch conversion and adapts to the needs of different report formats, and reduces R&D costs and efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 00000000_0000_ABST
    Figure 00000000_0000_ABST
Patent Text Reader

Abstract

The present specification relates to the field of big data processing technology, and specifically discloses a file conversion method, device and equipment, the method comprising: obtaining a basic parameter table corresponding to a business data table; the basic parameter table is determined based on the position information and annotation information of the annotated cell in the sample table corresponding to the business data table; the annotation information at least includes the node parameters of the xml node to which the data corresponding to the annotated cell needs to be filled; reading the node parameters in the basic data table, extracting the data values ​​corresponding to the read node parameters from the business data table based on the position information of the annotated cell corresponding to the read node parameters; filling the extracted data values ​​into the xml nodes corresponding to the read node parameters in the xml tree structure, and obtaining the reporting xml file corresponding to the business data table. Using the various embodiments of the present specification, the efficiency and accuracy of file conversion can be greatly improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present specification relates to the field of big data processing technology, and in particular, to a file conversion method, device and equipment. Background Art

[0002] Overseas branches of financial institutions are usually required to submit some operational data to local regulatory authorities on a regular basis. The reported data is usually generated by transactions and is generated into Excel reports through the internal reporting system and then submitted to local regulatory authorities. At present, some regions require that in addition to submitting normal Excel report data, XML (Extensible Markup Language) formatted data files must be submitted. The data types involved in financial Excel reports are complex and varied, and the XML file requirements of regulatory requirements in various regions also vary greatly. Therefore, it is difficult to directly use a general conversion tool to convert various Excel reports into XML files that meet local requirements. At present, relevant business personnel basically manually extract data from Excel and then use general conversion tools to convert it into XML files. The conversion work is time-consuming, labor-intensive and error-prone. Summary of the invention

[0003] The purpose of the embodiments of this specification is to provide a file conversion method, device and equipment, which can further improve the efficiency and accuracy of file conversion.

[0004] This specification provides a file conversion method, device and equipment which are implemented in the following ways:

[0005] A file conversion method, the method comprising: obtaining a basic parameter table corresponding to a business data table; the basic parameter table is determined based on the position information and annotation information of annotated cells in a sample table corresponding to the business data table; the annotation information at least includes the node parameters of the XML node to which the data corresponding to the annotated cells need to be filled; reading the node parameters in the basic data table, and extracting the data values ​​corresponding to the read node parameters from the business data table based on the position information of the annotated cells corresponding to the read node parameters; filling the extracted data values ​​into the XML nodes corresponding to the read node parameters in the XML tree structure, and obtaining the reporting XML file corresponding to the business data table.

[0006] In some other embodiments of the method provided in this specification, the xml tree structure is constructed in the following manner: obtain the xsd file specified in the basic parameter table; wherein the specified xsd file at least includes the node parameters of the xml nodes contained in the submitted xml file; traverse the specified xsd file to filter out element nodes therefrom; construct a node directed graph based on the reference relationship between each element node in the specified xsd file; and generate the xml tree structure using the node directed graph.

[0007] In some other embodiments of the method provided in this specification, the name of the element node is used as the XML node name in the XML tree structure.

[0008] In some other embodiments of the method provided in this specification, the basic parameter table is determined in the following manner: read the position information and annotation information of the annotated cells in the sample table in sequence; add node subtitles to the node parameters; wherein the node subtitles are used to distinguish the data corresponding to different annotated cells under the same xml node; the position information of the annotated cells and the node parameters with the added node subtitles are associated and stored in an editable data table to obtain the basic parameter table.

[0009] In some other embodiments of the method provided in the present specification, the annotation information also includes a writing method for writing business data into a cell, and the writing method includes at least a fixed position type and a list type; the fixed position type means that the position of the cell into which the business data changes over time is fixed; the list type means that the position of the cell into which the business data changes over time is expanded in a specified direction; accordingly, adding a node subtitle in the node parameter includes: when the annotation information does not include an expansion method and an expansion length, adding a node subtitle in the node parameter based on a preset node sorting rule of the sample table; when the annotation information does not include an expansion method and an expansion length, adding a node subtitle in the node parameter based on a preset node sorting rule of the sample table, and supplementing the node subtitle in the node parameter according to the expansion direction and expansion length in the annotation information.

[0010] In some other embodiments of the method provided in the present specification, the annotation information also includes a deletion flag and a zero-filling flag; the deletion flag is used to delete the corresponding xml node or the child node corresponding to the node subtitle when the data value is empty; the zero-filling flag is used to fill the corresponding xml node or the child node corresponding to the node subtitle with a specified value when the data value is empty; the method also includes: reading the deletion flag and the zero-filling flag in the annotation information; associating the read deletion flag and the zero-filling flag with the position information of the annotation cell and the node parameters with the node subtitle added and storing them in an editable data table to obtain a basic parameter table.

[0011] In some other embodiments of the method provided in this specification, when the read node parameters exist in the XML tree structure, the data values ​​corresponding to the read node parameters are extracted from the business data table based on the position information of the marked cells corresponding to the read node parameters.

[0012] In some other embodiments of the method provided in this specification, when the read node parameter does not exist in the XML tree structure, the read node parameter is recorded in an exception table, and the next node parameter is read.

[0013] On the other hand, an embodiment of the present specification also provides a file conversion device, which includes: an acquisition module, used to acquire a basic parameter table corresponding to a business data table; the basic parameter table is determined based on the position information and annotation information of the annotated cells in the sample table corresponding to the business data table; the annotation information at least includes the node parameters of the xml node to which the data corresponding to the annotated cells need to be filled; an extraction module, used to read the node parameters in the basic data table, and based on the position information of the annotated cells corresponding to the read node parameters, extract the data values ​​corresponding to the read node parameters from the business data table; a filling module, used to fill the extracted data values ​​into the xml nodes corresponding to the read node parameters in the xml tree structure, so as to obtain the reporting xml file corresponding to the business data table.

[0014] On the other hand, an embodiment of the present specification also provides a file conversion device, which includes at least one processor and a memory for storing processor executable instructions, and when the instructions are executed by the processor, the steps of the method described in any one or more of the above embodiments are implemented.

[0015] The file conversion method, device and equipment provided by one or more embodiments of the present specification configure the annotation information of the cell that needs to fill the data into the XML file in the sample table, and configure the XML node information that needs to be filled in the annotation information. Then generate a parameter table based on the annotation information and the position information of the corresponding cell. After that, read the data value based on the parameter table and fill it into the corresponding node of the pre-built XML tree structure to obtain an XML file. The generated parameter table can be reused and can adapt to the needs of changing the length of the tabular report. It can be used all the time without modifying the report sample and the regulatory XSD, which improves the reporting efficiency. The records in the parameter table are mutually opposed, and concurrent operation can be achieved, a large number of report conversion tasks can be completed quickly, and the data conversion delay during reporting can be greatly shortened. At the same time, it can also support batch conversion of existing Excel files, quickly respond to the reporting needs later, and reduce R&D costs and efficiency. And the use of the parameter table can also enable the conversion program to retain the greatest flexibility and adapt to the various requirements for formats or data between different reports. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solutions in the embodiments of this specification or the prior art, the following briefly introduces the drawings required for use in the embodiments or the prior art description. Obviously, the drawings described below are only some embodiments recorded in this specification. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor. In the drawings:

[0017] Figure 1 A flowchart of an embodiment of a file conversion method provided in this specification;

[0018] Figure 2 A schematic diagram of marking information in an embodiment provided in this specification;

[0019] Figure 3 A schematic diagram of marking information in an embodiment provided in this specification;

[0020] Figure 4 A schematic diagram of constructing a parameter table in an embodiment provided in this specification;

[0021] Figure 5 A schematic diagram of marking information in an embodiment provided in this specification;

[0022] Figure 6 A schematic diagram of marking information in an embodiment provided in this specification;

[0023] Figure 7 A schematic diagram of generating an XML tree structure in an embodiment provided in this specification;

[0024] Figure 8 A schematic diagram of partial information of an xsd file in an embodiment provided in this specification;

[0025] Fig. 9 A schematic diagram of a node directed graph in an embodiment provided in this specification;

[0026] Fig.10 A schematic diagram of filling in data values ​​in an embodiment provided in this specification;

[0027] Fig.11 A schematic diagram of the XML file generation process in an embodiment provided in this specification;

[0028] Fig.12 This is a schematic diagram of the module structure of a file conversion device provided in this specification. DETAILED DESCRIPTION

[0029] In order to enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in one or more embodiments of this specification will be clearly and completely described below in conjunction with the drawings in one or more embodiments of this specification. Obviously, the described embodiments are only part of the embodiments of the specification, not all of the embodiments. Based on one or more embodiments of the specification, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the embodiments of this specification.

[0030] In an example of an application scenario of this specification, the file conversion method can be applied to a file conversion tool. The execution logic of the file conversion tool can be configured in a server or in a client. The client can be a computer, a business terminal or other intelligent terminal. For example, the file conversion tool can be a client application built based on the Java language to batch convert Excel reports into XML files of a specified format, so that the business system of a financial institution can feed back business data to the system of the corresponding regulatory department.

[0031] Figure 1 The following is a flowchart of an embodiment of the file conversion method provided in this specification. When the method is applied in a server or terminal product in practice, it can be executed sequentially or in parallel according to the method shown in the embodiment or the accompanying drawings (for example, in an environment of parallel processors or multi-threaded processing, or even in an implementation environment of distributed processing and server clusters). A specific implementation example is Figure 1 As shown, in one embodiment of the file conversion method provided in this specification, the method can be applied to the file conversion tool. The method may include the following steps:

[0032] S20: Obtain a basic parameter table corresponding to the business data table; the basic parameter table is determined based on the position information and annotation information of the annotated cells in the sample table corresponding to the business data table; the annotation information at least includes the node parameters of the xml node to which the data corresponding to the annotated cells need to be filled.

[0033] The business system of a financial institution can develop different sample tables for different businesses. The sample table has the same structure format as the business data table filled with business data. The difference is that the sample table only contains report style information, not specific business data, while the business data table includes business data written according to the report frequency (daily, monthly, annual, etc.).

[0034] The sample table can be annotated in advance. Usually, not all types of data in the sample table need to be reported to the regulatory authority. You can add annotation information to the cells that need to be reported in the sample table based on the reporting requirements provided by the regulatory authority in advance, and the cells corresponding to other data that do not need to be reported do not need to be annotated. Accordingly, the tool can accurately extract the data that needs to be reported and the cell location of the data that needs to be reported by reading the annotation information, so that the data that needs to be reported can be accurately extracted from a large amount of complex data, improving the simplicity and accuracy of data screening. For the sake of convenience, cells with added annotation information can be called annotated cells.

[0035] The reporting requirements can be determined by the xsd (xml schema definition) file provided by the regulatory agency. The xsd file can contain two types of configuration information: one is the xml node parameters that define the data to be reported, such as the node identifier and node path of the xml node; the other is the constraints on the data filled in each node of the xml file, such as numerical data, enumeration data, numerical decimal places, enumeration values, etc.

[0036] Business personnel can manually annotate the sample table based on the xsd file provided by the regulatory agency. Alternatively, a marking program can be designed to read the corresponding information in the xsd file provided by the regulatory agency and add marking information to the cells to be reported in the sample table. Of course, other methods can also be used, which are not limited here.

[0037] Accordingly, the annotation information may at least include the node parameters of the XML node to which the data corresponding to the annotated cell needs to be filled. The node parameters may include, for example, the node identifier and the node path of the XML node. By configuring the node parameters of the XML node, an association may be established between the data corresponding to the annotated cell and the XML node to be filled, so as to facilitate accurate filling of the data.

[0038] The basic parameter table can be determined based on the position information and annotation information of the annotated cells in the sample table corresponding to the business data table. For example, the type of data to be filled in each row and column in the table can be preset. The tool can read the annotation information in the sample table and the position information of the annotated cells associated with the annotation information. The read annotation information and the position information of the associated annotated cells can be filled into a pre-set table to obtain a basic parameter table. As an intermediate file, the basic parameter table only needs to be generated once during the initial development, provided that the sample table and the regulatory xsd file do not change, and subsequent daily conversions do not need to be repeatedly generated. In addition, the intermediate file is implemented as an excel table file, which can support manual modification of the data in the parameter table. When the sample table or xsd changes in a small range, the parameter table can also be manually modified to respond to changes quickly and maintain flexibility.

[0039] Since most business data changes over time, even if it does not change at any time, the amount of data cannot be kept fixed in most cases, and it is impossible for regulatory authorities to count the actual amount of data of various types of business data. Therefore, the data required to be filled in each XML node given by the regulatory authorities is usually a certain type of data, such as the transaction amount data of a certain product. Obviously, the transaction amount data of a certain product is usually not just one data, but consists of multiple transaction data. That is, the same XML node may correspond to multiple sets of data.

[0040] In some embodiments, the position information and the annotation information of the annotated cells in the sample table can be read in sequence. A node subtitle is added to the node parameter; wherein the node subtitle is used to distinguish the data corresponding to different annotated cells under the same XML node. The position information of the annotated cell and the node parameter with the added node subtitle are associated and stored in an editable data table to obtain a basic parameter table. By further setting a method of adding a node subtitle after the node path, the data writing under each XML node can be made more flexible and accurate.

[0041] In other implementations, the content of the annotation information can also be determined based on the writing method of the data in the annotated cell. The writing method may include at least a fixed position type and a list type. The fixed position type may mean that the position of the cell into which the business data changes over time is fixed. The list type means that the position of the cell into which the business data changes over time is expanded in a specified direction. For example, if the single transaction amount data of a certain product is written into a column of a data table with a writing frequency of every day, the transaction volume of the product is not fixed every day. Accordingly, the position of the cell occupied by the transaction amount data written into the column in the data table every day is not fixed, and the position of the occupied cell is expanded in the column. Correspondingly, there are also cells into which the position of some business data written over time is fixed.

[0042] Correspondingly, the annotation information of the annotation cell written in a fixed position type may at least include the node parameters of the XML node to which the data corresponding to the annotation cell needs to be filled. Figure 2 A schematic diagram showing the annotation information of a fixed-position annotation cell. Figure 2 As shown, the annotation information includes the node path (Metric), and the writing method (Data Type) is a fixed position type (Bk-Boolean). The annotation information of the annotation cell with the writing method of list type may include at least the node parameters of the xml node to which the data corresponding to the annotation cell needs to be filled, and also needs to include the expansion direction and expansion length. Figure 3 A schematic diagram showing the annotation information of a list-type annotation cell. Figure 3 As shown, the annotation information includes the node path (Metric), the writing method (Data Type) is a list type (Bk-Text(200)), the expansion direction (Direction) is downward (Down), and the expansion length (Max Length) is 100.

[0043] When reading the annotation information, if the read annotation information does not include the extension direction and extension length, it can be determined that the writing method of each annotation unit is a fixed position type; if the read annotation information includes the extension direction and extension length, it can be determined that the writing method of each annotation unit is a list type.

[0044] The cell positions and numbers of the business data corresponding to the fixed position annotation cells are fixed. Therefore, when annotating, all the occupied cells can be annotated. Figure 4 As shown in the figure, when generating the basic parameter table, if the read annotation information does not include the extension direction and extension length, the sample table is sorted according to the principle of upper left priority, and node sub-labels are added to the node paths of multiple annotated cells under the same node path to clarify the order of the annotated cells under the same node path. Figure 5 As shown, Figure 5 The node paths of cells X and Y are both A / B / C. Then the node path information of cell X can be configured as A / B / C^1, and the node path information of cell Y can be configured as A / B / C^2, that is, a node subtitle is added to the original node path. Of course, the above-mentioned principle of upper left priority is only a preferred solution given by the usual storage habits of financial business data. The specific embodiment can also adopt other sorting principles based on the data storage method of the business data table, such as upper right priority, lower left priority, etc.

[0045] like Figure 4As shown, for the list type, the position and number of cells occupied by business data are not fixed, so a maximum cell occupation range can be given in advance as the extension length as part of the annotation information. For example, the amount of business data under the node path in the historical business data table can be counted, and the historical maximum data amount multiplied by two can be used as the extension length. When annotating, the first cell occupied by this type of data can be selected as the annotation cell based on the upper left priority principle, and the extension direction and extension length can be configured in the annotation information. Correspondingly, when generating the basic parameter table, if the expansion direction and extension length are included in the read annotation information, the node subtitle of the annotated cell can be added to the node path based on the sorting based on the upper left priority principle, and then the position information of the annotated cell and the node path and node subtitle associated with the position information can be supplemented based on the extension direction and extension length.

[0046] When reading the business data table, the actual business data may not be able to completely fill the node sub-labels generated above. Accordingly, a deletion flag can be added to the annotation information in advance, and in the absence of any data filling, the redundant empty node sub-labels can be deleted based on the deletion flag. For example, Figure 6 As shown, the annotation information includes an expansion direction of downward and an expansion length of 100. After sorting by the upper left priority principle, if there is no other annotation cell with the same node identifier before the annotation cell, the node subtitle of the annotation cell is first increased to 1, and the corresponding node path information is A / B / D^1. Afterwards, the location information of the annotation cell and the node path and node subtitle associated with the location information can be supplemented based on the expansion direction and expansion length. A delete flag can also be added accordingly, and an example of some information in the generated basic parameter table is shown in Table 1.

[0047] Table 1

[0048] Node Name OK List Delete Flag A / B / D^1 23 2 True A / B / D^2 24 2 True A / B / D^3 25 2 True ··· ··· ··· ··· A / B / D^100 123 2 True

[0049] Accordingly, in some embodiments, the annotation information may also include a writing mode for writing business data into a cell, and the writing mode includes at least a fixed position type and a list type. The fixed position type means that the position of the cell into which the business data changes over time is fixed. The list type means that the position of the cell into which the business data changes over time is extended in a specified direction. Accordingly, the adding of node subtitles in the node parameters may include: when the annotation information does not include an extension mode and an extension length, adding node subtitles in the node parameters based on the preset node sorting rules of the sample table; when the annotation information does not include an extension mode and an extension length, adding node subtitles in the node parameters based on the preset node sorting rules of the sample table, and supplementing the addition of node subtitles in the node parameters according to the extension direction and extension length in the annotation information. By further distinguishing the table state occupied by the business data written into the business data table to configure the node subtitle addition mode, the addition of node subtitles can be made more accurate.

[0050] When generating a basic parameter table, the identification information of the sample table can also be read and stored in association with the basic parameter table to distinguish the sample table from which the information in the basic parameter table comes, so as to quickly find the business data table corresponding to the sample table based on the identification. The sample table may also contain multiple sub-tables, and the identification information of the sub-table can also be further read and stored in association with the basic parameter table.

[0051] Alternatively, the file identifier of the XML file to be written into the data may be added to the annotation information. When generating the basic parameter table, the file identifier of the XML file may be read and associated and stored in the basic parameter table to facilitate quick location of the XML file to be written.

[0052] You can also add a zero flag to the annotation information. The zero flag means whether the value is automatically set to 0 when it is empty. The zero flag and the delete flag can be set to be mutually exclusive, and the delete flag takes precedence. By using the delete flag and the zero flag together, the addition and deletion of node subtags can be made more flexible. At the same time, it will not affect the processing requirements of empty data or default values ​​in the business data table, ensuring some special requirements in the business data table and improving the flexibility of XML file generation.

[0053] Accordingly, in some embodiments, the annotation information may further include a delete flag and a zero-fill flag. The delete flag is used to delete the corresponding xml node or the child node corresponding to the node subtitle when the data value is empty. The zero-fill flag is used to fill the corresponding xml node or the child node corresponding to the node subtitle with a specified value when the data value is empty. The method may further include: reading the delete flag and the zero-fill flag in the annotation information; associating the read delete flag and the zero-fill flag with the position information of the annotation cell and the node parameters with the node subtitle added and storing them in an editable data table to obtain a basic parameter table.

[0054] As shown in Table 2, Table 2 is an example of the content included in a basic parameter table of a transaction details list provided in an embodiment of this specification.

[0055] Table 2

[0056]

[0057]

[0058] S22: Reading node parameters in the basic data table, and extracting data values ​​corresponding to the read node parameters from the business data table based on position information of the marked cells corresponding to the read node parameters.

[0059] S24: Fill the extracted data value into the XML node corresponding to the read node parameter in the XML tree structure, and obtain the reporting XML file corresponding to the business data table.

[0060] The file conversion tool can process the xsd file provided by the regulatory agency to construct an initial xml tree structure. The xsd file can contain a variety of information. In this embodiment, only the element node information is extracted to construct the initial xml tree structure of the generated xml file, which can greatly improve the simplicity of xml file generation. At the same time, by constructing the tree structure to generate the xml file, the flexibility and accuracy of data filling can be improved.

[0061] In some embodiments, an xsd file specified in a basic parameter table may be obtained; wherein the specified xsd file includes at least the node parameters of the xml nodes contained in the submitted xml file. The specified xsd file is traversed to filter out element nodes therefrom; a node directed graph is constructed based on the reference relationship between each element node in the specified xsd file; and an xml tree structure is generated using the node directed graph. By constructing an element node directed graph and then constructing an xml tree structure based on the directed graph, the accuracy and efficiency of constructing an xml tree structure based on the xsd file can be greatly improved.

[0062] like Figure 7 As shown, you can first traverse all the lines in the xsd file and filter out the element nodes. Since there are many elements, you can create an index according to the element name to facilitate the search in subsequent steps. Alternatively, you can use the element name as the xml node identifier of the initial xml tree structure to facilitate the search in subsequent steps. You can build an element node directed graph based on the reference relationship between the element nodes in the xsd file. You can determine the root node based on the mutual reference relationship in the directed graph, take the root node as the starting point of the xml tree structure, and build the initial xml tree structure based on the element node directed graph.

[0063] Figure 8 This is a partial information example of an xsd file. In a scenario example, after traversing Figure 8 After finding all the element nodes, the element nodes found are Kontoregister, Info_Daten, MessageSpec, KontoregisterBody, Fastnr_Fon_Tn, Fastnr_Fi, Vers. Figure 8 The reference relationship between each element node in the element node constructs a directed graph of element nodes, such as Fig. 9 As shown. The Kontoregister node contains Info_Daten, MessageSpec, and KontoregisterBody, and the Info_Daten node contains Fastnr_Fon_Tn, Fastnr_Fi, and Vers nodes. Based on this directed graph, it can be determined that Kontoregister is the root node. The XML tree structure generated with Kontoregister as the root node is as follows:

[0064]

[0065]

[0066] By indexing the nodes or using the node name of the element as the node identifier of the XML node, the data filling efficiency in the subsequent XML construction can be accelerated, and the overall running speed of the tool can be improved. In addition, the tool has independent memory when running, and can support concurrent processing of multiple XSD files, improving the running efficiency.

[0067] The xml tree structure of the corresponding xsd file can be pre-built based on the above method. The identification information of the xml tree structure is configured as part of the node path information of the xml node and added to the annotation information to facilitate the rapid and accurate filling of subsequent data values. The update frequency of xsd files is usually not fast. By pre-building, the efficiency of xml file generation can be greatly improved.

[0068] Alternatively, the identification information of the xsd file corresponding to the marked cell can also be configured in the basic parameter table. When the xml file corresponding to the business data table is generated based on the basic parameter table, if the xml tree structure of the corresponding xsd file already exists, the data value is filled into the corresponding xml node. If the xml tree structure of the corresponding xsd file does not exist, the xml tree structure of the corresponding xsd file is first generated based on the above method, and then the data value filling operation is performed.

[0069] Since xsd files vary from place to place, the specific implementation methods also vary. Different implementation interfaces can be further configured for different xsd files. Each interface can generate processing logic for the xml file under the corresponding xsd file to ensure the flexibility of tool execution.

[0070] like Fig.10 As shown, the tool can read the data in the basic parameter table line by line, obtain the position information of the annotated cells corresponding to each node path, extract the data value corresponding to the read node parameter from the business data table, and fill the extracted data value into the xml node corresponding to the read node parameter in the xml tree structure, and obtain the reporting xml file corresponding to the business data table. In the case of the existence of node sub-labels, the child nodes corresponding to the node sub-labels can be gradually added under the corresponding path in the xml tree structure, and the read data values ​​can be filled into the child nodes of the corresponding xml nodes based on the node path and the node sub-labels.

[0071] Fig.11 Generate an overall process diagram for an XML file in a scenario example. Assume that the initial XML tree structure generated based on the XSD file of the regulatory agency is:

[0072]

[0073]

[0074] Table 3 is an example table consisting of node path information with node subtitles and their corresponding data values, zero padding flags, and deletion flags. Table 3 is only used for example description and does not directly limit the need to extract the following information to generate the table shown in Table 3 in actual processing.

[0075] Table 3

[0076] Node path information Data value Delete Flag Zero padding flag / a / c / e^1 1 false true / a / c / e^2 true true / a / d^1 / f 2 false true / a / d^2 / f 3 fasle true / a / d^2 / g^1 fasle true / a / e / x^1 E fasle true

[0077] Correspondingly, the XML generated after reading the node path information / a / c / e^1 is:

[0078]

[0079] Since the node path information does not involve the b node, for the sake of ease of description, the display of the b node is omitted here.

[0080] The XML generated after reading the node path information / a / c / e^2 is:

[0081]

[0082] The XML generated after reading the node path information / a / d^1 / f is:

[0083]

[0084]

[0085] The XML generated after reading the node path information / a / d^2 / f is:

[0086]

[0087] The XML generated after reading the node path information / a / d^2 / g^1 is:

[0088]

[0089] After reading the node path information / a / e / x^1, the initial XML tree structure is checked and the path information of the node path information / a / e / x^1 is found to be wrong. At this time, a prompt of path error can be thrown and the node path information can be skipped, that is, the XML structure remains unchanged after reading the node path information / a / d^2 / g^1. If there is the next node path information, the processing of the next node path information is continued. This can avoid the termination of the overall XML file generation when a path error occurs, and improve the stability of tool processing.

[0090] Accordingly, in some embodiments, when the read node parameter exists in the xml tree structure, the data value corresponding to the read node parameter can be extracted from the business data table based on the position information of the annotated cell corresponding to the read node parameter. When the read node parameter does not exist in the xml tree structure, the read node parameter is recorded in the exception table, and the next node parameter is read, thereby avoiding the termination of the overall xml file generation when a path error occurs, and improving the stability of tool processing.

[0091] Then, the XML generated based on the above method can be corrected according to the delete flag and zero-fill flag corresponding to the node path or the node subtitle under the node path. For example, after reading the node path information / a / c / e^2, since the delete flag is true and the zero-fill flag is true, the child node is deleted because the delete flag takes precedence over the zero-fill flag. The corrected XML is,

[0092]

[0093] After reading the node path information / a / d^2 / g^1, since the delete flag is false and the zero-fill flag is true, the corrected xml is:

[0094]

[0095] After completing the above zero-padding and deletion processing, the tool can serialize the XML structure and generate an XML file.

[0096] The records in the basic parameter table are ordered by the node path and the node subtitles under the node path, which can improve the accuracy of the generated XML file. The records in the basic parameter table are independent of each other, and the records in the parameter table and different parameter tables can be processed in parallel, which can improve the flexibility and efficiency of XML file processing. Since different records are independent of each other, the error handling mechanism can be flexibly configured for errors that may occur in the parameter table, and the error of one record will not cause the failure of the entire generation process, which improves the fault tolerance of the XML file generation process. As shown in Table 3, a parameter table filled with data values ​​can also be generated synchronously during the XML file generation process, so that the reporting personnel can check and correct the XML file to improve the accuracy of the reported data. The generated XML file can also be verified using the XML Notepad tool, and submitted to the regulatory department's system after the inspection passes.

[0097] Each embodiment in this specification is described in a progressive manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. For details, please refer to the description of the above-mentioned related processing related embodiments, and no further description is given here.

[0098] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0099] Based on the file conversion method described above, one or more embodiments of this specification also provide a file conversion device. The device may include a system, software (application), module, component, server, etc. that uses the method described in the embodiments of this specification and is combined with necessary implementation hardware. Based on the same innovative concept, the device in one or more embodiments provided in the embodiments of this specification is as described in the following embodiments. Since the implementation scheme of the device to solve the problem is similar to the method, the implementation of the specific device in the embodiments of this specification can refer to the implementation of the aforementioned method, and the repetitions will not be repeated. As used below, the term "unit" or "module" can be a combination of software and / or hardware that implements predetermined functions. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived. Specifically, Fig.12 The module structure diagram of a file conversion device embodiment provided in the specification is applied to file conversion tools. Fig.12 As shown, the device may include:

[0100] The acquisition module 102 can be used to obtain the basic parameter table corresponding to the business data table; the basic parameter table is determined based on the position information and annotation information of the annotated cells in the sample table corresponding to the business data table; the annotation information at least includes the node parameters of the xml node to which the data corresponding to the annotated cells need to be filled.

[0101] The extraction module 104 may be used to read the node parameters in the basic data table, and extract the data values ​​corresponding to the read node parameters from the business data table based on the position information of the marked cells corresponding to the read node parameters.

[0102] The filling module 106 can be used to fill the extracted data value into the XML node corresponding to the read node parameter in the XML tree structure, so as to obtain the reporting XML file corresponding to the business data table.

[0103] It should be noted that the above-mentioned device may also include other implementations according to the description of the method embodiment. The specific implementation methods can refer to the description of the relevant method embodiment, and will not be described one by one here.

[0104] This specification also provides a file conversion device, which can be used in file conversion tools and can also be used in various computer data processing systems. The system can be a separate server, or it can include a server cluster, system (including distributed system), software (application), actual operation device, logic gate circuit device, quantum computer, etc. that uses one or more of the methods or one or more embodiments of this specification and a terminal device combined with necessary implementation hardware. In some embodiments, the device may include at least one processor and a memory for storing processor executable instructions, and when the instructions are executed by the processor, the steps of the method described in any one or more of the above embodiments are implemented.

[0105] The memory may include a physical device for storing information, which is usually to digitize the information and then store it in a medium using electrical, magnetic or optical means. The storage medium may include: a device that uses electrical energy to store information, such as various memories, such as RAM, ROM, etc.; a device that uses magnetic energy to store information, such as a hard disk, a floppy disk, a magnetic tape, a magnetic core memory, a magnetic bubble memory, a USB flash drive; a device that uses optical means to store information, such as a CD or a DVD. Of course, there are other types of readable storage media, such as quantum memory, graphene memory, etc.

[0106] It should be noted that the above-mentioned device may also include other implementation methods according to the description of the method or device embodiment. The specific implementation method can refer to the description of the relevant method embodiment, which will not be described one by one here.

[0107] The embodiments of this specification are not limited to situations that must comply with standard data models / templates or the embodiments of this specification. Certain industry standards or slightly modified implementation plans based on the implementation described in the custom methods or embodiments can also achieve the same, equivalent or similar, or predictable implementation effects after deformation of the above-mentioned embodiments. The embodiments obtained by using these modified or deformed data acquisition, storage, judgment, processing methods, etc. can still fall within the scope of the optional implementation plans of this specification.

[0108] Each embodiment in this specification is described in a progressive manner, and the same and similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment. In the description of this specification, the description of the reference terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of this specification. In this specification, the schematic representation of the above terms does not necessarily target the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, in the absence of contradiction, a person skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples.

[0109] The above description is only an embodiment of the present specification and is not intended to limit the present specification. For those skilled in the art, the present specification may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present specification shall be included in the scope of the claims of the present specification.

Claims

1. A file conversion method, characterized in that: The method comprises: Obtain a basic parameter table corresponding to the business data table; the basic parameter table is determined based on the position information and annotation information of the annotated cells in the sample table corresponding to the business data table; the annotation information at least includes the node parameters of the XML node to which the data corresponding to the annotated cells need to be filled; the node parameters at least include a node identifier, a node path and a node subtitle, and the node subtitle is used to distinguish the data corresponding to different annotated cells under the same XML node; Reading the node parameters in the basic data table, and extracting the data values ​​corresponding to the read node parameters from the business data table based on the position information of the marked cells corresponding to the read node parameters; Fill the extracted data value into the XML node corresponding to the read node parameter in the XML tree structure to obtain the reporting XML file corresponding to the business data table; the XML tree structure is constructed by extracting the element node information in the XSD file specified in the basic parameter table; The step of filling the extracted data value into the XML node corresponding to the read node parameter in the XML tree structure includes: When there is a node subtitle in the read node parameter, a child node corresponding to the node subtitle is added under the corresponding path in the xml tree structure, and the extracted data value is filled into the child node of the corresponding xml node based on the node path and the node subtitle.

2. The method according to claim 1, characterized in that The xml tree structure is constructed in the following way: Obtain the xsd file specified in the basic parameter table; wherein the specified xsd file at least includes the node parameters of the xml nodes contained in the submitted xml file; Traverse the specified xsd file and filter out element nodes therefrom; Construct a node directed graph based on the reference relationship between element nodes in the specified xsd file; The node directed graph is used to generate an XML tree structure.

3. The method according to claim 2, characterized in that Use the name of the element node as the XML node name in the XML tree structure.

4. The method according to claim 2, characterized in that: The basic parameter table is determined in the following manner: Read the position information and annotation information of the marked cells in the sample table in sequence; Adding a node subtitle to the node parameter; wherein the node subtitle is used to distinguish the data corresponding to different annotated cells under the same xml node; The position information of the marked cells and the node parameters with added node sub-labels are associated and stored in an editable data table to obtain a basic parameter table.

5. The method according to claim 4, characterized in that The annotation information also includes a writing mode of writing the business data into the cell, and the writing mode includes at least a fixed position type and a list type; the fixed position type means that the position of the cell into which the business data changes over time is fixed; the list type means that the position of the cell into which the business data changes over time is extended in a specified direction; Correspondingly, the adding of node subtitles in the node parameters includes: In the case where the annotation information does not include the extension mode and the extension length, adding a node subtitle to the node parameter based on the preset node sorting rule of the sample table; When the annotation information does not include the extension mode and the extension length, a node subtitle is added to the node parameter based on the preset node sorting rule of the sample table, and a node subtitle is additionally added to the node parameter according to the extension direction and the extension length in the annotation information.

6. The method according to claim 4, characterized in that The annotation information also includes a delete flag and a zero-fill flag; the delete flag is used to delete the corresponding XML node or the child node corresponding to the node sub-label when the data value is empty; the zero-fill flag is used to fill the corresponding XML node or the child node corresponding to the node sub-label with a specified value when the data value is empty; the method also includes: Reading a deletion flag and a zero-filling flag in the marking information; The read deletion flag and zero-filling flag are associated with the position information of the marked cell and the node parameters with the node sub-label added and stored in an editable data table to obtain a basic parameter table.

7. The method according to any one of claims 1 to 6, characterized in that: In the case where the read node parameter exists in the XML tree structure, the data value corresponding to the read node parameter is extracted from the business data table based on the position information of the marked cell corresponding to the read node parameter.

8. The method according to any one of claims 1 to 6, characterized in that: When the read node parameter does not exist in the XML tree structure, the read node parameter is recorded in the exception table and the next node parameter is read.

9. A file conversion device, characterized in that: The device comprises: An acquisition module is used to acquire a basic parameter table corresponding to a business data table; the basic parameter table is determined based on the position information and annotation information of the annotated cells in the sample table corresponding to the business data table; the annotation information at least includes the node parameters of the XML node to which the data corresponding to the annotated cells need to be filled; the node parameters at least include a node identifier, a node path and a node subtitle, and the node subtitle is used to distinguish the data corresponding to different annotated cells under the same XML node; An extraction module, used for reading the node parameters in the basic data table, and extracting the data values ​​corresponding to the read node parameters from the business data table based on the position information of the marked cells corresponding to the read node parameters; A filling module is used to fill the extracted data value into the XML node corresponding to the read node parameter in the XML tree structure to obtain the reporting XML file corresponding to the business data table; the XML tree structure is constructed by extracting the element node information in the XSD file specified in the basic parameter table; When the filling module fills the extracted data value into the XML node corresponding to the read node parameter in the XML tree structure, it is specifically used to: When there is a node subtitle in the read node parameter, a child node corresponding to the node subtitle is added under the corresponding path in the xml tree structure, and the extracted data value is filled into the child node of the corresponding xml node based on the node path and the node subtitle.

10. A file conversion device, characterized in that: The device comprises at least one processor and a memory for storing processor-executable instructions, wherein the instructions, when executed by the processor, implement the steps of the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Method for converting document format

    CN103593457A

  • Data conversion method and device

    CN106874493A