Optimization method and system for JSON serialization and deserialization
A technology of deserialization and optimization methods, which is applied in the direction of program code conversion, instrumentation, and electrical digital data processing, etc. It can solve problems such as unfavorable multi-person collaboration, error concealment, and difficulty in error correction, so as to facilitate multi-person collaboration and fast writing Effect
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
no. 1 example
[0047] Such as figure 1 As shown, this embodiment provides an optimization method for JSON serialization and deserialization, including:
[0048] Create an abstract base class of JSON objects for optimizing JSON serialization and deserialization, define in the abstract base class of JSON objects including creating various types of attributes, and implement macro definition objects for parsing functions for each attribute.
[0049] Specifically, create a JSON object abstract base class, and then according to the JSON object abstract base class, for a specific single JSON object, the JSON object in the key-value format inherits the JSON object abstract base class, redefines the generated object A business logic class for a single JSON object. When programmers access and call JSON objects, they don’t need to understand the specific attributes in JSON objects. The code editor can directly display all attributes through syntax prompts, which is convenient for multiple people to co...
no. 2 example
[0076] This embodiment provides a specific example of using a macro to define a subclass corresponding to JSON.
[0077] For example, there is a JSON object of student (Student) data, which includes: number (string ID), name (string Name), gender (bool Sex), age (int Age). Its json data is as follows:
[0078]
[0079] It corresponds to define a Student class, where WJsonObject is the abstract base class of the Json object provided by the present invention, as follows:
[0080]
[0081]
no. 3 example
[0083] This embodiment provides a system for performing the optimization method of JSON serialization and deserialization as in the first embodiment, including:
[0084] The abstract base class creation module is used to create the JSON object abstract base class optimized for JSON serialization and deserialization, and the definition in the JSON object abstract base class includes creating various types of attributes and implementing parsing functions for each attribute The macro definition object;
[0085] The deserialization module is used to parse JSON data through JSON parsing libraries including QJSON, JsonCpp, RapidJSON, and Parson when performing deserialization operations on JSON, and generate JSON object key-value pairs in key-value format. Then create a business logic class containing all attribute members of the JSON data by calling the JSON object abstract base class, and assign a value to each attribute;
[0086] The serialization module is used to call the busi...
PUM
Abstract
Description
Claims
Application Information
- R&D Engineer
- R&D Manager
- IP Professional
- Industry Leading Data Capabilities
- Powerful AI technology
- Patent DNA Extraction
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic, Popular Technical Reports.
© 2024 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap|About US| Contact US: help@patsnap.com