CN108008936A - A kind of data processing method, device and electronic equipment - Google Patents

A kind of data processing method, device and electronic equipment Download PDF

Info

Publication number
CN108008936A
CN108008936A CN201711262677.2A CN201711262677A CN108008936A CN 108008936 A CN108008936 A CN 108008936A CN 201711262677 A CN201711262677 A CN 201711262677A CN 108008936 A CN108008936 A CN 108008936A
Authority
CN
China
Prior art keywords
nodes
json
value
flag
josn
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201711262677.2A
Other languages
Chinese (zh)
Other versions
CN108008936B (en
Inventor
陈阳春
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN201711262677.2A priority Critical patent/CN108008936B/en
Publication of CN108008936A publication Critical patent/CN108008936A/en
Application granted granted Critical
Publication of CN108008936B publication Critical patent/CN108008936B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/20Software design
    • G06F8/24Object-oriented

Abstract

An embodiment of the present invention provides a kind of data processing method, device and electronic equipment, the described method includes:Obtain script object tag JSON nodes;Determine the characteristic value of the JSON nodes, and according to the characteristic value, judge the type of the JOSN nodes, when JOSN nodes are different type, using with the corresponding analytic method of different type, JOSN nodes are resolved into first flag and corresponding first data of first flag, first flag is JOSN nodes and its title of child node, first data are the JOSN nodes or the specific data of the child node of the JOSN nodes, so as to, can be by directly invoking first flag, obtain its corresponding first data, complete the processing to JOSN data, whole processing procedure is not required technical staff to intervene, cost of labor can be reduced, and improve data-handling efficiency.

Description

A kind of data processing method, device and electronic equipment
Technical field
The present invention relates to field of computer technology, more particularly to a kind of data processing method, device and electronic equipment.
Background technology
With the rapid development of computer technology, in all kinds of computer systems or smart machine, can all produce at any time a large amount of Data, and need to carry out various processing to data, to realize the specific data application such as the interaction of data, storage.Especially In data interaction field, between sorts of systems or equipment, the interaction of data can directly influence overall operational efficiency.So Interaction of the data between sorts of systems or equipment, is the direction of a primary study.
JSON (JavaScript Object Notation, script object tag) is that a kind of data of lightweight are handed over Language is changed, based on word, and is easy to allow people to read, while has been also convenient for machine and has been parsed and generated, data use During interaction of the form of JSON between sorts of systems or equipment, the efficiency of data interaction or transmission can be effectively lifted. Can be mutually nested with array by object by key-value pair, the structure such as object and array in JSON, multilayer can be formed Data structure, so as to represent various complicated data structures.Wherein, each layer can be used as a JSON node, on One layer is father node, and next layer of father node can be child node.By carrying out dissection process to each node in JSON data, The specific data in JSON data can be obtained, for example, data such as character string or numerical value etc..
In the prior art, when being parsed to JSON data, it is necessary to technical staff is by corresponding analytical tool, or Corresponding analytical function is called, handling the node for each node in JSON data one by one, obtains every The specific data of one node, and then substantial amounts of cost of labor can be spent, and data-handling efficiency is low.
The content of the invention
The purpose of the embodiment of the present invention is to provide a kind of data processing method, device and electronic equipment, to realize JSON Data automatically process.Concrete technical scheme is as follows:
The embodiment of the invention discloses a kind of data processing method, including:
Obtain script object tag JSON nodes;
Determine the characteristic value of the JSON nodes, and according to the characteristic value, judge the type of the JOSN nodes, it is described Node type includes key-value pair, object and array, and the characteristic value is the quantity of element arranged side by side in JSON nodes;
,, will as first flag by the title of the key in the key-value pair when the JSON node types are key-value pair Value in the key-value pair, as the first data value, wherein the first flag is corresponding with first data value;
Alternatively, when the JSON node types are object, the name of the object is referred to as the first flag, and time The first child node of the JSON nodes is gone through, the title of first child node is added in the first flag, by described the The value of one child node, as first data value;
Alternatively, when the JSON node types are array, and the JSON nodes have multiple second child nodes, by institute The name for stating array is referred to as the first flag, and travels through each described second child node of the JSON nodes one by one, will The title and sequence number of each second child node are separately added into the first flag, form mutually independent multiple first marks Know, by the value of each the second child node, as mutually independent multiple first data values, wherein second described in the serial number Position number of the child node in array;
By calling the first flag, corresponding first data value of the first flag is obtained.
Optionally, the characteristic value for determining the JSON nodes, including:
By size functions, the characteristic value of the JSON nodes is determined.
Optionally, it is described according to the characteristic value, judge the type of the JOSN nodes, including:
Judge whether the characteristic value of the JOSN nodes is more than predetermined threshold value, when the characteristic value of the JOSN nodes, be more than During the predetermined threshold value, the type of the JOSN nodes is array or object;
Alternatively, when the characteristic value of the JOSN nodes, during no more than the predetermined threshold value, the type of the JOSN nodes is Key-value pair.
Optionally, it is described according to the characteristic value, judge the type of the JOSN nodes, including:
Judge the characteristic value of the JOSN nodes, if more than the predetermined threshold value, and according to the JOSN nodes Syntactic structure determines the type of the JOSN nodes;
When the characteristic value of the JOSN nodes, during more than the predetermined threshold value, and the syntactic structure of the JOSN nodes is Braces form, the type of the JOSN nodes is object;
Alternatively, when the characteristic value of the JOSN nodes, during more than the predetermined threshold value, and the grammer knot of the JOSN nodes Structure is bracket form, and the type of the JOSN nodes is array.
Optionally, it is described when the JSON node types are object, the name of the object is referred to as first mark Know, and travel through the first child node of the JSON nodes, the title of first child node is added in the first flag, will The value of first child node, as first data value, including:
When the JSON node types are object, and the JSON nodes have multiple first child nodes, travel through one by one Each described first child node of the JSON nodes, described is separately added into by the title of each first child node One mark, forms mutually independent multiple first flags, by the value of each the first child node, as mutually independent multiple the One data value.
Optionally, in the characteristic value for determining the JSON nodes, and according to the characteristic value, the JOSN sections are judged After the type of point, the method further includes:
When the JSON node types are array, then the name of the array is referred to as second identifier, by the characteristic value, As second data value, the second identifier is corresponding with second data value;
Correspondingly, it is described by calling the first flag, corresponding first data value of the first flag is obtained, is wrapped Include:
When the JSON node types are array, according to second data value, determined for the JSON nodes multiple The quantity of first flag;
The multiple first flag is called by the quantity, obtains corresponding multiple first data of the multiple first flag Value.
Optionally, it is described when the JSON node types are object, the name of the object is referred to as first mark Know, and travel through the first child node of the JSON nodes, including:
When the JSON node types are object, the name of the object is referred to as the first flag, and use and pass The mode returned travels through the first child node of the JSON nodes;
It is described when the JSON node types are array, and the JSON nodes have multiple second child nodes, by institute The name for stating array is referred to as the first flag, and travels through each described second child node of the JSON nodes one by one, bag Include:
When the JSON node types are array, and the JSON nodes have multiple second child nodes, by the number The name of group is referred to as the first flag, and each described second son section of the JSON nodes is traveled through using recursive mode Point.
The embodiment of the invention also discloses a kind of data processing equipment, including:
Acquisition module, for obtaining script object tag JSON nodes;
Judgment module, for determining the characteristic value of the JSON nodes, and according to the characteristic value, judges the JOSN sections The type of point, the node type include key-value pair, object and array, and the characteristic value is element arranged side by side in JSON nodes Quantity;
First parsing module, for when the JSON node types are key-value pair, by the name of the key in the key-value pair Claim, as first flag, by the value in the key-value pair, as the first data value, wherein the first flag and described first Data value is corresponding;
Second parsing module, for when the JSON node types are object, the name of the object being referred to as described First flag, and the first child node of the JSON nodes is traveled through, the title of first child node is added into first mark In knowledge, by the value of first child node, as first data value;
3rd parsing module, for being array when the JSON node types, and the JSON nodes have multiple second During child node, the name of the array is referred to as the first flag, and is traveled through one by one described in each of the JSON nodes Second child node, the first flag is separately added into by the title of each second child node and sequence number, is formed mutually only Vertical multiple first flags, by the value of each the second child node, as mutually independent multiple first data values, wherein described Position number of second child node in array described in serial number;
Calling module, for by calling the first flag, obtaining corresponding first data value of the first flag.
Optionally, the judgment module, is specifically used for:
By size functions, the characteristic value of the JSON nodes is determined.
Optionally, the judgment module, is specifically used for:
Judge whether the characteristic value of the JOSN nodes is more than predetermined threshold value, when the characteristic value of the JOSN nodes, be more than During the predetermined threshold value, the type of the JOSN nodes is array or object;Alternatively, when the characteristic value of the JOSN nodes, no During more than the predetermined threshold value, the type of the JOSN nodes is key-value pair.
Optionally, the judgment module, is specifically used for:
Judge the characteristic value of the JOSN nodes, if more than the predetermined threshold value, and according to the JOSN nodes Syntactic structure determines the type of the JOSN nodes;When the characteristic value of the JOSN nodes, during more than the predetermined threshold value, and The syntactic structure of the JOSN nodes is braces form, and the type of the JOSN nodes is object;Alternatively, when the JOSN is saved The characteristic value of point, during more than the predetermined threshold value, and the syntactic structure of the JOSN nodes be bracket form, and the JOSN is saved The type of point is array.
Optionally, second parsing module, is specifically used for:
When the JSON node types are object, and the JSON nodes have multiple first child nodes, travel through one by one Each described first child node of the JSON nodes, described is separately added into by the title of each first child node One mark, forms mutually independent multiple first flags, by the value of each the first child node, as mutually independent multiple the One data value.
Optionally, described device further includes:
Add module, for being array when the JSON node types, is then referred to as second identifier by the name of the array, By the characteristic value, as second data value, the second identifier is corresponding with second data value;
Correspondingly, the calling module, is specifically used for:
When the JSON node types are array, according to second data value, determined for the JSON nodes multiple The quantity of first flag;The multiple first flag is called by the quantity, it is corresponding multiple to obtain the multiple first flag First data value.
Optionally, second parsing module, is specifically used for:
When the JSON node types are object, the name of the object is referred to as the first flag, and use and pass The mode returned travels through the first child node of the JSON nodes;
3rd parsing module, is specifically used for:
When the JSON node types are array, and the JSON nodes have multiple second child nodes, by the number The name of group is referred to as the first flag, and each described second son section of the JSON nodes is traveled through using recursive mode Point.
The embodiment of the invention also discloses a kind of electronic equipment, including processor, communication interface, memory and communication are total Line, wherein, processor, communication interface, memory completes mutual communication by communication bus;
Memory, for storing computer program;
Processor, during for performing the program stored on memory, realizes any of the above-described data processing method.
The embodiment of the invention also discloses a kind of computer-readable recording medium, deposited in the computer-readable recording medium Instruction is contained, when run on a computer so that computer performs any of the above-described data processing method.
The embodiment of the invention also discloses a kind of computer program product for including instruction, when it runs on computers When so that computer performs any of the above-described data processing method.
A kind of data processing method, device and electronic equipment provided in an embodiment of the present invention, by obtaining JSON nodes, really Make the characteristic value of JSON nodes, and according to the characteristic value, the type of the JOSN nodes is judged, when JOSN nodes are difference During type, using with the corresponding analytic method of different type, JOSN nodes are resolved into first flag and first flag and are corresponded to The first data, wherein, first flag is the title of JOSN nodes and its child node, and the first data are the JOSN nodes or should The specific data of the child node of JOSN nodes, it is thus possible to by directly invoking first flag, obtain its corresponding first number According to completing the processing to JOSN data, whole processing procedure is not required technical staff to intervene, it is possible to reduce cost of labor, and Improve data-handling efficiency.Certainly, implement any of the products of the present invention or method must be not necessarily required to reach described above at the same time All advantages.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing There is attached drawing needed in technology description to be briefly described.
Fig. 1 is a kind of flow chart of data processing method provided in an embodiment of the present invention;
Fig. 2 is another flow chart of data processing method provided in an embodiment of the present invention;
Fig. 3 is the structure chart of data processing equipment provided in an embodiment of the present invention;
Fig. 4 is the structure chart of electronic equipment provided in an embodiment of the present invention.
Embodiment
Below in conjunction with the attached drawing in the embodiment of the present invention, the technical solution in the embodiment of the present invention is described.
Each JSON node can be the node of individual layer in JSON data structures, or the node of multilayer, and The type of JSON nodes includes key-value pair, object and array, wherein, key-value pair is most basic Component units, for example, " firstName":" Brett " is a most basic key-value pair, and firstName is the title of the key in key-value pair, and Brett is Value in key-value pair.
Object can be the set of one unordered " key-value pair ", such as:
Wherein, " personal information " be the object title, " name ":" Zhang San " and " age ":24, it is respectively the object The child node of two key-value pair types.
Array, can be the ordered set of value, such as:
Wherein, " student " be the array title, { " name ":" Xiao Ming ", " age ":23 } and { " name ":" Zhang San ", " Age ":24 }, be respectively the array two object types child node.
In JSON data structures, object, array etc. can realize mutual nesting, so as to form the multi-layer data of complexity Structure.The data processing method provided by the embodiment of the present invention, can be directed to different types of JSON nodes, be not required On the premise of manually being intervened, JSON nodes are parsed and handled automatically, obtain each in JSON data structures The corresponding node path of specific data value, so as to the data in more convenient acquisition JSON data structures.
Below in conjunction with the accompanying drawings, data processing method provided in an embodiment of the present invention is described in detail.
Referring to Fig. 1, Fig. 1 is a kind of flow chart of data processing method provided in an embodiment of the present invention, including:
Step 101, script object tag JSON nodes are obtained.
The embodiment of the present invention can be applied to each class of electronic devices, for example, PC, server, mobile phone and other Equipment with data-handling capacity.Also, data processing method provided in an embodiment of the present invention can by software, hardware or The mode of software and hardware combining is realized.
Electronic equipment can be one by one the pending JSON nodes of acquisition, can again after handling a JSON nodes completion Obtain next JSON nodes.
Since a JSON node may have the data structure of multilayer, for example, carrying out object or array in array It is nested.When the JSON nodes to the multilayer are handled, it is necessary to travel through each child node in each layer.So to every When one child node is handled, each step of data processing method provided in an embodiment of the present invention is equally performed.
In practical applications, for the JSON nodes of multilayer, recursive mode can be used, the execution present invention successively is real The data processing method of example offer is provided.For example, when data processing method provided in an embodiment of the present invention is realized by software, can In the form of using recursive function, call and perform the data processing method, so that acquisition child node one by one successively, and perform Subsequent step.
Step 102, determine the characteristic value of JSON nodes, and according to characteristic value, judge the type of JOSN nodes, node type Including key-value pair, object and array, characteristic value is the quantity of element arranged side by side in JSON nodes.
Electronic equipment can determine the characteristic value of the JSON nodes first after pending JSON nodes are obtained, The type of the JSON nodes can be determined by this feature value.Characteristic value is the quantative attribute of element arranged side by side in JSON nodes Value, can be used for representing the child node quantity of the JSON nodes.
Specifically, whether predetermined threshold value can be more than by judging the characteristic value of JOSN nodes, to determine that the JSON is saved The type of point.
When the characteristic value of JOSN nodes, during more than predetermined threshold value, the type of JOSN nodes is array or object.
When the characteristic value of JOSN nodes, during no more than predetermined threshold value, the type of JOSN nodes is key-value pair.
Wherein predetermined threshold value can be 0, i.e. the characteristic value when the JOSN nodes, during more than 0, represent that the JOSN nodes exist At least one child node, so the type of the JOSN nodes is not certainly key-value pair, may be array or object.
When the characteristic value of the JOSN nodes, during no more than 0, then it represents that child node is not present in the JOSN nodes, so should The type of JOSN nodes is key-value pair.
, can be according to the grammer of the JOSN nodes after the types of the JOSN nodes may be array or object when determining Structure determines that the JOSN nodes are array or object.
Specifically, when the characteristic value of JOSN nodes, during more than predetermined threshold value, and the syntactic structure of JOSN nodes is braces Form, the type of JOSN nodes is object.When i.e. the outermost bracket of the numerical part of the JOSN nodes is braces " { } ", then It is object to represent the JOSN node types.
When the characteristic value of JOSN nodes, during more than predetermined threshold value, and the syntactic structure of JOSN nodes is bracket form, The type of JOSN nodes is array.When i.e. the outermost bracket of the numerical part of the JOSN nodes is bracket " [] ", then it represents that The JOSN node types are array.
Step 103,, will as first flag by the title of the key in key-value pair when JSON node types are key-value pair Value in key-value pair, it is corresponding with the first data value as the first data value, wherein first flag.
For example, in the above example, which is:
{"firstName":"Brett"}
Can be using firstName as first flag, using Brett as the first data value.First flag and the first data Value corresponds.
In a kind of implementation of the embodiment of the present invention, first flag and the first data value can by map objects come Realize.The mapping relations of mark and value can be set up in map objects, first flag is the major key in map objects, the first data Be worth for the corresponding value of major key in map objects, for example, map (firstName, Brett) can then set up firstName with The mapping relations of Brett, when calling " firstName " in map objects, it is possible to obtain its corresponding value " Brett ".
In another implementation of the embodiment of the present invention, first flag can be established by the form of data list With the mapping relations of the first data value.First flag and the corresponding first number can be preserved in a line in data list According to value.
Step 104, when JSON node types are object, the name of object is referred to as first flag, and travels through JSON sections First child node of point, the title of the first child node is added in first flag, by the value of the first child node, as the first data Value.
When it is object to determine JSON node types, the name of the object first can be referred to as first flag, and open Beginning travels through the first child node of the JSON nodes, and the first child node is the section of next layer data structures of object JSON nodes Point.Such as the JSON nodes are:
Then using the title " personal information " of object as first flag, and begin stepping through the first son section of the JSON nodes Point, the first child node are a key-value pair, the title " name " of first child node are added first flag, then first flag is " personal information name ".Using the value " Zhang San " of first child node as the first data value.
Also, in embodiments of the present invention, when there are during the nest relation of multilayer, each first child node may also have There is child node, so that when traversing first child node, also need to travel through each child node of first child node.
Likewise, after first flag and the first data value is obtained, can using first flag and the first data value as Map objects or data list, its method is identical with step 103, and details are not described herein.
Step 105, when JSON node types are array, and JSON nodes have multiple second child nodes, by array Name is referred to as first flag, and travels through each second child node of JSON nodes one by one, by the name of each the second child node Claim and sequence number is separately added into first flag, form mutually independent multiple first flags, the value of each the second child node is made For mutually independent multiple first data values, wherein position number of the second child node of serial number in array.
When it is array to determine JSON node types, the name of the array first can be referred to as first flag, due to number Element in group is at least multiple, so when the JSON node types are array, which is respectively provided with multiple second sons Node, the second child node are the node of next layer data structures of array JSON nodes.So need to travel through the JSON nodes Each second child node,
Such as the JSON nodes can be:
Then first using the title " student " of array as first flag, and begin stepping through the JSON nodes each Two child nodes, for the second child node { " name ":" Xiao Ming " }, entitled " name " of second child node and the second son section The sequence number of point can be 0, and the title of the second child node and sequence number are added first flag, then first flag for " student name 0 ", Corresponding first data value of the first flag is " Xiao Ming ";
For the second child node { " name ":" Zhang San " }, entitled " name " of second child node and the second son section The sequence number of point can be 1, and the title of the second child node and sequence number are added first flag, then first flag for " student name 1 ", Corresponding first data value of the first flag is " Zhang San ".
By traveling through the JSON nodes, two independent first flags and two independent corresponding can be obtained One data.So as to by two corresponding first flags and the first data, as two mutually independent map objects or Separate two rows data in data list.
Likewise, in embodiments of the present invention, when there are during the nest relation of multilayer, each second child node may also With child node, so that when traversing second child node, also need to travel through each child node of second child node.
, can be again to another after the processing to JSON node is completed it is easily understood that in embodiments of the present invention One JSON node is handled, and can set up the mapping relations of another new first flag and the first data value, for example, A new map object is preserved, or new a line is added in data list.
Step 106, by calling first flag, corresponding first data value of first flag is obtained.
When by above-mentioned steps, one or more first flags, and the first flag corresponding can be obtained One data value.Map objects or data list can be passed through, it is established that the corresponding to each first flag and the first flag The mapping relations of one data.
So as to easily by calling first flag, and obtain corresponding first data value of the first flag.For example, When first flag and the first data value are stored by map objects, the first flag in map objects is called, can be direct Obtain corresponding first data value of the first flag.When first flag and the first data value are stored by data list, By retrieving first flag in table, its corresponding first data value can be obtained.
Also, including the name information of each node layer in obtained first flag, so, first flag can be made For routing information, for representing position of corresponding first data value of the first flag in JSON data structures.So as to Corresponding first data value of the first flag can directly be obtained from original JSON data structures by first flag.
In embodiments of the present invention, by obtaining JSON nodes, the characteristic value of JSON nodes is determined, and according to the spy Value indicative, judges the type of the JOSN nodes, when JOSN nodes are different type, using with the corresponding parsing of different type Method, first flag and corresponding first data of first flag are resolved to by JOSN nodes, wherein, first flag is JOSN nodes And its title of child node, the first data are the specific data of the JOSN nodes or the child node of the JOSN nodes, it is thus possible to By directly invoking first flag, its corresponding first data is obtained, completes the processing to JOSN data, whole processing procedure is not Technical staff is needed to intervene, it is possible to reduce cost of labor, and improve data-handling efficiency.
With reference to above-described embodiment, in the another embodiment of the embodiment of the present invention, in step 102, in definite JSON During the characteristic value of node, the characteristic value of JSON nodes by size functions, can be specifically determined.
Size functions are a kind of functions for the size that can be used for returning array.The size of array is element in the array Quantity.When size functions are applied in the embodiment of the present invention, size functions are called for JOSN nodes, when the JOSN nodes When type is object or array, the quantity of element arranged side by side in the JOSN nodes can be returned.If the class of the JOSN nodes Type is key-value pair, then it is assumed that does not contain element arranged side by side in the JOSN nodes, will directly return to numerical value 0.
The characteristic value of acquisition JOSN nodes that can be more convenient by size functions, and size functions are general mark Quasi-function, so as to improve the compatibility of data processing method provided in an embodiment of the present invention, can be adapted for the model of bigger Enclose.
With reference to above-described embodiment, in another embodiment provided in an embodiment of the present invention, step 104, when JSON nodes When type is object, the name of object is referred to as first flag, and travels through the first child node of JSON nodes, by the first child node Title add in first flag, by the value of the first child node, as the first data value, including:
When JSON node types are object, and JSON nodes have multiple first child nodes, JSON nodes are traveled through one by one Each first child node, the title of each the first child node is separately added into first flag, is formed mutually independent more A first flag, by the value of each the first child node, as mutually independent multiple first data values.
When determining that JSON node types are object, and when the JSON nodes have multiple first child nodes, Ke Yixian The name of object in the JSON nodes is referred to as first flag, and each first son section for traveling through the JSON nodes one by one Point.
For example, the JSON nodes can be:
The type of the JSON nodes is object, and the JSON nodes have three the first child nodes, is respectively " surname Name ":" Zhang San ", " age ":24 and " blood group ":B.
It can then begin stepping through the every of the JSON nodes using the title " personal information " of object as first flag first One the first child node, is then separately added into first flag by the title of each the first child node, is formed mutually independent more A first flag, by the value of each the first child node, as mutually independent multiple first data values.So as to obtain three A mutually independent first flag, is respectively:" personal information name ", " personal information age " and " personal information blood group ", and And three mutually independent first flags correspond to three mutually independent first data values respectively, it is respectively:" Zhang San ", 24 Hes B。
By traveling through the JSON nodes, three independent first flags and three independent corresponding can be obtained One data.Then can by three corresponding first flags and the first data, as three mutually independent map objects or Separate three rows data in data list.In embodiments of the present invention, when JSON node types are object, and the JSON is saved When point has multiple first child nodes, each first child node of the JSON nodes can be traveled through, it is ensured that the JSON is saved The total data of point is processed, and avoids the omission of data.
With reference to above embodiment, referring to Fig. 2, in step 102, the characteristic value of JSON nodes is determined, and according to characteristic value, After the type for judging JOSN nodes, the method can also include:
Step 100, when JSON node types are array, then the name of array is referred to as second identifier, by characteristic value, as Second data value, second identifier are corresponding with the second data value.
When the JSON node types are array, second identifier and the second data corresponding with the second identifier can be passed through Value, bag preserve or record the title and characteristic value of the array, and this feature value is the quantity of element contained in the array, i.e., The quantity of second child node.
Second identifier and the second data value corresponding with the second identifier can also be real by map objects or data list It is existing.Its structure type with, first flag and the first data value corresponding with the first flag are identical.But second identifier and the second number According to value, the quantity for the second child node having in the array of the JSON nodes can be represented, is not used directly for preserving and is somebody's turn to do The specific data of JSON nodes.
Correspondingly, step 106, by calling first flag, obtains corresponding first data value of first flag, including:
When JSON node types are array, according to the second data value, multiple first flags are determined for the JSON nodes Quantity.Multiple first flags are called by the quantity, obtain corresponding multiple first data values of multiple first flags.
If JSON node types are array, due to will necessarily be there are more than one element, i.e., with multiple second in array Child node, so the JSON nodes can form multiple first flags and corresponding multiple first data of multiple first flags Value.
, can be first by this when obtaining corresponding first data value of first flag when needing by calling first flag The second identifier of JSON nodes the second data value corresponding with the second identifier, obtains the second son section possessed by the JSON nodes The quantity of point, the quantity of second child node is the quantity of the first flag corresponding to the JSON nodes, so as to there is choosing Selecting property, according to sequence number included in the quantity and first flag of first flag, the JSON of the selected digit group type of acquisition The specific data of indivedual second child nodes in node.Alternatively, the digit group type can also be obtained according to the quantity of first flag The specific data of whole second child nodes in JSON nodes, so as to avoid omitting the data in the JSON nodes.
With reference to above embodiment, in data processing method provided in an embodiment of the present invention, when JSON node types are During object, the name of object is referred to as first flag, and travels through the first child node of JSON nodes, can be included:
When JSON node types are object, the name of object is referred to as first flag, and travel through using recursive mode First child node of JSON nodes.
Likewise, when JSON node types are array, and JSON nodes have multiple second child nodes, by the name of array Referred to as first flag, and each second child node of JSON nodes is traveled through one by one, including:
When JSON node types are array, and JSON nodes have multiple second child nodes, the name of array is referred to as First flag, and the recursive mode of use travels through each second child node of JSON nodes.
When JSON nodes are object or array node, which can contain multiple first child nodes or the second son Node, and first child node and second child node, can also each have multiple child nodes.So as to form complexity More node layers structure.
By recursive mode, recurrence can be carried out from the node of the bottom, so as to which the title of each node layer is divided Do not add first flag, form mutually independent multiple first flags, and by the value of each node layer, as mutually independent multiple First data value.
Specifically, can by using the form of recursive function, the parameter using first flag as the recursive function so that The title of each node layer can be separately added into first flag by the parameter by recurrence by way of recurrence adds up layer by layer.
Pass through recursive mode, it is ensured that travel through whole more level of child nodes of the JSON nodes, node will not be caused Omission.It can make it that the data processing to JSON nodes is more accurate.
Data processing method provided in an embodiment of the present invention is described by a specific example again below.
There are following JSON data structures:
For above-mentioned JSON data structures by electronic equipment, data processing method provided in an embodiment of the present invention is performed,
JSON nodes are obtained one by one, obtain JSON nodes first:"msg":" ", determines that the JSON is saved by size functions The characteristic value of point is 0, so that it is determined that it is key-value pair to go out the JSON nodes, " msg " is used as first flag, by " " as with this Corresponding first data value of one mark, and save as in the first row of a map object or data list.
Obtaining next JSON nodes " code ":" stirng ", it is key-value pair equally to judge the JSON nodes, will " Code " is used as first flag, by " stirng " as the first data value corresponding with the first flag, and saves as another In map objects or the second row of data list.
Next JSON nodes are being obtained,
Determine that the characteristic value of the JSON nodes is 2 by size functions, and by syntactic structure, determine the JSON Node is object, its JSON node has 2 the first child nodes, and " data " is used as first flag, and travels through each first son Node.
First first child node is obtained, and judges that the type of first child node is object, by first child node Title " 0 " adds first flag, and continues to travel through the child node of first child node.Likewise, " nick_name " is added again Enter first flag, i.e. first flag is:" data0nick_name ", the first flag corresponding first is used as by " michael " Data value.In the same way, can obtain another first flag is:" data0age ", and using 16 as this first Identify corresponding first data value.
Next first child node is obtained again, can obtain first flag:" data0mrt ", the first flag is used as by -1 Corresponding first data value.
, can be by obtained three first flags the first number corresponding with its by the processing to the JSON nodes According to value, three map objects are saved as, or are stored in third and fourth and the five-element of data list.
Next JSON nodes are being obtained,
Determine that the characteristic value of the JSON nodes is 3 by size functions, and by syntactic structure, determine the JSON Node is array, its JSON node has 3 the second child nodes, and " arr " is used as first flag, and can be by " arr " As second identifier, and by the characteristic value 3 of the JSON nodes, as corresponding second data value of the second identifier.Likewise, can Second identifier the second data value corresponding with the second identifier is saved as a map object, or it is stored in data list The 6th row in.Then each second child node is traveled through.
First second child node is obtained, the title " 0 " of second child node is added into first flag, and by second son The sequence number 0 of node, also adds first flag, then first flag is " arr00 ", by the numerical value 0 of the second child node, as this first Identify corresponding first data value.
Using same method, travel through the second child node below, can obtain first flag " arr11 ", and this first Identify corresponding first data value 1;Obtain first flag " arr22 ", and corresponding first data value 2 of the first flag.
Then by obtained three first flags the first data value corresponding with its, three are saved as Map objects, or be stored in the seven, the eight and nine rows of data list.
So far, the data processing to above-mentioned JSON data structures is just completed, multiple map objects can be obtained, such as:[1] (" msg, " ")
[2] (" code ", " stirng ")
[3] (" data0nick_name ", " michael ")
[4] (" data0age ", " 16 ")
[5] (" datamrt ", " -1 ")
[6] (" arr ", " 3 ")
[7] (" arr00 ", " 0 ")
[8] (" arr11 ", " 1 ")
[9] (" arr22 ", " 2 ")
Alternatively, data list as shown in Table 1 can be obtained.
Table 1
0 "msg ""
0 "code" "stirng"
0 "data0nick_name" "michael"
0 "data0age" "16"
0 "datamrt" "-1"
1 "arr" "3"
0 "arr00" "0"
0 "arr11" "1"
0 arr22" "2"
In table 1, first row can be the distinguishing identifier for distinguishing first flag and second identifier, such as can use 0 table Show that the row recorded for first flag and corresponding first data value, with 1 represent that the row recorded for second identifier and right The second data value answered.
Second is classified as first flag or second identifier, and the 3rd is classified as the first data value or the second data value.
, can be by calling first flag, so that side when needing to obtain the specific data in above-mentioned JSON data structures Just the first data value corresponding to the first flag is efficiently obtained.
Referring to Fig. 3, Fig. 3 is the structure chart of data processing equipment provided in an embodiment of the present invention, including:
Acquisition module 301, for obtaining script object tag JSON nodes;
Judgment module 302, for determining the characteristic value of the JSON nodes, and according to the characteristic value, described in judgement The type of JOSN nodes, the node type include key-value pair, object and array, and the characteristic value is arranged side by side in JSON nodes The quantity of element;
First parsing module 303, for when the JSON node types are key-value pair, by the key in the key-value pair Title, as first flag, by the value in the key-value pair, as the first data value, wherein the first flag and described the One data value is corresponding;
Second parsing module 304, for when the JSON node types are object, the name of the object to be referred to as institute First flag is stated, and travels through the first child node of the JSON nodes, the title of first child node is added described first In mark, by the value of first child node, as first data value;
3rd parsing module 305, for being array when the JSON node types, and the JSON nodes have multiple the During two child nodes, the name of the array is referred to as the first flag, and travels through each institute of the JSON nodes one by one The second child node is stated, the title of each second child node and sequence number are separately added into the first flag, is formed mutual Independent multiple first flags, by the value of each the second child node, as mutually independent multiple first data values, wherein institute State position number of second child node in array described in serial number;
Calling module 306, for by calling the first flag, obtaining corresponding first data of the first flag Value.
In embodiments of the present invention, by obtaining JSON nodes, the characteristic value of JSON nodes is determined, and according to the spy Value indicative, judges the type of the JOSN nodes, when JOSN nodes are different type, using with the corresponding parsing of different type Method, first flag and corresponding first data of first flag are resolved to by JOSN nodes, wherein, first flag is JOSN nodes And its title of child node, the first data are the specific data of the JOSN nodes or the child node of the JOSN nodes, it is thus possible to By directly invoking first flag, its corresponding first data is obtained, completes the processing to JOSN data, whole processing procedure is not Technical staff is needed to intervene, it is possible to reduce cost of labor, and improve data-handling efficiency.
Optionally, in data processing equipment provided in an embodiment of the present invention, the judgment module 302, is specifically used for:
By size functions, the characteristic value of the JSON nodes is determined.
Optionally, in data processing equipment provided in an embodiment of the present invention, the judgment module 302, is specifically used for:
Judge whether the characteristic value of the JOSN nodes is more than predetermined threshold value, when the characteristic value of the JOSN nodes, be more than During predetermined threshold value, the type of the JOSN nodes is array or object;Alternatively, when the characteristic value of the JOSN nodes, it is not more than During predetermined threshold value, the type of the JOSN nodes is key-value pair.
Optionally, in data processing equipment provided in an embodiment of the present invention, the judgment module 302, is specifically used for:
Judge the characteristic value of the JOSN nodes, if more than the predetermined threshold value, and according to the JOSN nodes Syntactic structure determines the type of the JOSN nodes;When the characteristic value of the JOSN nodes, during more than predetermined threshold value, and it is described The syntactic structure of JOSN nodes is braces form, and the type of the JOSN nodes is object;Alternatively, when the JOSN nodes Characteristic value, during more than predetermined threshold value, and the syntactic structure of the JOSN nodes is bracket form, the type of the JOSN nodes For array.
Optionally, in data processing equipment provided in an embodiment of the present invention, second parsing module 304 is specific to use In:
When the JSON node types are object, and the JSON nodes have multiple first child nodes, travel through one by one Each described first child node of the JSON nodes, described is separately added into by the title of each first child node One mark, forms mutually independent multiple first flags, by the value of each the first child node, as mutually independent multiple the One data value.
Optionally, in data processing equipment provided in an embodiment of the present invention, described device further includes:
Add module, for being array when the JSON node types, is then referred to as second identifier by the name of the array, By the characteristic value, as second data value, the second identifier is corresponding with second data value;
Correspondingly, the calling module 306, is specifically used for:
When the JSON node types are array, according to second data value, determined for the JSON nodes multiple The quantity of first flag;The multiple first flag is called by the quantity, it is corresponding multiple to obtain the multiple first flag First data value.
Optionally, in data processing equipment provided in an embodiment of the present invention, second parsing module 304 is specific to use In:
When the JSON node types are object, the name of the object is referred to as the first flag, and use and pass The mode returned travels through the first child node of the JSON nodes;
3rd parsing module 305, is specifically used for:
When the JSON node types are array, and the JSON nodes have multiple second child nodes, by the number The name of group is referred to as the first flag, and each described second son section of the JSON nodes is traveled through using recursive mode Point.
For device embodiment, since it is substantially similar to embodiment of the method, so description is fairly simple, it is related Part illustrates referring to the part of embodiment of the method.
The embodiment of the present invention additionally provides a kind of electronic equipment, as shown in figure 4, including processor 401, communication interface 402, Memory 403 and communication bus 404, wherein, processor 401, communication interface 402, memory 403 is complete by communication bus 404 Into mutual communication,
Memory 403, for storing computer program;
Processor 401, during for performing the program stored on memory 403, realizes following steps:
Obtain script object tag JSON nodes;
Determine the characteristic value of the JSON nodes, and according to the characteristic value, judge the type of the JOSN nodes, it is described Node type includes key-value pair, object and array, and the characteristic value is the quantity of element arranged side by side in JSON nodes;
,, will as first flag by the title of the key in the key-value pair when the JSON node types are key-value pair Value in the key-value pair, as the first data value, wherein the first flag is corresponding with first data value;
Alternatively, when the JSON node types are object, the name of the object is referred to as the first flag, and time The first child node of the JSON nodes is gone through, the title of first child node is added in the first flag, by described the The value of one child node, as first data value;
Alternatively, when the JSON node types are array, and the JSON nodes have multiple second child nodes, by institute The name for stating array is referred to as the first flag, and travels through each described second child node of the JSON nodes one by one, will The title and sequence number of each second child node are separately added into the first flag, form mutually independent multiple first marks Know, by the value of each the second child node, as mutually independent multiple first data values, wherein second described in the serial number Position number of the child node in array;
By calling the first flag, corresponding first data value of the first flag is obtained.
The communication bus that above-mentioned electronic equipment is mentioned can be Peripheral Component Interconnect standard (Peripheral Pomponent Interconnect, abbreviation PCI) bus or expanding the industrial standard structure (Extended Industry Standard Architecture, abbreviation EISA) bus etc..The communication bus can be divided into address bus, data/address bus, controlling bus etc.. For ease of representing, only represented in figure with a thick line, it is not intended that an only bus or a type of bus.
Communication interface is used for the communication between above-mentioned electronic equipment and other equipment.
Memory can include random access memory (Random Access Memory, abbreviation RAM), can also include Nonvolatile memory (non-volatile memory), for example, at least a magnetic disk storage.Optionally, memory may be used also To be at least one storage device for being located remotely from aforementioned processor.
Above-mentioned processor can be general processor, including central processing unit (Central Processing Unit, Abbreviation CPU), network processing unit (Ne twork Processor, abbreviation NP) etc.;It can also be digital signal processor (Digital Signal Processing, abbreviation DSP), application-specific integrated circuit (Applica tion Specific Integrated Circuit, abbreviation ASIC), field programmable gate array (Field-Programmable Gate Array, Abbreviation FPGA) either other programmable logic device, discrete gate or transistor logic, discrete hardware components.
In another embodiment provided by the invention, a kind of computer-readable recording medium is additionally provided, which can Read to be stored with instruction in storage medium, when run on a computer so that computer performs any institute in above-described embodiment The data processing method stated.
In another embodiment provided by the invention, a kind of computer program product for including instruction is additionally provided, when it When running on computers so that computer performs any data processing method in above-described embodiment.
In the above-described embodiments, can come wholly or partly by software, hardware, firmware or its any combination real It is existing.When implemented in software, can realize in the form of a computer program product whole or in part.The computer program Product includes one or more computer instructions.When loading on computers and performing the computer program instructions, all or Partly produce according to the flow or function described in the embodiment of the present invention.The computer can be all-purpose computer, special meter Calculation machine, computer network or other programmable devices.The computer instruction can be stored in computer-readable recording medium In, or the transmission from a computer-readable recording medium to another computer-readable recording medium, for example, the computer Instruction can pass through wired (such as coaxial cable, optical fiber, numeral from a web-site, computer, server or data center User's line (DSL)) or wireless (such as infrared, wireless, microwave etc.) mode to another web-site, computer, server or Data center is transmitted.The computer-readable recording medium can be any usable medium that computer can access or It is the data storage devices such as server, the data center integrated comprising one or more usable mediums.The usable medium can be with It is magnetic medium, (for example, floppy disk, hard disk, tape), optical medium (for example, DVD) or semiconductor medium (such as solid state hard disc Solid State Disk (SSD)) etc..
It should be noted that herein, relational terms such as first and second and the like are used merely to a reality Body or operation are distinguished with another entity or operation, are deposited without necessarily requiring or implying between these entities or operation In any this actual relation or order.Moreover, term " comprising ", "comprising" or its any other variant are intended to Non-exclusive inclusion, so that process, method, article or equipment including a series of elements not only will including those Element, but also including other elements that are not explicitly listed, or further include as this process, method, article or equipment Intrinsic key element.In the absence of more restrictions, the key element limited by sentence "including a ...", it is not excluded that Also there are other identical element in process, method, article or equipment including the key element.
Each embodiment in this specification is described using relevant mode, identical similar portion between each embodiment Divide mutually referring to what each embodiment stressed is the difference with other embodiment.It is real especially for system For applying example, since it is substantially similar to embodiment of the method, so description is fairly simple, related part is referring to embodiment of the method Part explanation.
The foregoing is merely illustrative of the preferred embodiments of the present invention, is not intended to limit the scope of the present invention.It is all Any modification, equivalent replacement, improvement and so within the spirit and principles in the present invention, are all contained in protection scope of the present invention It is interior.

Claims (15)

  1. A kind of 1. data processing method, it is characterised in that including:
    Obtain script object tag JSON nodes;
    Determine the characteristic value of the JSON nodes, and according to the characteristic value, judge the type of the JOSN nodes, the node Type includes key-value pair, object and array, and the characteristic value is the quantity of element arranged side by side in JSON nodes;
    When the JSON node types are key-value pair, by the title of the key in the key-value pair, as first flag, will described in Value in key-value pair, as the first data value, wherein the first flag is corresponding with first data value;
    Alternatively, when the JSON node types are object, the name of the object is referred to as the first flag, and travel through institute The first child node of JSON nodes is stated, the title of first child node is added in the first flag, by the described first son The value of node, as first data value;
    Alternatively, when the JSON node types are array, and the JSON nodes have multiple second child nodes, by the number The name of group is referred to as the first flag, and travels through each described second child node of the JSON nodes one by one, will be each The title and sequence number of a second child node are separately added into the first flag, form mutually independent multiple first flags, By the value of each the second child node, as mutually independent multiple first data values, wherein the second son described in the serial number Position number of the node in array;
    By calling the first flag, corresponding first data value of the first flag is obtained.
  2. 2. according to the method described in claim 1, it is characterized in that, it is described determine the JSON nodes characteristic value, including:
    By size functions, the characteristic value of the JSON nodes is determined.
  3. 3. according to the method described in claim 1, it is characterized in that, described according to the characteristic value, the JOSN nodes are judged Type, including:
    Judge whether the characteristic value of the JOSN nodes is more than predetermined threshold value;
    When the characteristic value of the JOSN nodes, during more than the predetermined threshold value, the type of the JOSN nodes is array or object;
    Alternatively, when the characteristic value of the JOSN nodes, during no more than the predetermined threshold value, the type of the JOSN nodes is key assignments It is right.
  4. 4. according to the method described in claim 3, it is characterized in that, described according to the characteristic value, the JOSN nodes are judged Type, including:
    Judge the characteristic value of the JOSN nodes, if more than the predetermined threshold value, and according to the grammer of the JOSN nodes Structure determination goes out the type of the JOSN nodes;
    When the characteristic value of the JOSN nodes, during more than the predetermined threshold value, and the syntactic structure of the JOSN nodes is includes greatly Number form, the type of the JOSN nodes is object;
    Alternatively, when the characteristic value of the JOSN nodes, during more than the predetermined threshold value, and the syntactic structure of the JOSN nodes is Bracket form, the type of the JOSN nodes is array.
  5. 5. according to the method described in claim 1, it is characterized in that, described when the JSON node types are object, by institute The name for stating object is referred to as the first flag, and travels through the first child node of the JSON nodes, by first child node Title add in the first flag, by the value of first child node, as first data value, including:
    When the JSON node types are object, and the JSON nodes have multiple first child nodes, one by one described in traversal Each described first child node of JSON nodes, first mark is separately added into by the title of each first child node Know, form mutually independent multiple first flags, the value of each the first child node is counted as mutually independent multiple first According to value.
  6. 6. according to the method described in claim 1, it is characterized in that, in the characteristic value for determining the JSON nodes, and root According to the characteristic value, after the type for judging the JOSN nodes, the method further includes:
    When the JSON node types are array, then the name of the array is referred to as second identifier, by the characteristic value, as Second data value, the second identifier are corresponding with second data value;
    Correspondingly, it is described by calling the first flag, corresponding first data value of the first flag is obtained, including:
    When the JSON node types are array, according to second data value, multiple first are determined for the JSON nodes The quantity of mark;
    The multiple first flag is called by the quantity, obtains corresponding multiple first data values of the multiple first flag.
  7. 7. according to the method described in claim 1, it is characterized in that, described when the JSON node types are object, by institute The name for stating object is referred to as the first flag, and travels through the first child node of the JSON nodes, including:
    When the JSON node types are object, the name of the object is referred to as the first flag, and using recursive Mode travels through the first child node of the JSON nodes;
    It is described when the JSON node types are array, and the JSON nodes have multiple second child nodes, by the number The name of group is referred to as the first flag, and travels through each described second child node of the JSON nodes one by one, including:
    When the JSON node types are array, and the JSON nodes have multiple second child nodes, by the array Name is referred to as the first flag, and each described second child node of the JSON nodes is traveled through using recursive mode.
  8. A kind of 8. data processing equipment, it is characterised in that including:
    Acquisition module, for obtaining script object tag JSON nodes;
    Judgment module, for determining the characteristic value of the JSON nodes, and according to the characteristic value, judges the JOSN nodes Type, the node type include key-value pair, object and array, and the characteristic value is the number of element arranged side by side in JSON nodes Amount;
    First parsing module, for when the JSON node types are key-value pair, the title of the key in the key-value pair to be made For first flag, by the value in the key-value pair, as the first data value, wherein the first flag and first data value It is corresponding;
    Second parsing module, for when the JSON node types are object, the name of the object to be referred to as described first Mark, and the first child node of the JSON nodes is traveled through, the title of first child node is added in the first flag, By the value of first child node, as first data value;
    3rd parsing module, for being array when the JSON node types, and there are the JSON nodes the multiple second sons to save Point when, the name of the array is referred to as the first flag, and travel through one by one the JSON nodes each described second Child node, is separately added into the first flag by the title of each second child node and sequence number, is formed mutually independent Multiple first flags, by the value of each the second child node, as mutually independent multiple first data values, wherein the sequence number For position number of second child node in array;
    Calling module, for by calling the first flag, obtaining corresponding first data value of the first flag.
  9. 9. device according to claim 8, it is characterised in that the judgment module, is specifically used for:
    By size functions, the characteristic value of the JSON nodes is determined.
  10. 10. device according to claim 8, it is characterised in that the judgment module, is specifically used for:
    Judge whether the characteristic value of the JOSN nodes is more than predetermined threshold value, when the characteristic value of the JOSN nodes, more than described During predetermined threshold value, the type of the JOSN nodes is array or object;Alternatively, when the characteristic value of the JOSN nodes, it is not more than During the predetermined threshold value, the type of the JOSN nodes is key-value pair.
  11. 11. device according to claim 10, it is characterised in that the judgment module, is specifically used for:
    Judge the characteristic value of the JOSN nodes, if more than the predetermined threshold value, and according to the grammer of the JOSN nodes Structure determination goes out the type of the JOSN nodes;When the characteristic value of the JOSN nodes, during more than the predetermined threshold value, and it is described The syntactic structure of JOSN nodes is braces form, and the type of the JOSN nodes is object;Alternatively, when the JOSN nodes Characteristic value, during more than the predetermined threshold value, and the syntactic structure of the JOSN nodes is bracket form, the JOSN nodes Type is array.
  12. 12. device according to claim 8, it is characterised in that second parsing module, is specifically used for:
    When the JSON node types are object, and the JSON nodes have multiple first child nodes, one by one described in traversal Each described first child node of JSON nodes, first mark is separately added into by the title of each first child node Know, form mutually independent multiple first flags, the value of each the first child node is counted as mutually independent multiple first According to value.
  13. 13. device according to claim 8, it is characterised in that described device further includes:
    Add module, for being array when the JSON node types, is then referred to as second identifier, by institute by the name of the array Characteristic value is stated, as second data value, the second identifier is corresponding with second data value;
    Correspondingly, the calling module, is specifically used for:
    When the JSON node types are array, according to second data value, multiple first are determined for the JSON nodes The quantity of mark;The multiple first flag is called by the quantity, obtains the multiple first flag corresponding multiple first Data value.
  14. 14. device according to claim 8, it is characterised in that second parsing module, is specifically used for:
    When the JSON node types are object, the name of the object is referred to as the first flag, and using recursive Mode travels through the first child node of the JSON nodes;
    3rd parsing module, is specifically used for:
    When the JSON node types are array, and the JSON nodes have multiple second child nodes, by the array Name is referred to as the first flag, and each described second child node of the JSON nodes is traveled through using recursive mode.
  15. 15. a kind of electronic equipment, it is characterised in that including processor, communication interface, memory and communication bus, wherein, processing Device, communication interface, memory complete mutual communication by communication bus;
    Memory, for storing computer program;
    Processor, during for performing the program stored on memory, realizes any method and steps of claim 1-7.
CN201711262677.2A 2017-12-04 2017-12-04 Data processing method and device and electronic equipment Active CN108008936B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711262677.2A CN108008936B (en) 2017-12-04 2017-12-04 Data processing method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711262677.2A CN108008936B (en) 2017-12-04 2017-12-04 Data processing method and device and electronic equipment

Publications (2)

Publication Number Publication Date
CN108008936A true CN108008936A (en) 2018-05-08
CN108008936B CN108008936B (en) 2021-03-19

Family

ID=62056715

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711262677.2A Active CN108008936B (en) 2017-12-04 2017-12-04 Data processing method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN108008936B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109241164A (en) * 2018-08-24 2019-01-18 北京智能管家科技有限公司 A kind of data processing method, device, server and storage medium
CN109508409A (en) * 2018-10-23 2019-03-22 魔秀科技(北京)股份有限公司 A kind of semi-structured json data freely parse adaptation method
CN109766100A (en) * 2018-12-11 2019-05-17 新华三技术有限公司合肥分公司 Data processing method and device
CN110764768A (en) * 2018-07-26 2020-02-07 北京京东金融科技控股有限公司 Method and device for mutual conversion between model object and JSON object
CN111061927A (en) * 2018-10-16 2020-04-24 阿里巴巴集团控股有限公司 Data processing method and device and electronic equipment
CN112612563A (en) * 2020-12-16 2021-04-06 上海哔哩哔哩科技有限公司 Page test data generation method and device and computer equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104331315A (en) * 2014-10-31 2015-02-04 北京思特奇信息技术股份有限公司 Analysis and generation method and system of json object of any level
CN105354020A (en) * 2015-09-30 2016-02-24 武汉钢铁(集团)公司 Json format data analytic method and data receiving end
US20170153888A1 (en) * 2015-11-30 2017-06-01 International Business Machines Corporation Tracking changes within javascript object notation
CN107220096A (en) * 2017-04-20 2017-09-29 北京小度信息科技有限公司 A kind of json data analysis methods and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104331315A (en) * 2014-10-31 2015-02-04 北京思特奇信息技术股份有限公司 Analysis and generation method and system of json object of any level
CN105354020A (en) * 2015-09-30 2016-02-24 武汉钢铁(集团)公司 Json format data analytic method and data receiving end
US20170153888A1 (en) * 2015-11-30 2017-06-01 International Business Machines Corporation Tracking changes within javascript object notation
CN107220096A (en) * 2017-04-20 2017-09-29 北京小度信息科技有限公司 A kind of json data analysis methods and device

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110764768A (en) * 2018-07-26 2020-02-07 北京京东金融科技控股有限公司 Method and device for mutual conversion between model object and JSON object
CN109241164A (en) * 2018-08-24 2019-01-18 北京智能管家科技有限公司 A kind of data processing method, device, server and storage medium
CN111061927A (en) * 2018-10-16 2020-04-24 阿里巴巴集团控股有限公司 Data processing method and device and electronic equipment
CN111061927B (en) * 2018-10-16 2023-06-20 阿里巴巴集团控股有限公司 Data processing method and device and electronic equipment
CN109508409A (en) * 2018-10-23 2019-03-22 魔秀科技(北京)股份有限公司 A kind of semi-structured json data freely parse adaptation method
CN109766100A (en) * 2018-12-11 2019-05-17 新华三技术有限公司合肥分公司 Data processing method and device
CN112612563A (en) * 2020-12-16 2021-04-06 上海哔哩哔哩科技有限公司 Page test data generation method and device and computer equipment

Also Published As

Publication number Publication date
CN108008936B (en) 2021-03-19

Similar Documents

Publication Publication Date Title
CN108008936A (en) A kind of data processing method, device and electronic equipment
JP2019079556A5 (en)
CN107665171A (en) Automatic regression test method and device
CN103345469B (en) The storage of set of numbers, querying method and device thereof
CN105893349A (en) Category label matching and mapping method and device
CN104216724B (en) A kind of method and system of web application interface upgrade
CN110201393A (en) Configuration data storage method and device and electronic equipment
CN106873952B (en) Data processing system and method for mobile terminal webpage development and application device
CN106371999B (en) Program code test method and device
CN108763274A (en) Recognition methods, device, electronic equipment and the storage medium of access request
CN105630803B (en) The method and apparatus that Document image analysis establishes index
CN105809389A (en) Method and apparatus for generating BOM trees
CN112181804A (en) Parameter checking method, equipment and storage medium
CN106681903A (en) Method and device for generating test case
CN106325756A (en) Data storage and data computation methods and devices
CN104021223B (en) The access method and device of a kind of Cluster Database measuring point
CN107622061A (en) A kind of method, apparatus and system for determining address uniqueness
CN105204920A (en) Distributed calculation operation realizing method and device based on mapping and polymerizing
CN109242458A (en) Approaches to IM and relevant device based on block chain
CN107733894A (en) Comparison method, system, equipment and the storage medium of logic interfacing message
CN113516246A (en) Parameter optimization method, quantum chip control method and device
CN108154024A (en) A kind of data retrieval method, device and electronic equipment
CN104408183B (en) The data lead-in method and device of data system
CN107515958B (en) Circuit wiring inspection method and device
CN106651183A (en) Communication data security audit method and device for industrial control system

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant