A method and apparatus for parsing a json node
By defining an array and parsing JSON data to obtain a JSON handle, and comparing it with preset elements, the application interface is called after successfully obtaining the target JSON node information. This solves the problem of high error rate in JSON node parsing methods and achieves higher parsing accuracy.
Patent Information
- Application Number
- CN202310307818.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-24
- Publication Date
- 2026-01-30
- Estimated Expiration
- 2043-03-24
AI Technical Summary
Existing methods for parsing JSON nodes have a high error rate, leading to incorrect parsing results.
By defining an array containing multiple elements, JSON data is parsed to determine the JSON handle, and the JSON handle is compared with the first preset number of elements in the array to obtain the target JSON node information. It is then determined whether the target JSON node information has been successfully obtained, and if successful, the corresponding application programming interface is called to parse it.
It improves the accuracy of JSON node parsing and reduces the error rate during the parsing process.
Smart Images

Figure CN116301901B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of software technology, specifically to a method and apparatus for parsing JSON nodes. Background Technology
[0002] With JavaScript Object Notation (JSON) becoming the mainstream data format, various languages have increasingly matured their support for JSON. C also has its own JSON library, json-c. json-c provides numerous functions for parsing and generating JSON. However, like XML, JSON is an unordered, multi-layered data structure. Therefore, json-c does not provide simple single-function implementations for multi-layered JSON data formats. Instead, developers need to write algorithms based on basic library functions to parse or generate the data, a rather cumbersome process. To solve this problem, existing technologies typically rely on finding the corresponding JSON node based on its name. However, relying solely on a single condition to find the corresponding JSON node is prone to errors. Therefore, existing technologies suffer from a high error rate. Summary of the Invention
[0003] The purpose of this application is to provide a method and apparatus for parsing JSON nodes, so as to solve the problem of high error rate in the existing JSON node parsing methods.
[0004] To achieve the above objectives, the first aspect of this application provides a method for parsing JSON nodes, including:
[0005] Define an array that contains multiple elements;
[0006] Parse the JSON data to determine the JSON handle;
[0007] The JSON handle is compared with the first preset number of elements in the array to obtain the comparison result;
[0008] If the comparison result is successful, the target JSON node information is obtained from the JSON handle based on the information described by the last element in the array.
[0009] Determine whether the target JSON node information was successfully retrieved;
[0010] If the target JSON node information is successfully obtained, the corresponding application programming interface is called to complete the parsing function based on the target JSON node information.
[0011] In this embodiment of the application, the method further includes:
[0012] If the comparison fails, send the target JSON node information to obtain the failure signal.
[0013] In this embodiment of the application, the method further includes:
[0014] If the target JSON node information is not successfully obtained, a signal indicating failure to obtain the target JSON node information is sent.
[0015] In this embodiment, the target JSON node information includes the name and value of the target JSON node. The parsing function is completed by calling the corresponding application programming interface based on the target JSON node information, including:
[0016] Determine the type of the target JSON node based on its value;
[0017] The parsing function is completed by calling the corresponding application programming interface based on the name and type of the target JSON node.
[0018] In this embodiment of the application, the target JSON node type includes key-value pairs, objects, and arrays.
[0019] In this embodiment, the last element is a description of the target JSON node, and each of the first preset number of elements is a description of each of the remaining JSON nodes other than the target JSON node.
[0020] A second aspect of this application provides a JSON node parsing apparatus, comprising:
[0021] The array definition module is configured to define an array that contains multiple elements.
[0022] The JSON data parsing module is configured to parse JSON data to determine the JSON handle;
[0023] The comparison module is configured to compare the JSON handle with the first preset number of elements in the array to obtain the comparison result;
[0024] The JSON node information retrieval module is configured to retrieve the target JSON node information from the JSON handle based on the information described by the last element in the array when the comparison result is successful.
[0025] The judgment module is configured to determine whether the target JSON node information has been successfully obtained.
[0026] The parsing module is configured to, upon successfully obtaining the target JSON node information, call the corresponding application programming interface to complete the parsing function based on the target JSON node information.
[0027] In this embodiment of the application, the JSON node information acquisition module is further configured to:
[0028] If the comparison fails, send the target JSON node information to obtain the failure signal.
[0029] In this embodiment of the application, the parsing module is further configured to:
[0030] If the target JSON node information is not successfully obtained, a signal indicating failure to obtain the target JSON node information is sent.
[0031] In this embodiment of the application, the target JSON node information includes the name and value of the target JSON node, and the parsing module is further configured to:
[0032] Determine the type of the target JSON node based on its value;
[0033] The parsing function is completed by calling the corresponding application programming interface based on the name and type of the target JSON node.
[0034] The above technical solution defines an array containing multiple elements. JSON data is then parsed to determine the JSON handle. This JSON handle is then compared with the first preset number of elements in the array to obtain a comparison result. If the comparison is successful, the target JSON node information is retrieved from the JSON handle based on the information described by the last element in the array, and the success of retrieving the target JSON node information is further determined. Finally, if the target JSON node information is successfully retrieved, the corresponding application programming interface (API) is called to complete the parsing function. This application improves the accuracy of API calls by calling the corresponding API based on the target JSON node information, thereby reducing the error rate during parsing.
[0035] Other features and advantages of the embodiments of this application will be described in detail in the following detailed description section. Attached Figure Description
[0036] The accompanying drawings are provided to further illustrate the embodiments of this application and form part of the specification. They are used together with the following detailed description to explain the embodiments of this application, but do not constitute a limitation on the embodiments of this application. In the drawings:
[0037] Figure 1 The flowchart illustrating a method for parsing a JSON node according to an embodiment of this application is shown schematically.
[0038] Figure 2 The flowchart illustrating a method for parsing a JSON node according to a specific embodiment of this application is shown in the illustration.
[0039] Figure 3 The diagram illustrates a structural diagram of a JSON node parsing apparatus according to an embodiment of this application. Detailed Implementation
[0040] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are only for illustration and explanation of the embodiments of this application and are not intended to limit the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.
[0041] It should be noted that if the embodiments of this application involve directional indicators (such as up, down, left, right, front, back, etc.), the directional indicators are only used to explain the relative positional relationship and movement of the components in a certain specific posture (as shown in the figure). If the specific posture changes, the directional indicators will also change accordingly.
[0042] Furthermore, if the embodiments of this application involve descriptions such as "first" or "second," these descriptions are for descriptive purposes only and should not be construed as indicating or implying their relative importance or implicitly specifying the number of technical features indicated. Therefore, features defined with "first" or "second" may explicitly or implicitly include at least one of those features. Additionally, the technical solutions of various embodiments can be combined with each other, but this must be based on the ability of those skilled in the art to implement them. If the combination of technical solutions is contradictory or impossible to implement, it should be considered that such a combination of technical solutions does not exist and is not within the scope of protection claimed in this application.
[0043] Figure 1 A flowchart illustrating a method for parsing a JSON node according to an embodiment of this application is shown schematically. Figure 1 As shown in the figure, this application embodiment provides a method for parsing JSON nodes, which may include the following steps:
[0044] Step 101: Define an array that contains multiple elements;
[0045] Step 102: Parse the JSON data to determine the JSON handle;
[0046] Step 103: Compare the JSON handle with the first preset number of elements in the array to obtain the comparison result;
[0047] Step 104: If the comparison result is successful, obtain the target JSON node information from the JSON handle based on the information described by the last element in the array.
[0048] Step 105: Determine whether the target JSON node information has been successfully obtained;
[0049] Step 106: If the target JSON node information is successfully obtained, call the corresponding application programming interface to complete the parsing function based on the target JSON node information.
[0050] Existing technologies typically invoke the corresponding application programming interface (API) based on the name of the JSON node to parse it. However, invoking the API solely based on the JSON node name can easily lead to errors in the invocation process, failing to accurately invoke the API corresponding to the JSON node to be parsed, resulting in incorrect parsing results. The embodiments of this application invoke the corresponding API based on the target JSON node information, ensuring the accuracy of the invocation process and thus reducing the error rate during target JSON node parsing.
[0051] In this embodiment, the JSON node parsing method is applied to a JSON node parsing device. First, the parsing device determines the target JSON node based on an instruction, which can be sent by a server or other control device. The target JSON node is the JSON node that needs to be parsed. After determining the target JSON node, the parsing device can define an array containing multiple elements. Each element describes the name and type of the JSON node. The last element in the array is the description corresponding to the target JSON node, and each of the first preset number of elements is the description corresponding to each of the remaining JSON nodes excluding the target JSON node. The preset number is determined based on the actual situation. In one example, if the array contains n elements, then the preset number is n-1. Subsequently, the parsing device can parse the JSON data to determine the JSON handle. The JSON handle contains information about all JSON nodes in the JSON data. JSON node information refers to the name and value of the JSON node. Then, the parsing device can determine the remaining JSON node information in the JSON handle, excluding the target JSON node information. It compares each remaining JSON node information with the corresponding element from the previous preset number of elements to obtain a comparison result. That is, it compares the name and value of each remaining JSON node with the name and type of the JSON node described by the corresponding element to determine if they match. If a match is found, the comparison result is successful. At this point, the parsing device can retrieve the target JSON node information from the JSON handle based on the information described by the last element in the array and determine if the retrieval of the target JSON node information was successful. If the target JSON node information is successfully retrieved, the parsing device can call the corresponding application programming interface to complete the parsing function. In this way, the parsing of the target JSON node can be completed.
[0052] The above technical solution defines an array containing multiple elements. JSON data is then parsed to determine the JSON handle. This JSON handle is then compared with the first preset number of elements in the array to obtain a comparison result. If the comparison is successful, the target JSON node information is retrieved from the JSON handle based on the information described by the last element in the array, and the success of retrieving the target JSON node information is further determined. Finally, if the target JSON node information is successfully retrieved, the corresponding application programming interface (API) is called to complete the parsing function. This application improves the accuracy of API calls by calling the corresponding API based on the target JSON node information, thereby reducing the error rate during parsing.
[0053] In this embodiment of the application, the method further includes:
[0054] If the comparison fails, send the target JSON node information to obtain the failure signal.
[0055] Specifically, the parsing device can parse JSON data to determine a JSON handle. The JSON handle contains information about all JSON nodes in the JSON data. JSON node information refers to the name and value of each JSON node. Then, it identifies the remaining JSON nodes in the JSON handle excluding the target JSON node information. Each remaining JSON node is compared with its corresponding element from a pre-set number of elements to obtain a comparison result. That is, the name and value of each remaining JSON node are compared with the name and type of the JSON node described by the corresponding element to determine if they match. If a mismatch is found, the comparison result is "comparison failed." In this case, the parsing device can send a failure signal to the target JSON node information to indicate an error in the parsing process.
[0056] In this embodiment of the application, the method further includes:
[0057] If the target JSON node information is not successfully obtained, a signal indicating failure to obtain the target JSON node information is sent.
[0058] Specifically, if the comparison is successful, the parsing device can retrieve the target JSON node information from the JSON handle based on the information described by the last element in the array, and determine whether the retrieval of the target JSON node information was successful. If the retrieval of the target JSON node information is unsuccessful, the parsing device can send a target JSON node information retrieval failure signal to indicate that an error occurred in the parsing process.
[0059] In this embodiment, the target JSON node information includes the name and value of the target JSON node. The parsing function is completed by calling the corresponding application programming interface based on the target JSON node information, including:
[0060] Determine the type of the target JSON node based on its value;
[0061] The parsing function is completed by calling the corresponding application programming interface based on the name and type of the target JSON node.
[0062] Specifically, the target JSON node information includes the target JSON node's name and value. The type of the target JSON node can be determined based on its value, that is, its syntax structure and the number of child nodes. The type of the target JSON node includes, but is not limited to, key-value pairs, objects, and arrays. After determining the type of the target JSON node, the parsing device can invoke the corresponding application programming interface to complete the parsing of the target JSON node based on its name and type.
[0063] In this embodiment of the application, the target JSON node type includes key-value pairs, objects, and arrays.
[0064] Specifically, the target JSON node information includes the target JSON node's name and value. The type of the target JSON node can be determined based on its value, that is, its syntax structure and the number of its child nodes. The types of target JSON nodes include, but are not limited to, key-value pairs, objects, and arrays.
[0065] In this embodiment, the last element is a description of the target JSON node, and each of the first preset number of elements is a description of each of the remaining JSON nodes other than the target JSON node.
[0066] Specifically, after determining the target JSON node, the parsing device can define an array containing multiple elements. Each element in the array is a description of the JSON node's name and type. The last element in the array is the description corresponding to the target JSON node, and each of the first preset number of elements is a description corresponding to each of the remaining JSON nodes excluding the target JSON node.
[0067] Figure 2 The flowchart illustrating a method for parsing a JSON node according to a specific embodiment of this application is shown schematically. Figure 2 As shown, in a specific embodiment of this application, it includes:
[0068] S1. Define an array that contains multiple elements;
[0069] S2. Parse the JSON data and obtain the JSON handle;
[0070] S3. Compare the JSON handle with the first preset number of elements in the array;
[0071] S4. Determine if all comparisons were successful. If successful, proceed to S5; otherwise, proceed to S6.
[0072] S5. Obtain the target JSON node information from the JSON handle based on the information described in the last element;
[0073] S6. Send target JSON node information to obtain failure signal;
[0074] S7. Determine whether the target JSON node information was successfully obtained. If successful, proceed to S8; otherwise, proceed to S6.
[0075] S8. Call the corresponding application programming interface to complete the parsing function based on the target JSON node information.
[0076] In one specific embodiment of this application, the parsing device can define an array after determining the target JSON node, where the array includes multiple elements. Then, the parsing device can parse the JSON data to obtain a JSON handle. The JSON handle contains all JSON node information. The JSON handle is compared with the first preset number of elements in the array, and it is determined whether all comparisons are successful. If the comparison fails, a failure signal is sent to retrieve the target JSON node information. If the comparison succeeds, the target JSON node information is retrieved from the JSON handle based on the information described by the last element, and it is determined whether the target JSON node information was successfully retrieved. If the target JSON node information is successfully retrieved, the corresponding application programming interface is called to complete the parsing function based on the target JSON node information. If the target JSON node information is not successfully retrieved, a failure signal is sent to retrieve the target JSON node information.
[0077] Figure 3 The diagram schematically illustrates a structural diagram of a JSON node parsing apparatus according to an embodiment of this application. Figure 3 As shown in the illustration, this application also provides a JSON node parsing device, which may include:
[0078] Array definition module 301 is configured to define an array that contains multiple elements;
[0079] The JSON data parsing module 302 is configured to parse JSON data to determine the JSON handle;
[0080] Comparison module 303 is configured to compare the JSON handle with the first preset number of elements in the array to obtain the comparison result;
[0081] The JSON node information retrieval module 304 is configured to retrieve the target JSON node information from the JSON handle based on the information described by the last element in the array when the comparison result is successful.
[0082] Module 305 is configured to determine whether the target JSON node information has been successfully obtained.
[0083] Parsing module 306 is configured to call the corresponding application programming interface to complete the parsing function based on the target JSON node information after successfully obtaining the target JSON node information.
[0084] In this embodiment, firstly, the parsing device determines the target JSON node according to an instruction, which can be sent by a server or other control device. The target JSON node is the JSON node that needs to be parsed. After determining the target JSON node, the array definition module 301 can define an array containing multiple elements. Each element describes the name and type of the JSON node. The last element in the array is the description corresponding to the target JSON node, and each of the first preset number of elements is the description corresponding to each of the remaining JSON nodes excluding the target JSON node. The preset number is determined based on the actual situation. In one example, if the array contains n elements, then the preset number is n-1. Subsequently, the JSON data parsing module 302 can parse the JSON data to determine the JSON handle. The JSON handle contains information about all JSON nodes in the JSON data. JSON node information refers to the name and value of the JSON node. Then, the comparison module 303 determines the remaining JSON node information in the JSON handle, excluding the target JSON node information. It compares each remaining JSON node information with the corresponding element from the previous preset number of elements to obtain a comparison result. Specifically, it compares the name and value of each remaining JSON node with the name and type of the JSON node described by the corresponding element to determine if they match. If a match is found, the comparison result is successful. At this point, the JSON node information acquisition module 304 can retrieve the target JSON node information from the JSON handle based on the information described by the last element in the array, and the judgment module 305 determines whether the target JSON node information was successfully retrieved. If the target JSON node information is successfully retrieved, the parsing module 306 can call the corresponding application programming interface to complete the parsing function based on the target JSON node information. This completes the parsing of the target JSON node.
[0085] The above technical solution defines an array containing multiple elements. JSON data is then parsed to determine the JSON handle. This JSON handle is then compared with the first preset number of elements in the array to obtain a comparison result. If the comparison is successful, the target JSON node information is retrieved from the JSON handle based on the information described by the last element in the array, and the success of retrieving the target JSON node information is further determined. Finally, if the target JSON node information is successfully retrieved, the corresponding application programming interface (API) is called to complete the parsing function. This application improves the accuracy of API calls by calling the corresponding API based on the target JSON node information, thereby reducing the error rate during parsing.
[0086] like Figure 3 As shown in this embodiment, the JSON node information acquisition module 304 is further configured to:
[0087] If the comparison fails, send the target JSON node information to obtain the failure signal.
[0088] Specifically, the JSON data parsing module 302 parses the JSON data to determine the JSON handle. The JSON handle contains all the JSON node information in the JSON data. JSON node information refers to the name and value of the JSON node. Then, the comparison module 303 determines the remaining JSON node information in the JSON handle excluding the target JSON node information. It compares each remaining JSON node information with the corresponding element from the previous preset number of elements to obtain a comparison result. That is, it compares the name and value of each remaining JSON node with the name and type of the JSON node described by the corresponding element to determine if they match. If they do not match, the comparison result is "comparison failed." At this time, the JSON node information acquisition module 304 can send a target JSON node information acquisition failure signal to indicate that an error occurred in the parsing process.
[0089] like Figure 3 As shown in this embodiment, the parsing module 306 is further configured to:
[0090] If the target JSON node information is not successfully obtained, a signal indicating failure to obtain the target JSON node information is sent.
[0091] Specifically, if the comparison is successful, the JSON node information acquisition module 304 can retrieve the target JSON node information from the JSON handle based on the information described by the last element in the array, and the judgment module 305 will determine whether the target JSON node information was successfully retrieved. If the target JSON node information is not successfully retrieved, the parsing module 306 can send a target JSON node information retrieval failure signal to indicate that an error occurred in the parsing process.
[0092] like Figure 3 As shown in this embodiment, the target JSON node information includes the name and value of the target JSON node, and the parsing module 306 is further configured to:
[0093] Determine the type of the target JSON node based on its value;
[0094] The parsing function is completed by calling the corresponding application programming interface based on the name and type of the target JSON node.
[0095] Specifically, the target JSON node information includes the target JSON node's name and value. The parsing module 306 can determine the type of the target JSON node based on its value, that is, based on its syntax structure and the number of child nodes. The types of the target JSON node include, but are not limited to, key-value pairs, objects, and arrays. After determining the type of the target JSON node, the parsing module 306 can call the corresponding application programming interface to complete the parsing of the target JSON node based on its name and type.
[0096] This application also provides a machine-readable storage medium storing instructions that cause a machine to execute the above-described method for parsing JSON nodes.
[0097] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0098] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0099] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0100] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0101] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0102] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.
[0103] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.
[0104] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.
[0105] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.
Claims
1. A method for parsing a json node, characterized in that, The method comprises: defining an array, the array comprising a plurality of elements, each element being a description of a name of a json node and a type of the json node; parsing json data to determine a json handle; comparing the json handle with a preset number of elements in the array to obtain a comparison result; in a case where the comparison result is a comparison success, obtaining target json node information from the json handle based on information described by a last element in the array, wherein the last element in the array is a description of the target json node, and each of the preset number of elements is a description corresponding to each remaining json node other than the target json node; determining whether the target json node information is successfully obtained; in a case where the target json node information is successfully obtained, invoking a corresponding application programming interface based on the target json node information to complete a parsing function.
2. The resolution method according to claim 1, wherein, The method further comprises: in a case where the comparison result is a comparison failure, sending a target json node information obtaining failure signal.
3. The resolution method according to claim 1, wherein, The method further comprises: in a case where the target json node information is not successfully obtained, sending a target json node information obtaining failure signal.
4. The resolution method according to claim 1, wherein, The target json node information comprises a name of the target json node and a value of the target json node, and the invoking of the corresponding application programming interface based on the target json node information to complete the parsing function comprises: determining a type of the target json node according to the value of the target json node; invoking the corresponding application programming interface based on the name of the target json node and the type of the target json node to complete the parsing function.
5. The resolution method according to claim 4, wherein, The type of the target json node comprises a key-value pair, an object, and an array.
6. An apparatus for parsing a json node, the apparatus comprising: The method comprises: an array defining module configured to define an array, the array comprising a plurality of elements, each element being a description of a name of a json node and a type of the json node; a json data parsing module configured to parse json data to determine a json handle; a comparison module configured to compare the json handle with a preset number of elements in the array to obtain a comparison result; a json node information obtaining module configured to, in a case where the comparison result is a comparison success, obtain target json node information from the json handle based on information described by a last element in the array, wherein the last element in the array is a description of the target json node, and each of the preset number of elements is a description corresponding to each remaining json node other than the target json node; a determination module configured to determine whether the target json node information is successfully obtained; a parsing module configured to, in a case where the target json node information is successfully obtained, invoke a corresponding application programming interface based on the target json node information to complete a parsing function.
7. The resolution device of claim 6, wherein, The json node information obtaining module is further configured to: In a case where the comparison result is a comparison failure, a target json node information acquisition failure signal is sent.
8. The resolution device of claim 6, wherein, The parsing module is further configured to: In a case where the target json node information is not successfully acquired, a target json node information acquisition failure signal is sent.
9. The resolution device of claim 6, wherein, The target json node information includes a name of a target json node and a value of the target json node, and the parsing module is further configured to: determine a type of the target json node according to the value of the target json node; invoke a corresponding application programming interface to complete a parsing function according to the name of the target json node and the type of the target json node.
Citation Information
Patent Citations
Analysis and generation method and system of json object of any level
CN104331315A