Graph data conversion algorithm programming method and framework

By defining graph nodes and edges through open interfaces, and employing syntax parsing, semantic conversion, and graph data converters, the problem of graph data conversion between different programming languages ​​is solved, achieving efficient and stable file conversion, suitable for input file conversion in commercial CAE software.

CN121742853APending Publication Date: 2026-03-27SICHUAN ZHONGJIU SHUCHUANG TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-01-13
Publication Date
2026-03-27

AI Technical Summary

Technical Problem

Existing technologies cannot achieve universal graph data conversion between different programming languages; they can only solve specific problems, such as compiling code into binary files, but cannot convert from one programming language to another.

Method used

Through an open programmable interface, arbitrary graph nodes and edges can be defined. Using syntax parsing, semantic transformation, and graph data converter, the conversion from a file that can be abstracted as graph data to another programming language can be realized. This includes parsing the syntax tree structure, establishing the association relationship of the file model, transforming the graph structure, and outputting the text.

Benefits of technology

It achieves universal graph data conversion between different programming languages, improving conversion efficiency and convenience, supports parallel execution, and has rich error prompts and handling mechanisms to ensure stable framework operation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121742853A_ABST
    Figure CN121742853A_ABST
Patent Text Reader

Abstract

The invention belongs to the field of computer programs, and relates to a graph data conversion algorithm programming method and framework, and the method comprises the steps: S1, reading a to-be-converted file through a grammar parser, and converting the to-be-converted file into a grammar tree structure; the to-be-converted file is a file which can be abstracted into graph data; s2, the syntax tree structure is read through a semantic converter, and the incidence relation between the file models is obtained; the file model is a data object expressed in a graph node form and is used for bearing data in the file; s3, converting the graph structure of the to-be-converted file model into a graph structure of a target file model through a graph data converter; the method comprises the following steps of: realizing the conversion of a graph structure through separated steps: firstly performing graph node conversion and then performing graph edge conversion; s4, converting the target node data and the target edge data into a target file through a text output device; one programming language capable of being abstracted into graph data is converted into another programming language capable of being abstracted into graph data through universal graph-to-graph conversion.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of computer programs, and specifically discloses a graph data conversion algorithm programming method and framework. BACKGROUND

[0002] Most data relationships in the real world can be represented using graphs. However, the data structure representation of graphs differs greatly under different perspectives. For example, the same algorithm logic can be written using C++ language and using python code, and the code content can differ greatly. The graph data corresponding to the C++ code and the graph data corresponding to the python code also differ in structure. For text files, the association between graph nodes cannot be directly displayed using the data structure of a graph, and a conventional syntax rule is usually used to represent the association between graph nodes. For example, in C++ code, the value used by a variable is a reference to the value defined by the variable before this point, and the reference relationship of the variable value can only be agreed upon by syntax rules in the text. Therefore, if C++ code needs to be converted into python code, the C++ code text needs to be converted into a syntax tree with a hierarchical structure, the syntax tree needs to be converted into graph data, and finally the graph data of C++ needs to be converted into equivalent graph data under the python semantics, and finally the graph data is used to generate python code. The prior art uses a front-end and back-end separation design to convert source code parsed by different front-end parsers into corresponding syntax trees, and then converts the syntax trees into intermediate expressions through optimization transformation; the back-end optimizes and translates the intermediate expressions and different hardware architectures and operating systems into machine code for the corresponding architecture. However, the prior art cannot implement general conversion and can only solve specific problems, such as llvm-clang. Only code compilation into binary files can be implemented, and conversion from one programming language to another programming language cannot be implemented.

[0003] Therefore, the present application provides a graph data conversion algorithm programming method and framework for implementing general graph-to-graph conversion. Through an open programmable interface, developers can define any graph nodes and edges based on the interface to represent graph relationships, so that developers can implement conversion of any file based on the framework. For example, bidirectional conversion between CAD step files and dxf files. As long as the data can be abstracted as a graph, conversion can be implemented. SUMMARY

[0004] The present application aims to provide a graph data conversion algorithm programming method and framework, and solves the problem of converting one programming language that can be abstracted as graph data into another programming language that can be abstracted as graph data through general graph-to-graph conversion. The specific scheme is as follows: The application discloses a programming method of a graph data conversion algorithm, which comprises the following steps: S1, reading a to-be-converted file through a syntax parser, and converting the to-be-converted file into a syntax tree structure; the to-be-converted file is a file capable of being abstracted into graph data; S2, reading the syntax tree structure through a semantic converter, and obtaining the association relationship between file models; the file model is a data object represented in the form of a graph node and used for carrying data in the file; S3, converting the graph structure of the to-be-converted file model into the graph structure of a target file model through a graph data converter; the graph structure comprises node data and edge data; the conversion of the graph structure is realized through separate steps, which comprises the following steps: S31, performing a node conversion algorithm, independently converting each to-be-converted node data in the to-be-converted file model to obtain target node data in the target file model, the conversion process does not need to follow a preset node sequence and supports parallel execution, and a bidirectional mapping table recording the corresponding relationship between the to-be-converted node data and the target node data is established; S32, after all the to-be-converted nodes are converted, performing an edge conversion algorithm, traversing all the to-be-converted edge data in the to-be-converted file model, locating corresponding target nodes in the target file model by querying the bidirectional mapping table, and establishing target edge data between the target nodes based on the association relationship of the to-be-converted edge data; and S4, converting the target node data and the target edge data into the target file through a text outputter.

[0005] Further, the association relationship between the file models is obtained by reading the syntax tree structure, which comprises the following steps: extracting and storing the data in the syntax tree structure into the to-be-converted file model; and establishing the association relationship between the to-be-converted file model and the target file model.

[0006] Further, the association relationship comprises the corresponding cases of the reference relationship, the containing relationship and the dependency relationship between the node data in the file models.

[0007] Further, the syntax tree structure adopts a nested hierarchical structure of a root node, multiple levels of child nodes and leaf nodes; each node carries identification information related to the type of the to-be-converted file; the root node corresponds to a basic data unit with independent functions or logical meanings in the to-be-converted file; the multiple levels of child nodes comprise an identification description child node and a data field child node; the identification description child node is used for carrying the identity information of the root node; the data field child node is used for carrying the data content of the root node or the reference relationship between the nodes; and the leaf node corresponds to the smallest data unit of the basic data unit in the to-be-converted file.

[0008] Further, the data in the syntax tree structure is extracted and stored into the to-be-converted file model, which comprises the following steps: converting the root node in the syntax tree structure into an instance of the file model; converting the identification description child node into an identification variable of the file model; converting the data field child node into a data variable of the file model; and converting the leaf node into the specific numerical value of the variable in the file model.

[0009] Further, the converting the to-be-converted node data into target node data comprises: converting one to-be-converted node data into multiple target node data; converting one to-be-converted node data into one target node data; converting multiple to-be-converted node data into one target node data; and converting multiple to-be-converted node data into multiple target node data.

[0010] Further, for converting one to-be-converted node data into multiple target node data, the bidirectional mapping relationship table records the mapping relationship between the to-be-converted node data and the multiple target node data; for converting one to-be-converted node data into one target node data, the bidirectional mapping relationship table records the mapping relationship between the to-be-converted node data and the target node data; for converting multiple to-be-converted node data into one target node data, the bidirectional mapping relationship table records the mapping relationship between the multiple to-be-converted node data and the target node data; and for converting multiple to-be-converted node data into multiple target node data, the bidirectional mapping relationship table records the mapping relationship between the multiple to-be-converted node data and the multiple target node data.

[0011] Further, the method further comprises defining a new node type, an edge type and attribute information through a programming interface.

[0012] The application further provides a graph data conversion algorithm programming framework for implementing the graph data conversion algorithm programming method, comprising a syntax analysis module, a semantic conversion module, a graph data conversion module and a text output module; the syntax analysis module is used for reading a to-be-converted file through a syntax analyzer and converting the to-be-converted file into a syntax tree structure; the to-be-converted file is a file capable of being abstracted into graph data; the semantic conversion module is used for reading the syntax tree structure through a semantic converter and obtaining the correlation relationship between file models; the file model is a data object represented in the form of a graph node and used for carrying data in the file; the graph data conversion module is used for converting the graph structure of the to-be-converted file model into the graph structure of a target file model through a graph data converter; the graph structure comprises node data and edge data; and the text output module is used for converting the target node data and the target edge data into a target file through a text outputter.

[0013] The application has the following advantages and beneficial effects: The method in the application can be and has been applied to realizing mutual conversion of input files between different commercial CAE software, for example, converting the k file of ls-dyna into the input and j files of sdyn. For a k file with ten million lines, the running time on a 3GHz 8-core CPU is about 70 seconds. Each step has rich and detailed error prompts and error processing, and the framework can exit without crashing in any case. BRIEF DESCRIPTION OF DRAWINGS

[0014] Figure 1 An exemplary flowchart of a graph data conversion algorithm programming method of the present application; Figure 2 A portion of the contents of a k file used in some embodiments of the present application; Figure 3 An exemplary schematic diagram of node data in a graph structure converted by the present application; Figure 4 An exemplary schematic diagram of edge data in a graph structure converted by the present application. DETAILED DESCRIPTION

[0015] To make the objects, technical solutions and advantages of embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some but not all of the embodiments of the present application. The components of the embodiments of the present application described and shown in the drawings herein can be arranged and designed in various different configurations.

[0016] As Figure 1 shown, the present application provides a graph data conversion algorithm programming method, including the following contents: S1: reading a to-be-converted file (text file 1) through a syntax parser to convert the to-be-converted file into a syntax tree structure; the to-be-converted file is a file that can be abstracted into graph data. For example, by using a Paser syntax parser, the file is read in to generate a syntax tree corresponding to the file. Taking the partial content of a k file of LS-DYNA as an example, the process of converting text into a syntax tree is demonstrated as follows: The k file writes data in the form of cards, and the cards can have specific ids. Card A indicates a reference to card B by saving the id of card B in the card data of card A. Taking Figure 2 as an example: the lcid field of the LOAD_BODY_Z card above indicates that the DEFINE_CURVE card with lcid number 1 needs to be referenced. The parser converts the card above into a syntax tree as shown below: “K::k_card: K::k_card_name_option: K::k_card_name:*LOAD_BODY K::k_card_option:Z K::k_card_field_line: K::k_field:1 K::k_field:9806.0 K::k_field:0 K::k_field:0.0 K::k_field:0.0 K::k_field:0.0 K::k_field:0 K::k_field: K::k_card: K::k_card_name_option: K::k_card_name:*DEFINE_CURVE K::k_card_field_line: K::k_field:1 K::k_field:0 K::k_field:1.0 K::k_field:1.0 K::k_field:0.0 K::k_field:0.0 K::k_field:0 K::k_field:0 K::k_card_field_line: K::k_field:0.0 K::k_field:1.0 K::k_card_field_line: K::k_field:10.0 K::k_field:1.0”。

[0017] In combination with the syntax tree example described above, it can be seen that the syntax tree structure adopts a nested hierarchical structure of root nodes, multiple levels of child nodes, and leaf nodes; each node carries identification information related to the type of file to be converted (such as the k file syntax tree node prefix “K::”); the root node corresponds to a basic data unit in the file to be converted that has independent functions or logical meanings (such as a single card in the k file); the multiple levels of child nodes include identification description child nodes and data field child nodes; the identification description child nodes are used to carry the identity information of the root node (such as the card name, options); the data field child nodes are used to carry the data content of the root node or the reference relationship between nodes (such as the field line set of the card); and the leaf nodes correspond to the smallest data unit of the basic data unit in the file to be converted (such as the numerical value of a single field in the card).

[0018] S2: reading the syntax tree structure through the semantic converter to obtain the association relationship between the file models; the file model is a data object represented in the form of a graph node, used to carry data in the file. For example, through the Convertor semantic converter, the processed syntax tree is read in, the data is loaded into the corresponding file model, and the association relationship between the file models is established. The file model is a data object represented in the form of a graph node. For example, the file model corresponding to the DEFINE_CURVE card is a class in the C++ code, as follows: “class DEFINE_CURVE:public Vertex{ int lcid; int sidr; double scla; double sclo; double offa; double offo; int dtyp; int lcint; std::vector<std::pair<double, double>>a1_o1; };”.

[0019] The file model class inherits from the custom graph node Vertex class and serves as a data container to save data in the file. The specific operation of Convertor is to extract characters from the syntax tree and convert them into real data types. For example, the string “1” is extracted from the first field of the first line of the DEFINE_CURVE syntax tree node and converted into the integer 1, which is saved to the lcid member variable of the file model.

[0020] In some embodiments, reading the syntax tree structure to obtain the association relationship between the file models includes: extracting and storing data in the syntax tree structure into the file model to be converted, including: converting the root node in the syntax tree structure into an instance of the file model; converting the identification description subnode into an identification class variable of the file model; converting the data field subnode into a data variable of the file model; and converting the leaf node into a specific numerical value of a variable in the file model.

[0021] establishing the association relationship between the file model to be converted and the target file model. The association relationship includes the corresponding cases of the reference relationship, the containing relationship and the dependency relationship between the node data in the file models.

[0022] The Convertor provides an extensible algorithm interface, and two functions need to be implemented for each card: a convert function, which mainly writes the logic of extracting data from the syntax tree and saving it to the file model object; and a connect function, which mainly writes the logic of establishing associated nodes. For example, for the LOAD_BODY file model node, an edge in the graph structure needs to be established with the corresponding DEFINE_CURVE file model node in the connect function. Since the framework defines the calling order of all Convertor algorithms, the convert function of all algorithms is called first, and then the connect function of all algorithms is called, so that all file model nodes that need to establish relationships are created in the connect phase.

[0023] S3: converting the graph structure of the file model to be converted into the graph structure of the target file model through a graph data converter; the graph structure includes node data and edge data. For example, through a Transformer graph data converter, the graph structure of one file model is converted into the graph conversion algorithm of another file model. The core function is to convert the graph structure of one file model into the graph structure of another file model. Similar to the Convertor algorithm interface, Transformer also provides two algorithm interface functions: transfer and connect, and the most core is the Transformer conversion algorithm, which is divided into two steps: graph node data conversion (transfer) and graph edge conversion (connect). By designing the conversion algorithm in two steps, the development of the original algorithm and the target algorithm can be independent, and each graph node conversion and graph edge conversion algorithm can be developed independently without deliberately designing the conversion order of the graph node, and at the same time, the graph node conversion algorithm can be run in parallel, improving the conversion efficiency and convenience of the algorithm.

[0024] In the graph node data conversion step, only the data of the graph node is converted, and the edges of the original graph are not processed. The conversion of the node data in the file model to be converted is performed to obtain the target node data in the target file model, and the conversion process does not need to follow the preset node order and supports parallel execution, and a bidirectional mapping table between nodes is established; the bidirectional mapping table is used to record the correspondence between the node data to be converted and the target node data. For example, Figure 3 Different circles in the figure represent different nodes, and Figure 3Data extraction of the left 1 node, according to the algorithm rules (for example, the LOAD three-direction component in the SDYN file is stored in a file model node, and the k file needs to be stored according to the x / y / z component), the single node is decomposed into three nodes on the right side, and the edges between the left nodes are not processed at this stage. This stage needs to introduce a conversion node bidirectional mapping table to record the node conversion relationship between the two graphs, which is convenient for subsequent use. For example, the graph node of file model A and the corresponding graph node of file model B are stored in the mapping table. Since the nodes and edges are separated, the conversion of each node does not depend on the data of other new nodes, so it supports out-of-order parallel execution of conversion. For example, when converting the LOAD_BODY data of the k file model to the LOAD class of the SDYN file model, only the data of LOAD_BODY needs to be extracted, without considering the referenced DEFINE_CURVE data).

[0025] After all the graph nodes of the file model A to be converted are converted into the graph nodes of the target file model B through the transfer function, if the graph nodes of the target file model B still lack edges, the conversion (connect) of the graph edges needs to be performed. All the edge data to be converted in the file model to be converted is traversed, and the target edge data of the target node data corresponding to the node data to be converted is established in the target file model by querying the bidirectional mapping table. The flow of the Connect function is as follows: all the edges in the file model A to be converted are traversed; the target nodes after the conversion of the nodes of the file model A to the file model B are found by querying the bidirectional mapping table; and new edges are established between the target nodes of the file model B according to the algorithm rules. For example, after the LOAD_BODY of the k file is converted into the LOAD of the SDYN and the DEFINE_CURVE of the k file is converted into the CURVE of the SDYN, the edge between the LOAD and the CURVE needs to be established in the SDYN. The Connect stage can query the converted LOAD corresponding to the LOAD_BODY and the CURVE corresponding to the DEFINE_CURVE according to the bidirectional mapping table, and associate the LOAD and the CURVE. Since the node data on which the establishment of the edges in the Connect stage depends is fully prepared, all the nodes of the target file model B are created, and therefore the conversion can be executed in parallel in disorder. For example, for the graph data structure of the k file, the load_body card corresponds to a graph node A, and the define_curve corresponds to a graph node B. Since the load_body needs to refer to the define_curve, there is an edge between the node A and the node B in the graph data. The present application separates the two steps of the node conversion and the edge establishment, so that the conversion order of A and B is irrelevant, and the edge between C and D can be established after A and B are converted. When the node conversion stage is executed, each node can be converted independently without caring about how the edge of the node is processed, and the edge data is uniformly processed in the edge construction stage. In the edge construction stage, all the new nodes are ensured to be created, and only need to be created according to the node bidirectional mapping table. The traditional graph conversion algorithm needs to convert the node B into the node D in the new graph first, and then convert the node A into the node C in the new graph, and then establish the edge between C and D according to the edge between A and B. Therefore, the traditional conversion algorithm has requirements on the conversion order of the nodes, and must convert B first and then convert A. Otherwise, if A is converted into C first, since B has not been converted into D at this time, C cannot immediately establish the edge between C and D. Therefore, the graph data conversion algorithm programming method provided by the present application greatly improves the conversion efficiency and convenience of the algorithm.

[0026] In some embodiments, converting the to-be-converted node data into target node data includes the following four cases: converting one to-be-converted node data into multiple target node data; converting one to-be-converted node data into one target node data; converting multiple to-be-converted node data into one target node data; and converting multiple to-be-converted node data into multiple target node data. Corresponding bidirectional mapping table recording rules can be as follows: if one to-be-converted node data is converted into multiple target node data, the bidirectional mapping table records the mapping relationship between the to-be-converted node data and the multiple target node data; if one to-be-converted node data is converted into one target node data, the bidirectional mapping table records the mapping relationship between the to-be-converted node data and the target node data; if multiple to-be-converted node data is converted into one target node data, the bidirectional mapping table records the mapping relationship between the multiple to-be-converted node data and the target node data; and if multiple to-be-converted node data is converted into multiple target node data, the bidirectional mapping table records the mapping relationship between the multiple to-be-converted node data and the multiple target node data.

[0027] S4: converting the target node data and the target edge data into a target file through a text outputter. The step converts the converted target file model graph structure (containing node data and edge data) into a final file (for example, an input file, a j file, etc. of SDYN) conforming to a target file format through the text outputter.

[0028] In some embodiments, an extension function is further included, a new node type, edge type and attribute information are defined through a programming interface, and a developer can extend the support of the framework for a new type of to-be-converted file based on the interface.

[0029] The application further provides a graph data conversion algorithm programming framework for implementing the graph data conversion algorithm programming method.

[0030] The syntax parsing module is used to read a to-be-converted file through a syntax parser and convert the to-be-converted file into a syntax tree structure; the to-be-converted file is a file (for example, a code class file, a CAE software input file, a CAD file, etc.) that can be abstracted into graph data. Corresponding to the method step S1, the syntax parsing module is specifically implemented as a Paser syntax parser and is responsible for generating a syntax tree structure as shown in a k file example.

[0031] The semantic conversion module is configured to read the syntax tree structure through a semantic converter to obtain the association relationship between file models. The file model is a data object represented in the form of a graph node and is configured to carry data in a file. Corresponding to the method step S2, the Convertor semantic converter is specifically configured to convert the syntax tree data into a file model instance and establish the association relationship between the models (for example, the generation of the DEFINE_CURVE class file model, and the edge establishment between LOAD_BODY and DEFINE_CURVE).

[0032] The graph data conversion module is configured to convert the graph structure of the file model to be converted into the graph structure of the target file model through a graph data converter. The graph structure includes node data and edge data. Corresponding to the method step S3, the Transformer graph data converter is specifically configured to execute the core conversion logic of transfer (node conversion) and connect (edge conversion), support parallel conversion, and realize the graph structure conversion from the k file to the SDYN file.

[0033] The text output module is configured to convert the target node data and the target edge data into a target file (the text file 2) through a text outputter. Corresponding to the method step S4, the text output module is configured to convert the converted target file model graph structure into the final target file.

[0034] The method provides the above basic algorithm framework. When used specifically, the developer needs to realize the node conversion algorithm and the edge conversion algorithm based on the framework. The framework has been applied to the mutual conversion of input files between different commercial CAE software (for example, the conversion of the k file of ls-dyna into the input and j files of SDYN). It is verified in practice that, for the k file with a level of ten million lines, the running time is about 70 seconds on a 3GHz 8-core CPU, and each step has rich and detailed error prompts and error processing mechanisms, so that the framework can stably run in any case and does not crash and exit.

[0035] The above is only a preferred embodiment of the present application and is not used to limit the present application. For those skilled in the art, the present application can have various modifications and changes. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A programming method for graph data conversion algorithms, characterized in that, include: S1: The file to be converted is read by the syntax parser and converted into a syntax tree structure; the file to be converted is a file that can be abstracted as graph data; S2: The semantic transformer reads the syntax tree structure to obtain the relationships between file models; the file model is a data object represented in the form of graph nodes, used to carry the data in the file; S3: Convert the graph structure of the file model to be converted into the graph structure of the target file model using a graph data converter; the graph structure includes node data and edge data; the graph structure conversion is achieved through separate steps, including: S31: Execute the node conversion algorithm to independently convert each node data in the file model to be converted, obtain the target node data in the target file model, and establish a bidirectional mapping table that records the correspondence between the node data to be converted and the target node data; S32: After all nodes to be converted have been converted, execute the edge conversion algorithm, traverse all edge data to be converted in the file model to be converted, locate the corresponding target node in the target file model by querying the bidirectional mapping table, and establish target edge data between target nodes based on the association relationship of the edge data to be converted. S4: Convert the target node data and target edge data into a target file using a text outputter.

2. The graph data conversion algorithm programming method according to claim 1, characterized in that, Read the syntax tree structure to obtain the relationships between file models, including: Extract the data from the syntax tree structure and store it into the file model to be converted; Establish the association between the file model to be converted and the target file model.

3. The graph data conversion algorithm programming method according to claim 2, characterized in that, Relationships include the correspondence between references, inclusions, and dependencies between node data in the file model.

4. The graph data conversion algorithm programming method according to claim 2, characterized in that, The syntax tree structure adopts a nested hierarchical structure of root node, multi-level child nodes, and leaf nodes; each node carries identification information related to the type of file to be converted. The root node corresponds to the basic data unit in the file to be converted that has independent function or logical meaning; Multilevel child nodes include identifier / description child nodes and data field child nodes; identifier / description child nodes are used to carry the identity information of the root node; data field child nodes are used to carry the data content of the root node or the reference relationship between nodes; Leaf nodes correspond to the smallest data unit of the basic data unit in the file to be converted.

5. The graph data conversion algorithm programming method according to claim 4, characterized in that, Extracting data from the syntax tree structure and storing it into the file model to be converted includes: Convert the root node in the syntax tree structure into an instance of the file model; Convert the identifier description sub-node into an identifier class variable in the file model; Convert data field child nodes into data variables of the file model; Transform the leaf nodes into specific numerical values ​​of variables in the file model.

6. The graph data conversion algorithm programming method according to claim 1, characterized in that, Convert the data of the node to be converted into the data of the target node, including: Transform one node of data to be converted into multiple target node data; Transform a node data to be transformed into a target node data; Convert multiple nodes of data to be transformed into a single target node; Convert multiple nodes of data to be converted into multiple target nodes of data.

7. The graph data conversion algorithm programming method according to claim 6, characterized in that, For converting one node data to multiple target node data, a bidirectional mapping table records the mapping relationship between the node data to be converted and the multiple target node data. For converting a node data to be transformed into a target node data, a bidirectional mapping table records the mapping relationship between the node data to be transformed and the target node data. For converting multiple node data to a single target node data, a bidirectional mapping table records the mapping relationship between the multiple node data to be converted and the target node data. For converting multiple nodes of data to be converted into multiple target nodes of data, a bidirectional mapping table records the mapping relationship between the multiple nodes of data to be converted and the multiple target nodes of data.

8. The graph data conversion algorithm programming method according to claim 1, characterized in that, It also includes defining new node types, edge types, and attribute information through programming interfaces.

9. A graph data conversion algorithm programming framework for implementing the graph data conversion algorithm programming method according to any one of claims 1-8, characterized in that, It includes a syntax parsing module, a semantic conversion module, a graph data conversion module, and a text output module; The syntax parsing module is used to read the file to be converted through a syntax parser and convert it into a syntax tree structure; the file to be converted is a file that can be abstracted as graph data; The semantic conversion module is used to read the syntax tree structure through the semantic converter to obtain the relationships between file models; the file model is a data object represented in the form of graph nodes, used to carry the data in the file; The graph data conversion module is used to convert the graph structure of the file model to be converted into the graph structure of the target file model using a graph data converter; the graph structure includes node data and edge data; The text output module is used to convert target node data and target edge data into target files through a text output device.

Citation Information

Patent Citations

  • Data model conversion method based on graph data and graph data structure converter

    CN109408601A

  • Computer-implemented method for computer program translation

    WO2014040766A1