CN111447268B - File structure conversion method, device, equipment and storage medium - Google Patents
File structure conversion method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN111447268B CN111447268B CN202010214662.4A CN202010214662A CN111447268B CN 111447268 B CN111447268 B CN 111447268B CN 202010214662 A CN202010214662 A CN 202010214662A CN 111447268 B CN111447268 B CN 111447268B
- Authority
- CN
- China
- Prior art keywords
- file
- node
- mounting
- matched
- content
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/56—Provisioning of proxy services
- H04L67/565—Conversion or adaptation of application format or content
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/11—File system administration, e.g. details of archiving or snapshots
- G06F16/116—Details of conversion of file system types or formats
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/2866—Architectures; Arrangements
- H04L67/30—Profiles
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
The embodiment of the invention discloses a file structure conversion method, a file structure conversion device, file structure conversion equipment and a storage medium. The file structure conversion method comprises the following steps: determining a configuration file matched with the file to be converted according to the file type of the file to be converted; the configuration file comprises mounting nodes with preset structures, and the preset structures of the mounting nodes are determined in advance according to the content of the file message; matching the content to be matched in the file to be converted with the mount node of the configuration file, and determining a target mount node of the content to be matched; and mounting the content to be matched to a target mounting node to generate a target file with a converted structure. The readability of the message content in the file is improved by automatically converting the structure of the file to be converted, and the file structure conversion method supports the random superposition and nesting of the message content in the file, so that the universality of structure conversion is improved; and high availability of data file transmission is realized through structure conversion, and data consistency is ensured.
Description
Technical Field
The embodiment of the invention relates to the technical field of computers, in particular to a file structure conversion method, a file structure conversion device, file structure conversion equipment and a storage medium.
Background
SWIFT (Society for world Wide Interbank Financial Telecommunications Association) is an international collaboration organization between international banking industries, with the SWIFT system being used by most banks in most countries around the world. The use of SWIFT provides safe, reliable, fast, standardized and automatic communication service for bank settlement, thereby greatly improving the settlement speed of the bank. Because the format of SWIFT has standardization, the format of the letter of credit is mainly the message of SWIFT.
The contracted bank sends a statement to the host foreign bank in the region or the global headquarter location in an MT940 (Message Type) Message format every day in a SWIFT mode, the headquarter of the multinational enterprise inquires the account information of the subsidiary company in time through an electronic bank platform of the host foreign bank, and one piece of information of the Message is occupied by each business.
In the SWIFT message, the cycle of the service is presented in a one-dimensional structure, which brings difficulty to message analysis and has poor readability.
Disclosure of Invention
The embodiment of the invention provides a file structure conversion method, a file structure conversion device, equipment and a storage medium, which are used for improving the readability of a message file structure.
In a first aspect, an embodiment of the present invention provides a file structure conversion method, including:
determining a configuration file matched with the file to be converted according to the file type of the file to be converted; the configuration file comprises mounting nodes with preset structures, and the preset structures of the mounting nodes are determined in advance according to file message contents;
matching the content to be matched in the file to be converted with the mounting node of the configuration file, and determining a target mounting node of the content to be matched;
and mounting the content to be matched to the target mounting node to generate a target file with a converted structure.
In a second aspect, an embodiment of the present invention further provides a file structure conversion apparatus, including:
the configuration file determining module is used for determining a configuration file matched with the file to be converted according to the file type of the file to be converted; the configuration file comprises mounting nodes with preset structures, and the preset structures of the mounting nodes are determined in advance according to file message contents;
the target mounting node determining module is used for matching the content to be matched in the file to be converted with the mounting node of the configuration file and determining the target mounting node of the content to be matched;
and the target file generation module is used for mounting the content to be matched to the target mounting node so as to generate a target file after structure conversion.
In a third aspect, an embodiment of the present invention further provides an apparatus, including:
one or more processors;
a storage device for storing one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors implement the file structure conversion method according to any embodiment of the present invention.
In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the file structure conversion method according to any embodiment of the present invention.
The method and the device for generating the target file determine the target mounting node of the content to be matched in the file to be converted based on the configuration file matched with the file type of the file to be converted, mount the content to be matched on the target mounting node, realize the structure conversion of the file to be converted and generate the target file. The readability of the message content in the file is improved by automatically converting the structure of the file to be converted, and the file structure conversion method supports the random superposition and nesting of the message content in the file, so that the universality of structure conversion is improved; and high availability of data file transmission is realized through structure conversion, and data consistency is ensured.
Drawings
FIG. 1 is a flowchart of a file structure conversion method according to a first embodiment of the present invention;
FIG. 2 is a flowchart of a file structure conversion method according to a second embodiment of the present invention;
FIG. 3 is a schematic structural diagram of a file structure conversion apparatus according to a third embodiment of the present invention;
fig. 4 is a schematic structural diagram of an apparatus in a fourth embodiment of the present invention.
Detailed Description
The present invention will be described in further detail with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not to be construed as limiting the invention. It should be further noted that, for the convenience of description, only some of the structures related to the present invention are shown in the drawings, not all of the structures.
Example one
Fig. 1 is a flowchart of a file structure conversion method in the first embodiment of the present invention, and this embodiment is applicable to the case of performing structure conversion on a SWIFT message. The method may be performed by a file structure conversion apparatus, which may be implemented in software and/or hardware and may be configured in a device, for example, a device with communication and computing capabilities such as a background server. As shown in fig. 1, the method specifically includes:
The file to be converted refers to a file for transmitting the content of the message in a SWIFT manner, for example, a signed bank sends a statement of account to a host foreign bank in the local or global headquarters location in an MT940 message format every day in a SWIFT manner, and the MT940 message is the file to be converted. The file type is used to indicate a specific classification of the message content, e.g., MT940 messages in the above example are one file type and MT103 for a money transfer representation for a single customer is another file type. Different message node representations exist in different file types, namely different file types correspond to different configuration files. The configuration file is used for representing message nodes in the message content and representing the relationship between the message nodes, so that the file to be converted can convert the content structure according to the configuration file. The mounting nodes in the configuration file are used for specifically representing the message nodes in the message content, and the hierarchical relationship of the mounting nodes is represented in the configuration file, so that the hierarchical relationship between the message nodes in the file to be converted is represented.
Illustratively, in the SWIFT message, the loop for the service is presented in a one-dimensional structure, that is, each service occupies one piece of information of the message content, and when the content in the loop structure formed by multiple pieces of information is excessive, or the loop content exists in the message content in an overlapping or nested manner, the loop structure in the SWIFT message is difficult to be visually displayed, which is not favorable for the user to view the content.
Specifically, a specific file type of the file to be converted is determined, a corresponding configuration file is determined according to the file type, for example, a preset association relationship exists between the file type and the configuration file, and the configuration file matched with the file to be converted is determined according to the association relationship. The configuration file comprises mounting nodes determined according to the relation between the contents of the file messages, and the hierarchical relation between the mounting nodes is also determined.
In the embodiment of the present invention, optionally, the configuration file is determined through the following steps:
determining all message nodes in the basic file; the message nodes at least comprise message node contents and message node attributes; establishing a mapping relation between the content of the message node and the matched object according to the attribute of the message node; determining mounting nodes formed by matching objects and a hierarchical relationship between the mounting nodes according to the mapping relationship and the message node attribute; and generating a configuration file according to the mounting nodes and the hierarchical relation between the mounting nodes.
The configuration file is preset according to the content in the basic file. Each file type corresponds to a basic file, and the configuration file corresponding to the file type can be predetermined according to the basic file. And the basic file comprises all message nodes appearing in the file type, so that the configuration file comprises mounting nodes corresponding to all the message nodes, and the problem of wrong conversion of the structure of the file to be converted caused by missing of the message nodes is avoided.
The message node consists of a node name, a node code number and a clause content; the message node is also called a message column, the node name refers to the specific meaning of the node, the node code refers to the code simply expressed in the message, and the clause content refers to the specific content information of the node. Illustratively, for the MT940, 61 is a message node, which means a piece of bank reconciliation information, the node number is 61, and the content of the clause is represented by the content following the 61. The message node contents in the message nodes refer to node codes and clause contents; for the message node attribute, the node name is referred, and the relationship between the nodes can be determined according to the node name.
The matching object is an object in a target file after the structure of the file to be converted is converted, illustratively, the SWIFT message format is converted into the Java format, and the matching object establishing the mapping relationship with the message node content is the Java object. For a message content, the message content is composed of a plurality of message nodes, each message node is converted into a mapped matching object, and the matching object constitutes a mounting node of the message content. And the hierarchical relationship of the mounting nodes inherits the hierarchical relationship between the message nodes in the corresponding message content, and the generated configuration file can be determined according to the determined mounting nodes and the hierarchical relationship between the mounting nodes.
Illustratively, mapping relationships between all message nodes in the SWIFT message and the Java object are configured, and the configuration structure is configured in a mounting manner, where mounting means that the message nodes in the SWIFT message are connected to objects in Java, and completing accessing the Java object is equivalent to accessing the corresponding message nodes. The relation between the mounting nodes is determined according to the relation between the message nodes in the mounting mode, so that the simple MT message columns, the combined MT message columns and the MT circular message columns are unified into the mounting mode for configuration. Through adopting the mount mode to design to the configuration file, realized waiting to convert the file according to the configuration file, can improve the readability of file structure after the conversion, the user of being convenient for looks over.
And 102, matching the content to be matched in the file to be converted with the mount node of the configuration file, and determining a target mount node of the content to be matched.
The content to be matched in the file to be converted refers to each message content in the file to be converted, each message content is matched with each mounting node in the configuration file, and if the mounting node which is successfully matched exists, the mounting node is indicated as a target mounting node of the message content; and if the successfully matched mounting node does not exist, indicating that the configuration is wrong or the input message is wrong.
In this embodiment of the present invention, optionally, matching the content to be matched in the file to be converted with the mount node of the configuration file, and determining the target mount node of the content to be matched includes:
sequentially taking each message node of the content to be matched in the file to be converted as a unit, and determining a matching object result mapped by the content to be matched according to the mapping relation between the content of the message node and the matching object; and matching the matching object result with the mounting node of the configuration file, and determining a target mounting node of the content to be matched.
Sequentially reading each message node according to the sequence of each content to be matched in the file to be converted; and sequentially converting each message node into a corresponding mapping matching object according to the mapping relation between the message node and the matching object in the configuration file, and forming a matching object result of the content to be matched by all the matching objects determined by each content to be matched. And matching with the mounting node according to the matching object result, wherein the mounting node is also composed of a plurality of matching objects, when the matching object result of the content to be matched is the same as any mounting node, the matching is successful, and the mounting node is the target mounting node of the content to be matched.
Illustratively, the mount node claims MT message node design in turn, and takes the MT message node as a unit to parse an input MT message into a two-dimensional structure corresponding to a configuration file. And sequentially claiming the one-dimensional structure of the MT message nodes according to the mapping mounting definition of the MT message nodes and the Java objects, and if the MT message nodes are not claimed, considering that the configuration is wrong or the input message is wrong.
In the embodiment of the present invention, optionally, the hierarchical relationship of the mount nodes at least includes an upper-lower level relationship and a parallel relationship.
Correspondingly, matching the content to be matched in the file to be converted with the mount node of the configuration file, and determining the target mount node of the content to be matched, including:
matching the content to be matched in the file to be converted with all the sub mount nodes of the target mount node of the previous content to be matched, and if the sub mount nodes are successfully matched, determining the matched mount nodes as the sub mount nodes; and if the matching fails, matching the content to be matched in the file to be converted with all the same-level mounting nodes of the target mounting node of the previous content to be matched, and if the matching of the same-level mounting nodes is successful, determining the matched mounting nodes as the same-level mounting nodes.
The hierarchical relation of the mounting nodes is used for visually representing the circulating structure, and comprises a superior-subordinate relation and a parallel relation. The upper and lower level relation means that the two mounting nodes are in an inclusion relation, the corresponding message node information is also in an inclusion relation, the mounting nodes in the upper and lower level relation are a father mounting node and a son mounting node, and at least one son mounting node exists for one father mounting node; the parallel relation means that the message node information of the two mounting node identifications are of the same type, and the mounting nodes in the parallel relation are the same-level mounting nodes.
Specifically, the child mount node of the target mount node of the previous content to be matched matches the MT message node preferentially over the mount nodes of the same level, that is, when the child mount node and the mount node of the same level exist at the same time, the child mount node matches the MT message node preferentially, and when the child mount node fails to match, the peer node continues to match the MT message column.
Because the configuration is carried out in the configuration file in a mounting mode, if the sequential matching is directly carried out according to the sequence of the mounting nodes, the matching efficiency is influenced; the matching priority of the sub mounting node of the target mounting node of the determined previous content to be matched and the mounting nodes at the same level is set, so that the mounting structure can be quickly formed, and the matching efficiency is improved.
And 103, mounting the content to be matched to the target mounting node to generate a target file with a converted structure.
After the target mounting node of the content to be matched is determined, the content to be matched is mounted on the target mounting node, so that the content to be matched can be viewed through the target mounting node, and after all the content to be matched in the file to be converted is mounted, a final target file subjected to structure conversion is generated. The target file generated in the mounting mode not only ensures the conversion of the file structure, but also improves the viewing efficiency of the file; and the consistency of the file content is ensured, and the accurate analysis of the file to be converted is realized.
The method and the device for generating the target file determine the target mounting node of the content to be matched in the file to be converted based on the configuration file matched with the file type of the file to be converted, mount the content to be matched on the target mounting node, realize the structure conversion of the file to be converted and generate the target file. The readability of the message content in the file is improved by automatically converting the structure of the file to be converted, and the file structure conversion method supports the random superposition and nesting of the message content in the file, so that the universality of structure conversion is improved; and high availability of data file transmission is realized through structure conversion, and data consistency is ensured.
Example two
Fig. 2 is a flowchart of a file structure conversion method in the second embodiment of the present invention, and the second embodiment of the present invention is further optimized based on the first embodiment of the present invention. As shown in fig. 2, the method includes:
The final sub mount node is a mount node without the sub mount node, and is the deepest node of the mount structure. When the message nodes are analyzed, a delegation mechanism is adopted, and different delegation mechanisms can be determined through the judgment of the final sub-mount nodes, so that the accuracy of message content analysis is improved.
When the target mounting node is the final sub-mounting node, the target mounting node indicates that the content to be matched corresponding to the target mounting node does not contain information of other message nodes; when the target mount node is not the final sub mount node, it indicates that the content to be matched corresponding to the target mount node contains information of other message nodes, and a delegation mechanism is required to be adopted to ensure the accuracy of the analysis content.
When the target mounting node is the final sub-mounting node, the specific value corresponding to each matching object in the target mounting node is determined according to the content to be matched of the target mounting node, and the specific value is set as the attribute value of each matching object of the target mounting node, namely, the specific value of the message node mapped by the matching object is checked through checking the attribute value of the matching object in the target mounting node, so that the structure conversion of the content to be matched is completely completed in a mounting mode.
And after the attribute values of all the final sub mounting nodes are set, generating a target file with a converted structure by the target mounting node matched with the content to be matched.
Illustratively, if the target mount node is the final sub-mount node, the MT message string is intercepted according to the type and length of the message node corresponding to the mount node in the configuration file, the string is converted into the configured Java type, and the converted value is set to the corresponding Java object attribute. The specific content represented by the MT message character string is intercepted and corresponds to the mounting node in the file to be converted; the converted value is the value of the message node; the Java object is the matching object mapped by the message node.
When the target mount node is not the final sub mount node, determining the message node content in the file to be converted under the target mount node according to the configuration of the target mount node in the configuration file, using the message node content as the entrusted mount content, entrusting the message node content to the sub mount node of the target mount node for matching, if the sub mount node of the target mount node is successfully matched with the message node in the entrusted mount content, determining that the sub mount node is a new target mount node, and executing the content of step 203. And determining the hierarchical relationship of the contents to be matched in the contents to be converted through the hierarchical relationship of the mounting nodes and the entrusting mechanism, and ensuring the consistency of the contents after entrusting conversion.
Illustratively, if the target mount node is not the final sub mount node, initializing the Java object mapped with the packet node according to the Java object structure mapped with the packet node in the configuration file, and using the corresponding MT packet node character string and the initialized Java object as input parameters, delegating the sub mount node of the target mount node to perform parsing, and performing a new round of judgment on whether the target mount node is the final sub mount node. The structure conversion of the file to be converted is realized through the progressive hierarchical relationship, the one-dimensional structure displayed by the content in the file to be converted is converted into the two-dimensional structure displayed in the target file in a mounting mode, and the readability of the circulating content of the message in the file is improved.
According to the embodiment of the invention, whether the matched target mount node is the final sub mount node is judged, so that the structure conversion of the contents to be matched in the files to be converted is completed by adopting a delegation mechanism, and the efficiency and the accuracy of the structure conversion are improved. And the accuracy of determining the hierarchical relationship of the file to be converted is realized through an entrusting mechanism, the problem of mismatching is avoided, and the consistency of the content of the target file after structure conversion and the content of the file to be converted is improved.
EXAMPLE III
Fig. 3 is a schematic structural diagram of a file structure conversion apparatus in a third embodiment of the present invention, which is applicable to a case of performing structure conversion on a SWIFT message. As shown in fig. 3, the apparatus includes:
a configuration file determining module 310, configured to determine, according to the file type of the file to be converted, a configuration file matched with the file to be converted; the configuration file comprises mounting nodes with preset structures, and the preset structures of the mounting nodes are determined in advance according to file message contents;
a target mount node determining module 320, configured to match a to-be-matched content in a to-be-converted file with a mount node of the configuration file, and determine a target mount node of the to-be-matched content;
a target file generating module 330, configured to mount the content to be matched to the target mount node, so as to generate a target file with a converted structure.
The method and the device for generating the target file determine the target mounting node of the content to be matched in the file to be converted based on the configuration file matched with the file type of the file to be converted, mount the content to be matched on the target mounting node, realize the structure conversion of the file to be converted and generate the target file. The readability of the message content in the file is improved by automatically converting the structure of the file to be converted, and the file structure conversion method supports the random superposition and nesting of the message content in the file, so that the universality of structure conversion is improved; and high availability of data file transmission is realized through structure conversion, and data consistency is ensured.
Optionally, the apparatus further includes a configuration file generating module, specifically configured to:
determining all message nodes in the basic file; the message nodes at least comprise message node contents and message node attributes;
establishing a mapping relation between the content of the message node and the matched object according to the attribute of the message node;
determining mounting nodes formed by matched objects and a hierarchical relationship between the mounting nodes according to the mapping relationship and the message node attribute;
and generating a configuration file according to the mounting nodes and the hierarchical relation between the mounting nodes.
Optionally, the target mount node determining module 320 is specifically configured to:
sequentially taking each message node of the content to be matched in the file to be converted as a unit, and determining a matching object result mapped by the content to be matched according to the mapping relation between the content of the message node and the matching object;
and matching the matching object result with the mounting node of the configuration file to determine a target mounting node of the content to be matched.
Optionally, the target file generating module 330 is specifically configured to:
if the target mounting node is the final sub-mounting node, determining the attribute value of the target mounting node according to the content to be matched;
and generating a target file with a converted structure according to the target mounting node and the attribute value.
Optionally, the target file generating module 330 is specifically configured to:
if the target mounting node is not the final sub-mounting node, determining entrusted mounting content in the file to be converted according to the configuration file;
and entrusting the entrusting mounting content to the sub mounting node of the target mounting node for conversion, and judging whether the sub mounting node is the final sub mounting node or not.
Optionally, the hierarchical relationship of the mounted nodes at least includes an upper-level relationship, a lower-level relationship and a parallel relationship;
correspondingly, the target mount node determining module 320 is specifically configured to:
matching the content to be matched in the file to be converted with all the sub mount nodes of the target mount node of the previous content to be matched, and if the sub mount nodes are successfully matched, determining the matched mount nodes as the sub mount nodes;
and if the matching fails, matching the content to be matched in the file to be converted with all the same-level mounting nodes of the target mounting node of the previous content to be matched, and if the matching of the same-level mounting nodes is successful, determining the matched mounting nodes as the same-level mounting nodes.
The file structure conversion device provided by the embodiment of the invention can execute the file structure conversion method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of executing the file structure conversion method.
Example four
Fig. 4 is a schematic structural diagram of an apparatus according to a fourth embodiment of the present invention. Fig. 4 illustrates a block diagram of an exemplary device 12 suitable for use in implementing embodiments of the present invention. The device 12 shown in fig. 4 is only an example and should not bring any limitation to the function and scope of use of the embodiments of the present invention.
As shown in FIG. 4, device 12 is in the form of a general purpose computing device. The components of device 12 may include, but are not limited to: one or more processors or processing units 16, a system memory device 28, and a bus 18 that couples various system components including the system memory device 28 and the processing unit 16.
The system storage 28 may include computer system readable media in the form of volatile memory devices, such as Random Access Memory (RAM) 30 and/or cache storage 32. Device 12 may further include other removable/non-removable, volatile/nonvolatile computer system storage media. By way of example only, storage system 34 may be used to read from and write to non-removable, nonvolatile magnetic media (not shown in FIG. 4, and commonly referred to as a "hard drive"). Although not shown in FIG. 4, a magnetic disk drive for reading from and writing to a removable, nonvolatile magnetic disk (e.g., a "floppy disk") and an optical disk drive for reading from or writing to a removable, nonvolatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 by one or more data media interfaces. Storage 28 may include at least one program product having a set (e.g., at least one) of program modules that are configured to carry out the functions of embodiments of the invention.
A program/utility 40 having a set (at least one) of program modules 42 may be stored, for example, in storage 28, such program modules 42 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which examples or some combination thereof may comprise an implementation of a network environment. Program modules 42 generally carry out the functions and/or methodologies of embodiments of the invention as described.
The processing unit 16 executes various functional applications and data processing by running programs stored in the system storage device 28, for example, implementing a file structure conversion method provided by an embodiment of the present invention, including:
determining a configuration file matched with the file to be converted according to the file type of the file to be converted; the configuration file comprises mounting nodes with a preset structure, and the preset structure of the mounting nodes is determined in advance according to the content of the file message;
matching the content to be matched in the file to be converted with the mount node of the configuration file, and determining a target mount node of the content to be matched;
and mounting the content to be matched to the target mounting node to generate a target file with a converted structure.
EXAMPLE five
The fifth embodiment of the present invention further provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the file structure conversion method provided in the fifth embodiment of the present invention, and the method includes:
determining a configuration file matched with the file to be converted according to the file type of the file to be converted; the configuration file comprises mounting nodes with a preset structure, and the preset structure of the mounting nodes is determined in advance according to the content of the file message;
matching the content to be matched in the file to be converted with the mounting node of the configuration file, and determining a target mounting node of the content to be matched;
and mounting the content to be matched to the target mounting node to generate a target file with a converted structure.
Computer storage media for embodiments of the invention may employ any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations for aspects of the present invention may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
It is to be noted that the foregoing description is only exemplary of the invention and that the principles of the technology may be employed. Those skilled in the art will appreciate that the present invention is not limited to the particular embodiments described herein, and that various obvious changes, rearrangements and substitutions will now be apparent to those skilled in the art without departing from the scope of the invention. Therefore, although the present invention has been described in some detail by the above embodiments, the invention is not limited to the above embodiments, and may include other equivalent embodiments without departing from the spirit of the invention, and the scope of the invention is determined by the scope of the appended claims.
Claims (6)
1. A file structure conversion method, comprising:
determining a configuration file matched with the file to be converted according to the file type of the file to be converted; the configuration file comprises mounting nodes with a preset structure, and the preset structure of the mounting nodes is determined in advance according to the content of the file message;
matching the content to be matched in the file to be converted with the mounting node of the configuration file, and determining a target mounting node of the content to be matched;
mounting the content to be matched to the target mounting node to generate a target file with a converted structure;
wherein the configuration file is determined by:
determining all message nodes in the basic file; the message nodes at least comprise message node contents and message node attributes;
establishing a mapping relation between the content of the message node and the matched object according to the attribute of the message node;
determining mounting nodes formed by matched objects and a hierarchical relationship between the mounting nodes according to the mapping relationship and the message node attribute;
generating a configuration file according to the mounting nodes and the hierarchical relation between the mounting nodes;
the basic file is obtained according to the file type of the file to be converted;
wherein the mounting the content to be matched to the target mounting node to generate a target file with a converted structure includes:
if the target mounting node is the final sub-mounting node, determining the attribute value of the target mounting node according to the content to be matched;
generating a target file with a converted structure according to the target mounting node and the attribute value;
if the target mounting node is not the final sub-mounting node, determining entrusted mounting content in the file to be converted according to the configuration file;
entrusting the entrusting mounting content to a sub mounting node of the target mounting node for conversion, and judging whether the sub mounting node is a final sub mounting node or not;
if the target mounting node is the final sub-mounting node, the content to be matched corresponding to the target mounting node does not contain information of other message nodes; and if the target mounting node is not the final sub-mounting node, the content to be matched corresponding to the target mounting node contains information of other message nodes.
2. The method according to claim 1, wherein matching the content to be matched in the file to be converted with the mount node of the configuration file, and determining the target mount node of the content to be matched comprises:
sequentially taking each message node of the content to be matched in the file to be converted as a unit, and determining a matching object result mapped by the content to be matched according to the mapping relation between the content of the message node and the matching object;
and matching the matching object result with the mounting node of the configuration file to determine a target mounting node of the content to be matched.
3. The method according to claim 1, wherein the hierarchical relationship of the mounted nodes at least comprises a top-bottom relationship and a parallel relationship;
correspondingly, matching the content to be matched in the file to be converted with the mount node of the configuration file, and determining the target mount node of the content to be matched, including:
matching the content to be matched in the file to be converted with all the sub mount nodes of the target mount node of the previous content to be matched, and if the sub mount nodes are successfully matched, determining the matched mount nodes as the sub mount nodes;
and if the matching fails, matching the content to be matched in the file to be converted with all the same-level mounting nodes of the target mounting node of the previous content to be matched, and if the matching of the same-level mounting nodes is successful, determining the matched mounting nodes as the same-level mounting nodes.
4. A file structure conversion apparatus, comprising:
the configuration file determining module is used for determining a configuration file matched with the file to be converted according to the file type of the file to be converted; the configuration file comprises mounting nodes with a preset structure, and the preset structure of the mounting nodes is determined in advance according to the content of the file message;
the target mounting node determining module is used for matching the content to be matched in the file to be converted with the mounting node of the configuration file and determining the target mounting node of the content to be matched;
the target file generation module is used for mounting the content to be matched to the target mounting node so as to generate a target file with a converted structure;
the device further comprises a configuration file generation module, which is specifically configured to:
determining all message nodes in the basic file; the message nodes at least comprise message node contents and message node attributes;
establishing a mapping relation between the content of the message node and the matched object according to the attribute of the message node;
determining mounting nodes formed by matching objects and a hierarchical relationship between the mounting nodes according to the mapping relationship and the message node attribute;
generating a configuration file according to the mounting nodes and the hierarchical relation between the mounting nodes
The basic file is obtained according to the file type of the file to be converted;
the target mount node determination module is specifically configured to:
matching the content to be matched in the file to be converted with all the sub mount nodes of the target mount node of the previous content to be matched, and if the sub mount nodes are successfully matched, determining the matched mount nodes as the sub mount nodes;
if the matching fails, matching the content to be matched in the file to be converted with all the same-level mounting nodes of the target mounting node of the previous content to be matched, and if the matching of the same-level mounting nodes is successful, determining the matched mounting nodes as the same-level mounting nodes;
if the target mounting node is the final sub-mounting node, the content to be matched corresponding to the target mounting node does not contain information of other message nodes; and if the target mounting node is not the final sub-mounting node, the content to be matched corresponding to the target mounting node contains information of other message nodes.
5. An apparatus, comprising:
one or more processors;
a storage device for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the file structure conversion method of any of claims 1-3.
6. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, implements the file structure conversion method according to any one of claims 1 to 3.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010214662.4A CN111447268B (en) | 2020-03-24 | 2020-03-24 | File structure conversion method, device, equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010214662.4A CN111447268B (en) | 2020-03-24 | 2020-03-24 | File structure conversion method, device, equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN111447268A CN111447268A (en) | 2020-07-24 |
CN111447268B true CN111447268B (en) | 2022-11-25 |
Family
ID=71629506
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010214662.4A Active CN111447268B (en) | 2020-03-24 | 2020-03-24 | File structure conversion method, device, equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111447268B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111949614B (en) * | 2020-08-12 | 2024-04-02 | 中国工商银行股份有限公司 | Bank system file conversion method and device |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2003001812A2 (en) * | 2001-06-20 | 2003-01-03 | Thomson Licensing Sa | Method and system for the conversion of xhtml/html documents to mpeg-4 documents |
WO2004064357A2 (en) * | 2003-01-03 | 2004-07-29 | V-Enable, Inc. | Data conversion server for voice browsing system |
JP2006163820A (en) * | 2004-12-07 | 2006-06-22 | Mitsubishi Electric Corp | Data converter |
CN109101500A (en) * | 2017-06-20 | 2018-12-28 | 北京国双科技有限公司 | A kind of methods of exhibiting and device of file data |
WO2019053234A1 (en) * | 2017-09-15 | 2019-03-21 | Spherical Defence Labs Limited | Detecting anomalous application messages in telecommunication networks |
CN110457256A (en) * | 2019-08-01 | 2019-11-15 | 大众问问(北京)信息科技有限公司 | Date storage method, device, computer equipment and storage medium |
Family Cites Families (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
KR100694238B1 (en) * | 2000-09-28 | 2007-03-14 | 가부시키가이샤 리코 | Structure edit method, video structure edit method, contents structure management method of object, contents structure display method, contents management method, and a computer-readable storage medium |
US9183062B2 (en) * | 2013-02-25 | 2015-11-10 | International Business Machines Corporation | Automated application reconfiguration |
EP2879040B1 (en) * | 2013-10-18 | 2017-03-01 | Huawei Technologies Co., Ltd. | Data storage method, data storage apparatus, and storage device |
CN104573011B (en) * | 2015-01-08 | 2018-11-06 | 北京数码大方科技股份有限公司 | Network disk file shows method and device |
CN106202149B (en) * | 2016-06-22 | 2019-07-23 | 南京南瑞继保电气有限公司 | A kind of IEC61850 model file conversion method |
CN109542664B (en) * | 2018-12-13 | 2024-07-16 | 平安科技(深圳)有限公司 | File verification method and device based on artificial intelligence and computer equipment |
CN109933800A (en) * | 2019-03-22 | 2019-06-25 | 中国农业银行股份有限公司 | Creation method, information query method and the device of data structures system |
-
2020
- 2020-03-24 CN CN202010214662.4A patent/CN111447268B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2003001812A2 (en) * | 2001-06-20 | 2003-01-03 | Thomson Licensing Sa | Method and system for the conversion of xhtml/html documents to mpeg-4 documents |
WO2004064357A2 (en) * | 2003-01-03 | 2004-07-29 | V-Enable, Inc. | Data conversion server for voice browsing system |
JP2006163820A (en) * | 2004-12-07 | 2006-06-22 | Mitsubishi Electric Corp | Data converter |
CN109101500A (en) * | 2017-06-20 | 2018-12-28 | 北京国双科技有限公司 | A kind of methods of exhibiting and device of file data |
WO2019053234A1 (en) * | 2017-09-15 | 2019-03-21 | Spherical Defence Labs Limited | Detecting anomalous application messages in telecommunication networks |
CN110457256A (en) * | 2019-08-01 | 2019-11-15 | 大众问问(北京)信息科技有限公司 | Date storage method, device, computer equipment and storage medium |
Non-Patent Citations (2)
Title |
---|
XML与关系型数据库数据转换技术的研究;代丽等;《重庆科技学院学报(自然科学版)》;20101215(第06期);全文 * |
异构数据库间数据交换工具的设计与实现;王洪荣等;《北京林业大学学报》;20091115;全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN111447268A (en) | 2020-07-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108519967B (en) | Chart visualization method and device, terminal and storage medium | |
KR20080101907A (en) | Edi instance based transaction set definition | |
US20050229156A1 (en) | Filter-based comments in source code | |
CN111813804A (en) | Data query method and device, electronic equipment and storage medium | |
CN111242462B (en) | Data processing method and device, computer storage medium and electronic equipment | |
US20230316792A1 (en) | Automated generation of training data comprising document images and associated label data | |
CN111241180A (en) | Information processing method, device, equipment and storage medium | |
CN109951553B (en) | Data processing method, system, electronic device and computer readable storage medium | |
CN113094625B (en) | Page element positioning method and device, electronic equipment and storage medium | |
CN113158101A (en) | Visual page rendering method, device, equipment and storage medium | |
CN112948396A (en) | Data storage method and device, electronic equipment and storage medium | |
US20230419710A1 (en) | Information extraction from documents containing handwritten text | |
CN111913922B (en) | Binary structured log generation method, device, equipment and storage medium | |
CN113761428A (en) | Page rendering method, device and system, storage medium and electronic equipment | |
CN111447268B (en) | File structure conversion method, device, equipment and storage medium | |
CN113032674A (en) | Project publishing method, device, equipment and medium | |
US20230418859A1 (en) | Unified data classification techniques | |
US20030131071A1 (en) | Electronic document interchange document object model | |
CN109189332A (en) | A kind of disk hanging method, device, server and storage medium | |
CN112306694B (en) | Memory analysis method and device, computer readable storage medium and electronic equipment | |
CN114217790A (en) | Interface scheduling method and device, electronic equipment and medium | |
CN113590883A (en) | Method, system, device and storage medium for mapping medical information and database | |
CN112162922A (en) | Method, device, server and storage medium for determining difference of new and old systems | |
CN113392014A (en) | Test case generation method and device, electronic equipment and medium | |
CN111400623A (en) | Method and apparatus for searching information |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
TA01 | Transfer of patent application right |
Effective date of registration: 20220919 Address after: 25 Financial Street, Xicheng District, Beijing 100033 Applicant after: CHINA CONSTRUCTION BANK Corp. Address before: 25 Financial Street, Xicheng District, Beijing 100033 Applicant before: CHINA CONSTRUCTION BANK Corp. Applicant before: Jianxin Financial Science and Technology Co.,Ltd. |
|
TA01 | Transfer of patent application right | ||
GR01 | Patent grant | ||
GR01 | Patent grant |