CN110740048A - network request processing method and device based on iOS network - Google Patents

network request processing method and device based on iOS network Download PDF

Info

Publication number
CN110740048A
CN110740048A CN201810791616.3A CN201810791616A CN110740048A CN 110740048 A CN110740048 A CN 110740048A CN 201810791616 A CN201810791616 A CN 201810791616A CN 110740048 A CN110740048 A CN 110740048A
Authority
CN
China
Prior art keywords
network
configuration
network request
ios
request
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
CN201810791616.3A
Other languages
Chinese (zh)
Other versions
CN110740048B (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.)
Guangdong Eshore Technology Co Ltd
Original Assignee
Guangdong Eshore 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 Guangdong Eshore Technology Co Ltd filed Critical Guangdong Eshore Technology Co Ltd
Priority to CN201810791616.3A priority Critical patent/CN110740048B/en
Publication of CN110740048A publication Critical patent/CN110740048A/en
Application granted granted Critical
Publication of CN110740048B publication Critical patent/CN110740048B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/14Network architectures or network communication protocols for network security for detecting or protecting against malicious traffic
    • H04L63/1441Countermeasures against malicious traffic
    • H04L63/1466Active attacks involving interception, injection, modification, spoofing of data unit addresses, e.g. hijacking, packet injection or TCP sequence number attacks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/20Network architectures or network communication protocols for network security for managing network security; network security policies in general
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/2866Architectures; Arrangements
    • H04L67/30Profiles
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/565Conversion or adaptation of application format or content
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/568Storing data temporarily at an intermediate stage, e.g. caching
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/16Implementing security features at a particular protocol layer
    • H04L63/168Implementing security features at a particular protocol layer above the transport layer

Abstract

The invention relates to network request processing methods based on an iOS network, wherein the method comprises the steps of obtaining content of a network request, wherein the content of the network request comprises configuration content and parameters, processing the configuration content and the parameters and generating a corresponding -only identifier, receiving configuration through a system interface according to the configuration content, wherein the configuration comprises HTTPS configuration, DNS hijack prevention configuration and cache configuration, and initiating the network request through a single instance in a sub-thread.

Description

network request processing method and device based on iOS network
Technical Field
The invention relates to the technical field of computer networks, in particular to network request processing methods and devices based on an iOS network.
Background
In the world of mobile internet, mobile applications have penetrated in the area of the masses, hundreds of millions of network requests are made daily through mobile applications, and countless mobile developers are working to ensure that these requests are transmitted stably, efficiently, and safely.
Although most requests are properly handled during development, problems remain when developing using the API provided by the system. First, the system API is low-level in packaging and complex to use. Developers need to know about network-related APIs deeply to develop, and the requirements on the level of the developers are high. Second, the request security aspect is cumbersome to configure. Nowadays, the requirements of users on data security are increasing. However, the configuration of the HTTPS network request is very cumbersome and inconvenient for the ordinary developer. Furthermore, caching of types of pictures, doclets, and the like. Ordinary network requests obviously do not cache the contents, and actually caching the contents of the types can greatly improve the request efficiency and save the flow.
In summary, the network request configuration directly performed by using the system API is complex, the system API is complex to use, the network security configuration is complex, a perfect cache mechanism is not provided, the network request modules of different projects are difficult to reuse, the inheritance is poor, and the like, the requirement on the level of a developer is high, and the project is not facilitated to be performed.
In view of the above, there is a need to provide improvement on the current internet request processing technology based on iOS internet.
Disclosure of Invention
To solve at least the technical problem, the main object of the present invention is to provide methods for processing network requests based on iOS network.
In order to achieve the purpose, the invention adopts technical solutions that network request processing methods based on the iOS network are provided, and the network request processing method based on the iOS network comprises the following steps in sequence:
s10, obtaining the content of the network request, wherein the content of the network request comprises: configuring content and parameters;
s20, processing the configuration content and the parameters and generating a corresponding unique identifier;
s40, receiving configuration through a system interface according to the configuration content, wherein the configuration comprises HTTPS configuration, DNS hijack prevention configuration and cache configuration;
and S50, initiating the network request at the child thread through a single instance.
After step S20, the method further includes:
s302, detecting a request state list;
s304, judging whether the same request exists according to the identification, if not, updating the request state list, and if so, terminating the network request.
After step S50, the method further includes:
and S60, receiving the data returned by the network request, and converting the data into a general message format.
Wherein, after the step S60, the method further includes:
and S70, caching the data returned by the network request, and reading the cache according to the cache configuration when the request is made.
Wherein, step S50 is followed by:
and S80, detecting errors occurring in the network request processing method based on the iOS network, and feeding back the detected errors.
In order to achieve the above object, another technical solutions adopted by the present invention are to provide types of iOS network-based network request processing apparatuses, including:
an obtaining module, configured to obtain content of a network request, where the content of the network request includes: configuring content and parameters;
the generating module is used for processing the configuration content and the parameters and generating a corresponding unique identifier;
the configuration module is used for receiving configuration through an interface according to the configuration content, wherein the configuration comprises HTTPS configuration, DNS hijack prevention configuration and cache configuration;
and the initiating module is used for initiating the network request at the sub thread through a single case.
Wherein, the network request processing device based on the iOS network further comprises:
the state detection module is used for detecting a request state list;
and the judging module is used for judging whether the same request exists according to the identifier, updating the request state list if the same request does not exist, and terminating the network request if the same request exists.
Wherein, the network request processing device based on the iOS network further comprises:
and the message module is used for receiving the data returned by the network request and converting the data into a general message format.
Wherein, the network request processing device based on the iOS network further comprises:
and the cache module is used for caching the data returned by the network request and reading the cache according to the cache configuration when the request is made.
Wherein, the network request processing device based on the iOS network further comprises:
and the error feedback module is used for detecting errors occurring in the network request processing method based on the iOS network and feeding back the detected errors.
The network request processing methods based on the iOS network provided by the invention add HTTPS configuration and prevent DNS hijack configuration quickly by the configuration class mode, and avoid repeated fussy operation, and the invention is packaged into different modules according to the network request stage and provides API of a system , which is beneficial to subsequent maintenance and expansion.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the structures shown in the drawings without creative efforts.
FIG. 1 is a flowchart illustrating a method for processing iOS network-based network requests according to an embodiment of ;
FIG. 2 is a flowchart of a method for processing requests over an iOS network according to another embodiment of the present invention;
FIG. 3 is a flowchart of a method for processing iOS network-based network requests according to another embodiment of the present invention;
FIG. 4 is a flowchart of a method for processing iOS network-based network requests according to another embodiment of the present invention;
FIG. 5 is a block diagram of an embodiment of of the present invention illustrating a IOS network based network request processing device;
fig. 6 is a block diagram of types of iOS network-based network request processing apparatuses according to another embodiment of the present invention.
The objects, features, and advantages of the present invention are further described in with reference to the accompanying drawings.
Detailed Description
The technical solutions in the embodiments of the present invention will be described clearly and completely with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only partial embodiments of the present invention, rather than all embodiments.
It should be noted that the description of the invention relating to "", "second", etc. is for descriptive purposes only and is not to be construed as indicating or implying any relative importance or implicit indication of the number of technical features indicated, whereby the features defined as "", "second", etc. may or may not explicitly include at least of such features.
Referring to fig. 1, in the embodiment of the present invention, types of network request processing methods based on the iOS network are provided, and the network request processing method based on the iOS network includes the following steps in sequence:
s10, obtaining the content of the network request, wherein the content of the network request comprises: configuring content and parameters;
s20, processing the configuration content and the parameters and generating a corresponding unique identifier;
s40, receiving configuration through a system interface according to the configuration content, wherein the configuration comprises HTTPS configuration, DNS hijack prevention configuration and cache configuration;
and S50, initiating the network request at the child thread through a single instance.
The method comprises the steps of firstly obtaining the content of a network request, wherein the content of the network request comprises configuration content and parameters, then processing the configuration content and the parameters and generating a corresponding unique identifier for identifying the current request and preventing multiple requests input in the same way, receiving configuration through a system interface according to the configuration content, wherein the configuration comprises HTTPS configuration, DNS hijack prevention configuration and cache configuration, management is facilitated, and finally, the effect of high-efficiency -caused network request is achieved by using a single-case and sub-thread operation mode without influencing the operation of other parts of an application.
In addition, the network request processing methods based on the iOS network proposed in the embodiment are packaged into different modules according to the network request stage, and provide the API of the system , which is beneficial to subsequent maintenance and expansion, so that only network request objects exist during the operation by using a single-case and sub-thread manner to make the request, and the request confusion possibly caused by a plurality of different request objects is effectively avoided.
Referring to fig. 2, in the specific embodiment of , after the step S20, the method further includes:
s302, detecting a request state list;
s304, judging whether the same request exists according to the identification, if not, updating the request state list, and if so, terminating the network request.
Specifically, first, a request status list is detected, and then, whether the same request exists is determined according to the identifier, if not, the request status list is updated, and if so, the network request is terminated.
The embodiment realizes that whether the same network request exists or not is judged according to the unique identifier by detecting and updating the request state list, so that a user can check the current state of each request at any time, and the embarrassment situation that the network request is initiated for many times and repeatedly initiated within a period of time like is effectively prevented.
Referring to fig. 3, in the specific embodiment of , after the step S50, the method further includes:
and S60, receiving the data returned by the network request, and converting the data into a general message format.
Specifically, in this embodiment, data returned by the network request is received, and is attempted to be converted into a general message, an XML format and a JSON format are built in, and an open interface is provided, so that a user can conveniently extend and use a new message format.
The embodiment realizes the purpose of providing an open message analysis scheme for the user. The built-in message analysis module supports the analysis of JSON and XML messages, and meets most of the current requirements.
Referring to fig. 4, in the specific embodiment of , the step S60 is followed by:
and S70, caching the data returned by the network request, and reading the cache according to the cache configuration when the request is made.
Specifically, the request return data is cached, and the cache is read according to the cache configuration when the request is made, so that the efficiency of the content with changed content is obviously improved, and the traffic use is reduced.
The embodiment realizes caching processing of types such as pictures, small files and the like, and can greatly improve the request efficiency and save the flow by caching the contents of the types.
In an embodiment of , the step S50 is followed by:
and S80, detecting errors occurring in the network request processing method based on the iOS network, and feeding back the detected errors.
Specifically, in the present embodiment, an complete error feedback mechanism is defined, and errors occurring during the network request process flow to the error processing module to feed back the detected errors, so that the user can operate according to the prompt.
Referring to fig. 5, the present embodiment provides types of iOS network-based network request processing apparatuses, including:
an obtaining module 10, configured to obtain content of a network request, where the content of the network request includes: configuring content and parameters;
a generating module 20, configured to process the configuration content and the parameters and generate a corresponding unique identifier;
the configuration module 40 is used for accepting configuration through an interface according to the configuration content, wherein the configuration comprises HTTPS configuration, DNS hijack prevention configuration and cache configuration;
an initiating module 50, configured to initiate the network request at the child thread by a single instance.
In an specific embodiment, the iOS network-based network request processing apparatus further includes:
a status detection module 302, configured to detect a request status list;
a determining module 304, configured to determine whether the same request exists according to the identifier, if not, update the request status list, and if so, terminate the network request.
In addition, the request is carried out by using a single-case and sub-thread mode, so that only network request objects exist in the application operation period, and the request confusion possibly caused by a plurality of different request objects is effectively avoided.
In an specific embodiment, the iOS network-based network request processing apparatus further includes:
and a message module 60, configured to receive data returned by the network request, and convert the data into a general message format.
Referring to fig. 6, in an specific embodiment, the iOS network based network request processing apparatus further includes:
the caching module 70 is configured to cache data returned by the network request, and read the cache according to the cache configuration when the request is made.
In an specific embodiment, the iOS network-based network request processing apparatus further includes:
an error feedback module 80, configured to detect an error occurring in the iOS network-based network request processing method, and feed back the detected error.
The above description is only a preferred embodiment of the present invention, and is not intended to limit the scope of the present invention, and all modifications and equivalents of the present invention, which are made by the contents of the present specification and the accompanying drawings, or directly/indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1, A network request processing method based on iOS network, characterized in that, the network request processing method based on iOS network includes the following steps in order:
s10, obtaining the content of the network request, wherein the content of the network request comprises: configuring content and parameters;
s20, processing the configuration content and the parameters and generating a corresponding unique identifier;
s40, receiving configuration through a system interface according to the configuration content, wherein the configuration comprises HTTPS configuration, DNS hijack prevention configuration and cache configuration;
and S50, initiating the network request at the child thread through a single instance.
2. The iOS network-based network request processing method of claim 1, wherein after the step S20, further comprising:
s302, detecting a request state list;
s304, judging whether the same request exists according to the identification, if not, updating the request state list, and if so, terminating the network request.
3. The iOS network-based network request processing method of claim 2, wherein after the step S50, further comprising:
and S60, receiving the data returned by the network request, and converting the data into a general message format.
4. The iOS network-based network request processing method of claim 3, wherein the step S60 is followed by further comprising:
and S70, caching the data returned by the network request, and reading the cache according to the cache configuration when the request is made.
5. The iOS network-based network request processing method of any of claims 1-4 and , wherein the step S50 is followed by further comprising:
and S80, detecting errors occurring in the network request processing method based on the iOS network, and feeding back the detected errors.
6, A network request processing device based on iOS network, wherein the network request processing device based on iOS network includes:
an obtaining module, configured to obtain content of a network request, where the content of the network request includes: configuring content and parameters;
the generating module is used for processing the configuration content and the parameters and generating a corresponding unique identifier;
the configuration module is used for receiving configuration through an interface according to the configuration content, wherein the configuration comprises HTTPS configuration, DNS hijack prevention configuration and cache configuration;
and the initiating module is used for initiating the network request at the sub thread through a single case.
7. The iOS network based network request processing apparatus of claim 6, wherein the iOS network based network request processing apparatus further comprises:
the state detection module is used for detecting a request state list;
and the judging module is used for judging whether the same request exists according to the identifier, updating the request state list if the same request does not exist, and terminating the network request if the same request exists.
8. The iOS network based network request processing apparatus of claim 7, wherein the iOS network based network request processing apparatus further comprises:
and the message module is used for receiving the data returned by the network request and converting the data into a general message format.
9. The iOS network based network request processing apparatus of claim 8, wherein the iOS network based network request processing apparatus further comprises:
and the cache module is used for caching the data returned by the network request and reading the cache according to the cache configuration when the request is made.
10. The iOS network based network request processing apparatus of any of claims 6-9, wherein the iOS network based network request processing apparatus further comprises:
and the error feedback module is used for detecting errors occurring in the network request processing method based on the iOS network and feeding back the detected errors.
CN201810791616.3A 2018-07-18 2018-07-18 Network request processing method and device based on iOS network Active CN110740048B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810791616.3A CN110740048B (en) 2018-07-18 2018-07-18 Network request processing method and device based on iOS network

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810791616.3A CN110740048B (en) 2018-07-18 2018-07-18 Network request processing method and device based on iOS network

Publications (2)

Publication Number Publication Date
CN110740048A true CN110740048A (en) 2020-01-31
CN110740048B CN110740048B (en) 2022-09-27

Family

ID=69234938

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810791616.3A Active CN110740048B (en) 2018-07-18 2018-07-18 Network request processing method and device based on iOS network

Country Status (1)

Country Link
CN (1) CN110740048B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070156842A1 (en) * 2005-12-29 2007-07-05 Vermeulen Allan H Distributed storage system with web services client interface
CN106254491A (en) * 2016-08-17 2016-12-21 成都聚美优品科技有限公司 A kind of stable IOS client framework model efficiently
CN106899969A (en) * 2017-01-18 2017-06-27 东南大学常州研究院 Specific secrecy terminal system implementation method based on iOS system
CN108234149A (en) * 2016-12-09 2018-06-29 沈阳美行科技有限公司 Network request management method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070156842A1 (en) * 2005-12-29 2007-07-05 Vermeulen Allan H Distributed storage system with web services client interface
CN106254491A (en) * 2016-08-17 2016-12-21 成都聚美优品科技有限公司 A kind of stable IOS client framework model efficiently
CN108234149A (en) * 2016-12-09 2018-06-29 沈阳美行科技有限公司 Network request management method and device
CN106899969A (en) * 2017-01-18 2017-06-27 东南大学常州研究院 Specific secrecy terminal system implementation method based on iOS system

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
茉莉儿: "可能是最全的iOS端HttpDns集成方案", 《简书》 *
莲舟MQL: "AFNetworking源码解析", 《简书》 *

Also Published As

Publication number Publication date
CN110740048B (en) 2022-09-27

Similar Documents

Publication Publication Date Title
CN108984388B (en) Method and terminal equipment for generating automatic test case
CN109635019B (en) Request processing method, device, equipment and storage medium
CN103237060B (en) A kind of data object acquisition, Apparatus and system
US11150896B2 (en) Automated generation of service definitions for message queue application clients
CN111708619B (en) Distributed transaction processing method and system based on message queue and database
CN111510330B (en) Interface management device, method and storage medium
CN113259479B (en) Data processing method and equipment
CN109343983B (en) Information interaction method, device, equipment and storage medium between function modules
CN109104368B (en) Connection request method, device, server and computer readable storage medium
CN111355622A (en) Container traffic monitoring method, system and computer readable storage medium
WO2016107120A1 (en) Application programming interface calling method and device
US10715628B2 (en) Attribute operating method and device
CN111008087A (en) Message processing method and device
CN109388388B (en) Information interaction method, device, equipment and storage medium between function modules
CN112468585B (en) Data transmission method and device, electronic equipment and storage medium
CN112732560B (en) Method and device for detecting leakage risk of file descriptor
WO2019062634A1 (en) Communication method and apparatus
CN110740048B (en) Network request processing method and device based on iOS network
CN112905197A (en) Information processing method, device and system, electronic equipment and storage medium
KR20120017619A (en) Apparatus and method for providing device management package and method to be provided the device management package
US10771578B2 (en) Webpage loading method and apparatus
CN108390770B (en) Information generation method and device and server
CN114610446A (en) Method, device and system for automatically injecting probe
US11349926B1 (en) Protected smart contracts for managing internet of things devices
CN113760712A (en) Test evaluation method and device

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