Looking for breakthrough ideas for innovation challenges? Try Patsnap Eureka!

Code generation method and system for converting universal C/C++ structured object into JSON object

A code generation and code conversion technology, applied in the field of code generation of JSON objects, can solve the problems of inconvenient software maintenance and reconstruction, affecting the efficiency of application development, and low degree of automation, reducing manual coding links, improving the degree of development automation, good versatility

Active Publication Date: 2020-12-22
NO 709 RES INST OF CHINA SHIPBUILDING IND CORP
View PDF4 Cites 1 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

This processing method, first of all, requires custom coding according to different structured objects, which is not universal; second, it requires a lot of manual conversion and coding work, and the degree of automation is not high, which affects the efficiency of application development; finally, once the structured object If the data structure changes, it is necessary to manually re-transform the code and modify it, which is very inconvenient for software maintenance and reconstruction

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Code generation method and system for converting universal C/C++ structured object into JSON object
  • Code generation method and system for converting universal C/C++ structured object into JSON object
  • Code generation method and system for converting universal C/C++ structured object into JSON object

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0042] In order to make the object, technical solution and advantages of the present invention clearer, the present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described here are only used to explain the present invention, not to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not constitute a conflict with each other.

[0043]Aiming at the problems in the prior art, the present invention proposes a method for automatically generating codes based on tree-based general C / C++ structured objects converted to JSON objects, and changes the current method of converting C / C++ structured objects into JSON objects by manual coding According to the structure definition of the C / C++ structured object, the metadata informat...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

PUM

No PUM Login to View More

Abstract

The invention provides a code generation method for converting a universal C / C++ structured object into a JSON object, and the method comprises the steps: scanning the data structure definition of thestructured object, and obtaining a logic structure metadata information tree of the structured object; then, outputting a code for creating a blank root JSON object, and starting to deeply traverse the metadata information tree; then, respectively creating a simple key value pair, a JSON object key value pair and a nested JSON array object according to traversal node types, non-array leaf nodes,non-array non-leaf nodes and array nodes, adding the simple key value pair, the JSON object key value pair and the nested JSON array object into a JSON object corresponding to a father node of each node, and respectively outputting corresponding codes; and finally, combining and outputting all the codes, and ending code generation. According to the method, the code for converting the C / C++ structured object into the JSON object is automatically generated according to the structure definition, the problem of converting the C / C++ structured object into the JSON object is solved, manual coding isnot needed, and the development efficiency is improved. The invention further provides a corresponding code generation system for converting the universal C / C++ structured object into the JSON object.

Description

technical field [0001] The invention belongs to the technical field of software development automation and data exchange, and in particular relates to a code generation method and system for converting a general C / C++ structured object into a JSON object. Background technique [0002] With the development of computer software technology and network technology, the demand for distributed applications or cross-application integration is increasing. However, due to technical needs or historical reasons, each application is often developed using different programming languages, relies on different software environments, and runs on different On the hardware platform, therefore, data exchange in a heterogeneous environment is required between applications. JSON (JavaScript Object Notation, JS Object Notation) is a lightweight data exchange format, which uses a plain text format completely independent of programming languages ​​to store and represent data, has a concise and clear ...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to View More

Application Information

Patent Timeline
no application Login to View More
Patent Type & Authority Applications(China)
IPC IPC(8): G06F8/30G06F8/41
CPCG06F8/315G06F8/447Y02D10/00
Inventor 张利武王军利汤传乐骆训浩高子文
Owner NO 709 RES INST OF CHINA SHIPBUILDING IND CORP
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Patsnap Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Patsnap Eureka Blog
Learn More
PatSnap group products