Safe parsing method for IOS (Iphone Operating System) dictionary

A dictionary and security technology, applied in the field of data parsing returned by the server, can solve problems such as crash, and achieve the effect of improving security, reliability, and avoiding program crashes.

Inactive Publication Date: 2018-06-15
BEIJING KUWO TECH
View PDF7 Cites 1 Cited by
  • Summary
  • Abstract
  • Description
  • Claims
  • Application Information

AI Technical Summary

Problems solved by technology

[0003] When we use the json format to transfer data, we often need to parse the data from the dictionary, but many times the data may not be sent in the format we expected. For example, sending an empty string may be an NSNULL or an @ "", send a long integer, which may be a string object, or an NSNumber. At this time, if we call a method that does not match the type, it is likely to crash, so we need to be safe when parsing the data Judgment, maintain good compatibility and robustness

Method used

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Image

Smart Image Click on the blue labels to locate them in the text.
Viewing Examples
Smart Image
  • Safe parsing method for IOS (Iphone Operating System) dictionary
  • Safe parsing method for IOS (Iphone Operating System) dictionary

Examples

Experimental program
Comparison scheme
Effect test

Embodiment Construction

[0034] The present invention will be described in further detail below in conjunction with the accompanying drawings.

[0035] Such as figure 1 Shown, the method for iOS dictionary security analysis of the present invention comprises the steps:

[0036] Input the dictionary to parse the data and judge whether it is a basic data type,

[0037] If yes, enter the basic data type center, otherwise enter the class type center;

[0038] In the basic data type center or class type center, first determine whether a default value is required,

[0039] store default value if needed, ignore default value otherwise;

[0040] Then judge whether the input value is empty,

[0041] If it is empty, output the default value or empty value, otherwise further parse;

[0042] When further parsing, first determine whether the input value is a class type,

[0043] If yes, further judge whether the class type exists, if otherwise, further judge whether the basic data type function exists;

[0...

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

No PUM Login to view more

Abstract

The invention relates to a safe parsing method for an IOS (Iphone Operating System) dictionary. The method comprises the following steps that: inputting dictionary parsing data: firstly, judging whether the dictionary parsing data is a basic data type or not, secondly, judging whether a default value is required or not, if the default value is required, storing the default value, then, judging whether an input value is empty or not, and carrying out further parsing when the input value is not empty; during further parsing, firstly, judging whether the input is a category type or not, if the input is the category type, further judging whether the category type is in the presence or not, and otherwise, further judging whether a basic data type function is in the presence or not; and when a judgment result shows that the category type and the basic data type function are both in the presence, continuously carrying out parsing, i.e., calling a parsing algorithm to convert the dictionary parsing data into OC data, outputting a parsing value if the dictionary parsing data is successfully converted into the OC data, if the dictionary parsing data fails to be converted into the OC data, judging whether the default value is in the presence or not, outputting the default value if the default value is in the presence, and otherwise, outputting a null value. By use of the method, when theOC data is obtained by parsing, reliability is good, safety is high, an App is effectively protected, the App is not influenced by wrong data, program crash is effectively avoided, and data safety isimproved.

Description

technical field [0001] The invention relates to the technical field of data analysis returned by a server, in particular to a method for safely analyzing an iOS dictionary. Background technique [0002] The app needs to interact with the server to update data and obtain resources. Then, the server returns data to the client in two formats: json format and XML format (except for file downloads). App receives the data returned by the server and needs to parse it into OC data before using it. During parsing, erroneous data may appear. For example: [0003] When we use the json format to transfer data, we often need to parse the data from the dictionary, but many times the data may not be sent in the format we expected. For example, sending an empty string may be an NSNULL or an @ "", send a long integer, which may be a string object, or an NSNumber. At this time, if we call a method that does not match the type, it is likely to crash, so we need to be safe when parsing the d...

Claims

the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Application Information

Patent Timeline
no application Login to view more
Patent Type & Authority Applications(China)
IPC IPC(8): G06F17/22G06F9/448G06F9/54
CPCG06F9/548G06F40/151
Inventor 邱扬
Owner BEIJING KUWO TECH
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products