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
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
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...
PUM
Login to View More Abstract
Description
Claims
Application Information
Login to View More 


