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

Method and system for converting json string into array

A format conversion and string technology, applied in semi-structured data retrieval, electronic digital data processing, special data processing applications, etc., can solve the problems of complex code, low development efficiency, less XML scalability, etc. Redundant code, avoiding data conversion, and convenient operation

Inactive Publication Date: 2015-11-18
北京思特奇信息技术股份有限公司
View PDF3 Cites 8 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

There is a lot of publicity about how XML has cross-platform, cross-language advantages, but: unless applied to WebServices, otherwise, in ordinary Web applications, developers often have a headache for XML parsing, whether it is generated or processed on the server side. , or the client uses JavaScript to parse XML, which often leads to complex code and extremely low development efficiency
In fact, for most web applications, they don't need complex XML to transmit data at all, the extensibility of XML is rarely an advantage, and many AJAX applications even directly return HTML fragments to build dynamic web pages
Compared with returning XML and parsing it, returning HTML fragments greatly reduces the complexity of the system, but at the same time lacks certain flexibility

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
  • Method and system for converting json string into array
  • Method and system for converting json string into array

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0031] Such as figure 1 As shown, a method of converting a string in json format into an array includes the following steps:

[0032] Obtain the string to be converted in json format;

[0033] Define the document format (i.e. SCHEMA) according to the properties of the json object corresponding to the target array;

[0034] Convert the string in the json format according to the defined document format to obtain the target array.

[0035] The converting according to the array in the json format and the document format specifically includes: calling a format conversion tool, and performing format conversion according to the array in the json format and the document format.

[0036] The format conversion tool adopts the following methods for format conversion:

[0037] Get the length of the array in json format;

[0038] Get the length of the document format;

[0039] Get the primary key and key value in json format;

[0040] Nesting of document formats;

[0041] Perform mu...

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 relates to a method and system for converting a character string with a json format into an array. The method comprises the following steps of: acquiring a to-be-converted character string with the json format; defining a document format according to attributes of a json object corresponding to a target array; and performing format conversion on the character string with the json format according to the defined document format to obtain the target array. The method is convenient to operate without many times of code writing for data conversion; the method is simple; and redundancy codes are greatly reduced. Simple and efficient code requirements are met.

Description

technical field [0001] The invention relates to the field of Internet web development, in particular to a method and system for converting json strings into arrays. Background technique [0002] With the rapid development of the Internet today, the needs of network users are changing rapidly and greatly, and are unpredictable. How to transfer data between platforms and in what format is the format that users pay attention to. There is a lot of publicity about how XML has cross-platform, cross-language advantages, but: unless applied to WebServices, otherwise, in ordinary Web applications, developers often have a headache for XML parsing, whether it is generated or processed on the server side. , or the client uses JavaScript to parse XML, which often leads to complex code and extremely low development efficiency. In fact, for most web applications, they don't need complex XML to transmit data at all, the extensibility of XML has few advantages, and many AJAX applications ev...

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
IPC IPC(8): G06F17/30
CPCG06F16/84
Inventor 卢继霞
Owner 北京思特奇信息技术股份有限公司
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