Unlock instant, AI-driven research and patent intelligence for your innovation.

JSON data editing method, device and system

A JSON and data technology, applied in the editing field of JSON data, can solve problems such as occupying large memory and destroying the "parent-child" relationship of nodes, and achieve the effect of increasing operating load, saving free memory, and improving operating efficiency

Pending Publication Date: 2019-05-24
车伯乐(北京)信息科技有限公司
View PDF4 Cites 2 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0004] Usually, the JSON data structure has strong expansibility, and usually needs to edit the JSON data structure at any time according to the needs of users, such as adding and modifying; the JSON data structure shown in the prior art is added, In the process of modification and other operations, it is necessary to destroy the "parent-child" relationship between nodes, serialize all nodes again in the form of key-value key-value pairs, and add a large number of nodes for each key-value pair to dynamically apply for memory. This process takes up a lot of memory

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
  • JSON data editing method, device and system
  • JSON data editing method, device and system
  • JSON data editing method, device and system

Examples

Experimental program
Comparison scheme
Effect test

Embodiment 1

[0080] The present application shows a method for editing JSON data in the second aspect of the embodiment;

[0081] Specifically, see image 3 , the method includes:

[0082] S101 divides the JSON data structure into several nodes;

[0083] Divide the JSON data structure into several nodes according to the set storage path. The cutting method is: divide the JSON data structure into several nodes according to the preset rules from top to bottom and from inside to outside.

[0084] Specifically, for figure 1 In terms of the JSON data structure of the typical tree chart shown, the results after cutting are: A, B, C, D, E, F, G, H, I, J, K, L.

[0085] S102 Analyze the node information corresponding to each node, and the node information includes node depth, node path, and node key-value pair.

[0086] S103 generates a one-dimensional array according to the node information and the editing instruction;

[0087] Convert the above nodes into a one-dimensional array {A, B, C, D...

Embodiment 2

[0097] In order to ensure that the method shown in the embodiment is more eye-catching during the editing process, embodiment 2 of the present application shows a display mode of a one-dimensional array. Specifically, see Figure 4 In the technical solution shown in embodiment 1, step S103 includes the following steps:

[0098] S10311 Determine the pixels of the node according to the depth of the node;

[0099] S10312 Generate a one-dimensional array according to the pixel, node information, and editing instruction.

[0100] The difference between embodiment 2 and the method shown in embodiment 1 is that the method shown in embodiment 2 further limits the display method of the one-dimensional array;

[0101] Specifically, firstly, according to the node depth corresponding to each node, the display pixels of the node are determined;

[0102] For example, for figure 1 As shown in the JSON data structure of a typical tree chart, a one-dimensional array {A, B, C, D, E, F, G, H...

Embodiment 3

[0106] At present, when a network application needs to obtain data, it usually needs to send the data request condition to the application platform server in the background. The application platform server queries the data from the database server, and the application platform server integrates the list data returned from the database server into a string in JSON format. sent to the client side of the front-end application.

[0107] In order to further improve the operating efficiency of the system, the embodiment of this application shows a JSON object conversion method. For details, please refer to Figure 5 ;

[0108] S1041 traverse each node in the one-dimensional array;

[0109] S1042 judging whether the node is a composite node;

[0110] The judgment principle is to judge whether the current node has child nodes, and if there are child nodes, it proves that the node is a composite node;

[0111] S1043 If the node is a compound node, determine the child node correspondin...

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 embodiment of the invention discloses a JSON data editing method, device and system. The method comprises the steps that a JSON data structure is divided into a plurality of nodes; node information corresponding to each node is analyzed, the node information comprising a node depth, a node path and a node key value pair; a one-dimensional array is generated according to the node information and an editing instruction; and the one-dimensional array is converted into a JSON object, and the JSON object is serialized and converted into a character string. The method comprises the following steps: firstly, carrying out segmentation processing on a JSON data structure to obtain a plurality of nodes; analyzing the node information corresponding to each node to obtain a one-dimensional array;when the JSON data structure is subjected to adding, modifying and other editing operations, corresponding operation is carried out on data in the one-dimensional array according to the editing instruction and the node path, node configuration does not need to be added in the operation process, memory idleness is saved, system operation load is not increased, and system operation efficiency is improved.

Description

technical field [0001] The present invention relates to the field of computer technology, in particular to a JSON data editing method, device and system. Background technique [0002] JSON (English full name: Java Script Object Notation) is a lightweight data exchange format. It is based on a subset of Java Script (Standard ECMA-2623rd Edition-December 1999). JSON adopts a completely language-independent text format, but also uses conventions similar to the C language. These features make JSON an ideal data exchange language, which is easy to read and write for humans, and easy for machines to parse and generate. [0003] In the process of finding the target node in the JSON data structure, the programmer often has no way to start. In order to facilitate the programmer to find the node, the JSON data is usually converted into a chart format. E.g figure 1 It is a typical JSON data structure of a tree diagram, in which each letter represents a node, and is passed through f...

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): G06F17/22
Inventor 张加鹏李树亮邱慧
Owner 车伯乐(北京)信息科技有限公司